mirror of
https://github.com/jumpserver/lina.git
synced 2025-08-02 07:27:01 +00:00
commit
16606d6a27
11
src/App.vue
11
src/App.vue
@ -1,19 +1,12 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
<router-view v-if="isRouterAlive" />
|
||||
<router-view />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'App',
|
||||
computed: {
|
||||
...mapState({
|
||||
isRouterAlive: state => state.common.isRouterAlive
|
||||
})
|
||||
}
|
||||
name: 'App'
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -6,17 +6,17 @@
|
||||
<div v-else>
|
||||
<el-col :span="rightEmpty() ? 24 : 12">
|
||||
<div v-if="!leftEmpty()">
|
||||
<el-alert type="info" effect="dark" :closable="false" style="width: 100%;">{{ row.leftTitle }}</el-alert>
|
||||
<div v-for="(value, key, index) in row.left" :key="index" class="text item">
|
||||
<el-tag type="info" :hit="true"><strong>{{ key }}: </strong>{{ value }}</el-tag>
|
||||
<el-tag type="primary" effect="dark" :closable="false" style="width: 100%;">{{ row.leftTitle }}</el-tag>
|
||||
<div v-for="(value, key, index) in row.left" :key="index">
|
||||
<el-tag type="primary"><strong>{{ key }}: </strong>{{ value }}</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="leftEmpty() ? 24 : 12">
|
||||
<div v-if="!rightEmpty()">
|
||||
<el-alert type="success" effect="dark" :closable="false" style="width: 100%;">{{ row.rightTitle }}</el-alert>
|
||||
<el-tag type="primary" effect="dark" :closable="false" style="width: 100%;">{{ row.rightTitle }}</el-tag>
|
||||
<div v-for="(value, key, index) in row.right" :key="index">
|
||||
<el-tag type="info" :hit="true"><strong>{{ key }}: </strong>{{ value }}</el-tag>
|
||||
<el-tag type="primary"><strong>{{ key }}: </strong>{{ value }}</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
|
@ -2,8 +2,7 @@ import { optionUrlMeta } from '@/api/common'
|
||||
|
||||
const getDefaultState = () => {
|
||||
return {
|
||||
metaMap: {},
|
||||
isRouterAlive: true
|
||||
metaMap: {}
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,12 +11,6 @@ const state = getDefaultState()
|
||||
const mutations = {
|
||||
SET_URL_META: (state, { url, meta }) => {
|
||||
state.metaMap[url] = meta
|
||||
},
|
||||
reload: (state) => {
|
||||
state.isRouterAlive = false
|
||||
setTimeout(() => {
|
||||
state.isRouterAlive = true
|
||||
}, 0)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ async function changeOrg(org) {
|
||||
if (index !== -1) {
|
||||
location.href = path.substring(0, index)
|
||||
}
|
||||
setTimeout(() => store.commit('common/reload'), 400)
|
||||
setTimeout(() => location.reload(), 400)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -39,6 +39,9 @@ export function changeElementColor(themeColors) {
|
||||
.el-link.el-link--${key}:after {
|
||||
border-color: ${value}!important;
|
||||
}
|
||||
.el-tag--dark.el-tag--${key} {
|
||||
background-color: ${value} !important;
|
||||
}
|
||||
`
|
||||
}
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ export default {
|
||||
that.iHasObjects = [...that.iHasObjects, ...objects]
|
||||
that.$refs.select2.clearSelected()
|
||||
this.$message.success(this.$t('common.updateSuccessMsg'))
|
||||
this.$store.commit('common/reload')
|
||||
window.location.reload()
|
||||
this.$refs.listTable.$refs.ListTable.reloadTable()
|
||||
}
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ export default {
|
||||
onAddSuccess: (items, that) => {
|
||||
this.$log.debug('AssetSelect value', that.assets)
|
||||
this.$message.success(this.$t('common.updateSuccessMsg'))
|
||||
this.$store.commit('common/reload')
|
||||
window.location.reload()
|
||||
}
|
||||
},
|
||||
nodeRelationConfig: {
|
||||
@ -120,7 +120,7 @@ export default {
|
||||
that.iHasObjects = [...that.iHasObjects, ...objects]
|
||||
that.$refs.select2.clearSelected()
|
||||
this.$message.success(this.$t('common.updateSuccessMsg'))
|
||||
this.$store.commit('common/reload')
|
||||
window.location.reload()
|
||||
},
|
||||
performDelete: (item) => {
|
||||
const data = {
|
||||
|
@ -1,6 +1,10 @@
|
||||
<template>
|
||||
<div>
|
||||
<GenericListPage :table-config="tableConfig" :header-actions="headerActions" />
|
||||
<GenericListPage
|
||||
v-loading="loading"
|
||||
:table-config="tableConfig"
|
||||
:header-actions="headerActions"
|
||||
/>
|
||||
<el-dialog
|
||||
:title="this.$t('route.OperateLog')"
|
||||
:visible.sync="logDetailVisible"
|
||||
@ -30,11 +34,12 @@ export default {
|
||||
return {
|
||||
rowObj: {
|
||||
left: '',
|
||||
rigth: '',
|
||||
right: '',
|
||||
leftTitle: vm.$t('audits.BeforeChange'),
|
||||
rightTitle: vm.$t('audits.AfterChange')
|
||||
},
|
||||
logDetailVisible: false,
|
||||
loading: false,
|
||||
tableConfig: {
|
||||
url: '/api/v1/audits/operate-logs/',
|
||||
columns: ['user', 'action_display', 'resource_type_display', 'resource', 'remote_addr', 'datetime', 'actions'],
|
||||
@ -74,12 +79,15 @@ export default {
|
||||
title: this.$t('common.View'),
|
||||
type: 'primary',
|
||||
callback: ({ row }) => {
|
||||
vm.loading = true
|
||||
vm.$axios.get(
|
||||
`/api/v1/audits/operate-logs/${row.id}/?type=action_detail`,
|
||||
).then(res => {
|
||||
vm.rowObj.left = res.before
|
||||
vm.rowObj.right = res.after
|
||||
vm.logDetailVisible = true
|
||||
}).finally(() => {
|
||||
vm.loading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ export default {
|
||||
this.$message.success(this.$t('common.updateSuccessMsg'))
|
||||
this.$refs.ListTable.reloadTable()
|
||||
that.$refs.assetSelect.$refs.select2.clearSelected()
|
||||
this.$store.commit('common/reload')
|
||||
window.location.reload()
|
||||
}
|
||||
},
|
||||
nodeRelationConfig: {
|
||||
|
@ -49,7 +49,7 @@ export default {
|
||||
const msg = vm.$t('sessions.TerminateTaskSendSuccessMsg')
|
||||
vm.$message.success(msg)
|
||||
window.setTimeout(function() {
|
||||
this.$store.commit('common/reload')
|
||||
window.location.reload()
|
||||
}, 50000)
|
||||
})
|
||||
}
|
||||
|
@ -175,7 +175,7 @@ export default {
|
||||
}).then(() => {
|
||||
restoreInterface().then(res => {
|
||||
this.$message.success(res.success)
|
||||
this.$store.commit('common/reload')
|
||||
location.reload()
|
||||
})
|
||||
})
|
||||
}.bind(this)
|
||||
@ -221,7 +221,7 @@ export default {
|
||||
}
|
||||
}
|
||||
updateInterface(form).then(res => {
|
||||
this.$store.commit('common/reload')
|
||||
location.reload()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -140,7 +140,6 @@ export default {
|
||||
window.open(url, '_blank')
|
||||
},
|
||||
importLicense() {
|
||||
const vm = this
|
||||
if (this.licenseFile['file'] === undefined) {
|
||||
return
|
||||
}
|
||||
@ -149,7 +148,7 @@ export default {
|
||||
importLicense(formData).then(res => {
|
||||
if (res.status) {
|
||||
this.$message.success(res.msg)
|
||||
setTimeout(() => vm.$store.commit('common/reload'), 500)
|
||||
setTimeout(() => location.reload(), 500)
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
|
@ -236,7 +236,7 @@ export default {
|
||||
return toSafeLocalDateStr(dataStr)
|
||||
},
|
||||
reloadPage() {
|
||||
this.$store.commit('common/reload')
|
||||
window.location.reload()
|
||||
},
|
||||
handleApprove() {
|
||||
if (this.object.approval_step === this.object.process_map.length) {
|
||||
|
@ -244,7 +244,7 @@ export default {
|
||||
return toSafeLocalDateStr(dataStr)
|
||||
},
|
||||
reloadPage() {
|
||||
this.$store.commit('common/reload')
|
||||
window.location.reload()
|
||||
},
|
||||
handleApprove() {
|
||||
if (this.object.approval_step === this.object.process_map.length) {
|
||||
|
@ -88,7 +88,7 @@ export default {
|
||||
return toSafeLocalDateStr(dataStr)
|
||||
},
|
||||
reloadPage() {
|
||||
this.$store.commit('common/reload')
|
||||
window.location.reload()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -199,7 +199,7 @@ export default {
|
||||
)
|
||||
},
|
||||
reloadPage() {
|
||||
this.$store.commit('common/reload')
|
||||
window.location.reload()
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user