mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-18 00:02:15 +00:00
- flush cache after language upgrade
- Gateway fix - extended language editor with textarea
This commit is contained in:
@@ -27,7 +27,6 @@ class AppFunctionsController extends Controller
|
||||
* @var array
|
||||
*/
|
||||
private $blacklist = [
|
||||
'contact_email',
|
||||
'purchase_code',
|
||||
'license',
|
||||
];
|
||||
|
||||
@@ -17,20 +17,14 @@ use Schema;
|
||||
|
||||
class Maintenance extends Controller
|
||||
{
|
||||
/**
|
||||
* @throws \Illuminate\Auth\Access\AuthorizationException
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
// Check admin permission
|
||||
Gate::authorize('maintenance');
|
||||
}
|
||||
|
||||
/**
|
||||
* Start maintenance mode
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
// Check admin permission
|
||||
Gate::authorize('maintenance');
|
||||
|
||||
$command = Artisan::call('up');
|
||||
|
||||
if ($command === 0) {
|
||||
@@ -43,6 +37,9 @@ class Maintenance extends Controller
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
// Check admin permission
|
||||
Gate::authorize('maintenance');
|
||||
|
||||
$command = Artisan::call('down');
|
||||
|
||||
if ($command === 0) {
|
||||
@@ -58,9 +55,14 @@ class Maintenance extends Controller
|
||||
*/
|
||||
public function upgrade_translations()
|
||||
{
|
||||
// Check admin permission
|
||||
Gate::authorize('maintenance');
|
||||
|
||||
resolve(LanguageService::class)
|
||||
->upgrade_language_translations();
|
||||
|
||||
|
||||
|
||||
return response('Done.', 201);
|
||||
}
|
||||
|
||||
@@ -69,6 +71,9 @@ class Maintenance extends Controller
|
||||
*/
|
||||
public function upgrade_database()
|
||||
{
|
||||
// Check admin permission
|
||||
Gate::authorize('maintenance');
|
||||
|
||||
$command = Artisan::call('migrate', [
|
||||
'--force' => true
|
||||
]);
|
||||
|
||||
@@ -88,6 +88,9 @@ class LanguageService
|
||||
// Store translations into database
|
||||
DB::table('language_translations')
|
||||
->insert($translations);
|
||||
|
||||
// Flush cache
|
||||
cache()->forget("language-translations-$locale");
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -97,12 +97,27 @@
|
||||
<div class="block-wrapper" v-for="(translation, key) in translationList" :key="key">
|
||||
<label> {{ referenceTranslations[key] }}:</label>
|
||||
<ValidationProvider tag="div" class="input-wrapper" name="Language string" rules="required" v-slot="{ errors }">
|
||||
<input type="text"
|
||||
:class="{'is-error': errors[0]}"
|
||||
class="focus-border-theme"
|
||||
@input="$updateText(`/admin/languages/${selectedLanguage.data.id}/strings`, key, selectedLanguage.data.attributes.translations[key])"
|
||||
v-model="selectedLanguage.data.attributes.translations[key]"
|
||||
|
||||
<!--Input-->
|
||||
<input
|
||||
v-if="selectedLanguage.data.attributes.translations[key].length < 80"
|
||||
type="text"
|
||||
:class="{'is-error': errors[0]}"
|
||||
class="focus-border-theme"
|
||||
@input="$updateText(`/admin/languages/${selectedLanguage.data.id}/strings`, key, selectedLanguage.data.attributes.translations[key])"
|
||||
v-model="selectedLanguage.data.attributes.translations[key]"
|
||||
/>
|
||||
|
||||
<!--Textarea-->
|
||||
<textarea
|
||||
v-if="selectedLanguage.data.attributes.translations[key].length > 80"
|
||||
v-model="selectedLanguage.data.attributes.translations[key]"
|
||||
@input="$updateText(`/admin/languages/${selectedLanguage.data.id}/strings`, key, selectedLanguage.data.attributes.translations[key])"
|
||||
rows="3"
|
||||
class="focus-border-theme"
|
||||
:class="{'is-error': errors[0]}"
|
||||
></textarea>
|
||||
|
||||
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
|
||||
</ValidationProvider>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user