mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
add experimental option feature in TooWebAdmin
This commit is contained in:
parent
7517106633
commit
2267b58ed2
3 changed files with 60 additions and 15 deletions
|
@ -125,6 +125,7 @@
|
||||||
"error_server_unexpected": "Unexpected server error (%s)",
|
"error_server_unexpected": "Unexpected server error (%s)",
|
||||||
"error_connection_interrupted": "The server closed the connection instead of answering it. Has nginx or the yunohost-api been restarted or stoppted for some reason? (Error code/message: %s)",
|
"error_connection_interrupted": "The server closed the connection instead of answering it. Has nginx or the yunohost-api been restarted or stoppted for some reason? (Error code/message: %s)",
|
||||||
"everything_good": "Everything good!",
|
"everything_good": "Everything good!",
|
||||||
|
"experimental": "Experimental",
|
||||||
"experimental_warning": "Warning: this feature is experimental and not consider stable, you shouldn't be using it except if you know what you are doing.",
|
"experimental_warning": "Warning: this feature is experimental and not consider stable, you shouldn't be using it except if you know what you are doing.",
|
||||||
"firewall": "Firewall",
|
"firewall": "Firewall",
|
||||||
"footer": {
|
"footer": {
|
||||||
|
@ -349,7 +350,9 @@
|
||||||
"locale": "Locale",
|
"locale": "Locale",
|
||||||
"fallback_locale": "Fallback locale",
|
"fallback_locale": "Fallback locale",
|
||||||
"cache": "Cache",
|
"cache": "Cache",
|
||||||
"cache_description": "Consider disabling the cache if you plan on working with the CLI while also navigating in this web-admin."
|
"cache_description": "Consider disabling the cache if you plan on working with the CLI while also navigating in this web-admin.",
|
||||||
|
"experimental": "Experimental mode",
|
||||||
|
"experimental_description": "Gives you access to experimental features. These are considered unstable and may break your system.<br> Enabled this only if you know what you are doing."
|
||||||
},
|
},
|
||||||
"tools_webadmin_settings": "Web-admin settings",
|
"tools_webadmin_settings": "Web-admin settings",
|
||||||
"udp": "UDP",
|
"udp": "UDP",
|
||||||
|
|
|
@ -12,6 +12,7 @@ export default {
|
||||||
locale: localStorage.getItem('locale'),
|
locale: localStorage.getItem('locale'),
|
||||||
fallbackLocale: localStorage.getItem('fallbackLocale'),
|
fallbackLocale: localStorage.getItem('fallbackLocale'),
|
||||||
cache: localStorage.getItem('cache') !== 'false',
|
cache: localStorage.getItem('cache') !== 'false',
|
||||||
|
experimental: localStorage.getItem('experimental') === 'true',
|
||||||
supportedLocales: supportedLocales
|
supportedLocales: supportedLocales
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -26,9 +27,14 @@ export default {
|
||||||
state.fallbackLocale = locale
|
state.fallbackLocale = locale
|
||||||
},
|
},
|
||||||
|
|
||||||
'SET_CACHE' (state, enable) {
|
'SET_CACHE' (state, boolean) {
|
||||||
localStorage.setItem('cache', enable)
|
localStorage.setItem('cache', boolean)
|
||||||
state.cache = enable
|
state.cache = boolean
|
||||||
|
},
|
||||||
|
|
||||||
|
'SET_EXPERIMENTAL' (state, boolean) {
|
||||||
|
localStorage.setItem('experimental', boolean)
|
||||||
|
state.experimental = boolean
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -55,6 +61,7 @@ export default {
|
||||||
locale: state => (state.locale),
|
locale: state => (state.locale),
|
||||||
fallbackLocale: state => (state.fallbackLocale),
|
fallbackLocale: state => (state.fallbackLocale),
|
||||||
cache: state => (state.cache),
|
cache: state => (state.cache),
|
||||||
|
experimental: state => state.experimental,
|
||||||
|
|
||||||
availableLocales: state => {
|
availableLocales: state => {
|
||||||
return Object.entries(state.supportedLocales).map(([locale, { name }]) => {
|
return Object.entries(state.supportedLocales).map(([locale, { name }]) => {
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
<template>
|
<template>
|
||||||
<basic-form :header="$t('tools_webadmin_settings')" @submit.prevent="onSubmit" no-footer>
|
<basic-form :header="$t('tools_webadmin_settings')" @submit.prevent="onSubmit" no-footer>
|
||||||
<!-- LOCALE -->
|
<!-- LOCALE -->
|
||||||
<b-form-group label-cols="auto" :label="$t('tools_webadmin.locale')" label-for="locale">
|
<b-form-group
|
||||||
|
label-cols="0" label-cols-lg="2" label-class="font-weight-bold"
|
||||||
|
:label="$t('tools_webadmin.locale')" label-for="locale"
|
||||||
|
>
|
||||||
<b-select
|
<b-select
|
||||||
id="locale"
|
id="locale"
|
||||||
:options="availableLocales"
|
:options="availableLocales"
|
||||||
|
@ -11,7 +14,10 @@
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<!-- FALLBACK LOCALE -->
|
<!-- FALLBACK LOCALE -->
|
||||||
<b-form-group label-cols="auto" :label="$t('tools_webadmin.fallback_locale')" label-for="fallback-locale">
|
<b-form-group
|
||||||
|
label-cols="0" label-cols-lg="2" label-class="font-weight-bold"
|
||||||
|
:label="$t('tools_webadmin.fallback_locale')" label-for="fallback-locale"
|
||||||
|
>
|
||||||
<b-select
|
<b-select
|
||||||
id="fallback-locale"
|
id="fallback-locale"
|
||||||
:options="availableLocales"
|
:options="availableLocales"
|
||||||
|
@ -21,17 +27,38 @@
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<!-- CACHE -->
|
<!-- CACHE -->
|
||||||
<b-form-group label-cols="auto" :label="$t('tools_webadmin.cache')" label-for="cache">
|
<b-form-group
|
||||||
<template v-slot:description>
|
label-cols="0" label-cols-lg="2"
|
||||||
<b-alert variant="info" show v-t="'tools_webadmin.cache_description'" />
|
:label="$t('tools_webadmin.cache')" label-for="cache" label-class="font-weight-bold"
|
||||||
</template>
|
|
||||||
|
|
||||||
<b-checkbox
|
|
||||||
v-model="currentCache"
|
|
||||||
switch
|
|
||||||
>
|
>
|
||||||
|
<b-checkbox v-model="currentCache" id="cache" switch>
|
||||||
{{ $t(currentCache ? 'enabled' : 'disabled') }}
|
{{ $t(currentCache ? 'enabled' : 'disabled') }}
|
||||||
</b-checkbox>
|
</b-checkbox>
|
||||||
|
|
||||||
|
<template v-slot:description>
|
||||||
|
{{ $t('tools_webadmin.cache_description') }}
|
||||||
|
</template>
|
||||||
|
</b-form-group>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<!-- EXPERIMENTAL MODE -->
|
||||||
|
<b-form-group
|
||||||
|
label-cols="0" label-cols-lg="2" label-class="font-weight-bold"
|
||||||
|
label-for="experimental"
|
||||||
|
>
|
||||||
|
<template v-slot:label>
|
||||||
|
{{ $t('tools_webadmin.experimental') }}
|
||||||
|
<icon iname="flask" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<b-checkbox v-model="currentExperimental" id="experimental" switch>
|
||||||
|
{{ $t(currentExperimental ? 'enabled' : 'disabled') }}
|
||||||
|
</b-checkbox>
|
||||||
|
|
||||||
|
<template v-slot:description>
|
||||||
|
<span v-html="$t('tools_webadmin.experimental_description')" />
|
||||||
|
</template>
|
||||||
</b-form-group>
|
</b-form-group>
|
||||||
</basic-form>
|
</basic-form>
|
||||||
</template>
|
</template>
|
||||||
|
@ -48,6 +75,7 @@ export default {
|
||||||
'locale',
|
'locale',
|
||||||
'fallbackLocale',
|
'fallbackLocale',
|
||||||
'cache',
|
'cache',
|
||||||
|
'experimental',
|
||||||
'availableLocales'
|
'availableLocales'
|
||||||
]),
|
]),
|
||||||
|
|
||||||
|
@ -70,6 +98,13 @@ export default {
|
||||||
set: function (newValue) {
|
set: function (newValue) {
|
||||||
this.$store.commit('SET_CACHE', newValue)
|
this.$store.commit('SET_CACHE', newValue)
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
currentExperimental: {
|
||||||
|
get: function () { return this.experimental },
|
||||||
|
set: function (newValue) {
|
||||||
|
this.$store.commit('SET_EXPERIMENTAL', newValue)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue