Merge pull request #8218 from dataease/pr@dev-v2@perf_xpack_appearance_login_foot

perf(X-Pack): 外观配置-登录页面页脚
This commit is contained in:
fit2cloud-chenyw 2024-02-28 15:36:09 +08:00 committed by GitHub
commit d72132856e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 49 additions and 4 deletions

View File

@ -2,7 +2,7 @@ FROM registry.cn-qingdao.aliyuncs.com/dataease/alpine-openjdk17-jre
ARG IMAGE_TAG
RUN mkdir -p /opt/apps/config /opt/dataease2.0/drivers/ /opt/dataease2.0/cache/ /opt/dataease2.0/data/map /opt/dataease2.0/data/static-resource/
RUN mkdir -p /opt/apps/config /opt/dataease2.0/drivers/ /opt/dataease2.0/cache/ /opt/dataease2.0/data/map /opt/dataease2.0/data/static-resource/ /opt/dataease2.0/data/appearance/
ADD drivers/* /opt/dataease2.0/drivers/
ADD mapFiles/ /opt/dataease2.0/data/map/

View File

@ -52,7 +52,8 @@
"vue-uuid": "^3.0.0",
"vue3-ace-editor": "^2.2.2",
"vuedraggable": "^4.1.0",
"web-storage-cache": "^1.1.1"
"web-storage-cache": "^1.1.1",
"xss": "^1.0.14"
},
"devDependencies": {
"@intlify/unplugin-vue-i18n": "^0.8.2",

View File

@ -84,6 +84,9 @@ const navigate = computed(() => appearanceStore.getNavigate)
:deep(.work-bar) {
color: var(--ed-color-black) !important;
}
.ed-divider {
border-color: #1f232926 !important;
}
}
.header-flex {
margin-bottom: 0.5px;

View File

@ -15,6 +15,8 @@ interface AppearanceState {
slogan?: string
web?: string
name?: string
foot?: string
footContent?: string
loaded: boolean
}
const { wsCache } = useCache()
@ -31,6 +33,8 @@ export const useAppearanceStore = defineStore('appearanceStore', {
slogan: '',
web: '',
name: '',
foot: 'false',
footContent: '',
loaded: false
}
},
@ -79,6 +83,12 @@ export const useAppearanceStore = defineStore('appearanceStore', {
},
getLoaded(): boolean {
return this.loaded
},
getFoot(): string {
return this.foot
},
getFootContent(): string {
return this.footContent
}
},
actions: {
@ -133,6 +143,8 @@ export const useAppearanceStore = defineStore('appearanceStore', {
this.slogan = data.slogan
this.web = data.web
this.name = data.name
this.foot = data.foot
this.footContent = data.footContent
if (this.name) {
document.title = this.name
}

View File

@ -17,6 +17,7 @@ import { logoutHandler } from '@/utils/logout'
import DeImage from '@/assets/login-desc-de.png'
import elementResizeDetectorMaker from 'element-resize-detector'
import { isLarkPlatform } from '@/utils/utils'
import xss from 'xss'
const { wsCache } = useCache()
const appStore = useAppStoreWithOut()
const userStore = useUserStoreWithOut()
@ -184,6 +185,33 @@ const loadArrearance = () => {
if (appearanceStore.getSlogan) {
slogan.value = appearanceStore.getSlogan
}
if (appearanceStore.getFoot) {
showFoot.value = appearanceStore.getFoot === 'true'
if (showFoot.value) {
const content = appearanceStore.getFootContent
const myXss = new xss.FilterXSS({
css: {
whiteList: {
'background-color': true,
'text-align': true,
color: true,
'margin-top': true,
'margin-bottom': true,
'line-height': true,
'box-sizing': true,
'padding-top': true,
'padding-bottom': true
}
},
whiteList: {
...xss.whiteList,
p: ['style'],
span: ['style']
}
})
footContent.value = myXss.process(content)
}
}
}
onMounted(() => {
loadArrearance()

@ -1 +1 @@
Subproject commit c04491512fd7f2ba9f4a438ada69228c384b35cd
Subproject commit 5e22cfff250f06e2dafd2c775aed449e1c45bd59

View File

@ -12,6 +12,7 @@ services:
- ${DE_BASE}/dataease2.0/data/static-resource:/opt/dataease2.0/data/static-resource
- ${DE_BASE}/dataease2.0/cache:/opt/dataease2.0/cache
- ${DE_BASE}/dataease2.0/data/geo:/opt/dataease2.0/data/geo
- ${DE_BASE}/dataease2.0/data/appearance:/opt/dataease2.0/data/appearance
depends_on:
DE_MYSQL_HOST:
condition: service_healthy

View File

@ -71,7 +71,7 @@ cd $DE_RUN_BASE
env | grep DE_ >.env
mkdir -p ${DE_RUN_BASE}/{cache,logs,conf}
mkdir -p ${DE_RUN_BASE}/data/{mysql,static-resource,map,etcd_data,geo}
mkdir -p ${DE_RUN_BASE}/data/{mysql,static-resource,map,etcd_data,geo,appearance}
mkdir -p ${DE_RUN_BASE}/apisix/logs
mkdir -p ${DE_RUN_BASE}/task/logs
chmod 777 ${DE_RUN_BASE}/apisix/logs ${DE_RUN_BASE}/data/etcd_data ${DE_RUN_BASE}/task/logs