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

This commit is contained in:
Bai 2020-06-04 18:32:39 +08:00
commit 2beb4b89da
14 changed files with 144 additions and 17 deletions

View File

@ -0,0 +1,63 @@
<template>
<div>
<el-link class="detail" :type="col.type || 'success'" @click="dialogVisible=true">{{ iTitle }}</el-link>
<Dialog width="60%" :visible.sync="dialogVisible" :title="dialogTitle" :show-cancel="true" :show-confirm="false" @cancel="onCancel">
<DetailCard :items="detailCardItems" :title="detailTitle" />
</Dialog>
</div>
</template>
<script>
import DetailCard from '@/components/DetailCard'
import Dialog from '@/components/Dialog'
import BaseFormatter from './base'
export default {
name: 'DialogDetailFormatter',
components: {
DetailCard,
Dialog
},
extends: BaseFormatter,
props: {
formatterArgsDefault: {
type: Object,
default() {
return {
getDetailItems({ col, row, cellValue }) {
return []
},
getTitle({ col, row, cellValue }) {
return cellValue
},
getDetailTitle({ col, row, cellValue }) {
return ''
},
getDialogTile({ col, row, cellValue }) {
return cellValue
}
}
}
}
},
data() {
const formatterArgs = Object.assign(this.formatterArgsDefault, this.col.formatterArgs)
return {
formatterArgs: formatterArgs,
iTitle: formatterArgs.getTitle({ col: this.col, row: this.row, cellValue: this.cellValue }),
dialogTitle: formatterArgs.getDialogTile({ col: this.col, row: this.row, cellValue: this.cellValue }),
dialogVisible: false,
detailCardItems: formatterArgs.getDetailItems({ col: this.col, row: this.row, cellValue: this.cellValue }),
detailTitle: formatterArgs.getDetailTitle({ col: this.col, row: this.row, cellValue: this.cellValue })
}
},
methods: {
onCancel() {
this.dialogVisible = false
}
}
}
</script>
<style scoped>
</style>

View File

