diff --git a/assets/icons/magnify.svg b/assets/icons/magnify.svg new file mode 100644 index 0000000..3cb7089 --- /dev/null +++ b/assets/icons/magnify.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/composables/states.ts b/composables/states.ts index 3207e7d..ff2f32b 100644 --- a/composables/states.ts +++ b/composables/states.ts @@ -84,6 +84,8 @@ export interface Settings { portal_logo?: string portal_theme: string portal_title?: string + search_engine?: string + search_engine_name?: string show_other_domains_apps: 0 | 1 portal_user_intro: string portal_public_intro: string diff --git a/locales/en.json b/locales/en.json index e304870..69306e2 100644 --- a/locales/en.json +++ b/locales/en.json @@ -45,6 +45,8 @@ "primary_mail_adress": "Primary mail adress", "remove": "Remove", "save": "Save", + "search": "Search", + "search_engine_placeholder": "Search on {engine}", "skip_link": { "main_content": "Skip to main content", "footer": "Skip to footer" diff --git a/pages/index.vue b/pages/index.vue index 24820b4..280103d 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -3,7 +3,7 @@ definePageMeta({ public: true, }) -const { t } = useI18n() +const { t, locale } = useI18n() const isLoggedIn = await useIsLoggedIn() const settings = await useSettings() const appsData = await useApps() @@ -28,12 +28,41 @@ const apps = Object.entries(appsData.value).map(([id, app]) => { description: app.description[locale.value] || app.description.en } }) + +const search = ref('') + +async function onSearchSubmit() { + await navigateTo( + settings.value.search_engine + search.value, + { + open: { + target: '_blank', + } + } + ) +} + + + + + + {{ t('search') }} + + + +