mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-05 18:23:48 +00:00
user timezone v1 , add autofocus for CreateFolder,RenameItem popup
This commit is contained in:
@@ -102,7 +102,7 @@ class FileManagerFile extends Model
|
||||
*/
|
||||
public function getCreatedAtAttribute()
|
||||
{
|
||||
return format_date($this->attributes['created_at'], __('vuefilemanager.time'));
|
||||
return format_date(set_time_by_user_timezone($this->attributes['created_at']), __('vuefilemanager.time'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -114,7 +114,7 @@ class FileManagerFile extends Model
|
||||
{
|
||||
if (!$this->attributes['deleted_at']) return null;
|
||||
|
||||
return format_date($this->attributes['deleted_at'], __('vuefilemanager.time'));
|
||||
return format_date(set_time_by_user_timezone($this->attributes['deleted_at']), __('vuefilemanager.time'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -133,7 +133,7 @@ class FileManagerFolder extends Model
|
||||
*/
|
||||
public function getCreatedAtAttribute()
|
||||
{
|
||||
return format_date($this->attributes['created_at'], __('vuefilemanager.time'));
|
||||
return format_date(set_time_by_user_timezone($this->attributes['created_at']), __('vuefilemanager.time'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -145,7 +145,7 @@ class FileManagerFolder extends Model
|
||||
{
|
||||
if (! $this->attributes['deleted_at']) return null;
|
||||
|
||||
return format_date($this->attributes['deleted_at'], __('vuefilemanager.time'));
|
||||
return format_date(set_time_by_user_timezone($this->attributes['deleted_at']), __('vuefilemanager.time'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -429,8 +429,6 @@ class EditItemsController extends Controller
|
||||
|
||||
$zip = Editor::zip_files($files);
|
||||
|
||||
dd($zip);
|
||||
|
||||
// Get file
|
||||
return response([
|
||||
'url' => route('zip', $zip->id),
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
use App\FileManagerFile;
|
||||
use App\FileManagerFolder;
|
||||
use App\User;
|
||||
use App\Setting;
|
||||
use App\Share;
|
||||
use ByteUnits\Metric;
|
||||
@@ -766,3 +767,19 @@ function get_files_for_zip($folders, $files = [], $path = [])
|
||||
|
||||
return get_files_for_zip($folders->folders->first(), $files, $path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set time by user timezone GMT
|
||||
*
|
||||
* @param $time
|
||||
* @return int
|
||||
*/
|
||||
function set_time_by_user_timezone($time)
|
||||
{
|
||||
$user = Auth::user();
|
||||
|
||||
// Get the value of timezone if user have some
|
||||
$time_zone = intval($user->settings->timezone * 60 ?? null);
|
||||
|
||||
return Carbon::parse($time)->addMinutes($time_zone ?? null);
|
||||
}
|
||||
|
||||
@@ -76,7 +76,16 @@ class UserResource extends JsonResource
|
||||
'folders' => $this->folder_tree
|
||||
],
|
||||
],
|
||||
]
|
||||
],
|
||||
'timezone' => [
|
||||
'data' => [
|
||||
'id' => '1',
|
||||
'type' => 'timezone',
|
||||
'attributes' => [
|
||||
'timezone' =>$this->settings->timezone
|
||||
],
|
||||
]
|
||||
],
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ return [
|
||||
|
|
||||
*/
|
||||
|
||||
'timezone' => 'America/Toronto',
|
||||
'timezone' => 'UTC',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddTimezoneToUserSettingsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('user_settings', function (Blueprint $table) {
|
||||
$table->integer('timezone')->after('billing_phone_number')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('user_settings', function (Blueprint $table) {
|
||||
//
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -44,7 +44,7 @@
|
||||
"/chunks/plan-settings.js": "/chunks/plan-settings.js?id=e608674e1719be65fe6f",
|
||||
"/chunks/plan-subscribers.js": "/chunks/plan-subscribers.js?id=8655313c7b71b1019c8f",
|
||||
"/chunks/plans.js": "/chunks/plans.js?id=d6d92de642403caa999b",
|
||||
"/chunks/profile.js": "/chunks/profile.js?id=1e629aa55540ed106ce7",
|
||||
"/chunks/profile.js": "/chunks/profile.js?id=abfb1dad3d8fdce92787",
|
||||
"/chunks/profile~chunks/settings-password.js": "/chunks/profile~chunks/settings-password.js?id=f9e2ea1515204b5c63b6",
|
||||
"/chunks/purchase-code.js": "/chunks/purchase-code.js?id=91a470e84a34587f3944",
|
||||
"/chunks/settings.js": "/chunks/settings.js?id=87d29c7fd4e0e6f1a3bd",
|
||||
@@ -74,5 +74,40 @@
|
||||
"/chunks/user-password.js": "/chunks/user-password.js?id=ac51d17a4aa7ae50bc88",
|
||||
"/chunks/user-storage.js": "/chunks/user-storage.js?id=5cfec8a8f8a8aef24ef2",
|
||||
"/chunks/user-subscription.js": "/chunks/user-subscription.js?id=34603496ceacb8bd2da3",
|
||||
"/chunks/users.js": "/chunks/users.js?id=6e68cb068f69fba3199c"
|
||||
"/chunks/users.js": "/chunks/users.js?id=6e68cb068f69fba3199c",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page.0d42e15c9fc9a17db140.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.0d42e15c9fc9a17db140.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page.0d1d9e9d24b672e0eb4d.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.0d1d9e9d24b672e0eb4d.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page.00d1c9d50337238888d6.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.00d1c9d50337238888d6.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page.69875e53b11bb1bd4a9d.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.69875e53b11bb1bd4a9d.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page.c4cded7f2584ba7f58ec.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.c4cded7f2584ba7f58ec.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page.eb22772495bd39a4ca16.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.eb22772495bd39a4ca16.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page.2d3b6de84e5ca46a2a3b.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.2d3b6de84e5ca46a2a3b.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page.fb39421b71d4211adaf9.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.fb39421b71d4211adaf9.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page.dfebbee6812986456b84.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.dfebbee6812986456b84.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page.9a4b54ecb21b0e9e5d62.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.9a4b54ecb21b0e9e5d62.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page.22ca8324730e2b3d844c.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.22ca8324730e2b3d844c.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page.af3996aaf217a7e41cf9.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.af3996aaf217a7e41cf9.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page.9ba89a575c6d5c664c26.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.9ba89a575c6d5c664c26.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page.d9f1862daa9b39627335.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.d9f1862daa9b39627335.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page.9c7c11a70f6ca143a73e.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.9c7c11a70f6ca143a73e.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page.195fbecc5f0cddfead17.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.195fbecc5f0cddfead17.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page.f8baf448ac3897f2a01d.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.f8baf448ac3897f2a01d.hot-update.js",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page.a48e830506afe0f3db58.hot-update.js": "/chunks/files~chunks/shared-files~chunks/shared-page.a48e830506afe0f3db58.hot-update.js",
|
||||
"/chunks/profile.9bbd067322086f669c7f.hot-update.js": "/chunks/profile.9bbd067322086f669c7f.hot-update.js",
|
||||
"/chunks/profile.5caad98642a195d5c402.hot-update.js": "/chunks/profile.5caad98642a195d5c402.hot-update.js",
|
||||
"/chunks/profile.16965358d677097b2876.hot-update.js": "/chunks/profile.16965358d677097b2876.hot-update.js",
|
||||
"/chunks/profile.6757cd9355c2ae37fa81.hot-update.js": "/chunks/profile.6757cd9355c2ae37fa81.hot-update.js",
|
||||
"/chunks/profile.58467e9a426eb06fe7e8.hot-update.js": "/chunks/profile.58467e9a426eb06fe7e8.hot-update.js",
|
||||
"/chunks/profile.0e178ae895ce6f15a656.hot-update.js": "/chunks/profile.0e178ae895ce6f15a656.hot-update.js",
|
||||
"/chunks/profile.9e8431547a69ee335a52.hot-update.js": "/chunks/profile.9e8431547a69ee335a52.hot-update.js",
|
||||
"/chunks/profile.8b872787490512864078.hot-update.js": "/chunks/profile.8b872787490512864078.hot-update.js",
|
||||
"/js/main.914e014ba4448b5fd12c.hot-update.js": "/js/main.914e014ba4448b5fd12c.hot-update.js",
|
||||
"/js/main.b6937cd8d5084f9cdee9.hot-update.js": "/js/main.b6937cd8d5084f9cdee9.hot-update.js",
|
||||
"/chunks/profile.b72bfd249a1398fa9112.hot-update.js": "/chunks/profile.b72bfd249a1398fa9112.hot-update.js",
|
||||
"/chunks/profile.930b438250c236f4503d.hot-update.js": "/chunks/profile.930b438250c236f4503d.hot-update.js",
|
||||
"/chunks/profile.97fa89c4a4697afec88b.hot-update.js": "/chunks/profile.97fa89c4a4697afec88b.hot-update.js",
|
||||
"/chunks/profile.b1f78aeb1e02d400b21f.hot-update.js": "/chunks/profile.b1f78aeb1e02d400b21f.hot-update.js",
|
||||
"/chunks/profile.ac7401c63080dabe647a.hot-update.js": "/chunks/profile.ac7401c63080dabe647a.hot-update.js",
|
||||
"/chunks/profile.9e5657a7d7234d922466.hot-update.js": "/chunks/profile.9e5657a7d7234d922466.hot-update.js",
|
||||
"/chunks/profile.cc7877e8ededddef67ca.hot-update.js": "/chunks/profile.cc7877e8ededddef67ca.hot-update.js"
|
||||
}
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
<?php
|
||||
|
||||
// Show all information, defaults to INFO_ALL
|
||||
phpinfo();
|
||||
|
||||
?>
|
||||
@@ -13,7 +13,7 @@
|
||||
<!--Set password-->
|
||||
<ValidationProvider tag="div" mode="passive" class="input-wrapper password" name="Title" rules="required" v-slot="{ errors }">
|
||||
<label class="input-label">{{ $t('popup_create_folder.label') }}:</label>
|
||||
<input v-model="name" :class="{'is-error': errors[0]}" type="text" :placeholder="$t('popup_create_folder.placeholder')">
|
||||
<input v-model="name" :class="{'is-error': errors[0]}" type="text" ref="input" :placeholder="$t('popup_create_folder.placeholder')">
|
||||
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
|
||||
</ValidationProvider>
|
||||
</ValidationObserver>
|
||||
@@ -82,6 +82,15 @@
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted () {
|
||||
events.$on('popup:open', ({name}) => {
|
||||
|
||||
if (name === 'create-folder')
|
||||
this.$nextTick(() => {
|
||||
this.$refs.input.focus()
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<!--Set password-->
|
||||
<ValidationProvider tag="div" mode="passive" class="input-wrapper password" name="Name" rules="required" v-slot="{ errors }">
|
||||
<label class="input-label">{{ $t('popup_rename.label') }}:</label>
|
||||
<input v-model="pickedItem.name" :class="{'is-error': errors[0]}" type="text" :placeholder="$t('popup_rename.placeholder')">
|
||||
<input v-model="pickedItem.name" :class="{'is-error': errors[0]}" ref="input" type="text" :placeholder="$t('popup_rename.placeholder')">
|
||||
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
|
||||
</ValidationProvider>
|
||||
</ValidationObserver>
|
||||
@@ -103,6 +103,10 @@
|
||||
|
||||
if (args.name !== 'rename-item') return
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.$refs.input.focus()
|
||||
})
|
||||
|
||||
// Store picked item
|
||||
this.pickedItem = args.item
|
||||
})
|
||||
|
||||
@@ -105,6 +105,25 @@
|
||||
</div>
|
||||
</div>
|
||||
</PageTabGroup>
|
||||
|
||||
<PageTabGroup v-if="userInfo">
|
||||
<div class="form block-form">
|
||||
<FormLabel>User Timezone</FormLabel>
|
||||
<div class="block-wrapper">
|
||||
<label>Timezone</label>
|
||||
<div class="input-wrapper">
|
||||
<input @change="$updateText('/user/relationships/settings', 'timezone', userTimezone)"
|
||||
v-model="userTimezone"
|
||||
placeholder="Type your timezone"
|
||||
type="number"
|
||||
/>
|
||||
<small class="input-help">
|
||||
Set your timezone by type the hours of your GMT : 1, -5, 1.5
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</PageTabGroup>
|
||||
</PageTab>
|
||||
</template>
|
||||
|
||||
@@ -147,6 +166,7 @@
|
||||
return {
|
||||
userInfo: undefined,
|
||||
billingInfo: undefined,
|
||||
userTimezone: undefined,
|
||||
isLoading: false,
|
||||
}
|
||||
},
|
||||
@@ -158,6 +178,8 @@
|
||||
},
|
||||
created() {
|
||||
|
||||
this.userTimezone = this.user.relationships.timezone.data.attributes.timezone
|
||||
|
||||
this.userInfo = {
|
||||
name: this.user.data.attributes.name,
|
||||
email: this.user.data.attributes.email
|
||||
|
||||
Reference in New Issue
Block a user