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