Merge branch 'dev' of github.com:jumpserver/lina into dev

This commit is contained in:
ibuler
2020-06-16 17:26:52 +08:00
14 changed files with 60 additions and 16 deletions

View File

@@ -12,9 +12,15 @@ export default {
type: String,
default: ''
},
// 增加选项
options: {
type: Array,
default: () => []
},
// 排除选项
exclude: {
type: Array,
default: () => []
}
},
watch: {
@@ -36,6 +42,9 @@ export default {
if (!field.filter) {
continue
}
if (vm.exclude.includes(name)) {
continue
}
const option = {
label: field.label,
value: name

View File

@@ -40,7 +40,7 @@ export default {
autoParam: ['id=key', 'name=n', 'level=lv'],
type: 'get',
headers: {
'X-JMS-ORG': JSON.parse(this.$cookie.get('jms_current_org')).id || ''
'X-JMS-ORG': JSON.parse(this.$cookie.get('jms_current_org')) ? JSON.parse(this.$cookie.get('jms_current_org')).id : ''
}
},
callback: {

View File

@@ -202,6 +202,7 @@
"Upload": "上传",
"Username": "用户名",
"Validity": "有效",
"Invalidity": "无效",
"View": "查看",
"Yes": "是",
"action": "动作",

View File

@@ -203,6 +203,7 @@
"Upload": "Upload",
"Username": "Username",
"Validity": "Validity",
"Invalidity": "Invalidity",
"View": "View",
"Yes": "Yes",
"action": "Action",

View File

@@ -48,6 +48,7 @@ import Term from '@/components/Term'
import IBox from '@/components/IBox'
import CodeMirror from '@/components/CodeMirror'
import Page from '@/layout/components/Page'
export default {
name: 'CommandExecution',
components: {
@@ -117,7 +118,7 @@ export default {
}
},
mounted() {
this.$axios.get('/api/v1/assets/system-users/').then(res => {
this.$axios.get('/api/v1/perms/system-users-permission/').then(res => {
for (const i in res) {
// :disabled="item.protocol !== 'ssh'&& item.login_mode!=='auto'"
if (res[i].protocol === 'ssh' && res[i].login_mode === 'auto') {

View File

@@ -1,6 +1,7 @@
<template>
<IBox :fa="icon" :type="type" :title="title" v-bind="$attrs">
<table class="run-info">
<p v-if="contents.length === 0">{{ $t('common.Nothing') }}</p>
<tr v-for="content in contents" :key="content.hostname">
<td>{{ content.hostname }}</td>
<td>{{ content.result }}</td>

View File

@@ -94,7 +94,19 @@ export default {
url: '',
options: [
{ label: this.$t('common.Name'), value: 'name' },
{ label: this.$t('perms.isValid'), value: 'is_valid' },
{
label: this.$t('perms.isValid'), value: 'is_valid',
children: [
{
value: '1',
label: this.$t('common.Validity')
},
{
value: '0',
label: this.$t('common.Invalidity')
}
]
},
{ label: this.$t('common.Username'), value: 'username' },
{ label: this.$t('perms.UserGroups'), value: 'user_group' },
{ label: this.$t('perms.IP'), value: 'ip' },

View File

@@ -37,6 +37,7 @@ export default {
label: this.$t('perms.User'),
formatter: DetailFormatter,
formatterArgs: {
route: 'AssetPermissionDetail',
routeQuery: {
activeTab: 'AssetPermissionUser'
}
@@ -49,6 +50,7 @@ export default {
label: this.$t('perms.Asset'),
formatter: DetailFormatter,
formatterArgs: {
route: 'AssetPermissionDetail',
routeQuery: {
activeTab: 'AssetPermissionAsset'
}
@@ -75,7 +77,19 @@ export default {
url: '',
options: [
{ label: this.$t('common.Name'), value: 'name' },
{ label: this.$t('perms.isValid'), value: 'is_valid' },
{
label: this.$t('perms.isValid'), value: 'is_valid',
children: [
{
value: '1',
label: this.$t('common.Validity')
},
{
value: '0',
label: this.$t('common.Invalidity')
}
]
},
{ label: this.$t('common.Username'), value: 'username' },
{ label: this.$t('perms.UserGroups'), value: 'user_group' },
{ label: this.$t('perms.IP'), value: 'ip' },

View File

@@ -49,12 +49,7 @@ export default {
headerActions: {
hasLeftActions: false,
hasImport: false,
hasExport: false,
searchConfig: {
url: '',
options: [
]
}
hasExport: false
}
}
}

View File

@@ -44,6 +44,10 @@ export default {
const data = { is_active: v }
vm.$axios.patch(url, data).catch(() => {
item.attrs.model = !v
}).then(res => {
this.$message.success(this.$t('common.updateSuccessMsg'))
}).catch(err => {
this.$message.error(this.$t('common.updateErrorMsg' + ' ' + err))
})
}
}

View File

@@ -60,10 +60,7 @@ export default {
headerActions: {
hasLeftActions: false,
hasImport: false,
hasExport: false,
searchConfig: {
url: ''
}
hasExport: false
}
}
}

View File

@@ -34,6 +34,7 @@ export default {
hasLeftActions: false,
hasImport: false,
searchConfig: {
exclude: ['asset'],
options: [
{
label: this.$t('assets.Hostname'),

View File

@@ -19,7 +19,7 @@ export default {
url: '/api/v1/xpack/gathered-user/tasks/',
initial: {
is_periodic: true,
interval: null
interval: 24
},
fieldsMeta: {
crontab: {
@@ -47,7 +47,9 @@ export default {
'is_periodic': {
type: 'switch'
}
}
},
createSuccessNextRoute: { name: 'GatherUserListIndex' },
updateSuccessNextRoute: { name: 'GatherUserListIndex' }
}
}
}

View File

@@ -22,6 +22,11 @@ export default {
name: {
formatter: null
},
nodes: {
formatter: function(row, column, cellValue, index) {
return cellValue.length
}
},
actions: {
formatterArgs: {
updateRoute: 'GatherUserTaskUpdate',
@@ -35,6 +40,7 @@ export default {
`/api/v1/xpack/gathered-user/task-executions/`,
{ task: data.row.id }
).then(res => {
window.open(`/#/ops/celery/task/${res.task}/log/`, '_blank', 'toolbar=yes, width=900, height=600')
}).catch(res => {
})
}