mirror of
https://github.com/jumpserver/lina.git
synced 2025-08-01 23:18:17 +00:00
Merge pull request #551 from jumpserver/dev
chore: Merge master from dev
This commit is contained in:
commit
ba78e33f89
@ -192,6 +192,13 @@ export default {
|
||||
if (!field) {
|
||||
return
|
||||
}
|
||||
if (typeof error === 'object') {
|
||||
const str = error
|
||||
error = ''
|
||||
Object.keys(str).forEach(key => {
|
||||
error += `${parseInt(key) + 1}.${str[key][0]} `
|
||||
})
|
||||
}
|
||||
if (field.attrs.error === error) {
|
||||
error += '.'
|
||||
}
|
||||
|
@ -147,23 +147,27 @@ export default {
|
||||
this.$emit('submitSuccess', res)
|
||||
const h = this.$createElement
|
||||
this.$log.debug('router is: ', detailRoute)
|
||||
this.$message({
|
||||
message: h('p', null, [
|
||||
h('el-link', {
|
||||
on: {
|
||||
click: () => this.$router.push(detailRoute)
|
||||
},
|
||||
style: { 'vertical-align': 'top' }
|
||||
}, msgLinkName),
|
||||
h('span', { style: {
|
||||
'padding-left': '5px',
|
||||
'height': '18px',
|
||||
'line-height': '18px',
|
||||
'font-size': '13.5px',
|
||||
'font-weight': ' 400' }}, msg)
|
||||
]),
|
||||
type: 'success'
|
||||
})
|
||||
if (this.hasDetailInMsg) {
|
||||
this.$message({
|
||||
message: h('p', null, [
|
||||
h('el-link', {
|
||||
on: {
|
||||
click: () => this.$router.push(detailRoute)
|
||||
},
|
||||
style: { 'vertical-align': 'top' }
|
||||
}, msgLinkName),
|
||||
h('span', { style: {
|
||||
'padding-left': '5px',
|
||||
'height': '18px',
|
||||
'line-height': '18px',
|
||||
'font-size': '13.5px',
|
||||
'font-weight': ' 400' }}, msg)
|
||||
]),
|
||||
type: 'success'
|
||||
})
|
||||
} else {
|
||||
this.$message.success(msg)
|
||||
}
|
||||
if (!addContinue) {
|
||||
setTimeout(() => this.$router.push(route), 100)
|
||||
}
|
||||
@ -189,6 +193,10 @@ export default {
|
||||
hasSaveContinue: {
|
||||
type: Boolean,
|
||||
default: null
|
||||
},
|
||||
hasDetailInMsg: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
@ -24,6 +24,10 @@ export default {
|
||||
'currentUser'
|
||||
]),
|
||||
isExpire() {
|
||||
// 用户来源不是Local时不显示密码过期提示
|
||||
if (this.currentUser.source !== 'local') {
|
||||
return false
|
||||
}
|
||||
const intervalTime = this.getIntervalDays(this.currentUser.date_password_last_updated)
|
||||
const securityPasswordExpirationTime = this.publicSettings.SECURITY_PASSWORD_EXPIRATION_TIME
|
||||
if (intervalTime >= securityPasswordExpirationTime) {
|
||||
|
@ -8,6 +8,7 @@
|
||||
:update-success-next-route="updateSuccessNextRoute"
|
||||
:clean-form-value="cleanFormValue"
|
||||
:get-method="getMethod"
|
||||
:on-perform-success="onPerformSuccess"
|
||||
/>
|
||||
</IBox>
|
||||
</template>
|
||||
@ -86,6 +87,10 @@ export default {
|
||||
methods: {
|
||||
getMethod() {
|
||||
return 'put'
|
||||
},
|
||||
onPerformSuccess() {
|
||||
this.$message.success(this.$t('common.updateSuccessMsg'))
|
||||
setTimeout(() => this.$router.push({ name: 'UserGuide' }), 100)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -32,14 +32,17 @@ export default {
|
||||
title: this.$t('perms.addSystemUserToThisPermission'),
|
||||
objectsAjax: {
|
||||
url: '/api/v1/assets/system-users/',
|
||||
processResults: (data) => {
|
||||
let results = data.results
|
||||
results = results.filter((item) => item.protocol === 'ssh' || item.protocol === 'telnet').map((item) => {
|
||||
return { label: item.name + '(' + item.username + ')', value: item.id }
|
||||
})
|
||||
const more = !!data.next
|
||||
return { results: results, pagination: more, total: data.count }
|
||||
transformOption: (item) => {
|
||||
return { label: item.name + '(' + item.username + ')', value: item.id }
|
||||
}
|
||||
// processResults: (data) => {
|
||||
// let results = data.results
|
||||
// results = results.filter((item) => item.protocol === 'ssh' || item.protocol === 'telnet').map((item) => {
|
||||
// return { label: item.name + '(' + item.username + ')', value: item.id }
|
||||
// })
|
||||
// const more = !!data.next
|
||||
// return { results: results, pagination: more, total: data.count }
|
||||
// }
|
||||
},
|
||||
hasObjectsId: this.object.system_users,
|
||||
performAdd: (items) => {
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<GenericCreateUpdatePage :fields="fields" :initial="initial" :fields-meta="fieldsMeta" :url="url" />
|
||||
<GenericCreateUpdatePage :fields="fields" :initial="initial" :fields-meta="fieldsMeta" :url="url" :has-detail-in-msg="false" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
@ -59,6 +59,9 @@ export default {
|
||||
doc_type: {
|
||||
label: this.$t('sessions.docType'),
|
||||
rules: [Required],
|
||||
el: {
|
||||
disabled: true
|
||||
},
|
||||
helpText: this.$t('sessions.helpText.esDocType')
|
||||
}
|
||||
},
|
||||
@ -73,7 +76,7 @@ export default {
|
||||
return this.fieldsMap[this.currentType]
|
||||
},
|
||||
initial() {
|
||||
return { type: this.currentType }
|
||||
return { type: this.currentType, doc_type: 'command' }
|
||||
},
|
||||
currentType() {
|
||||
const params = this.$route.params
|
||||
|
@ -107,19 +107,19 @@ export default {
|
||||
},
|
||||
'state.session_active_count': {
|
||||
label: this.$t('sessions.sessionActiveCount'),
|
||||
width: '160px'
|
||||
width: '120px'
|
||||
},
|
||||
'state.system_cpu_load_1': {
|
||||
label: this.$t('sessions.systemCpuLoad'),
|
||||
width: '160px'
|
||||
width: '120px'
|
||||
},
|
||||
'state.system_disk_used_percent': {
|
||||
label: this.$t('sessions.systemDiskUsedPercent'),
|
||||
width: '160px'
|
||||
width: '120px'
|
||||
},
|
||||
'state.system_memory_used_percent': {
|
||||
label: this.$t('sessions.systemMemoryUsedPercent'),
|
||||
width: '160px'
|
||||
width: '120px'
|
||||
},
|
||||
'status_display': {
|
||||
label: this.$t('xpack.LoadStatus'),
|
||||
|
@ -10,6 +10,7 @@
|
||||
:object="object"
|
||||
:fields-meta="fieldsMeta"
|
||||
:get-method="getMethod"
|
||||
:has-detail-in-msg="false"
|
||||
/>
|
||||
</IBox>
|
||||
</template>
|
||||
|
@ -10,6 +10,7 @@
|
||||
:fields-meta="fieldsMeta"
|
||||
:get-method="getMethod"
|
||||
:more-buttons="moreButtons"
|
||||
:has-detail-in-msg="false"
|
||||
/>
|
||||
</IBox>
|
||||
</template>
|
||||
|
@ -9,6 +9,7 @@
|
||||
:object="object"
|
||||
:fields-meta="fieldsMeta"
|
||||
:get-method="getMethod"
|
||||
:has-detail-in-msg="false"
|
||||
/>
|
||||
</IBox>
|
||||
</template>
|
||||
|
@ -11,6 +11,7 @@
|
||||
:fields-meta="fieldsMeta"
|
||||
:get-method="getMethod"
|
||||
:more-buttons="moreButtons"
|
||||
:has-detail-in-msg="false"
|
||||
/>
|
||||
</IBox>
|
||||
<Dialog
|
||||
|
@ -10,6 +10,7 @@
|
||||
:fields-meta="fieldsMeta"
|
||||
:get-method="getMethod"
|
||||
:on-perform-success="onPerformSuccess"
|
||||
:has-detail-in-msg="false"
|
||||
/>
|
||||
</IBox>
|
||||
</template>
|
||||
|
@ -9,6 +9,7 @@
|
||||
:object="object"
|
||||
:fields-meta="fieldsMeta"
|
||||
:get-method="getMethod"
|
||||
:has-detail-in-msg="false"
|
||||
/>
|
||||
</IBox>
|
||||
</template>
|
||||
|
@ -21,6 +21,7 @@ export default {
|
||||
is_periodic: true,
|
||||
interval: 24
|
||||
},
|
||||
hasDetailInMsg: false,
|
||||
fieldsMeta: {
|
||||
crontab: {
|
||||
hidden: (formValue) => {
|
||||
|
@ -9,6 +9,7 @@
|
||||
:fields-meta="fieldsMeta"
|
||||
:on-submit="submitForm"
|
||||
:more-buttons="moreButtons"
|
||||
:has-save-continue="hasSaveContinue"
|
||||
/>
|
||||
</IBox>
|
||||
</Page>
|
||||
@ -32,6 +33,7 @@ export default {
|
||||
loading: true,
|
||||
files: {},
|
||||
interfaceInfo: {},
|
||||
hasSaveContinue: false,
|
||||
successUrl: { name: 'Settings' },
|
||||
fields: [
|
||||
['', ['login_title']],
|
||||
|
Loading…
Reference in New Issue
Block a user