mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-18 16:32:28 +00:00
[update]完善页面图标和添加动态图标功能
This commit is contained in:
Binary file not shown.
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 3.2 KiB |
@@ -52,3 +52,9 @@ export function getPublicSettings() {
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
export function getLogo() {
|
||||
return request({
|
||||
url: '/api/v1/xpack/interface/setting',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
@@ -6,7 +6,8 @@
|
||||
<h1 v-else class="sidebar-title">{{ title }}</h1>
|
||||
</router-link>
|
||||
<router-link v-else key="expand" class="sidebar-logo-link" to="/">
|
||||
<img v-if="logoText" :src="logoText" class="sidebar-logo-text">
|
||||
<img v-if="customSettings.logo_index != '/static/img/logo_text.png' " :src="customSettings.logo_index" class="sidebar-logo">
|
||||
<img v-else-if="logoText" :src="logoText" class="sidebar-logo-text">
|
||||
<!-- <h1 class="sidebar-title">{{ title }}</h1>-->
|
||||
</router-link>
|
||||
</transition>
|
||||
@@ -14,6 +15,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
export default {
|
||||
name: 'SidebarLogo',
|
||||
props: {
|
||||
@@ -26,8 +28,17 @@ export default {
|
||||
return {
|
||||
title: 'JumpServer',
|
||||
logoText: require('@/assets/img/logo-text.png'),
|
||||
logo: require('@/assets/img/logo.png')
|
||||
logo: require('@/assets/img/logo.png'),
|
||||
xpackData: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'customSettings'
|
||||
])
|
||||
},
|
||||
created() {
|
||||
console.log(this.customSettings.logo_index)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@@ -9,6 +9,7 @@ const getters = {
|
||||
visitedViews: state => state.tagsView.visitedViews,
|
||||
cachedViews: state => state.tagsView.cachedViews,
|
||||
publicSettings: state => state.settings.publicSettings,
|
||||
customSettings: state => state.settings.customSettings,
|
||||
getCurrentOrgRoles: state => state.users.profile.current_org_roles
|
||||
}
|
||||
export default getters
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import defaultSettings from '@/settings'
|
||||
import { getPublicSettings } from '@/api/settings'
|
||||
import { getPublicSettings, getLogo } from '@/api/settings'
|
||||
|
||||
const { showSettings, fixedHeader, sidebarLogo, tagsView } = defaultSettings
|
||||
|
||||
@@ -8,7 +8,8 @@ const state = {
|
||||
fixedHeader: fixedHeader,
|
||||
sidebarLogo: sidebarLogo,
|
||||
tagsView: tagsView,
|
||||
publicSettings: null
|
||||
publicSettings: null,
|
||||
customSettings: null
|
||||
}
|
||||
|
||||
const mutations = {
|
||||
@@ -19,6 +20,9 @@ const mutations = {
|
||||
},
|
||||
SET_PUBLIC_SETTINGS: (state, settings) => {
|
||||
state.publicSettings = settings
|
||||
},
|
||||
SET_CUSTOM_SETTINGS: (state, settings) => {
|
||||
state.customSettings = settings
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +35,13 @@ const actions = {
|
||||
return new Promise((resolve, reject) => {
|
||||
getPublicSettings().then(response => {
|
||||
commit('SET_PUBLIC_SETTINGS', response.data)
|
||||
if (response.data.XPACK_ENABLED) {
|
||||
if (response.data.XPACK_LICENSE_IS_VALID) {
|
||||
getLogo().then((res) => {
|
||||
commit('SET_CUSTOM_SETTINGS', res)
|
||||
})
|
||||
}
|
||||
}
|
||||
resolve(response)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
|
Reference in New Issue
Block a user