@ -7,6 +7,7 @@ import DeleteActionFormatter from './DeleteActionFormatter'
import DateFormatter from './DateFormatter'
import SystemUserFormatter from './GrantedSystemUsersShowFormatter'
import ShowKeyFormatter from '@/components/ListTable/formatters/ShowKeyFormatter'
import DialogDetailFormatter from './DialogDetailFormatter'
export default {
DetailFormatter,
@ -17,7 +18,8 @@ export default {
DeleteActionFormatter,
DateFormatter,
SystemUserFormatter,
ShowKeyFormatter
ShowKeyFormatter,
DialogDetailFormatter
}
export {
@ -29,5 +31,6 @@ export {
DeleteActionFormatter,
DateFormatter,
SystemUserFormatter,
ShowKeyFormatter
ShowKeyFormatter,
DialogDetailFormatter
}

View File

@ -650,6 +650,9 @@
"DeleteNode": "删除节点",
"RenameNode": "重命名节点"
},
"audits": {
"View": "查看"
},
"users": {
"SSHKey": "SSH公钥",
"TermsAndConditions": "条款和条件",

View File

@ -272,6 +272,9 @@
"Weekly": "Weekly",
"TimesWeekUnit": "times/week"
},
"audits": {
"View": "查看"
},
"ops": {
"ID": "ID",
"No": "No",

View File

@ -17,7 +17,7 @@ export default {
handleCommand(command) {
switch (command) {
case 'support':
window.open('https://jinshuju.net/f/sQ91MK', '_blank')
window.open('http://www.jumpserver.org/support/', '_blank')
break
default:
window.open('http://docs.jumpserver.org', '_blank')

View File

@ -4,7 +4,7 @@
<script>
import GenericTreeListPage from '@/layout/components/GenericTreeListPage/index'
import { DetailFormatter, ActionsFormatter, SystemUserFormatter } from '@/components/ListTable/formatters'
import { ActionsFormatter, SystemUserFormatter, DialogDetailFormatter } from '@/components/ListTable/formatters'
export default {
components: {
GenericTreeListPage
@ -36,7 +36,36 @@ export default {
{
prop: 'hostname',
label: this.$t('assets.Hostname'),
formatter: DetailFormatter,
formatter: DialogDetailFormatter,
formatterArgs: {
getDialogTile: function({ col, row, cellValue }) {
return this.$t('assets.AssetDetail')
}.bind(this),
getDetailItems: function({ col, row, cellValue }) {
return [
{
key: this.$t('assets.Hostname'),
value: row.hostname
},
{
key: this.$t('assets.ip'),
value: row.ip
},
{
key: this.$t('assets.Protocols'),
value: row.protocols.join(', ')
},
{
key: this.$t('assets.Platform'),
value: row.platform
},
{
key: this.$t('assets.Domain'),
value: row.domain
}
]
}.bind(this)
},
sortable: true,
align: 'center'
},

View File

@ -5,6 +5,7 @@
<script>
import GenericListPage from '@/layout/components/GenericListPage'
import { getDaysAgo } from '@/utils/common'
import { DetailFormatter, DisplayFormatter } from '@/components/ListTable/formatters'
export default {
components: {
@ -12,7 +13,7 @@ export default {
},
data() {
const now = new Date()
const dateFrom = getDaysAgo(1, now)
const dateFrom = getDaysAgo(7, now).toISOString()
const dateTo = now.toISOString()
return {
tableConfig: {
@ -22,12 +23,33 @@ export default {
'is_success', 'date_start'
],
columnsMeta: {
hosts: {
formatter: DetailFormatter,
formatterArgs: {
getTitle: ({ cellValue }) => {
return cellValue.length
}
}
},
user: {
formatter: DisplayFormatter
},
run_as: {
formatter: DisplayFormatter
},
is_finished: {
width: '100px'
},
is_success: {
width: '100px'
},
result: {
width: '80px',
formatter: (row) => {
const label = this.$t('audits.View')
return <el-link Type='success'>{ label }</el-link>
}
},
date_start: {
width: '160px'
}

View File

@ -138,8 +138,8 @@ export default {
this.dialogLicenseImport = true
},
consultAction: function() {
const url = 'https://jinshuju.net/f/sQ91MK'
window.open(url)
const url = 'http://www.jumpserver.org/support/'
window.open(url, '_blank')
},
importLicense() {
if (this.licenseFile['file'] === undefined) {

View File

@ -17,6 +17,10 @@ export default {
[this.$t('common.Others'), ['comment']]
],
url: '/api/v1/xpack/gathered-user/tasks/',
initial: {
is_periodic: true,
interval: null
},
fieldsMeta: {
crontab: {
helpTips: this.$t('common.CrontabHelpTips')

View File

@ -136,7 +136,7 @@ export default {
this.dialogLicenseImport = true
},
consultAction: function() {
const url = 'https://jinshuju.net/f/sQ91MK'
const url = 'http://www.jumpserver.org/support/'
window.open(url)
},
importLicense() {

View File

@ -42,7 +42,7 @@ export default {
}
},
users: {
label: this.$t('xpack.USER'),
label: this.$t('xpack.User'),
el: {
value: [],
ajax: {

View File

@ -1,10 +1,10 @@
<template>
<h1 />
<h2>hello</h2>
</template>
<script>
export default {
name: 'CloudCenter'
name: 'Vault'
}
</script>

View File

@ -32,27 +32,27 @@ export default {
path: '',
component: () => import('@/views/xpack/GatheredUser/GatheredUserList'),
name: 'GatherUserList',
meta: { title: i18n.t('xpack.GatherUserList') }
meta: { title: i18n.t('xpack.GatherUserList'), activeMenu: '/xpack/gathered-users' }
},
{
path: 'gathered-users/tasks',
component: () => import('@/views/xpack/GatheredUser/TaskList'),
name: 'GatherUserTaskList',
meta: { title: i18n.t('xpack.GatherUserTaskList') },
meta: { title: i18n.t('xpack.GatherUserTaskList'), activeMenu: '/xpack/gathered-users' },
hidden: true
},
{
path: 'gathered-users/tasks/create',
component: () => import('@/views/xpack/GatheredUser/TaskCreateUpdate'),
name: 'GatherUserTaskCreate',
meta: { title: i18n.t('xpack.GatherUserTaskCreate') },
meta: { title: i18n.t('xpack.GatherUserTaskCreate'), activeMenu: '/xpack/gathered-users' },
hidden: true
},
{
path: 'gathered-users/tasks/update',
path: 'gathered-users/tasks/:id/update',
component: () => import('@/views/xpack/GatheredUser/TaskCreateUpdate'),
name: 'GatherUserTaskUpdate',
meta: { title: i18n.t('xpack.GatherUserTaskUpdate'), action: 'update' },
meta: { title: i18n.t('xpack.GatherUserTaskUpdate'), action: 'update', activeMenu: '/xpack/gathered-users' },
hidden: true
}
]