vuefilemanager v1.5-alpha.1

This commit is contained in:
carodej
2020-04-29 11:32:08 +02:00
parent 2614efe601
commit 0f3cbaec3d
50 changed files with 426 additions and 355 deletions
+5 -16
View File
@@ -3,6 +3,7 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\FileManagerFolder; use App\FileManagerFolder;
use App\Http\Tools\Guardian;
use App\Share; use App\Share;
use Illuminate\Support\Arr; use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
@@ -63,8 +64,7 @@ class FileAccessController extends Controller
if ( ! $request->user()->tokenCan('master') ) { if ( ! $request->user()->tokenCan('master') ) {
// Get shared token // Get shared token
$shared = Share::where(DB::raw('BINARY `token`'), $request->cookie('shared_token')) $shared = get_shared($request->cookie('shared_token'));
->firstOrFail();
// Check access to file // Check access to file
$this->check_file_access($shared, $file); $this->check_file_access($shared, $file);
@@ -84,7 +84,7 @@ class FileAccessController extends Controller
public function get_file_public($filename, $token) public function get_file_public($filename, $token)
{ {
// Get sharing record // Get sharing record
$shared = Share::where(DB::raw('BINARY `token`'), $token)->firstOrFail(); $shared = get_shared($token);
// Abort if shared is protected // Abort if shared is protected
if ($shared->protected) { if ($shared->protected) {
@@ -137,7 +137,7 @@ class FileAccessController extends Controller
public function get_thumbnail_public($filename, $token) public function get_thumbnail_public($filename, $token)
{ {
// Get sharing record // Get sharing record
$shared = Share::where(DB::raw('BINARY `token`'), $token)->firstOrFail(); $shared = get_shared($token);
// Abort if thumbnail is protected // Abort if thumbnail is protected
if ($shared->protected) { if ($shared->protected) {
@@ -165,18 +165,7 @@ class FileAccessController extends Controller
{ {
// Check by parent folder permission // Check by parent folder permission
if ($shared->type === 'folder') { if ($shared->type === 'folder') {
Guardian::check_item_access($file->folder_id, $shared);
// Get all children folders
$foldersIds = FileManagerFolder::with('folders:id,parent_id,unique_id,name')
->where('user_id', $shared->user_id)
->where('parent_id', $shared->item_id)
->get();
// Get all authorized parent folders by shared folder as root of tree
$accessible_folder_ids = Arr::flatten([filter_folders_ids($foldersIds), $shared->item_id]);
// Check user access
if (!in_array($file->folder_id, $accessible_folder_ids)) abort(403);
} }
// Check by single file permission // Check by single file permission
@@ -127,7 +127,14 @@ class EditItemsController extends Controller
} }
// Rename item // Rename item
return Editor::rename_item($request, $unique_id, $shared); $item = Editor::rename_item($request, $unique_id, $shared);
// Set public url
if ($item->type !== 'folder') {
$item->setPublicUrl($token);
}
return $item;
} }
/** /**
@@ -33,7 +33,7 @@ class FileSharingController extends Controller
->firstOrFail(); ->firstOrFail();
// Delete old access_token if exist // Delete old access_token if exist
Cookie::queue('access_token', '', -1); Cookie::queue('shared_access_token', '', -1);
// Set cookies // Set cookies
if ($shared->protected) { if ($shared->protected) {
@@ -61,7 +61,7 @@ class FileSharingController extends Controller
// Check password // Check password
if (!Hash::check($request->password, $shared->password)) { if (!Hash::check($request->password, $shared->password)) {
abort(401, 'Sorry, your password is incorrect.'); abort(401, __('vuefilemanager.incorrect_password'));
} }
// Get owner of shared content // Get owner of shared content
@@ -71,12 +71,12 @@ class FileSharingController extends Controller
$scope = !is_null($shared->permission) ? $shared->permission : 'visitor'; $scope = !is_null($shared->permission) ? $shared->permission : 'visitor';
// Generate token for visitor/editor // Generate token for visitor/editor
$access_token = $user->createToken('access_token', [$scope])->accessToken; $access_token = $user->createToken('shared_access_token', [$scope])->accessToken;
// Return authorize token with shared options // Return authorize token with shared options
return response(new ShareResource($shared), 200) return response(new ShareResource($shared), 200)
->cookie('shared_token', $shared->token, 43200) ->cookie('shared_token', $shared->token, 43200)
->cookie('access_token', $access_token, 43200); ->cookie('shared_access_token', $access_token, 43200);
} }
/** /**
+4 -1
View File
@@ -4,6 +4,7 @@ namespace App\Http;
use App\Http\Middleware\CookieAuth; use App\Http\Middleware\CookieAuth;
use App\Http\Middleware\LastCheck; use App\Http\Middleware\LastCheck;
use App\Http\Middleware\SharedAuth;
use Illuminate\Foundation\Http\Kernel as HttpKernel; use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel class Kernel extends HttpKernel
@@ -55,7 +56,8 @@ class Kernel extends HttpKernel
* @var array * @var array
*/ */
protected $routeMiddleware = [ protected $routeMiddleware = [
'auth.cookie' => CookieAuth::class, 'auth.master' => CookieAuth::class,
'auth.shared' => SharedAuth::class,
'auth' => \App\Http\Middleware\Authenticate::class, 'auth' => \App\Http\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
@@ -81,6 +83,7 @@ class Kernel extends HttpKernel
\Illuminate\Session\Middleware\StartSession::class, \Illuminate\Session\Middleware\StartSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class, \Illuminate\View\Middleware\ShareErrorsFromSession::class,
CookieAuth::class, CookieAuth::class,
SharedAuth::class,
\App\Http\Middleware\Authenticate::class, \App\Http\Middleware\Authenticate::class,
\Illuminate\Routing\Middleware\ThrottleRequests::class, \Illuminate\Routing\Middleware\ThrottleRequests::class,
\Illuminate\Session\Middleware\AuthenticateSession::class, \Illuminate\Session\Middleware\AuthenticateSession::class,
-2
View File
@@ -23,8 +23,6 @@ class CookieAuth
$request->headers->add(['Authorization' => 'Bearer ' . $access_token]); $request->headers->add(['Authorization' => 'Bearer ' . $access_token]);
} else {
abort(401);
} }
} }
return $next($request); return $next($request);
+29
View File
@@ -0,0 +1,29 @@
<?php
namespace App\Http\Middleware;
use Closure;
class SharedAuth
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if (!$request->bearerToken()) {
if ($request->hasCookie('shared_access_token')) {
$shared_access_token = $request->cookie('shared_access_token');
$request->headers->add(['Authorization' => 'Bearer ' . $shared_access_token]);
}
}
return $next($request);
}
}
+3 -1
View File
@@ -1 +1,3 @@
@import url(https://fonts.googleapis.com/css2?family=Nunito:wght@200;300;400;600;700;900&display=swap); @import url(https://fonts.googleapis.com/css2?family=Nunito:wght@200;
300;400;600;700;900&display=swap);#application-wrapper{display:flex;height:100%}#application-wrapper #content{position:relative;width:100%}
+1 -1
View File
File diff suppressed because one or more lines are too long
+8 -2
View File
@@ -4,8 +4,14 @@
* Released under the MIT License. * Released under the MIT License.
*/ */
/*!
* vue-i18n v8.17.4
* (c) 2020 kazuya kawaguchi
* Released under the MIT License.
*/
/** /**
* vee-validate v3.2.5 * vee-validate v3.3.0
* (c) 2020 Abdelrahman Awad * (c) 2020 Abdelrahman Awad
* @license MIT * @license MIT
*/ */
@@ -20,7 +26,7 @@
*/ */
/** /**
* vuex v3.1.3 * vuex v3.3.0
* (c) 2020 Evan You * (c) 2020 Evan You
* @license MIT * @license MIT
*/ */
+1 -94
View File
@@ -1,97 +1,4 @@
{ {
"/js/main.js": "/js/main.js", "/js/main.js": "/js/main.js",
"/css/app.css": "/css/app.css", "/css/app.css": "/css/app.css"
"/js/main.9a27394a2df24ee693e3.hot-update.js": "/js/main.9a27394a2df24ee693e3.hot-update.js",
"/js/main.26f701f7b52599858cce.hot-update.js": "/js/main.26f701f7b52599858cce.hot-update.js",
"/js/main.5121a1dc87cc3f3442cd.hot-update.js": "/js/main.5121a1dc87cc3f3442cd.hot-update.js",
"/js/main.8b54f2c597a60d415870.hot-update.js": "/js/main.8b54f2c597a60d415870.hot-update.js",
"/js/main.53935909cecacef877d0.hot-update.js": "/js/main.53935909cecacef877d0.hot-update.js",
"/js/main.6e0d2ac0add6c3e6dc84.hot-update.js": "/js/main.6e0d2ac0add6c3e6dc84.hot-update.js",
"/js/main.bcef9d636d3dfe572ecc.hot-update.js": "/js/main.bcef9d636d3dfe572ecc.hot-update.js",
"/js/main.07de0a9dbfed267ff7b2.hot-update.js": "/js/main.07de0a9dbfed267ff7b2.hot-update.js",
"/js/main.549012c4fffc95472aa6.hot-update.js": "/js/main.549012c4fffc95472aa6.hot-update.js",
"/js/main.ea575a8d60a5a25453e4.hot-update.js": "/js/main.ea575a8d60a5a25453e4.hot-update.js",
"/js/main.880f1e5ff9834e6633ec.hot-update.js": "/js/main.880f1e5ff9834e6633ec.hot-update.js",
"/js/main.9cd0cd846091e6779623.hot-update.js": "/js/main.9cd0cd846091e6779623.hot-update.js",
"/js/main.435761e62a7eba7f7511.hot-update.js": "/js/main.435761e62a7eba7f7511.hot-update.js",
"/js/main.8ef42b97a65fa42e754c.hot-update.js": "/js/main.8ef42b97a65fa42e754c.hot-update.js",
"/js/main.801802ad6742f1431b33.hot-update.js": "/js/main.801802ad6742f1431b33.hot-update.js",
"/js/main.712419afb068ad058a73.hot-update.js": "/js/main.712419afb068ad058a73.hot-update.js",
"/js/main.559f1d43ac058be060f7.hot-update.js": "/js/main.559f1d43ac058be060f7.hot-update.js",
"/js/main.d8b716639ab25f3dc50a.hot-update.js": "/js/main.d8b716639ab25f3dc50a.hot-update.js",
"/js/main.efd3e8d2d7598c6c5ad5.hot-update.js": "/js/main.efd3e8d2d7598c6c5ad5.hot-update.js",
"/js/main.a337a75d4abd0a14c156.hot-update.js": "/js/main.a337a75d4abd0a14c156.hot-update.js",
"/js/main.40d1dab8fa1b64701590.hot-update.js": "/js/main.40d1dab8fa1b64701590.hot-update.js",
"/js/main.7fc88aadbaf4dddd1177.hot-update.js": "/js/main.7fc88aadbaf4dddd1177.hot-update.js",
"/js/main.68350763e369b5ff2093.hot-update.js": "/js/main.68350763e369b5ff2093.hot-update.js",
"/js/main.6284a84d480e86837360.hot-update.js": "/js/main.6284a84d480e86837360.hot-update.js",
"/js/main.25ee0aa3ee03e3e8b38f.hot-update.js": "/js/main.25ee0aa3ee03e3e8b38f.hot-update.js",
"/js/main.2e26a22377d42ebff156.hot-update.js": "/js/main.2e26a22377d42ebff156.hot-update.js",
"/js/main.b59bbae58419a6b486cf.hot-update.js": "/js/main.b59bbae58419a6b486cf.hot-update.js",
"/js/main.d2355590570597337ecf.hot-update.js": "/js/main.d2355590570597337ecf.hot-update.js",
"/js/main.60d4eefa65e064d28377.hot-update.js": "/js/main.60d4eefa65e064d28377.hot-update.js",
"/js/main.4167e6ccc3b10d70c878.hot-update.js": "/js/main.4167e6ccc3b10d70c878.hot-update.js",
"/js/main.1d8dd28c32fe1ebb0f90.hot-update.js": "/js/main.1d8dd28c32fe1ebb0f90.hot-update.js",
"/js/main.ad773a1236560dfa16b9.hot-update.js": "/js/main.ad773a1236560dfa16b9.hot-update.js",
"/js/main.34c776e9045fb0e219c3.hot-update.js": "/js/main.34c776e9045fb0e219c3.hot-update.js",
"/js/main.092895cf0d85296ec513.hot-update.js": "/js/main.092895cf0d85296ec513.hot-update.js",
"/js/main.a46dde16305495525978.hot-update.js": "/js/main.a46dde16305495525978.hot-update.js",
"/js/main.b9df9d4300e51d62c760.hot-update.js": "/js/main.b9df9d4300e51d62c760.hot-update.js",
"/js/main.ef40152e201f13bc6b7b.hot-update.js": "/js/main.ef40152e201f13bc6b7b.hot-update.js",
"/js/main.03e94dd396114f5ce51f.hot-update.js": "/js/main.03e94dd396114f5ce51f.hot-update.js",
"/js/main.ae8691214086a1aafe6d.hot-update.js": "/js/main.ae8691214086a1aafe6d.hot-update.js",
"/js/main.42070d8db8abc6c57f08.hot-update.js": "/js/main.42070d8db8abc6c57f08.hot-update.js",
"/js/main.ff4a9feafb80b24156ea.hot-update.js": "/js/main.ff4a9feafb80b24156ea.hot-update.js",
"/js/main.a75b114c09bd29e14d0c.hot-update.js": "/js/main.a75b114c09bd29e14d0c.hot-update.js",
"/js/main.3c80fdca8d8a4151fec5.hot-update.js": "/js/main.3c80fdca8d8a4151fec5.hot-update.js",
"/js/main.ce2a2b97c841955d6004.hot-update.js": "/js/main.ce2a2b97c841955d6004.hot-update.js",
"/js/main.32b5fdecf37fed13cd9a.hot-update.js": "/js/main.32b5fdecf37fed13cd9a.hot-update.js",
"/js/main.7a89ccb6115f0faacdfb.hot-update.js": "/js/main.7a89ccb6115f0faacdfb.hot-update.js",
"/js/main.92699644dc4433d69518.hot-update.js": "/js/main.92699644dc4433d69518.hot-update.js",
"/js/main.95ab80867410adfb44d4.hot-update.js": "/js/main.95ab80867410adfb44d4.hot-update.js",
"/js/main.15ec5d8a6721629ca107.hot-update.js": "/js/main.15ec5d8a6721629ca107.hot-update.js",
"/js/main.7c08936d73cc17d9f314.hot-update.js": "/js/main.7c08936d73cc17d9f314.hot-update.js",
"/js/main.3d44fb777bb96f9cfdb7.hot-update.js": "/js/main.3d44fb777bb96f9cfdb7.hot-update.js",
"/js/main.98249452457878999097.hot-update.js": "/js/main.98249452457878999097.hot-update.js",
"/js/main.254701868eb16ecc7ceb.hot-update.js": "/js/main.254701868eb16ecc7ceb.hot-update.js",
"/js/main.73bb5ad5ec65301443bd.hot-update.js": "/js/main.73bb5ad5ec65301443bd.hot-update.js",
"/js/main.d3e2774f2e315b7c16b5.hot-update.js": "/js/main.d3e2774f2e315b7c16b5.hot-update.js",
"/js/main.e1c6df6a9c86ceb0f997.hot-update.js": "/js/main.e1c6df6a9c86ceb0f997.hot-update.js",
"/js/main.84e6dd621e31be103cb9.hot-update.js": "/js/main.84e6dd621e31be103cb9.hot-update.js",
"/js/main.f9b77ba27f8c37a3cab6.hot-update.js": "/js/main.f9b77ba27f8c37a3cab6.hot-update.js",
"/js/main.4568b1ac1065ffb6734b.hot-update.js": "/js/main.4568b1ac1065ffb6734b.hot-update.js",
"/js/main.34dd57888d1ba88b8b51.hot-update.js": "/js/main.34dd57888d1ba88b8b51.hot-update.js",
"/js/main.427a9203ec38e951d238.hot-update.js": "/js/main.427a9203ec38e951d238.hot-update.js",
"/js/main.c0ef7695de0e2fb4df8f.hot-update.js": "/js/main.c0ef7695de0e2fb4df8f.hot-update.js",
"/js/main.d1ac8bf7abe8c3cab86f.hot-update.js": "/js/main.d1ac8bf7abe8c3cab86f.hot-update.js",
"/js/main.89cd5452893cfa0c4306.hot-update.js": "/js/main.89cd5452893cfa0c4306.hot-update.js",
"/js/main.9efa7621633482f41475.hot-update.js": "/js/main.9efa7621633482f41475.hot-update.js",
"/js/main.64f6c551250c31f1a04f.hot-update.js": "/js/main.64f6c551250c31f1a04f.hot-update.js",
"/js/main.afa8179642bbf412e95a.hot-update.js": "/js/main.afa8179642bbf412e95a.hot-update.js",
"/js/main.5c4a761e3d1b8ae3e586.hot-update.js": "/js/main.5c4a761e3d1b8ae3e586.hot-update.js",
"/js/main.0ceed72f1427b5958022.hot-update.js": "/js/main.0ceed72f1427b5958022.hot-update.js",
"/js/main.6131813f3daf3dbf18df.hot-update.js": "/js/main.6131813f3daf3dbf18df.hot-update.js",
"/js/main.1d7089edabf59ca7143b.hot-update.js": "/js/main.1d7089edabf59ca7143b.hot-update.js",
"/js/main.835a0e8499a6e9ce3eb6.hot-update.js": "/js/main.835a0e8499a6e9ce3eb6.hot-update.js",
"/js/main.34ca6eeac2f66555a259.hot-update.js": "/js/main.34ca6eeac2f66555a259.hot-update.js",
"/js/main.b103b99817043bcec0ee.hot-update.js": "/js/main.b103b99817043bcec0ee.hot-update.js",
"/js/main.2f39160d1e959ee8065e.hot-update.js": "/js/main.2f39160d1e959ee8065e.hot-update.js",
"/js/main.9ebf2fb72f11bfa290af.hot-update.js": "/js/main.9ebf2fb72f11bfa290af.hot-update.js",
"/js/main.a55c90d56d628ca5983b.hot-update.js": "/js/main.a55c90d56d628ca5983b.hot-update.js",
"/js/main.c77fe61a6e467daa6312.hot-update.js": "/js/main.c77fe61a6e467daa6312.hot-update.js",
"/js/main.2b72fda2d2b42a05b446.hot-update.js": "/js/main.2b72fda2d2b42a05b446.hot-update.js",
"/js/main.ae606d26a4b1b2344ca2.hot-update.js": "/js/main.ae606d26a4b1b2344ca2.hot-update.js",
"/js/main.5bd37eed26fa598948d5.hot-update.js": "/js/main.5bd37eed26fa598948d5.hot-update.js",
"/js/main.130254a5160e0ef992a1.hot-update.js": "/js/main.130254a5160e0ef992a1.hot-update.js",
"/js/main.5fa2ead36e925d546d3d.hot-update.js": "/js/main.5fa2ead36e925d546d3d.hot-update.js",
"/js/main.dba558d979b0090f27dd.hot-update.js": "/js/main.dba558d979b0090f27dd.hot-update.js",
"/js/main.44e728d411a734bc1a30.hot-update.js": "/js/main.44e728d411a734bc1a30.hot-update.js",
"/js/main.9301a0253ea88d48eaec.hot-update.js": "/js/main.9301a0253ea88d48eaec.hot-update.js",
"/js/main.c32533dd170b4ad36995.hot-update.js": "/js/main.c32533dd170b4ad36995.hot-update.js",
"/js/main.70d54b5f4ad55603282c.hot-update.js": "/js/main.70d54b5f4ad55603282c.hot-update.js",
"/js/main.ae3ebc3222124628f432.hot-update.js": "/js/main.ae3ebc3222124628f432.hot-update.js",
"/js/main.cd30cc7c96f7330f1e28.hot-update.js": "/js/main.cd30cc7c96f7330f1e28.hot-update.js",
"/js/main.6d71eff38004e48494e6.hot-update.js": "/js/main.6d71eff38004e48494e6.hot-update.js",
"/js/main.e0368145878abbdceab2.hot-update.js": "/js/main.e0368145878abbdceab2.hot-update.js",
"/js/main.63bc86c9bdf936a03d56.hot-update.js": "/js/main.63bc86c9bdf936a03d56.hot-update.js"
} }
-3
View File
@@ -85,9 +85,6 @@
this.$store.commit('SET_CONFIG', this.$root.$data.config) this.$store.commit('SET_CONFIG', this.$root.$data.config)
}, },
mounted() { mounted() {
//events.$emit('share-item')
// Handle VueFileManager width // Handle VueFileManager width
var VueFileManager = document.getElementById('vue-file-manager'); var VueFileManager = document.getElementById('vue-file-manager');
new ResizeSensor(VueFileManager, this.handleAppResize); new ResizeSensor(VueFileManager, this.handleAppResize);
+2 -2
View File
@@ -56,7 +56,7 @@
this.button = this.$t('alerts.error_confirm') this.button = this.$t('alerts.error_confirm')
this.emoji = '😢😢😢' this.emoji = '😢😢😢'
this.buttonStyle = 'danger' this.buttonStyle = 'danger-solid'
if (args.emoji) { if (args.emoji) {
this.emoji = args.emoji this.emoji = args.emoji
@@ -109,7 +109,7 @@
top: 50%; top: 50%;
transform: translateY(-50%) scale(1); transform: translateY(-50%) scale(1);
margin: 0 auto; margin: 0 auto;
padding: 40px; padding: 20px;
box-shadow: $light_mode_popup_shadow; box-shadow: $light_mode_popup_shadow;
border-radius: 8px; border-radius: 8px;
text-align: center; text-align: center;
@@ -34,7 +34,7 @@
{{ $t('context_menu.delete') }} {{ $t('context_menu.delete') }}
</li> </li>
<li class="menu-option" @click="shareItem" v-if="item"> <li class="menu-option" @click="shareItem" v-if="item">
{{ item.shared ? 'Edit Sharing' : $t('context_menu.share') }} {{ item.shared ? $t('context_menu.share_edit') : $t('context_menu.share') }}
</li> </li>
<li class="menu-option" @click="ItemDetail" v-if="item"> <li class="menu-option" @click="ItemDetail" v-if="item">
{{ $t('context_menu.detail') }} {{ $t('context_menu.detail') }}
@@ -59,7 +59,7 @@
{{ $t('context_menu.move') }} {{ $t('context_menu.move') }}
</li> </li>
<li class="menu-option" @click="shareItem" v-if="item"> <li class="menu-option" @click="shareItem" v-if="item">
{{ item.shared ? 'Edit Sharing' : $t('context_menu.share') }} {{ item.shared ? $t('context_menu.share_edit') : $t('context_menu.share') }}
</li> </li>
<li class="menu-option" @click="ItemDetail" v-if="item"> <li class="menu-option" @click="ItemDetail" v-if="item">
{{ $t('context_menu.detail') }} {{ $t('context_menu.detail') }}
@@ -28,17 +28,17 @@
<div class="toolbar-button-wrapper" v-if="$checkPermission(['master', 'editor'])"> <div class="toolbar-button-wrapper" v-if="$checkPermission(['master', 'editor'])">
<ToolbarButtonUpload <ToolbarButtonUpload
source="upload" source="upload"
action="Upload file" :action="$t('actions.upload')"
/> />
<ToolbarButton <ToolbarButton
source="trash-alt" source="trash-alt"
action="Delete" :action="$t('actions.delete')"
@click.native="deleteItems" @click.native="deleteItems"
/> />
<ToolbarButton <ToolbarButton
@click.native="createFolder" @click.native="createFolder"
source="folder-plus" source="folder-plus"
action="Create folder" :action="$t('actions.create_folder')"
/> />
</div> </div>
@@ -46,7 +46,7 @@
<div class="toolbar-button-wrapper"> <div class="toolbar-button-wrapper">
<ToolbarButton <ToolbarButton
:source="preview" :source="preview"
action="Change Preview" :action="$t('actions.preview')"
@click.native="$store.dispatch('changePreviewType')" @click.native="$store.dispatch('changePreviewType')"
/> />
<ToolbarButton <ToolbarButton
@@ -1,47 +1,55 @@
<template> <template>
<div class="empty-message"> <div class="empty-message">
<div class="message"> <div class="message">
<FontAwesomeIcon class="icon" :icon="icon" /> <FontAwesomeIcon class="icon" :icon="icon"/>
<p>{{ message }}</p> <p>{{ message }}</p>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: 'EmptyMessage', name: 'EmptyMessage',
props: ['icon', 'message'] props: ['icon', 'message']
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@import "@assets/app.scss"; @import "@assets/app.scss";
.empty-message { .empty-message {
text-align: center; text-align: center;
display: flex; display: flex;
align-items: center; align-items: center;
height: 100%; height: 100%;
.message { .message {
margin: 0 auto; margin: 0 auto;
p { p {
margin-top: 10px; margin-top: 10px;
max-width: 130px; max-width: 130px;
@include font-size(14); @include font-size(14);
font-weight: 500; font-weight: 500;
color: $text-muted; color: $text-muted;
} }
.icon { .icon {
@include font-size(36); @include font-size(36);
color: $text; color: $text;
path { path {
color: $text; fill: $text;
} }
} }
} }
} }
@media (prefers-color-scheme: dark) {
.empty-message .message .icon {
path {
fill: $dark_mode_text_secondary;
}
}
}
</style> </style>
@@ -4,7 +4,7 @@
<!--Shared empty message--> <!--Shared empty message-->
<div class="text-content" v-if="$isThisLocation(['shared']) && ! isLoading"> <div class="text-content" v-if="$isThisLocation(['shared']) && ! isLoading">
<h1 class="title">You Haven't Shared Anything Yet</h1> <h1 class="title">{{ $t('shared.empty_shared') }}</h1>
</div> </div>
<!--Trash empty message--> <!--Trash empty message-->
@@ -203,26 +203,6 @@
// On items delete // On items delete
events.$on('items:delete', () => { events.$on('items:delete', () => {
this.$store.dispatch('deleteItem', this.fileInfoDetail) this.$store.dispatch('deleteItem', this.fileInfoDetail)
//let ids = []
//let items = []
// Get ids
/*this.$children[0].$children.filter(item => {
if (item.isClicked) {
ids.push(item.data.unique_id)
items.push({
unique_id: item.data.unique_id,
type: item.data.type,
})
}
})*/
// Dispatch action
/*this.$store.dispatch('removeItems', [ids, items])*/
}) })
} }
} }
@@ -299,4 +279,10 @@
.file-leave-active { .file-leave-active {
position: absolute; position: absolute;
} }
@media only screen and (max-width: 660px) {
.file-info-container {
display: none;
}
}
</style> </style>
@@ -1,7 +1,6 @@
<template> <template>
<div class="file-info-content" v-if="fileInfoDetail"> <div class="file-info-content" v-if="fileInfoDetail">
<div class="file-headline" spellcheck="false"> <div class="file-headline" spellcheck="false">
<FilePreview /> <FilePreview />
<!--File info--> <!--File info-->
@@ -29,8 +28,8 @@
<!--Latest change--> <!--Latest change-->
<li v-if="$checkPermission(['master']) && fileInfoDetail.user_scope !== 'master'" class="list-info-item"> <li v-if="$checkPermission(['master']) && fileInfoDetail.user_scope !== 'master'" class="list-info-item">
<b>Author</b> <b>{{ $t('file_detail.author') }}</b>
<span>Public Participant</span> <span>{{ $t('file_detail.author_participant') }}</span>
</li> </li>
<!--Latest change--> <!--Latest change-->
@@ -50,7 +49,7 @@
<!--Parent--> <!--Parent-->
<li v-if="$checkPermission('master') && fileInfoDetail.shared" class="list-info-item"> <li v-if="$checkPermission('master') && fileInfoDetail.shared" class="list-info-item">
<b>Shared</b> <b>{{ $t('file_detail.shared') }}</b>
<div class="action-button" @click="shareItemOptions"> <div class="action-button" @click="shareItemOptions">
<FontAwesomeIcon class="icon" :icon="sharedIcon" /> <FontAwesomeIcon class="icon" :icon="sharedIcon" />
<span>{{ sharedInfo }}</span> <span>{{ sharedInfo }}</span>
@@ -77,7 +76,7 @@
CopyInput, CopyInput,
}, },
computed: { computed: {
...mapGetters(['fileInfoDetail']), ...mapGetters(['fileInfoDetail', 'permissionOptions']),
filePreviewIcon() { filePreviewIcon() {
switch (this.fileInfoDetail.type) { switch (this.fileInfoDetail.type) {
case 'folder': case 'folder':
@@ -98,16 +97,13 @@
} }
}, },
sharedInfo() { sharedInfo() {
switch (this.fileInfoDetail.shared.permission) {
case 'editor': // Get permission title
return 'Can edit and upload files' let title = this.permissionOptions.find(option => {
break return option.value === this.fileInfoDetail.shared.permission
case 'visitor': })
return 'Can only view and download'
break return title ? title.label : this.$t('shared.can_download')
default:
return 'Can download file'
}
}, },
sharedIcon() { sharedIcon() {
switch (this.fileInfoDetail.shared.permission) { switch (this.fileInfoDetail.shared.permission) {
@@ -133,7 +129,6 @@
moveItem() { moveItem() {
// Move item fire popup // Move item fire popup
events.$emit('popup:open', {name: 'move', item: this.fileInfoDetail}) events.$emit('popup:open', {name: 'move', item: this.fileInfoDetail})
} }
} }
} }
@@ -229,7 +224,7 @@
margin-right: 2px; margin-right: 2px;
path { path {
fill: $theme_light; fill: $theme;
} }
} }
} }
@@ -313,5 +308,22 @@
} }
} }
} }
.sharelink {
.lock-icon {
path {
fill: $dark_mode_text_primary;
}
&:hover {
path {
fill: $theme;
}
}
}
}
} }
</style> </style>
@@ -52,7 +52,7 @@
<!--Shared Icon--> <!--Shared Icon-->
<div v-if="$checkPermission('master') && data.shared" class="item-shared"> <div v-if="$checkPermission('master') && data.shared" class="item-shared">
<FontAwesomeIcon class="shared-icon" icon="user-friends"/> <FontAwesomeIcon class="shared-icon" icon="share"/>
</div> </div>
<!--Participant owner Icon--> <!--Participant owner Icon-->
@@ -86,7 +86,9 @@
name: 'FileItemGrid', name: 'FileItemGrid',
props: ['data'], props: ['data'],
computed: { computed: {
...mapGetters(['FilePreviewType']), ...mapGetters([
'FilePreviewType', 'sharedDetail'
]),
isFolder() { isFolder() {
return this.data.type === 'folder' return this.data.type === 'folder'
}, },
@@ -97,7 +99,10 @@
return this.data.type === 'image' return this.data.type === 'image'
}, },
canEditName() { canEditName() {
return !this.$isMobile() && !this.$isThisLocation(['trash', 'trash-root']) && !this.$checkPermission('visitor') return !this.$isMobile()
&& !this.$isThisLocation(['trash', 'trash-root'])
&& !this.$checkPermission('visitor')
&& (this.sharedDetail && this.sharedDetail.type !== 'file')
}, },
canDrag() { canDrag() {
return !this.isDeleted && this.$checkPermission(['master', 'editor']) return !this.isDeleted && this.$checkPermission(['master', 'editor'])
@@ -51,7 +51,7 @@
<!--Shared Icon--> <!--Shared Icon-->
<div v-if="$checkPermission('master') && data.shared" class="item-shared"> <div v-if="$checkPermission('master') && data.shared" class="item-shared">
<FontAwesomeIcon class="shared-icon" icon="user-friends"/> <FontAwesomeIcon class="shared-icon" icon="share"/>
</div> </div>
<!--Participant owner Icon--> <!--Participant owner Icon-->
@@ -31,7 +31,7 @@
{{ $t('context_menu.rename') }} {{ $t('context_menu.rename') }}
</li> </li>
<li class="menu-option" @click="shareItem" v-if="fileInfoDetail"> <li class="menu-option" @click="shareItem" v-if="fileInfoDetail">
{{ fileInfoDetail.shared ? 'Edit Sharing' : $t('context_menu.share') }} {{ fileInfoDetail.shared ? $t('context_menu.share_edit') : $t('context_menu.share') }}
</li> </li>
<li class="menu-option" @click="downloadItem" v-if="! isFolder"> <li class="menu-option" @click="downloadItem" v-if="! isFolder">
{{ $t('context_menu.download') }} {{ $t('context_menu.download') }}
@@ -53,7 +53,7 @@
{{ $t('context_menu.move') }} {{ $t('context_menu.move') }}
</li> </li>
<li class="menu-option" @click="shareItem" v-if="fileInfoDetail"> <li class="menu-option" @click="shareItem" v-if="fileInfoDetail">
{{ fileInfoDetail.shared ? 'Edit Sharing' : $t('context_menu.share') }} {{ fileInfoDetail.shared ? $t('context_menu.share_edit') : $t('context_menu.share') }}
</li> </li>
<li class="menu-option" @click="downloadItem" v-if="! isFolder"> <li class="menu-option" @click="downloadItem" v-if="! isFolder">
{{ $t('context_menu.download') }} {{ $t('context_menu.download') }}
@@ -22,7 +22,7 @@
.label { .label {
@include font-size(12); @include font-size(12);
color: $theme_light; color: $theme;
font-weight: 600; font-weight: 600;
text-decoration: underline; text-decoration: underline;
} }
@@ -33,7 +33,7 @@
margin-right: 2px; margin-right: 2px;
path { path {
fill: $theme_light; fill: $theme;
} }
} }
} }
@@ -75,4 +75,16 @@
} }
} }
} }
@media (prefers-color-scheme: dark) {
.copy-input {
input {
color: $dark_mode_text_primary;
&:disabled {
}
}
}
}
</style> </style>
@@ -14,7 +14,7 @@
<!--If is empty--> <!--If is empty-->
<div class="not-selected" v-if="! selected"> <div class="not-selected" v-if="! selected">
<span class="option-value placehoder">Selected your permision</span> <span class="option-value placehoder">{{ placeholder }}</span>
</div> </div>
<FontAwesomeIcon icon="chevron-down" class="chevron"/> <FontAwesomeIcon icon="chevron-down" class="chevron"/>
@@ -37,7 +37,7 @@
<script> <script>
export default { export default {
name:'SelectInput', name:'SelectInput',
props: ['options', 'isError', 'default'], props: ['options', 'isError', 'default', 'placeholder'],
data() { data() {
return { return {
selected: undefined, selected: undefined,
@@ -28,7 +28,6 @@
}, },
methods: { methods: {
changeState() { changeState() {
this.isSwitched = ! this.isSwitched this.isSwitched = ! this.isSwitched
this.$emit('input', this.isSwitched) this.$emit('input', this.isSwitched)
} }
@@ -90,4 +89,10 @@
} }
} }
} }
@media (prefers-color-scheme: dark) {
.switch {
background: $dark_mode_foreground;
}
}
</style> </style>
@@ -31,7 +31,8 @@
// Open called popup // Open called popup
events.$on('popup:open', ({name}) => { events.$on('popup:open', ({name}) => {
if (this.name === name) this.isVisibleWrapper = true if (this.name === name)
this.isVisibleWrapper = true
}) })
// Close popup // Close popup
@@ -1,7 +1,7 @@
<template> <template>
<PopupWrapper name="share-create"> <PopupWrapper name="share-create">
<!--Title--> <!--Title-->
<PopupHeader :title="'Share Your ' + itemTypeTitle" /> <PopupHeader :title="$t('popup_share_create.title', {item: itemTypeTitle})" />
<!--Content--> <!--Content-->
<PopupContent> <PopupContent>
@@ -14,22 +14,22 @@
<!--Permision Select--> <!--Permision Select-->
<ValidationProvider v-if="isFolder" tag="div" mode="passive" class="input-wrapper" name="Permission" rules="required" v-slot="{ errors }"> <ValidationProvider v-if="isFolder" tag="div" mode="passive" class="input-wrapper" name="Permission" rules="required" v-slot="{ errors }">
<label class="input-label">Permission:</label> <label class="input-label">{{ $t('shared_form.label_permission') }}:</label>
<SelectInput v-model="shareOptions.permission" :options="permissionOptions" :isError="errors[0]"/> <SelectInput v-model="shareOptions.permission" :options="permissionOptions" :placeholder="$t('shared_form.placeholder_permission')" :isError="errors[0]"/>
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span> <span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider> </ValidationProvider>
<!--Password Switch--> <!--Password Switch-->
<div class="input-wrapper"> <div class="input-wrapper">
<div class="inline-wrapper"> <div class="inline-wrapper">
<label class="input-label">Password Protected:</label> <label class="input-label">{{ $t('shared_form.label_password_protection') }}:</label>
<SwitchInput v-model="shareOptions.isPassword" class="switch" :state="0"/> <SwitchInput v-model="shareOptions.isPassword" class="switch" :state="0"/>
</div> </div>
</div> </div>
<!--Set password--> <!--Set password-->
<ValidationProvider v-if="shareOptions.isPassword" tag="div" mode="passive" class="input-wrapper password" name="Password" rules="required" v-slot="{ errors }"> <ValidationProvider v-if="shareOptions.isPassword" tag="div" mode="passive" class="input-wrapper password" name="Password" rules="required" v-slot="{ errors }">
<input v-model="shareOptions.password" :class="{'is-error': errors[0]}" type="text" placeholder="Type your password"> <input v-model="shareOptions.password" :class="{'is-error': errors[0]}" type="text" :placeholder="$t('page_sign_in.placeholder_password')">
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span> <span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider> </ValidationProvider>
</ValidationObserver> </ValidationObserver>
@@ -37,7 +37,7 @@
<!--Copy generated link--> <!--Copy generated link-->
<div v-if="isGeneratedShared" class="form-wrapper"> <div v-if="isGeneratedShared" class="form-wrapper">
<div class="input-wrapper"> <div class="input-wrapper">
<label class="input-label">Share url:</label> <label class="input-label">{{ $t('shared_form.label_shared_url') }}:</label>
<CopyInput size="small" :value="shareLink" /> <CopyInput size="small" :value="shareLink" />
</div> </div>
</div> </div>
@@ -65,10 +65,10 @@
</template> </template>
<script> <script>
import {ValidationProvider, ValidationObserver} from 'vee-validate/dist/vee-validate.full'
import PopupWrapper from '@/components/Others/Popup/PopupWrapper' import PopupWrapper from '@/components/Others/Popup/PopupWrapper'
import PopupActions from '@/components/Others/Popup/PopupActions' import PopupActions from '@/components/Others/Popup/PopupActions'
import PopupContent from '@/components/Others/Popup/PopupContent' import PopupContent from '@/components/Others/Popup/PopupContent'
import {ValidationProvider, ValidationObserver} from 'vee-validate/dist/vee-validate.full'
import PopupHeader from '@/components/Others/Popup/PopupHeader' import PopupHeader from '@/components/Others/Popup/PopupHeader'
import SwitchInput from '@/components/Others/Forms/SwitchInput' import SwitchInput from '@/components/Others/Forms/SwitchInput'
import SelectInput from '@/components/Others/Forms/SelectInput' import SelectInput from '@/components/Others/Forms/SelectInput'
@@ -99,13 +99,13 @@
computed: { computed: {
...mapGetters(['app', 'permissionOptions']), ...mapGetters(['app', 'permissionOptions']),
itemTypeTitle() { itemTypeTitle() {
return this.pickedItem && this.pickedItem.type === 'folder' ? 'Folder' : 'File' return this.pickedItem && this.pickedItem.type === 'folder' ? this.$t('types.folder') : this.$t('types.file')
}, },
isFolder() { isFolder() {
return this.pickedItem && this.pickedItem.type === 'folder' return this.pickedItem && this.pickedItem.type === 'folder'
}, },
submitButtonText() { submitButtonText() {
return this.isGeneratedShared ? 'Awesome, Im done!' : 'Generate Link' return this.isGeneratedShared ? this.$t('shared_form.button_done') : this.$t('shared_form.button_generate')
} }
}, },
data() { data() {
+11 -12
View File
@@ -1,7 +1,7 @@
<template> <template>
<PopupWrapper name="share-edit"> <PopupWrapper name="share-edit">
<!--Title--> <!--Title-->
<PopupHeader title="Update sharing options" /> <PopupHeader :title="$t('popup_share_edit.title')" />
<!--Content--> <!--Content-->
<PopupContent v-if="pickedItem && pickedItem.shared"> <PopupContent v-if="pickedItem && pickedItem.shared">
@@ -14,29 +14,29 @@
<!--Share link--> <!--Share link-->
<div class="input-wrapper"> <div class="input-wrapper">
<label class="input-label">Share url:</label> <label class="input-label">{{ $t('shared_form.label_shared_url') }}:</label>
<CopyInput size="small" :value="pickedItem.shared.link" /> <CopyInput size="small" :value="pickedItem.shared.link" />
</div> </div>
<!--Permision Select--> <!--Permision Select-->
<ValidationProvider v-if="isFolder" tag="div" mode="passive" class="input-wrapper" name="Permission" rules="required" v-slot="{ errors }"> <ValidationProvider v-if="isFolder" tag="div" mode="passive" class="input-wrapper" name="Permission" rules="required" v-slot="{ errors }">
<label class="input-label">Permission:</label> <label class="input-label">{{ $t('shared_form.label_permission') }}:</label>
<SelectInput v-model="shareOptions.permission" :options="permissionOptions" :default="shareOptions.permission" :isError="errors[0]"/> <SelectInput v-model="shareOptions.permission" :options="permissionOptions" :default="shareOptions.permission" :placeholder="$t('shared_form.placeholder_permission')" :isError="errors[0]"/>
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span> <span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider> </ValidationProvider>
<!--Password Switch--> <!--Password Switch-->
<div class="input-wrapper"> <div class="input-wrapper">
<div class="inline-wrapper"> <div class="inline-wrapper">
<label class="input-label">Password Protected:</label> <label class="input-label">{{ $t('shared_form.label_password_protection') }}:</label>
<SwitchInput v-model="shareOptions.isProtected" :state="shareOptions.isProtected" class="switch"/> <SwitchInput v-model="shareOptions.isProtected" :state="shareOptions.isProtected" class="switch"/>
</div> </div>
<ActionButton v-if="(pickedItem.shared.protected && canChangePassword) && shareOptions.isProtected" @click.native="changePassword" icon="pencil-alt">Change Password</ActionButton> <ActionButton v-if="(pickedItem.shared.protected && canChangePassword) && shareOptions.isProtected" @click.native="changePassword" icon="pencil-alt">{{ $t('popup_share_edit.change_pass') }}</ActionButton>
</div> </div>
<!--Set password--> <!--Set password-->
<ValidationProvider v-if="shareOptions.isProtected && ! canChangePassword" tag="div" mode="passive" class="input-wrapper password" name="Password" rules="required" v-slot="{ errors }"> <ValidationProvider v-if="shareOptions.isProtected && ! canChangePassword" tag="div" mode="passive" class="input-wrapper password" name="Password" rules="required" v-slot="{ errors }">
<input v-model="shareOptions.password" :class="{'is-error': errors[0]}" type="text" placeholder="Type your password"> <input v-model="shareOptions.password" :class="{'is-error': errors[0]}" type="text" :placeholder="$t('page_sign_in.placeholder_password')">
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span> <span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider> </ValidationProvider>
@@ -60,17 +60,17 @@
button-style="theme" button-style="theme"
:loading="isLoading" :loading="isLoading"
:disabled="isLoading" :disabled="isLoading"
>Ok >{{ $t('popup_share_edit.save') }}
</ButtonBase> </ButtonBase>
</PopupActions> </PopupActions>
</PopupWrapper> </PopupWrapper>
</template> </template>
<script> <script>
import {ValidationProvider, ValidationObserver} from 'vee-validate/dist/vee-validate.full'
import PopupWrapper from '@/components/Others/Popup/PopupWrapper' import PopupWrapper from '@/components/Others/Popup/PopupWrapper'
import PopupActions from '@/components/Others/Popup/PopupActions' import PopupActions from '@/components/Others/Popup/PopupActions'
import PopupContent from '@/components/Others/Popup/PopupContent' import PopupContent from '@/components/Others/Popup/PopupContent'
import {ValidationProvider, ValidationObserver} from 'vee-validate/dist/vee-validate.full'
import PopupHeader from '@/components/Others/Popup/PopupHeader' import PopupHeader from '@/components/Others/Popup/PopupHeader'
import SwitchInput from '@/components/Others/Forms/SwitchInput' import SwitchInput from '@/components/Others/Forms/SwitchInput'
import SelectInput from '@/components/Others/Forms/SelectInput' import SelectInput from '@/components/Others/Forms/SelectInput'
@@ -106,7 +106,7 @@
return this.pickedItem && this.pickedItem.type === 'folder' return this.pickedItem && this.pickedItem.type === 'folder'
}, },
destroyButtonText() { destroyButtonText() {
return this.isConfirmedDestroy ? 'Confirm' : 'Stop Sharing' return this.isConfirmedDestroy ? this.$t('popup_share_edit.confirm') : this.$t('popup_share_edit.stop')
}, },
destroyButtonStyle() { destroyButtonStyle() {
return this.isConfirmedDestroy ? 'danger-solid' : 'secondary' return this.isConfirmedDestroy ? 'danger-solid' : 'secondary'
@@ -144,7 +144,6 @@
axios axios
.delete('/api/share/' + this.pickedItem.shared.token) .delete('/api/share/' + this.pickedItem.shared.token)
.then(() => { .then(() => {
// Remove item from file browser // Remove item from file browser
if ( this.isSharedLocation ) { if ( this.isSharedLocation ) {
this.$store.commit('REMOVE_ITEM', this.pickedItem.unique_id) this.$store.commit('REMOVE_ITEM', this.pickedItem.unique_id)
@@ -154,7 +153,7 @@
this.$store.commit('FLUSH_SHARED', this.pickedItem.unique_id) this.$store.commit('FLUSH_SHARED', this.pickedItem.unique_id)
// End deleting spinner button // End deleting spinner button
this.isDeleting = false setTimeout(() => this.isDeleting = false, 150)
this.$closePopup() this.$closePopup()
}) })
@@ -159,7 +159,7 @@
.small { .small {
.file-item { .file-item {
padding: 0 15px; padding: 0 15px;
margin-bottom: 15px; margin-bottom: 25px;
} }
} }
@@ -24,7 +24,7 @@
<span class="name" >{{ file.name }}</span> <span class="name" >{{ file.name }}</span>
<!--Other attributes--> <!--Other attributes-->
<span v-if="! isFolder" class="item-size">{{ file.filesize }}, {{ file.created_at }}</span> <span v-if="! isFolder" class="item-size">{{ file.filesize }}</span>
<span v-if="isFolder" class="item-length">{{ file.items == 0 ? $t('folder.empty') : $tc('folder.item_counts', folderItems) }}, {{ file.created_at }}</span> <span v-if="isFolder" class="item-length">{{ file.items == 0 ? $t('folder.empty') : $tc('folder.item_counts', folderItems) }}, {{ file.created_at }}</span>
</div> </div>
+2 -2
View File
@@ -18,7 +18,7 @@
</li> </li>
<li class="menu-list-item" :class="{'is-active': isSharedLocation}" @click="getShared"> <li class="menu-list-item" :class="{'is-active': isSharedLocation}" @click="getShared">
<FontAwesomeIcon class="icon" icon="share"/> <FontAwesomeIcon class="icon" icon="share"/>
<span class="label">Shared</span> <span class="label">{{ $t('locations.shared') }}</span>
</li> </li>
<li class="menu-list-item" :class="{'is-active': isTrashLocation}" @click="getTrash"> <li class="menu-list-item" :class="{'is-active': isTrashLocation}" @click="getTrash">
<FontAwesomeIcon class="icon" icon="trash-alt"/> <FontAwesomeIcon class="icon" icon="trash-alt"/>
@@ -394,7 +394,7 @@
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
#sidebar { #sidebar {
background: $dark_mode_foreground; background: $dark_mode_background;
} }
.menu-list-wrapper { .menu-list-wrapper {
@@ -176,7 +176,7 @@
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
.user-headline { .user-headline {
background: $dark_mode_foreground; background: $dark_mode_background;
padding: 0; padding: 0;
&:hover { &:hover {
@@ -197,6 +197,10 @@
.menu-option { .menu-option {
color: $dark_mode_text_primary; color: $dark_mode_text_primary;
a {
color: $dark_mode_text_primary;
}
&:hover { &:hover {
background: $dark_mode_foreground; background: $dark_mode_foreground;
} }
+8 -4
View File
@@ -55,6 +55,7 @@ const Helpers = {
// Prevent submit empty files // Prevent submit empty files
if (files && files.length == 0) return if (files && files.length == 0) return
// Check storage size
if (! this.$isThisLocation(['public']) && this.$store.getters.app.storage.percentage >= 100) { if (! this.$isThisLocation(['public']) && this.$store.getters.app.storage.percentage >= 100) {
events.$emit('alert:open', { events.$emit('alert:open', {
emoji: '😬😬😬', emoji: '😬😬😬',
@@ -88,7 +89,8 @@ const Helpers = {
formData.append('parent_id', rootFolder) formData.append('parent_id', rootFolder)
// Upload data // Upload data
await store.dispatch('uploadFiles', formData).then(() => { await store.dispatch('uploadFiles', formData)
.then(() => {
// Progress file log // Progress file log
store.commit('UPDATE_FILE_COUNT_PROGRESS', { store.commit('UPDATE_FILE_COUNT_PROGRESS', {
current: fileCountSucceed, current: fileCountSucceed,
@@ -104,7 +106,7 @@ const Helpers = {
} }
}).catch(error => { }).catch(error => {
/*if (error.response.status === 423) { if (error.response.status === 423) {
events.$emit('alert:open', { events.$emit('alert:open', {
emoji: '😬😬😬', emoji: '😬😬😬',
@@ -119,7 +121,7 @@ const Helpers = {
title: this.$t('popup_error.title'), title: this.$t('popup_error.title'),
message: this.$t('popup_error.message'), message: this.$t('popup_error.message'),
}) })
}*/ }
}) })
} }
} }
@@ -132,7 +134,8 @@ const Helpers = {
// Get files // Get files
const files = [...event.dataTransfer.items].map(item => item.getAsFile()); const files = [...event.dataTransfer.items].map(item => item.getAsFile());
if (this.$store.getters.app.storage.percentage >= 100) { // Check storage size
if (! this.$isThisLocation(['public']) && this.$store.getters.app.storage.percentage >= 100) {
events.$emit('alert:open', { events.$emit('alert:open', {
emoji: '😬😬😬', emoji: '😬😬😬',
title: this.$t('popup_exceed_limit.title'), title: this.$t('popup_exceed_limit.title'),
@@ -141,6 +144,7 @@ const Helpers = {
return return
} }
let fileCountSucceed = 1 let fileCountSucceed = 1
store.commit('UPDATE_FILE_COUNT_PROGRESS', { store.commit('UPDATE_FILE_COUNT_PROGRESS', {
+2 -2
View File
@@ -2,14 +2,14 @@ import Vue from 'vue';
import VueI18n from 'vue-i18n'; import VueI18n from 'vue-i18n';
import en from './lang/en.json' import en from './lang/en.json'
import sk from './lang/sk.json' //import sk from './lang/sk.json'
Vue.use(VueI18n); Vue.use(VueI18n);
const i18n = new VueI18n({ const i18n = new VueI18n({
locale: config.locale, locale: config.locale,
messages: Object.assign({ messages: Object.assign({
en, sk en
}), }),
}); });
+49 -2
View File
@@ -24,6 +24,13 @@
"button_create_account": "Create Account", "button_create_account": "Create Account",
"have_an_account": "Do you have an account?" "have_an_account": "Do you have an account?"
}, },
"page_shared": {
"subtitle": "Please type the password to get shared content:",
"title": "Your Share Link is Protected",
"placeholder_pass": "Type password",
"download_file": "Download File",
"submit": "Submit"
},
"page_create_password": { "page_create_password": {
"title": "Only One Step to Log In", "title": "Only One Step to Log In",
"subtitle": "Create your new password here:", "subtitle": "Create your new password here:",
@@ -71,11 +78,15 @@
"nothing_was_found": "Nothing was found" "nothing_was_found": "Nothing was found"
}, },
"locations": { "locations": {
"home": "Home", "shared": "Shared",
"trash": "Trash" "trash": "Trash",
"home": "Home"
}, },
"file_detail": { "file_detail": {
"author_participant": "Public Participant",
"created_at": "Created at", "created_at": "Created at",
"shared": "Shared",
"author": "Author",
"where": "Where", "where": "Where",
"size": "Size" "size": "Size"
}, },
@@ -117,6 +128,7 @@
"profile_settings": "Profile Settings", "profile_settings": "Profile Settings",
"create_folder": "Create Folder", "create_folder": "Create Folder",
"empty_trash": "Empty Trash", "empty_trash": "Empty Trash",
"share_edit": "Edit Sharing",
"add_folder": "Add Folder", "add_folder": "Add Folder",
"download": "Download", "download": "Download",
"log_out": "Log Out", "log_out": "Log Out",
@@ -129,6 +141,7 @@
"move": "Move" "move": "Move"
}, },
"sidebar": { "sidebar": {
"shared": "Shared",
"locations": "Locations", "locations": "Locations",
"favourites": "Favourites", "favourites": "Favourites",
"favourites_empty": "Drag here your favourite folder.", "favourites_empty": "Drag here your favourite folder.",
@@ -162,5 +175,39 @@
"popup_exceed_limit": { "popup_exceed_limit": {
"title": "Whooops, you exceed your storage limit :(", "title": "Whooops, you exceed your storage limit :(",
"message": "Please contact your administrator to change your limit." "message": "Please contact your administrator to change your limit."
},
"popup_share_create": {
"title": "Share Your {item}"
},
"popup_share_edit": {
"title": "Update sharing options",
"change_pass": "Change Password",
"save": "Save Changes",
"stop": "Stop Sharing",
"confirm": "Confirm"
},
"shared": {
"empty_shared": "You Haven't Shared Anything Yet",
"editor": "Can edit and upload files",
"visitor": "Can only view and download",
"can_download": "Can download file"
},
"shared_form": {
"placeholder_permission": "Select your permission",
"label_password_protection": "Password Protected",
"button_done": "Awesome, Im done!",
"button_generate": "Generate Link",
"label_permission": "Permission",
"label_shared_url": "Share url"
},
"actions": {
"create_folder": "Create folder",
"preview": "Change preview",
"upload": "Upload file",
"delete": "Delete item"
},
"types": {
"folder": "Folder",
"file": "File"
} }
} }
+49 -2
View File
@@ -24,6 +24,13 @@
"button_create_account": "Vytvoriť účet", "button_create_account": "Vytvoriť účet",
"have_an_account": "Máš už účet?" "have_an_account": "Máš už účet?"
}, },
"page_shared": {
"subtitle": "Prosím vložte heslo pre získanie prístupu k obsahu:",
"title": "Zdieľaný odkaz je chránený",
"placeholder_pass": "Vložte heslo",
"download_file": "Stiahnúť súbor",
"submit": "Potvrdiť"
},
"page_create_password": { "page_create_password": {
"title": "Iba jeden krok pre prihlásenie", "title": "Iba jeden krok pre prihlásenie",
"subtitle": "Vytvorte si nové heslo tu:", "subtitle": "Vytvorte si nové heslo tu:",
@@ -71,12 +78,16 @@
"nothing_was_found": "Nič sa nenašlo" "nothing_was_found": "Nič sa nenašlo"
}, },
"locations": { "locations": {
"shared": "Zdieľané",
"home": "Domov", "home": "Domov",
"trash": "Kôš" "trash": "Kôš"
}, },
"file_detail": { "file_detail": {
"author_participant": "Verejný účastník",
"created_at": "Vytvorené", "created_at": "Vytvorené",
"where": "Umiestnenie", "where": "Umiestnenie",
"shared": "Zdieľané",
"author": "Autor",
"size": "Veľkosť" "size": "Veľkosť"
}, },
"empty_page": { "empty_page": {
@@ -116,19 +127,21 @@
"add_to_favourites": "Pridať do obľúbených", "add_to_favourites": "Pridať do obľúbených",
"profile_settings": "Nastavenia profilu", "profile_settings": "Nastavenia profilu",
"create_folder": "Vytvoriť priečinok", "create_folder": "Vytvoriť priečinok",
"share_edit": "Upraviť zdieľanie",
"empty_trash": "Vyprázdniť kôš", "empty_trash": "Vyprázdniť kôš",
"add_folder": "Nový priečinok", "add_folder": "Nový priečinok",
"download": "Stiahnúť",
"log_out": "Odhlásiť sa", "log_out": "Odhlásiť sa",
"download": "Stiahnúť",
"rename": "Premenovať",
"restore": "Obnoviť", "restore": "Obnoviť",
"upload": "Nahrať", "upload": "Nahrať",
"detail": "Detail", "detail": "Detail",
"rename": "Premenovať",
"delete": "Vymazať", "delete": "Vymazať",
"share": "Zdieľať", "share": "Zdieľať",
"move": "Presunúť" "move": "Presunúť"
}, },
"sidebar": { "sidebar": {
"shared": "Zdieľané",
"locations": "Umiestnenie", "locations": "Umiestnenie",
"favourites": "Obľúbené", "favourites": "Obľúbené",
"favourites_empty": "Presuňte sem svoj obľúbený priečinok.", "favourites_empty": "Presuňte sem svoj obľúbený priečinok.",
@@ -162,5 +175,39 @@
"popup_exceed_limit": { "popup_exceed_limit": {
"title": "Ups, presiahli ste limit úložiska", "title": "Ups, presiahli ste limit úložiska",
"message": "Prosím, kontaktujte administrátora pre navyšenie limitu." "message": "Prosím, kontaktujte administrátora pre navyšenie limitu."
},
"popup_share_create": {
"title": "Zdieľaj {item}"
},
"popup_share_edit": {
"title": "Upraviť nastavenia zdieľania",
"change_pass": "Zmeniť heslo",
"save": "Uložiť zmeny",
"stop": "Zastaviť zdieľanie",
"confirm": "Potvrdiť"
},
"shared": {
"empty_shared": "Zatiaľ ste nič nezdieľali",
"editor": "Môže upravovať a nahrávať súbory",
"visitor": "Môže len vidieť a sťahovať súbory",
"can_download": "Môže stiahnúť súbor"
},
"shared_form": {
"placeholder_permission": "Zvoľte oprávnenia",
"label_password_protection": "Chrániť heslom",
"button_done": "Super, som hotový!",
"button_generate": "Vygenerovať link",
"label_permission": "Oprávnenie",
"label_shared_url": "Zdieľací odkaz"
},
"actions": {
"create_folder": "Vytvoriť priečinok",
"preview": "Zmeniť náhľad",
"upload": "Nahrať súbory",
"delete": "Vymazať položku"
},
"types": {
"folder": "Priečinok",
"file": "Súbor"
} }
} }
-1
View File
@@ -1,6 +1,5 @@
import Vue from 'vue' import Vue from 'vue'
import Router from 'vue-router' import Router from 'vue-router'
import store from '@/store'
import Index from './views/Auth/SignIn' import Index from './views/Auth/SignIn'
import SignUp from './views/Auth/SignUp' import SignUp from './views/Auth/SignUp'
+20 -10
View File
@@ -43,7 +43,9 @@ const actions = {
location: folder.deleted_at || folder.location === 'trash' ? 'trash' : 'base' location: folder.deleted_at || folder.location === 'trash' ? 'trash' : 'base'
} }
let url = currentFolder.location === 'trash' ? '/folders/' + currentFolder.unique_id + '?trash=true' : '/folders/' + currentFolder.unique_id let url = currentFolder.location === 'trash'
? '/folders/' + currentFolder.unique_id + '?trash=true'
: '/folders/' + currentFolder.unique_id
axios axios
.get(context.getters.api + url) .get(context.getters.api + url)
@@ -61,12 +63,22 @@ const actions = {
if (!init) context.commit('ADD_BROWSER_HISTORY', currentFolder) if (!init) context.commit('ADD_BROWSER_HISTORY', currentFolder)
} }
}) })
.catch(() => { .catch(error => {
// Show error message
events.$emit('alert:open', { // Redirect if unauthenticated
title: i18n.t('popup_error.title'), if ([401, 403].includes(error.response.status)) {
message: i18n.t('popup_error.message'),
}) context.commit('SET_AUTHORIZED', false)
router.push({name: 'SignIn'})
} else {
// Show error message
events.$emit('alert:open', {
title: i18n.t('popup_error.title'),
message: i18n.t('popup_error.message'),
})
}
}) })
}, },
getShared: (context, back = false) => { getShared: (context, back = false) => {
@@ -187,7 +199,7 @@ const actions = {
if (getters.sharedDetail && getters.sharedDetail.protected) if (getters.sharedDetail && getters.sharedDetail.protected)
route = '/api/navigation/private' route = '/api/navigation/private'
else if (getters.sharedDetail && ! getters.sharedDetail.protected) else if (getters.sharedDetail && !getters.sharedDetail.protected)
route = '/api/navigation/public/' + router.currentRoute.params.token route = '/api/navigation/public/' + router.currentRoute.params.token
else else
route = '/api/navigation' route = '/api/navigation'
@@ -209,8 +221,6 @@ const actions = {
}) })
}) })
}) })
}, },
} }
+3 -2
View File
@@ -3,7 +3,6 @@ import router from '@/router'
import {events} from '@/bus' import {events} from '@/bus'
import axios from 'axios' import axios from 'axios'
const actions = { const actions = {
moveItem: ({commit, getters}, [item_from, to_item]) => { moveItem: ({commit, getters}, [item_from, to_item]) => {
@@ -86,9 +85,11 @@ const actions = {
if (response.data.folder_id == getters.currentFolder.unique_id) if (response.data.folder_id == getters.currentFolder.unique_id)
commit('ADD_NEW_ITEMS', response.data) commit('ADD_NEW_ITEMS', response.data)
commit('UPDATE_RECENT_UPLOAD', response.data)
commit('UPLOADING_FILE_PROGRESS', 0) commit('UPLOADING_FILE_PROGRESS', 0)
if (getters.permission === 'master')
commit('UPDATE_RECENT_UPLOAD', response.data)
resolve(response) resolve(response)
}) })
.catch(error => { .catch(error => {
+5 -3
View File
@@ -6,12 +6,12 @@ import axios from 'axios'
const defaultState = { const defaultState = {
permissionOptions: [ permissionOptions: [
{ {
label: 'Can edit and upload files', label: i18n.t('shared.editor'),
value: 'editor', value: 'editor',
icon: 'user-edit', icon: 'user-edit',
}, },
{ {
label: 'Can only view and download', label: i18n.t('shared.visitor'),
value: 'visitor', value: 'visitor',
icon: 'user', icon: 'user',
}, },
@@ -74,7 +74,9 @@ const actions = {
}, },
getSingleFile: ({commit, state}) => { getSingleFile: ({commit, state}) => {
let route = state.sharedDetail.protected ? '/api/files/private' : '/api/files/' + router.currentRoute.params.token + '/public' let route = state.sharedDetail.protected
? '/api/files/private'
: '/api/files/' + router.currentRoute.params.token + '/public'
axios.get(route) axios.get(route)
.then(response => { .then(response => {
+6 -3
View File
@@ -5,12 +5,12 @@ import router from '@/router'
const defaultState = { const defaultState = {
authorized: undefined, authorized: undefined,
permission: 'master', // master | editor | visitor, permission: 'master', // master | editor | visitor
app: undefined, app: undefined,
} }
const actions = { const actions = {
getAppData: ({commit, dispatch, getters}) => { getAppData: ({commit, getters}) => {
axios axios
.get(getters.api + '/user') .get(getters.api + '/user')
@@ -19,8 +19,11 @@ const actions = {
}).catch((error) => { }).catch((error) => {
if (error.response.status == 401) { // Redirect if unauthenticated
if ([401, 403].includes(error.response.status)) {
commit('SET_AUTHORIZED', false) commit('SET_AUTHORIZED', false)
router.push({name: 'SignIn'})
} }
} }
) )
+10 -28
View File
@@ -47,36 +47,18 @@
}, },
mounted() { mounted() {
// Set default directory let homeDirectory = {
if (this.config.directory) { name: this.$t('locations.home'),
// Set start directory location: 'base',
this.$store.commit('SET_START_DIRECTORY', this.config.directory) unique_id: 0,
// Load folder
this.$store.dispatch('getFolder', [
{
unique_id: this.config.directory.unique_id,
name: this.config.directory.name,
location: 'base',
},
false,
true
])
} else {
let homeDirectory = {
unique_id: 0,
name: 'Home',
location: 'base',
}
// Set start directory
this.$store.commit('SET_START_DIRECTORY', homeDirectory)
// Load folder
this.$store.dispatch('getFolder', [homeDirectory, false, true])
} }
// Set start directory
this.$store.commit('SET_START_DIRECTORY', homeDirectory)
// Load folder
this.$store.dispatch('getFolder', [homeDirectory, false, true])
var filesView = document.getElementById('files-view'); var filesView = document.getElementById('files-view');
new ResizeSensor(filesView, this.handleContentResize); new ResizeSensor(filesView, this.handleContentResize);
} }
+1 -1
View File
@@ -85,7 +85,7 @@
import axios from 'axios' import axios from 'axios'
export default { export default {
name: 'UserSettings', name: 'Profile',
components: { components: {
ValidationProvider, ValidationProvider,
ValidationObserver, ValidationObserver,
+39 -40
View File
@@ -16,17 +16,17 @@
<!--Verify share link by password--> <!--Verify share link by password-->
<AuthContent class="center" name="password" :visible="true"> <AuthContent class="center" name="password" :visible="true">
<img class="logo" :src="config.app_logo" :alt="config.app_name"> <img class="logo" :src="config.app_logo" :alt="config.app_name">
<h1>Your Share Link is Protected</h1> <h1>{{ $t('page_shared.title') }}</h1>
<h2>Please type the password to get shared content:</h2> <h2>{{ $t('page_shared.subtitle') }}</h2>
<ValidationObserver @submit.prevent="authenticateProtected" ref="authenticateProtected" v-slot="{ invalid }" tag="form" class="form inline-form"> <ValidationObserver @submit.prevent="authenticateProtected" ref="authenticateProtected" v-slot="{ invalid }" tag="form" class="form inline-form">
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Password" rules="required" v-slot="{ errors }"> <ValidationProvider tag="div" mode="passive" class="input-wrapper" name="Password" rules="required" v-slot="{ errors }">
<input v-model="password" placeholder="Type password" type="password" :class="{'is-error': errors[0]}"/> <input v-model="password" :placeholder="$t('page_shared.placeholder_pass')" type="password" :class="{'is-error': errors[0]}"/>
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span> <span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
</ValidationProvider> </ValidationProvider>
<AuthButton icon="chevron-right" text="Submit" :loading="isLoading" :disabled="isLoading" /> <AuthButton icon="chevron-right" :text="$t('page_shared.submit')" :loading="isLoading" :disabled="isLoading" />
</ValidationObserver> </ValidationObserver>
</AuthContent> </AuthContent>
</div> </div>
@@ -38,7 +38,7 @@
<FileItemGrid v-if="sharedFile" :data="sharedFile"/> <FileItemGrid v-if="sharedFile" :data="sharedFile"/>
<ButtonBase @click.native="download" class="download-button" button-style="theme"> <ButtonBase @click.native="download" class="download-button" button-style="theme">
Download File {{ $t('page_shared.download_file') }}
</ButtonBase> </ButtonBase>
</div> </div>
</div> </div>
@@ -64,8 +64,8 @@
</template> </template>
<script> <script>
import DesktopToolbar from '@/components/FilesView/DesktopToolbar'
import {ValidationProvider, ValidationObserver} from 'vee-validate/dist/vee-validate.full' import {ValidationProvider, ValidationObserver} from 'vee-validate/dist/vee-validate.full'
import DesktopToolbar from '@/components/FilesView/DesktopToolbar'
import FileItemGrid from '@/components/FilesView/FileItemGrid' import FileItemGrid from '@/components/FilesView/FileItemGrid'
import FileBrowser from '@/components/FilesView/FileBrowser' import FileBrowser from '@/components/FilesView/FileBrowser'
import ContextMenu from '@/components/FilesView/ContextMenu' import ContextMenu from '@/components/FilesView/ContextMenu'
@@ -129,7 +129,7 @@
axios axios
.post('/api/shared/authenticate/' + this.$route.params.token, { .post('/api/shared/authenticate/' + this.$route.params.token, {
password: this.password password: this.password
}).then(response => { }).then(() => {
// End loading // End loading
this.isLoading = false this.isLoading = false
@@ -140,20 +140,46 @@
// Get protected files // Get protected files
this.getFiles(); this.getFiles();
}) }).catch(error => {
/*.catch((error) => { if (error.response.status == 401) {
/!*if (error.response.status == 401) {
this.$refs.authenticateProtected.setErrors({ this.$refs.authenticateProtected.setErrors({
'Password': [error.response.data.message] 'Password': [error.response.data.message]
}); });
}*!/ }
// End loading // End loading
this.isLoading = false this.isLoading = false
})*/ })
},
getFiles() {
// Show folder
if (this.sharedDetail.type === 'folder') {
let homeDirectory = {
unique_id: this.sharedDetail.item_id,
name: this.$t('locations.home'),
location: 'public',
}
// Set start directory
this.$store.commit('SET_START_DIRECTORY', homeDirectory)
// Load folder
this.$store.dispatch('browseShared', [homeDirectory, false, true])
.then(() => {
var filesView = document.getElementById('files-view')
new ResizeSensor(filesView, this.handleContentResize)
})
}
// Get file
if (this.sharedDetail.type === 'file') {
this.$store.dispatch('getSingleFile')
}
}, },
download() { download() {
this.$downloadFile(this.sharedFile.file_url, this.sharedFile.name + '.' + this.sharedFile.mimetype) this.$downloadFile(this.sharedFile.file_url, this.sharedFile.name + '.' + this.sharedFile.mimetype)
@@ -176,33 +202,6 @@
else if (filesView >= 960) else if (filesView >= 960)
this.$store.commit('SET_FILES_VIEW_SIZE', 'full-scale') this.$store.commit('SET_FILES_VIEW_SIZE', 'full-scale')
}, },
getFiles() {
// Show folder
if (this.sharedDetail.type === 'folder') {
let homeDirectory = {
unique_id: this.sharedDetail.item_id,
name: 'Home',
}
// Set start directory
this.$store.commit('SET_START_DIRECTORY', homeDirectory)
// Load folder
this.$store.dispatch('browseShared', [homeDirectory, false, true])
.then(() => {
var filesView = document.getElementById('files-view')
new ResizeSensor(filesView, this.handleContentResize)
})
}
// Get file
if (this.sharedDetail.type === 'file') {
this.$store.dispatch('getSingleFile')
}
}
}, },
created() { created() {
+6 -5
View File
@@ -1,7 +1,8 @@
<?php <?php
return [ return [
'user_not_fount' => 'We can\'t find a user with that e-mail address.', 'user_not_fount' => 'We can\'t find a user with that e-mail address.',
'home' => 'Home', 'home' => 'Home',
'time' => '%d. %B. %Y at %H:%M', 'time' => '%d. %B. %Y at %H:%M',
]; 'incorrect_password' => 'Sorry, your password is incorrect.',
];
+4 -3
View File
@@ -1,7 +1,8 @@
<?php <?php
return [ return [
'user_not_fount' => 'Uživateľ s touto emailovou adresou sa nenašiel.', 'user_not_fount' => 'Uživateľ s touto emailovou adresou sa nenašiel.',
'home' => 'Domov', 'home' => 'Domov',
'time' => '%d. %B. %Y o %H:%M', 'time' => '%d. %B. %Y o %H:%M',
'incorrect_password' => 'Prepáč, zadané heslo je nesprávne',
]; ];
+7 -1
View File
@@ -34,7 +34,7 @@
} }
.icon { .icon {
background: $theme_light; background: $theme;
padding: 14px 18px; padding: 14px 18px;
border-top-right-radius: 8px; border-top-right-radius: 8px;
border-bottom-right-radius: 8px; border-bottom-right-radius: 8px;
@@ -54,4 +54,10 @@
font-weight: 700; font-weight: 700;
margin-bottom: 5px; margin-bottom: 5px;
display: block; display: block;
}
@media (prefers-color-scheme: dark) {
.input-label {
color: $dark_mode_text_primary;
}
} }
-1
View File
@@ -3,7 +3,6 @@ $text: #1b2539;
$text-muted: #667b90; $text-muted: #667b90;
$theme: #00BC7E; $theme: #00BC7E;
$theme_light: #4ECDA5;
$light_mode_border: rgba(0, 0, 0, 0.02); $light_mode_border: rgba(0, 0, 0, 0.02);
$danger: #fd397a; $danger: #fd397a;
+3 -3
View File
@@ -44,7 +44,7 @@ Route::group(['middleware' => ['api']], function () {
}); });
// User master Routes // User master Routes
Route::group(['middleware' => ['auth:api', 'auth.cookie', 'scope:master']], function () { Route::group(['middleware' => ['auth:api', 'auth.master', 'scope:master']], function () {
// User // User
Route::post('/user/password', 'User\AccountController@change_password'); Route::post('/user/password', 'User\AccountController@change_password');
@@ -77,7 +77,7 @@ Route::group(['middleware' => ['auth:api', 'auth.cookie', 'scope:master']], func
}); });
// Protected sharing routes for authenticated user // Protected sharing routes for authenticated user
Route::group(['middleware' => ['auth:api', 'auth.cookie', 'scope:visitor,editor']], function () { Route::group(['middleware' => ['auth:api', 'auth.shared', 'scope:visitor,editor']], function () {
// Browse folders & files // Browse folders & files
Route::get('/folders/{unique_id}/private', 'Sharing\FileSharingController@get_private_folders'); Route::get('/folders/{unique_id}/private', 'Sharing\FileSharingController@get_private_folders');
@@ -86,7 +86,7 @@ Route::group(['middleware' => ['auth:api', 'auth.cookie', 'scope:visitor,editor'
}); });
// User master,editor routes // User master,editor routes
Route::group(['middleware' => ['auth:api', 'auth.cookie', 'scope:master,editor']], function () { Route::group(['middleware' => ['auth:api', 'auth.shared', 'auth.master', 'scope:master,editor']], function () {
// Edit items // Edit items
Route::delete('/remove-item/{unique_id}', 'FileFunctions\EditItemsController@user_delete_item'); Route::delete('/remove-item/{unique_id}', 'FileFunctions\EditItemsController@user_delete_item');
+1 -1
View File
@@ -17,7 +17,7 @@ Route::get('/avatars/{avatar}', 'FileAccessController@get_avatar')->name('avatar
Route::get('/file/{name}/public/{token}', 'FileAccessController@get_file_public'); Route::get('/file/{name}/public/{token}', 'FileAccessController@get_file_public');
// User master,editor,visitor access to image thumbnails and file downloads // User master,editor,visitor access to image thumbnails and file downloads
Route::group(['middleware' => ['auth:api', 'auth.cookie', 'scope:master,editor,visitor']], function () { Route::group(['middleware' => ['auth:api', 'auth.shared', 'auth.master', 'scope:master,editor,visitor']], function () {
Route::get('/thumbnail/{name}', 'FileAccessController@get_thumbnail')->name('thumbnail'); Route::get('/thumbnail/{name}', 'FileAccessController@get_thumbnail')->name('thumbnail');
Route::get('/file/{name}', 'FileAccessController@get_file')->name('file'); Route::get('/file/{name}', 'FileAccessController@get_file')->name('file');
}); });