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

This commit is contained in:
Bai
2020-06-16 14:58:59 +08:00
7 changed files with 43 additions and 15 deletions

View File

@@ -8,8 +8,13 @@ export default {
name: 'DateFormatter',
extends: BaseFormatter,
data() {
const dt = new Date(this.cellValue)
const value = this.$d(dt, 'medium')
let value
if (this.cellValue) {
const dt = new Date(this.cellValue)
value = this.$d(dt, 'medium')
} else {
value = ''
}
// const locale = this.$i18n.locale
// const value = dt.toLocaleString(locale, { hourCycle: 'h23' })
// console.log(this.$i18n.locale)

View File

@@ -543,7 +543,8 @@
"user": "用户",
"riskLevels": {
"common": "普通"
}
},
"Monitor": "监控"
},
"setting": {
"ApiKeyList": "API Key 列表",

View File

@@ -543,7 +543,8 @@
"user": "Use",
"riskLevels": {
"common": "common"
}
},
"Monitor": "Monitor"
},
"setting": {
"ApiKeyList": "Api key list",

View File

@@ -43,14 +43,27 @@ export default {
return <router-link {...{ attrs: route }}>{ label }</router-link>
}
},
user: {
showOverflowTooltip: true
},
asset: {
showOverflowTooltip: true
},
command_amount: {
label: this.$t('sessions.command')
label: this.$t('sessions.command'),
width: '60px'
},
login_from: {
label: this.$t('sessions.loginFrom')
label: this.$t('sessions.loginFrom'),
width: '110px'
},
remote_addr: {
width: '130px'
},
protocol: {
label: this.$t('sessions.protocol'),
width: '60px',
sortable: false,
formatter: null
},
date_start: {
@@ -62,7 +75,8 @@ export default {
label: this.$t('sessions.duration'),
formatter: function(row) {
return timeOffset(row.date_start, row.date_end)
}
},
width: '80px'
},
actions: {
prop: 'id',

View File

@@ -31,7 +31,7 @@ export default {
},
{
name: 'join',
title: this.$t('sessions.join'),
title: this.$t('sessions.Monitor'),
type: 'primary',
can: (row, cellValue) => {
return row.can_join

View File

@@ -2,7 +2,7 @@
<ListTable :table-config="tableConfig" :header-actions="headerActions" />
</template>
<script>
<script type="text/jsx">
import ListTable from '@/components/ListTable'
export default {
@@ -14,7 +14,7 @@ export default {
tableConfig: {
url: '/api/v1/xpack/cloud/accounts/',
columns: [
'name', 'get_provider_display', 'get_validity_display', 'date_created', 'comment', 'actions'
'name', 'provider', 'validity', 'date_created', 'comment', 'actions'
],
columnsMeta: {
name: {
@@ -24,6 +24,16 @@ export default {
formatterArgs: {
updateRoute: 'AccountUpdate'
}
},
validity: {
formatter: (row, col, cellValue) => {
const display = row.validity_display
if (cellValue) {
return display
} else {
return <span class='text-danger'>{ display }</span>
}
}
}
}
},

View File

@@ -30,10 +30,8 @@ export default {
name: 'execute',
type: 'info',
callback: function(data) {
this.$axios.get(
`/api/v1/xpack/cloud/sync-instance-tasks/${data.row.id}/run/`
).then(res => {
}).catch(res => {
this.$axios.get(`/api/v1/xpack/cloud/sync-instance-tasks/${data.row.id}/run/`).then(res => {
window.open(`/#/ops/celery/task/${res.task}/log/`, '', 'width=900,height=600')
})
}
}
@@ -48,7 +46,6 @@ export default {
headerActions: {
hasBulkDelete: false,
hasImport: false,
hasRefresh: false,
hasExport: false,
createRoute: 'SyncInstanceTaskCreate'
}