Skip to content

Commit 0af80c2

Browse files
committed
feat(Appearance Settings): Empty the welcome message and still display the default welcome message
1 parent 8747fb7 commit 0af80c2

File tree

5 files changed

+21
-4
lines changed

5 files changed

+21
-4
lines changed

frontend/src/i18n/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@
634634
"larger_than_5mb": "Background image on the left: Recommended size: 576 x 900 for vector images, 1152 x 1800 for bitmap images, supports JPG, PNG, and SVG, and no larger than 5MB",
635635
"website_name": "Website Name",
636636
"on_webpage_tabs": "Platform name displayed on webpage tabs",
637-
"welcome_message": "Welcome Message",
637+
"welcome_message": "Display a welcome message",
638638
"the_product_logo": "Welcome Message below the product logo",
639639
"screen_customization_supported": "Defaults to the SQLBot login screen; customization supported",
640640
"screen_customization_settings": "The default is the SQLBot platform interface, which supports custom settings",

frontend/src/i18n/zh-CN.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@
634634
"larger_than_5mb": "左侧背景图,矢量图建议尺寸 576*900,位图建议尺寸 1152*1800;支持 JPG、PNG、SVG,大小不超过 5M",
635635
"website_name": "网站名称",
636636
"on_webpage_tabs": "显示在网页 Tab 的平台名称",
637-
"welcome_message": "欢迎语",
637+
"welcome_message": "显示欢迎语",
638638
"the_product_logo": "产品 Logo 下的 欢迎语",
639639
"screen_customization_supported": "默认为 SQLBot 登录界面,支持自定义设置",
640640
"screen_customization_settings": "默认为 SQLBot 平台界面,支持自定义设置",

frontend/src/stores/appearance.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ interface AppearanceState {
2727
web?: string
2828
name?: string
2929
foot?: string
30+
showSlogan?: string
3031
footContent?: string
3132
loaded: boolean
3233
showDemoTips?: boolean
@@ -50,6 +51,7 @@ export const useAppearanceStore = defineStore('appearanceStore', {
5051
mobileLoginBg: '',
5152
help: '',
5253
showDoc: '0',
54+
showSlogan: '0',
5355
showAi: '0',
5456
showCopilot: '0',
5557
showAbout: '0',
@@ -145,6 +147,9 @@ export const useAppearanceStore = defineStore('appearanceStore', {
145147
getShowCopilot(): boolean {
146148
return isBtnShow(this.showCopilot!)
147149
},
150+
getShowSlogan(): boolean {
151+
return isBtnShow(this.showSlogan!)
152+
},
148153
getShowDoc(): boolean {
149154
return isBtnShow(this.showDoc!)
150155
},
@@ -283,6 +288,7 @@ export const useAppearanceStore = defineStore('appearanceStore', {
283288
this.bg = data.bg
284289
this.login = data.login
285290
this.slogan = data.slogan
291+
this.showSlogan = data.showSlogan
286292
this.web = data.web
287293
this.name = data.name
288294
if (this.name) {

frontend/src/views/login/index.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
<div class="login-content">
77
<div class="login-right">
88
<img width="auto" height="52" :src="loginBg" alt="" />
9-
<div class="welcome">
9+
<div v-if="appearanceStore.getShowSlogan" class="welcome">
1010
{{ appearanceStore.slogan || $t('common.intelligent_questioning_platform') }}
1111
</div>
12+
<div v-else class="welcome" style="height: 0"></div>
1213
<div class="login-form">
1314
<h2 class="title">{{ $t('common.login') }}</h2>
1415
<el-form

frontend/src/views/system/appearance/index.vue

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,15 @@
117117
/>
118118
<div class="form-tips">{{ t('system.on_webpage_tabs') }}</div>
119119
</el-form-item>
120-
<el-form-item :label="$t('system.welcome_message')" prop="slogan">
120+
<el-form-item>
121+
<template #label>
122+
<el-checkbox
123+
v-model="loginForm.showSlogan"
124+
true-value="0"
125+
false-value="1"
126+
:label="$t('system.welcome_message')"
127+
/>
128+
</template>
121129
<el-input v-model="loginForm.slogan" maxlength="50" />
122130
</el-form-item>
123131
<!-- <el-form-item :label="t('system.footer')" prop="foot">
@@ -248,6 +256,7 @@ interface LoginForm {
248256
name: string
249257
slogan: string
250258
foot: string
259+
showSlogan: string
251260
footContent?: string
252261
}
253262
interface ConfigItem {
@@ -287,6 +296,7 @@ const defaultLoginForm = reactive<LoginForm>({
287296
name: 'SQLBot',
288297
slogan: t('common.intelligent_questioning_platform'),
289298
foot: 'false',
299+
showSlogan: '0',
290300
footContent: '',
291301
})
292302
const loginForm = reactive<LoginForm>(cloneDeep(defaultLoginForm))

0 commit comments

Comments
 (0)