feat: add search toggle option (fix #509)
This commit is contained in:
@@ -97,6 +97,7 @@ class AdminSettingController extends Controller
|
|||||||
'use-avatar',
|
'use-avatar',
|
||||||
'add-logo-link',
|
'add-logo-link',
|
||||||
'show-settings',
|
'show-settings',
|
||||||
|
'show-search-form',
|
||||||
'loader-enabled',
|
'loader-enabled',
|
||||||
'always-displayed',
|
'always-displayed',
|
||||||
'enabled',
|
'enabled',
|
||||||
@@ -137,6 +138,7 @@ class AdminSettingController extends Controller
|
|||||||
'use-avatar' => '0',
|
'use-avatar' => '0',
|
||||||
'add-logo-link' => '1',
|
'add-logo-link' => '1',
|
||||||
'show-settings' => '0',
|
'show-settings' => '0',
|
||||||
|
'show-search-form' => '1',
|
||||||
'loader-enabled' => '1',
|
'loader-enabled' => '1',
|
||||||
'always-displayed' => '0',
|
'always-displayed' => '0',
|
||||||
'enabled' => '1',
|
'enabled' => '1',
|
||||||
@@ -206,7 +208,17 @@ class AdminSettingController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach ($defaults as $key => $default) {
|
foreach ($defaults as $key => $default) {
|
||||||
if (!array_key_exists($key, $config)) {
|
if (array_key_exists($key, $config)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (in_array($key, $booleans)) {
|
||||||
|
$config[$key] = $default === '1';
|
||||||
|
} elseif (in_array($key, $arrays)) {
|
||||||
|
$config[$key] = json_decode($default);
|
||||||
|
} elseif (in_array($key, $integers)) {
|
||||||
|
$config[$key] = (int) $default;
|
||||||
|
} else {
|
||||||
$config[$key] = $default;
|
$config[$key] = $default;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -135,6 +135,7 @@ class JsController extends Controller
|
|||||||
'force-light-icon' => $this->config->getAppValueBool('force-light-icon', '0'),
|
'force-light-icon' => $this->config->getAppValueBool('force-light-icon', '0'),
|
||||||
'display-logo' => $this->config->getAppValueBool('display-logo', '1'),
|
'display-logo' => $this->config->getAppValueBool('display-logo', '1'),
|
||||||
'use-avatar' => $this->config->getAppValueBool('use-avatar', '0'),
|
'use-avatar' => $this->config->getAppValueBool('use-avatar', '0'),
|
||||||
|
'show-search-form' => $this->config->getAppValueBool('show-search-form', '1'),
|
||||||
'hide-when-no-apps' => $this->config->getAppValueBool('hide-when-no-apps', '0'),
|
'hide-when-no-apps' => $this->config->getAppValueBool('hide-when-no-apps', '0'),
|
||||||
'loader-enabled' => $this->config->getAppValueBool('loader-enabled', '1'),
|
'loader-enabled' => $this->config->getAppValueBool('loader-enabled', '1'),
|
||||||
'always-displayed' => $this->config->getAppValueBool('always-displayed', '0'),
|
'always-displayed' => $this->config->getAppValueBool('always-displayed', '0'),
|
||||||
|
|||||||
@@ -109,3 +109,4 @@
|
|||||||
'Customize': 'Přizpůsobit'
|
'Customize': 'Přizpůsobit'
|
||||||
'Custom': 'Custom'
|
'Custom': 'Custom'
|
||||||
'Close': 'Zavřít'
|
'Close': 'Zavřít'
|
||||||
|
'Show the search form': 'Show the search form'
|
||||||
|
|||||||
@@ -109,3 +109,4 @@
|
|||||||
'Customize': 'Customize'
|
'Customize': 'Customize'
|
||||||
'Custom': 'Custom'
|
'Custom': 'Custom'
|
||||||
'Close': 'Close'
|
'Close': 'Close'
|
||||||
|
'Show the search form': 'Show the search form'
|
||||||
|
|||||||
@@ -109,3 +109,4 @@
|
|||||||
'Customize': 'Personalizar'
|
'Customize': 'Personalizar'
|
||||||
'Custom': 'Custom'
|
'Custom': 'Custom'
|
||||||
'Close': 'Cerrar'
|
'Close': 'Cerrar'
|
||||||
|
'Show the search form': 'Show the search form'
|
||||||
|
|||||||
@@ -128,3 +128,4 @@
|
|||||||
'Customize': 'Personnaliser'
|
'Customize': 'Personnaliser'
|
||||||
'Custom': 'Personnalisé'
|
'Custom': 'Personnalisé'
|
||||||
'Close': 'Fermer'
|
'Close': 'Fermer'
|
||||||
|
'Show the search form': 'Afficher le formulaire de recherche'
|
||||||
|
|||||||
@@ -109,3 +109,4 @@
|
|||||||
'Customize': 'Personalizar'
|
'Customize': 'Personalizar'
|
||||||
'Custom': 'Personalizado'
|
'Custom': 'Personalizado'
|
||||||
'Close': 'Pechar'
|
'Close': 'Pechar'
|
||||||
|
'Show the search form': 'Show the search form'
|
||||||
|
|||||||
@@ -109,3 +109,4 @@
|
|||||||
'Customize': 'Customize'
|
'Customize': 'Customize'
|
||||||
'Custom': 'Custom'
|
'Custom': 'Custom'
|
||||||
'Close': 'Close'
|
'Close': 'Close'
|
||||||
|
'Show the search form': 'Show the search form'
|
||||||
|
|||||||
@@ -107,3 +107,4 @@
|
|||||||
'Customize': 'Customize'
|
'Customize': 'Customize'
|
||||||
'Custom': 'Custom'
|
'Custom': 'Custom'
|
||||||
'Close': 'Close'
|
'Close': 'Close'
|
||||||
|
'Show the search form': 'Show the search form'
|
||||||
|
|||||||
@@ -109,3 +109,4 @@
|
|||||||
'Customize': 'Приспособить'
|
'Customize': 'Приспособить'
|
||||||
'Custom': 'Custom'
|
'Custom': 'Custom'
|
||||||
'Close': 'Закрыть'
|
'Close': 'Закрыть'
|
||||||
|
'Show the search form': 'Show the search form'
|
||||||
|
|||||||
@@ -107,3 +107,4 @@
|
|||||||
'Customize': 'Customize'
|
'Customize': 'Customize'
|
||||||
'Custom': 'Custom'
|
'Custom': 'Custom'
|
||||||
'Close': 'Close'
|
'Close': 'Close'
|
||||||
|
'Show the search form': 'Show the search form'
|
||||||
|
|||||||
@@ -109,3 +109,4 @@
|
|||||||
'Customize': 'Anpassa'
|
'Customize': 'Anpassa'
|
||||||
'Custom': 'Anpassad'
|
'Custom': 'Anpassad'
|
||||||
'Close': 'Stäng'
|
'Close': 'Stäng'
|
||||||
|
'Show the search form': 'Show the search form'
|
||||||
|
|||||||
@@ -109,3 +109,4 @@
|
|||||||
'Customize': 'Customize'
|
'Customize': 'Customize'
|
||||||
'Custom': 'Custom'
|
'Custom': 'Custom'
|
||||||
'Close': 'Close'
|
'Close': 'Close'
|
||||||
|
'Show the search form': 'Show the search form'
|
||||||
|
|||||||
@@ -109,3 +109,4 @@
|
|||||||
'Customize': '自定义'
|
'Customize': '自定义'
|
||||||
'Custom': '自定义'
|
'Custom': '自定义'
|
||||||
'Close': '关闭'
|
'Close': '关闭'
|
||||||
|
'Show the search form': 'Show the search form'
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
:label="settings.name"
|
:label="settings.name"
|
||||||
:avatar="settings.avatar"
|
:avatar="settings.avatar"
|
||||||
/>
|
/>
|
||||||
<AppSearch v-model="search" />
|
<AppSearch v-if="showSearchForm" v-model="search" />
|
||||||
<OpenerButton
|
<OpenerButton
|
||||||
v-if="!openerHover"
|
v-if="!openerHover"
|
||||||
@click="$emit('close')"
|
@click="$emit('close')"
|
||||||
@@ -102,6 +102,7 @@ const activeApp = ref(null)
|
|||||||
const targetBlankApps = ref([])
|
const targetBlankApps = ref([])
|
||||||
const settings = ref(null)
|
const settings = ref(null)
|
||||||
const search = ref('')
|
const search = ref('')
|
||||||
|
const showSearchForm = ref(true)
|
||||||
const openerHover = ref(false)
|
const openerHover = ref(false)
|
||||||
const menu = useTemplateRef('menu')
|
const menu = useTemplateRef('menu')
|
||||||
const isTouchDevice = window.matchMedia('(pointer: coarse)').matches
|
const isTouchDevice = window.matchMedia('(pointer: coarse)').matches
|
||||||
@@ -120,6 +121,7 @@ onMounted(async () => {
|
|||||||
|
|
||||||
targetBlankApps.value = config['target-blank-apps']
|
targetBlankApps.value = config['target-blank-apps']
|
||||||
settings.value = config['settings']
|
settings.value = config['settings']
|
||||||
|
showSearchForm.value = config['show-search-form']
|
||||||
openerHover.value = config['opener-hover'] && !isTouchDevice
|
openerHover.value = config['opener-hover'] && !isTouchDevice
|
||||||
|
|
||||||
items.value = await navStore.getCategories()
|
items.value = await navStore.getCategories()
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
:avatar="settings.avatar"
|
:avatar="settings.avatar"
|
||||||
/>
|
/>
|
||||||
<AppSearch
|
<AppSearch
|
||||||
v-if="open"
|
v-if="showSearchForm"
|
||||||
v-model="search"
|
v-model="search"
|
||||||
/>
|
/>
|
||||||
<OpenerButton
|
<OpenerButton
|
||||||
@@ -103,6 +103,7 @@ const openerHover = ref(false)
|
|||||||
const alwaysDisplayed = ref(false)
|
const alwaysDisplayed = ref(false)
|
||||||
const displayLogo = ref(false)
|
const displayLogo = ref(false)
|
||||||
const useAvatarAsLogo = ref(false)
|
const useAvatarAsLogo = ref(false)
|
||||||
|
const showSearchForm = ref(true)
|
||||||
const search = ref('')
|
const search = ref('')
|
||||||
const apps = ref([])
|
const apps = ref([])
|
||||||
const menu = useTemplateRef('menu')
|
const menu = useTemplateRef('menu')
|
||||||
@@ -151,6 +152,7 @@ onMounted(async () => {
|
|||||||
alwaysDisplayed.value = config['always-displayed']
|
alwaysDisplayed.value = config['always-displayed']
|
||||||
targetBlankApps.value = config['target-blank-apps']
|
targetBlankApps.value = config['target-blank-apps']
|
||||||
forceLightIcon.value = config['force-light-icon']
|
forceLightIcon.value = config['force-light-icon']
|
||||||
|
showSearchForm.value = config['show-search-form']
|
||||||
|
|
||||||
avatar.value = config['avatar']
|
avatar.value = config['avatar']
|
||||||
logo.value = config['logo']
|
logo.value = config['logo']
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
:label="settings.name"
|
:label="settings.name"
|
||||||
:avatar="settings.avatar"
|
:avatar="settings.avatar"
|
||||||
/>
|
/>
|
||||||
<AppSearch v-model="search" />
|
<AppSearch v-if="showSearchForm" v-model="search" />
|
||||||
<OpenerButton
|
<OpenerButton
|
||||||
v-if="!openerHover"
|
v-if="!openerHover"
|
||||||
@click="$emit('close')"
|
@click="$emit('close')"
|
||||||
@@ -107,6 +107,7 @@ const activeApp = ref(null)
|
|||||||
const targetBlankApps = ref([])
|
const targetBlankApps = ref([])
|
||||||
const settings = ref(null)
|
const settings = ref(null)
|
||||||
const search = ref('')
|
const search = ref('')
|
||||||
|
const showSearchForm = ref(true)
|
||||||
const openerHover = ref(false)
|
const openerHover = ref(false)
|
||||||
const menu = useTemplateRef('menu')
|
const menu = useTemplateRef('menu')
|
||||||
const isTouchDevice = window.matchMedia('(pointer: coarse)').matches
|
const isTouchDevice = window.matchMedia('(pointer: coarse)').matches
|
||||||
@@ -125,6 +126,7 @@ onMounted(async () => {
|
|||||||
|
|
||||||
targetBlankApps.value = config['target-blank-apps']
|
targetBlankApps.value = config['target-blank-apps']
|
||||||
settings.value = config['settings']
|
settings.value = config['settings']
|
||||||
|
showSearchForm.value = config['show-search-form']
|
||||||
openerHover.value = config['opener-hover'] && !isTouchDevice
|
openerHover.value = config['opener-hover'] && !isTouchDevice
|
||||||
|
|
||||||
items.value = await navStore.getCategories()
|
items.value = await navStore.getCategories()
|
||||||
|
|||||||
@@ -80,6 +80,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
<FormYesNo v-model="config['show-settings']" />
|
<FormYesNo v-model="config['show-settings']" />
|
||||||
</SettingValue>
|
</SettingValue>
|
||||||
</SettingItem>
|
</SettingItem>
|
||||||
|
<SettingItem :disabled="config['always-displayed']">
|
||||||
|
<SettingLabel
|
||||||
|
label="Show the search form"
|
||||||
|
:middle="true"
|
||||||
|
/>
|
||||||
|
<SettingValue>
|
||||||
|
<FormYesNo v-model="config['show-search-form']" />
|
||||||
|
</SettingValue>
|
||||||
|
</SettingItem>
|
||||||
<SettingItem>
|
<SettingItem>
|
||||||
<SettingLabel
|
<SettingLabel
|
||||||
label="Icons"
|
label="Icons"
|
||||||
|
|||||||
Reference in New Issue
Block a user