mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-19 09:43:32 +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'
|
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>
|
<h1 v-else class="sidebar-title">{{ title }}</h1>
|
||||||
</router-link>
|
</router-link>
|
||||||
<router-link v-else key="expand" class="sidebar-logo-link" to="/">
|
<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>-->
|
<!-- <h1 class="sidebar-title">{{ title }}</h1>-->
|
||||||
</router-link>
|
</router-link>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -14,6 +15,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { mapGetters } from 'vuex'
|
||||||
export default {
|
export default {
|
||||||
name: 'SidebarLogo',
|
name: 'SidebarLogo',
|
||||||
props: {
|
props: {
|
||||||
@@ -26,8 +28,17 @@ export default {
|
|||||||
return {
|
return {
|
||||||
title: 'JumpServer',
|
title: 'JumpServer',
|
||||||
logoText: require('@/assets/img/logo-text.png'),
|
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>
|
</script>
|
||||||
|
@@ -9,6 +9,7 @@ const getters = {
|
|||||||
visitedViews: state => state.tagsView.visitedViews,
|
visitedViews: state => state.tagsView.visitedViews,
|
||||||
cachedViews: state => state.tagsView.cachedViews,
|
cachedViews: state => state.tagsView.cachedViews,
|
||||||
publicSettings: state => state.settings.publicSettings,
|
publicSettings: state => state.settings.publicSettings,
|
||||||
|
customSettings: state => state.settings.customSettings,
|
||||||
getCurrentOrgRoles: state => state.users.profile.current_org_roles
|
getCurrentOrgRoles: state => state.users.profile.current_org_roles
|
||||||
}
|
}
|
||||||
export default getters
|
export default getters
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import defaultSettings from '@/settings'
|
import defaultSettings from '@/settings'
|
||||||
import { getPublicSettings } from '@/api/settings'
|
import { getPublicSettings, getLogo } from '@/api/settings'
|
||||||
|
|
||||||
const { showSettings, fixedHeader, sidebarLogo, tagsView } = defaultSettings
|
const { showSettings, fixedHeader, sidebarLogo, tagsView } = defaultSettings
|
||||||
|
|
||||||
@@ -8,7 +8,8 @@ const state = {
|
|||||||
fixedHeader: fixedHeader,
|
fixedHeader: fixedHeader,
|
||||||
sidebarLogo: sidebarLogo,
|
sidebarLogo: sidebarLogo,
|
||||||
tagsView: tagsView,
|
tagsView: tagsView,
|
||||||
publicSettings: null
|
publicSettings: null,
|
||||||
|
customSettings: null
|
||||||
}
|
}
|
||||||
|
|
||||||
const mutations = {
|
const mutations = {
|
||||||
@@ -19,6 +20,9 @@ const mutations = {
|
|||||||
},
|
},
|
||||||
SET_PUBLIC_SETTINGS: (state, settings) => {
|
SET_PUBLIC_SETTINGS: (state, settings) => {
|
||||||
state.publicSettings = settings
|
state.publicSettings = settings
|
||||||
|
},
|
||||||
|
SET_CUSTOM_SETTINGS: (state, settings) => {
|
||||||
|
state.customSettings = settings
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -31,6 +35,13 @@ const actions = {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
getPublicSettings().then(response => {
|
getPublicSettings().then(response => {
|
||||||
commit('SET_PUBLIC_SETTINGS', response.data)
|
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)
|
resolve(response)
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
reject(error)
|
reject(error)
|
||||||
|
Reference in New Issue
Block a user