mirror of
https://github.com/jumpserver/lina.git
synced 2025-12-05 15:47:01 +00:00
Compare commits
10 Commits
dependabot
...
pr@dev@per
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8556b91fc4 | ||
|
|
3dd199ef01 | ||
|
|
20e1c833a6 | ||
|
|
f2c7a6bc71 | ||
|
|
6063e03d89 | ||
|
|
e2d9eb5bae | ||
|
|
84caf35f67 | ||
|
|
1d7a1bfff1 | ||
|
|
9039f572ac | ||
|
|
7798324a4b |
@@ -107,6 +107,10 @@ export default {
|
||||
this.$emit('add', true)
|
||||
}
|
||||
}).catch(error => {
|
||||
if (error?.response?.data?.code === 'no_valid_assets') {
|
||||
this.$message.error(error?.response?.data?.detail)
|
||||
return
|
||||
}
|
||||
this.iVisible = true
|
||||
this.handleResult(null, error)
|
||||
})
|
||||
|
||||
@@ -223,9 +223,21 @@ export default {
|
||||
const mapped = {}
|
||||
Object.entries(errors || {}).forEach(([k, v]) => {
|
||||
let msg = v
|
||||
console.log(k, v)
|
||||
// v是数组并且数组都是字符串,则拼接为字符串
|
||||
if (Array.isArray(v) && v.every(item => typeof item === 'string')) msg = v.join('; ')
|
||||
else if (typeof v === 'object' && v !== null) msg = JSON.stringify(v)
|
||||
// 处理 [{"port":["请确保该值小于或者等于 65535。"]},{},{}] 这种情况
|
||||
else if (Array.isArray(v) && v.every(item => _.isPlainObject(item))) {
|
||||
const subMsg = []
|
||||
v.forEach((subItem) => {
|
||||
Object.values(subItem).forEach((subMsgArr) => {
|
||||
if (Array.isArray(subMsgArr)) {
|
||||
subMsg.push(...subMsgArr)
|
||||
}
|
||||
})
|
||||
})
|
||||
msg = subMsg.join(' ')
|
||||
} else if (typeof v === 'object' && v !== null) msg = JSON.stringify(v)
|
||||
mapped[k] = String(msg || '')
|
||||
})
|
||||
this.serverErrors = mapped
|
||||
|
||||
@@ -65,6 +65,17 @@ export default {
|
||||
'usingOrgs',
|
||||
'currentViewRoute'
|
||||
]),
|
||||
currentOrgDisplayName() {
|
||||
const currentOrgId = this.currentOrg?.id
|
||||
if (!currentOrgId) {
|
||||
return this.$tc('Select')
|
||||
}
|
||||
const matchedOrg = this.usingOrgs.find(item => item.id === currentOrgId)
|
||||
if (matchedOrg?.name) {
|
||||
return matchedOrg.name
|
||||
}
|
||||
return this.currentOrg.name || this.$tc('Select')
|
||||
},
|
||||
orgActionsGroup() {
|
||||
const orgActions = {
|
||||
label: this.$t('OrganizationList'),
|
||||
@@ -110,11 +121,8 @@ export default {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
currentOrg: {
|
||||
handler() {
|
||||
this.updateWidth()
|
||||
},
|
||||
deep: true
|
||||
currentOrgDisplayName() {
|
||||
this.updateWidth()
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -133,8 +141,9 @@ export default {
|
||||
tempSpan.style.fontWeight = 'normal'
|
||||
tempSpan.style.letterSpacing = 'normal'
|
||||
|
||||
// 获取当前组织名称
|
||||
const orgName = this.currentOrg.name || this.$tc('Select')
|
||||
// 获取当前组织显示名称
|
||||
const orgName = this.currentOrgDisplayName
|
||||
|
||||
tempSpan.textContent = orgName
|
||||
document.body.appendChild(tempSpan)
|
||||
|
||||
|
||||
@@ -167,8 +167,7 @@ export default {
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='scss' scoped>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.page.no-title {
|
||||
::v-deep {
|
||||
.page-submenu .el-tabs__header {
|
||||
@@ -199,6 +198,14 @@ export default {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
&.is-disabled {
|
||||
cursor: not-allowed;
|
||||
|
||||
&:hover {
|
||||
color: #c0c4cc;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.el-tabs__nav-next {
|
||||
|
||||
@@ -149,6 +149,11 @@ export function getErrorResponseMsg(error) {
|
||||
.join('; ')
|
||||
} else if (typeof data === 'string') {
|
||||
return data
|
||||
} else if (_.isPlainObject(data)) {
|
||||
return Object.values(data)
|
||||
.map(item => getErrorResponseMsg(item))
|
||||
.filter(i => i)
|
||||
.join('; ')
|
||||
} else {
|
||||
msg = error.toString()
|
||||
}
|
||||
|
||||
@@ -43,7 +43,9 @@ export default {
|
||||
asset: ''
|
||||
},
|
||||
treeSetting: {
|
||||
showMenu: true,
|
||||
showMenu: (node) => {
|
||||
return node?.meta?.type === 'asset'
|
||||
},
|
||||
showRefresh: true,
|
||||
showSearch: true,
|
||||
showAssets: true,
|
||||
@@ -55,9 +57,8 @@ export default {
|
||||
menu: [
|
||||
{
|
||||
id: 'check',
|
||||
name: this.$t('Check'),
|
||||
name: this.$t('RiskDetection'),
|
||||
icon: 'scan',
|
||||
has: (node) => node?.meta?.type === 'asset',
|
||||
callback: (node) => {
|
||||
vm.detectDialog.asset = node.id
|
||||
setTimeout(() => {
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
class="risk-review-drawer"
|
||||
destroy-on-close
|
||||
direction="rtl"
|
||||
style="z-index: 999"
|
||||
>
|
||||
<div class="drawer-container">
|
||||
<div class="drawer-body">
|
||||
|
||||
@@ -408,7 +408,6 @@ export default {
|
||||
createJob(data).then(res => {
|
||||
this.progressLength = 0
|
||||
this.executionInfo.timeCost = 0
|
||||
this.showProgress = true
|
||||
this.speedText = ''
|
||||
const form = new FormData()
|
||||
const start = Date.now()
|
||||
@@ -436,6 +435,7 @@ export default {
|
||||
}
|
||||
}
|
||||
}).then(res => {
|
||||
this.showProgress = true
|
||||
this.executionInfo.status = 'running'
|
||||
this.currentTaskId = res.task_id
|
||||
this.xtermConfig = { taskId: this.currentTaskId, type: 'shortcut_cmd' }
|
||||
|
||||
@@ -32,6 +32,22 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
passwordMenuDisabled() {
|
||||
return this.$store.state.users.profile.source.value !== 'local'
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
passwordMenuDisabled: {
|
||||
immediate: true,
|
||||
handler(disabled) {
|
||||
this.config.submenu = this.getSubmenu()
|
||||
if (disabled && this.config.activeMenu === 'Password') {
|
||||
this.config.activeMenu = 'SSHKeyList'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getSubmenu() {
|
||||
return [
|
||||
|
||||
@@ -31,7 +31,7 @@ export default {
|
||||
[
|
||||
'SECURITY_MFA_AUTH',
|
||||
'SECURITY_MFA_IN_LOGIN_PAGE',
|
||||
'SECURITY_MFA_BY_EMAIL',
|
||||
'SECURITY_MFA_ENABLED_BACKENDS',
|
||||
'SECURITY_MFA_AUTH_ENABLED_FOR_THIRD_PARTY',
|
||||
'SECURITY_MFA_VERIFY_TTL',
|
||||
'OTP_ISSUER_NAME', 'OTP_VALID_WINDOW'
|
||||
|
||||
@@ -147,7 +147,7 @@ export default {
|
||||
this.loading = true
|
||||
const url = `/api/v1/tickets/comments/?ticket_id=${this.object.id}`
|
||||
this.$axios.get(url).then(res => {
|
||||
this.comments = res.results
|
||||
this.comments = res
|
||||
}).catch(err => {
|
||||
this.$message.error(err)
|
||||
}).finally(() => {
|
||||
|
||||
@@ -161,8 +161,7 @@ module.exports = {
|
||||
target: process.env.VUE_APP_CORE_HOST || 'http://127.0.0.1:8080',
|
||||
changeOrigin: true
|
||||
}
|
||||
},
|
||||
after: require('./mock/mock-server.js')
|
||||
}
|
||||
},
|
||||
css: {},
|
||||
configureWebpack: {
|
||||
|
||||
@@ -8570,9 +8570,9 @@ js-tokens@^3.0.2:
|
||||
integrity sha512-RjTcuD4xjtthQkaWH7dFlH85L+QaVtSoOyGdZ3g6HFhS9dFNDfLyqgm2NFe2X6cQpeFmt0452FJjFG5UameExg==
|
||||
|
||||
js-yaml@^3.13.0, js-yaml@^3.13.1, js-yaml@^3.14.0, js-yaml@^3.7.0, js-yaml@^3.9.1:
|
||||
version "3.14.2"
|
||||
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.2.tgz#77485ce1dd7f33c061fd1b16ecea23b55fcb04b0"
|
||||
integrity sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==
|
||||
version "3.14.1"
|
||||
resolved "https://registry.npmmirror.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537"
|
||||
integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==
|
||||
dependencies:
|
||||
argparse "^1.0.7"
|
||||
esprima "^4.0.0"
|
||||
|
||||
Reference in New Issue
Block a user