mirror of
https://framagit.org/les/gancio.git
synced 2025-01-31 16:42:22 +01:00
settings
This commit is contained in:
parent
e9d5386766
commit
ee0669421a
6 changed files with 158 additions and 12 deletions
3
NOTES.md
3
NOTES.md
|
@ -10,4 +10,5 @@
|
|||
|
||||
- [ ] event card
|
||||
- [ ] $auth
|
||||
- [ ] dialog / confirm / snackbar
|
||||
- [ ] dialog / confirm / snackbar
|
||||
- [ ] settings
|
||||
|
|
|
@ -7,8 +7,6 @@ function setSetting(key: string, value: string) {
|
|||
return saveSetting(key, value)
|
||||
}
|
||||
|
||||
const localSettings = { ...Settings.value }
|
||||
|
||||
</script>
|
||||
<template>
|
||||
<v-container>
|
||||
|
@ -17,13 +15,69 @@ const localSettings = { ...Settings.value }
|
|||
|
||||
<v-text-field :modelValue="getSetting('title')"
|
||||
:label="$t('common.title')"
|
||||
@update:model-value="v => setSetting('title', v)"
|
||||
@update:model-value="(v: string) => setSetting('title', v)"
|
||||
:hint="$t('admin.title_description')" persistent-hint />
|
||||
|
||||
<v-text-field class='mt-5' :modelValue="getSetting('description')"
|
||||
<v-text-field class='mt-5' :modelValue="getSetting('description')" @update:model-value="(v:string) => setSetting('description', v)"
|
||||
:label="$t('common.description')"
|
||||
@update:model-value="v => setSetting('description', v)"
|
||||
:hint="$t('admin.description_description')" persistent-hint />
|
||||
:hint="$t('admin.description_description')" persistent-hint />
|
||||
|
||||
<v-autocomplete class="mt-5"
|
||||
:modelValue="getSetting('instance_timezone')" @update:model-value="(v:string) => setSetting('instance_timezone', v)"
|
||||
:label="$t('admin.select_instance_timezone')" :hint="$t('admin.instance_timezone_description')"
|
||||
:items="filteredTimezones" persistent-hint placeholder="Timezone, type to search" />
|
||||
|
||||
<v-select class="mt-5"
|
||||
:modelValue="getSetting('instance_locale')" @update:model-value="(v:string) => setSetting('instance_locale', v)"
|
||||
:label="$t('admin.instance_locale')" :hint="$t('admin.instance_locale_description')" persistent-hint :items="locales" />
|
||||
|
||||
<v-switch class="mt-4"
|
||||
:modelValue="getSetting('allow_registration')" @update:model-value="(v:boolean) => setSetting('allow_registration', v)"
|
||||
:label="$t('admin.allow_registration_description')" />
|
||||
|
||||
<v-switch class="mt-1"
|
||||
:modelValue="getSetting('allow_anon_event')" @update:model-value="(v:boolean) => setSetting('allow_anon_event', v)"
|
||||
:label="$t('admin.allow_anon_event')" />
|
||||
|
||||
<v-switch class="mt-1"
|
||||
:modelValue="getSetting('allow_multidate_event')" @update:model-value="(v:boolean) => setSetting('allow_multidate_event', v)"
|
||||
:label="$t('admin.allow_multidate_event')" />
|
||||
|
||||
<v-switch class="mt-1"
|
||||
:modelValue="getSetting('allow_recurrent_event')" @update:model-value="(v:boolean) => setSetting('allow_recurrent_event', v)"
|
||||
:label="$t('admin.allow_recurrent_event')" />
|
||||
|
||||
<v-switch class="mt-1" v-if="Settings.allow_recurrent_event"
|
||||
:modelValue="getSetting('recurrent_event_visible')" @update:model-value="(v:boolean) => setSetting('recurrent_event_visible', v)"
|
||||
:label="$t('admin.recurrent_event_visible')" />
|
||||
|
||||
<v-switch class="mt-1"
|
||||
:modelValue="getSetting('allow_event_without_end_time')" @update:model-value="(v:boolean) => setSetting('allow_event_without_end_time', v)"
|
||||
:label="$t('admin.allow_event_without_end_time')" />
|
||||
|
||||
<v-switch class="mt-1"
|
||||
:modelValue="getSetting('allow_online_event')" @update:model-value="(v:boolean) => setSetting('allow_online_event', v)"
|
||||
:label="$t('admin.allow_online_event')" />
|
||||
|
||||
<v-switch class="mt-4"
|
||||
:modelValue="getSetting('allow_geolocation')" @update:model-value="(v:boolean) => setSetting('allow_geolocation', v)"
|
||||
persistent-hint :hint="$t('admin.allow_geolocation_hint')"
|
||||
:label="$t('admin.allow_geolocation')" />
|
||||
|
||||
<v-switch class="mt-4"
|
||||
:modelValue="getSetting('show_download_media')" @update:model-value="(v:boolean) => setSetting('show_download_media', v)"
|
||||
persistent-hint :hint="$t('admin.show_download_media_hint')"
|
||||
:label="$t('admin.show_download_media')" />
|
||||
|
||||
<v-switch class="mt-4"
|
||||
:modelValue="getSetting('enable_moderation')" @update:model-value="(v:boolean) => setSetting('enable_moderation', v)"
|
||||
persistent-hint :hint="$t('admin.enable_moderation_hint')"
|
||||
:label="$t('admin.enable_moderation')" />
|
||||
|
||||
<v-switch class="mt-4" v-if="Settings.enable_moderation" persistent-hint :hint="$t('admin.enable_report_hint')"
|
||||
:modelValue="getSetting('enable_report')" @update:model-value="(v:boolean) => setSetting('enable_report', v)"
|
||||
:label="$t('admin.enable_report')" />
|
||||
|
||||
|
||||
</v-card-text>
|
||||
</v-container>
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
"@sequelize/core": "^7.0.0-alpha.37",
|
||||
"@sequelize/sqlite3": "^7.0.0-alpha.42",
|
||||
"nuxt": "^3.13.2",
|
||||
"vue": "3.5.10",
|
||||
"vue": "3.5.11",
|
||||
"vuetify-nuxt-module": "^0.18.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
@ -376,7 +376,7 @@ export class Setting extends Model<
|
|||
declare key: string
|
||||
|
||||
@Attribute(DataTypes.JSON)
|
||||
declare value: string
|
||||
declare value: string | boolean
|
||||
|
||||
@Attribute(DataTypes.BOOLEAN)
|
||||
@Default(false)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
export type KeyValueType =
|
||||
| { [key: string]: string }
|
||||
| { [key: string]: string | boolean }
|
||||
|
||||
import { z } from 'zod'
|
||||
// import { SettingType } from './sequelize'
|
||||
|
@ -7,7 +7,7 @@ import { z } from 'zod'
|
|||
export const settingSchema = z.object({
|
||||
key: z.string(),
|
||||
is_secret: z.boolean().default(false),
|
||||
value: z.string()
|
||||
value: z.union([z.string(), z.boolean()])
|
||||
})
|
||||
|
||||
|
||||
|
|
93
yarn.lock
93
yarn.lock
|
@ -1903,6 +1903,17 @@
|
|||
estree-walker "^2.0.2"
|
||||
source-map-js "^1.2.0"
|
||||
|
||||
"@vue/compiler-core@3.5.11":
|
||||
version "3.5.11"
|
||||
resolved "https://registry.yarnpkg.com/@vue/compiler-core/-/compiler-core-3.5.11.tgz#3dcd0c1bab10732f44ab1790735afb03a4b69edc"
|
||||
integrity sha512-PwAdxs7/9Hc3ieBO12tXzmTD+Ln4qhT/56S+8DvrrZ4kLDn4Z/AMUr8tXJD0axiJBS0RKIoNaR0yMuQB9v9Udg==
|
||||
dependencies:
|
||||
"@babel/parser" "^7.25.3"
|
||||
"@vue/shared" "3.5.11"
|
||||
entities "^4.5.0"
|
||||
estree-walker "^2.0.2"
|
||||
source-map-js "^1.2.0"
|
||||
|
||||
"@vue/compiler-dom@3.5.10", "@vue/compiler-dom@^3.3.4":
|
||||
version "3.5.10"
|
||||
resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.5.10.tgz#233c660289ce289a48e8fe759b07b95f607cd98e"
|
||||
|
@ -1911,6 +1922,14 @@
|
|||
"@vue/compiler-core" "3.5.10"
|
||||
"@vue/shared" "3.5.10"
|
||||
|
||||
"@vue/compiler-dom@3.5.11":
|
||||
version "3.5.11"
|
||||
resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.5.11.tgz#950f8fc610e26326fed008b8d102cc8ee78a6ce5"
|
||||
integrity sha512-pyGf8zdbDDRkBrEzf8p7BQlMKNNF5Fk/Cf/fQ6PiUz9at4OaUfyXW0dGJTo2Vl1f5U9jSLCNf0EZJEogLXoeew==
|
||||
dependencies:
|
||||
"@vue/compiler-core" "3.5.11"
|
||||
"@vue/shared" "3.5.11"
|
||||
|
||||
"@vue/compiler-sfc@3.5.10", "@vue/compiler-sfc@^3.2.47", "@vue/compiler-sfc@^3.5.3", "@vue/compiler-sfc@^3.5.4":
|
||||
version "3.5.10"
|
||||
resolved "https://registry.yarnpkg.com/@vue/compiler-sfc/-/compiler-sfc-3.5.10.tgz#95e262a5ed836521a5aeee9492cc265ad3f1c787"
|
||||
|
@ -1926,6 +1945,21 @@
|
|||
postcss "^8.4.47"
|
||||
source-map-js "^1.2.0"
|
||||
|
||||
"@vue/compiler-sfc@3.5.11":
|
||||
version "3.5.11"
|
||||
resolved "https://registry.yarnpkg.com/@vue/compiler-sfc/-/compiler-sfc-3.5.11.tgz#68ba7bc6fed4fec6892aed118cb3ee8e4b180d06"
|
||||
integrity sha512-gsbBtT4N9ANXXepprle+X9YLg2htQk1sqH/qGJ/EApl+dgpUBdTv3yP7YlR535uHZY3n6XaR0/bKo0BgwwDniw==
|
||||
dependencies:
|
||||
"@babel/parser" "^7.25.3"
|
||||
"@vue/compiler-core" "3.5.11"
|
||||
"@vue/compiler-dom" "3.5.11"
|
||||
"@vue/compiler-ssr" "3.5.11"
|
||||
"@vue/shared" "3.5.11"
|
||||
estree-walker "^2.0.2"
|
||||
magic-string "^0.30.11"
|
||||
postcss "^8.4.47"
|
||||
source-map-js "^1.2.0"
|
||||
|
||||
"@vue/compiler-ssr@3.5.10":
|
||||
version "3.5.10"
|
||||
resolved "https://registry.yarnpkg.com/@vue/compiler-ssr/-/compiler-ssr-3.5.10.tgz#195f83ae7c52174be37fd7a4a0217132c1c0ed11"
|
||||
|
@ -1934,6 +1968,14 @@
|
|||
"@vue/compiler-dom" "3.5.10"
|
||||
"@vue/shared" "3.5.10"
|
||||
|
||||
"@vue/compiler-ssr@3.5.11":
|
||||
version "3.5.11"
|
||||
resolved "https://registry.yarnpkg.com/@vue/compiler-ssr/-/compiler-ssr-3.5.11.tgz#02d9891c7a649bbf06490ecd8d24dd1575d53e60"
|
||||
integrity sha512-P4+GPjOuC2aFTk1Z4WANvEhyOykcvEd5bIj2KVNGKGfM745LaXGr++5njpdBTzVz5pZifdlR1kpYSJJpIlSePA==
|
||||
dependencies:
|
||||
"@vue/compiler-dom" "3.5.11"
|
||||
"@vue/shared" "3.5.11"
|
||||
|
||||
"@vue/devtools-api@^6.5.0", "@vue/devtools-api@^6.6.4":
|
||||
version "6.6.4"
|
||||
resolved "https://registry.yarnpkg.com/@vue/devtools-api/-/devtools-api-6.6.4.tgz#cbe97fe0162b365edc1dba80e173f90492535343"
|
||||
|
@ -1991,6 +2033,13 @@
|
|||
dependencies:
|
||||
"@vue/shared" "3.5.10"
|
||||
|
||||
"@vue/reactivity@3.5.11":
|
||||
version "3.5.11"
|
||||
resolved "https://registry.yarnpkg.com/@vue/reactivity/-/reactivity-3.5.11.tgz#d27df4fba10c2de1c7234701f18247a775b7a391"
|
||||
integrity sha512-Nqo5VZEn8MJWlCce8XoyVqHZbd5P2NH+yuAaFzuNSR96I+y1cnuUiq7xfSG+kyvLSiWmaHTKP1r3OZY4mMD50w==
|
||||
dependencies:
|
||||
"@vue/shared" "3.5.11"
|
||||
|
||||
"@vue/runtime-core@3.5.10":
|
||||
version "3.5.10"
|
||||
resolved "https://registry.yarnpkg.com/@vue/runtime-core/-/runtime-core-3.5.10.tgz#e902eb2640fa6ab4cc4589af263818a898812668"
|
||||
|
@ -1999,6 +2048,14 @@
|
|||
"@vue/reactivity" "3.5.10"
|
||||
"@vue/shared" "3.5.10"
|
||||
|
||||
"@vue/runtime-core@3.5.11":
|
||||
version "3.5.11"
|
||||
resolved "https://registry.yarnpkg.com/@vue/runtime-core/-/runtime-core-3.5.11.tgz#7beccd013efe5d33981ffd6b6e05d0a5b9058316"
|
||||
integrity sha512-7PsxFGqwfDhfhh0OcDWBG1DaIQIVOLgkwA5q6MtkPiDFjp5gohVnJEahSktwSFLq7R5PtxDKy6WKURVN1UDbzA==
|
||||
dependencies:
|
||||
"@vue/reactivity" "3.5.11"
|
||||
"@vue/shared" "3.5.11"
|
||||
|
||||
"@vue/runtime-dom@3.5.10":
|
||||
version "3.5.10"
|
||||
resolved "https://registry.yarnpkg.com/@vue/runtime-dom/-/runtime-dom-3.5.10.tgz#dca26d7761147373c6929f1370cf2733aa19f3de"
|
||||
|
@ -2009,6 +2066,16 @@
|
|||
"@vue/shared" "3.5.10"
|
||||
csstype "^3.1.3"
|
||||
|
||||
"@vue/runtime-dom@3.5.11":
|
||||
version "3.5.11"
|
||||
resolved "https://registry.yarnpkg.com/@vue/runtime-dom/-/runtime-dom-3.5.11.tgz#14a3181ab7057de41b345b4b3d37b744b3ff8ff5"
|
||||
integrity sha512-GNghjecT6IrGf0UhuYmpgaOlN7kxzQBhxWEn08c/SQDxv1yy4IXI1bn81JgEpQ4IXjRxWtPyI8x0/7TF5rPfYQ==
|
||||
dependencies:
|
||||
"@vue/reactivity" "3.5.11"
|
||||
"@vue/runtime-core" "3.5.11"
|
||||
"@vue/shared" "3.5.11"
|
||||
csstype "^3.1.3"
|
||||
|
||||
"@vue/server-renderer@3.5.10":
|
||||
version "3.5.10"
|
||||
resolved "https://registry.yarnpkg.com/@vue/server-renderer/-/server-renderer-3.5.10.tgz#90462492c30c8cae499b9149d1b90af2ebfe7599"
|
||||
|
@ -2017,11 +2084,24 @@
|
|||
"@vue/compiler-ssr" "3.5.10"
|
||||
"@vue/shared" "3.5.10"
|
||||
|
||||
"@vue/server-renderer@3.5.11":
|
||||
version "3.5.11"
|
||||
resolved "https://registry.yarnpkg.com/@vue/server-renderer/-/server-renderer-3.5.11.tgz#74f558371dfc39f3b0f26f95d089a1a4d1676027"
|
||||
integrity sha512-cVOwYBxR7Wb1B1FoxYvtjJD8X/9E5nlH4VSkJy2uMA1MzYNdzAAB//l8nrmN9py/4aP+3NjWukf9PZ3TeWULaA==
|
||||
dependencies:
|
||||
"@vue/compiler-ssr" "3.5.11"
|
||||
"@vue/shared" "3.5.11"
|
||||
|
||||
"@vue/shared@3.5.10", "@vue/shared@^3.5.5":
|
||||
version "3.5.10"
|
||||
resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.5.10.tgz#066f7dde31e09d700123e92e63eaa126cda21a17"
|
||||
integrity sha512-VkkBhU97Ki+XJ0xvl4C9YJsIZ2uIlQ7HqPpZOS3m9VCvmROPaChZU6DexdMJqvz9tbgG+4EtFVrSuailUq5KGQ==
|
||||
|
||||
"@vue/shared@3.5.11":
|
||||
version "3.5.11"
|
||||
resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.5.11.tgz#464b840afc89be9373addff9eeb9dfc98bf3fe2e"
|
||||
integrity sha512-W8GgysJVnFo81FthhzurdRAWP/byq3q2qIw70e0JWblzVhjgOMiC2GyovXrZTFQJnFVryYaKGP3Tc9vYzYm6PQ==
|
||||
|
||||
"@vuetify/loader-shared@^2.0.3":
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/@vuetify/loader-shared/-/loader-shared-2.0.3.tgz#11451c717e4a352ec311da52a79c857cd256c92f"
|
||||
|
@ -7210,7 +7290,18 @@ vue-router@^4.4.4, vue-router@^4.4.5:
|
|||
dependencies:
|
||||
"@vue/devtools-api" "^6.6.4"
|
||||
|
||||
vue@3.5.10, vue@^3.5.5:
|
||||
vue@3.5.11:
|
||||
version "3.5.11"
|
||||
resolved "https://registry.yarnpkg.com/vue/-/vue-3.5.11.tgz#3e307183797629f701e303a0a008f517ae031483"
|
||||
integrity sha512-/8Wurrd9J3lb72FTQS7gRMNQD4nztTtKPmuDuPuhqXmmpD6+skVjAeahNpVzsuky6Sy9gy7wn8UadqPtt9SQIg==
|
||||
dependencies:
|
||||
"@vue/compiler-dom" "3.5.11"
|
||||
"@vue/compiler-sfc" "3.5.11"
|
||||
"@vue/runtime-dom" "3.5.11"
|
||||
"@vue/server-renderer" "3.5.11"
|
||||
"@vue/shared" "3.5.11"
|
||||
|
||||
vue@^3.5.5:
|
||||
version "3.5.10"
|
||||
resolved "https://registry.yarnpkg.com/vue/-/vue-3.5.10.tgz#14be9d4655e07be8d5e8295d017815ed14337f96"
|
||||
integrity sha512-Vy2kmJwHPlouC/tSnIgXVg03SG+9wSqT1xu1Vehc+ChsXsRd7jLkKgMltVEFOzUdBr3uFwBCG+41LJtfAcBRng==
|
||||
|
|
Loading…
Reference in a new issue