mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-28 15:55:24 +00:00
Merge branch 'dev' of github.com:jumpserver/lina into dev
This commit is contained in:
@@ -208,6 +208,8 @@
|
|||||||
"activateSelected": "激活所选",
|
"activateSelected": "激活所选",
|
||||||
"bulkDeleteErrorMsg": "批量删除失败: ",
|
"bulkDeleteErrorMsg": "批量删除失败: ",
|
||||||
"bulkDeleteSuccessMsg": "批量删除成功",
|
"bulkDeleteSuccessMsg": "批量删除成功",
|
||||||
|
"bulkRemoveErrorMsg": "批量移除失败: ",
|
||||||
|
"bulkRemoveSuccessMsg": "批量移除成功",
|
||||||
"createBy": "创建者",
|
"createBy": "创建者",
|
||||||
"createErrorMsg": "创建失败",
|
"createErrorMsg": "创建失败",
|
||||||
"createSuccessMsg": "创建成功",
|
"createSuccessMsg": "创建成功",
|
||||||
@@ -261,7 +263,8 @@
|
|||||||
"updateSuccessMsg": "更新成功",
|
"updateSuccessMsg": "更新成功",
|
||||||
"SelectProperties": "选择属性",
|
"SelectProperties": "选择属性",
|
||||||
"ObjectNotFoundOrDeletedMsg": "没有找到对应资源或者已被删除",
|
"ObjectNotFoundOrDeletedMsg": "没有找到对应资源或者已被删除",
|
||||||
"removeSelected": "移除所选"
|
"removeSelected": "移除所选",
|
||||||
|
"removeWarningMsg": "你确定要移除"
|
||||||
},
|
},
|
||||||
"dashboard": {
|
"dashboard": {
|
||||||
"ActiveAsset": "近期被登录过",
|
"ActiveAsset": "近期被登录过",
|
||||||
|
@@ -209,6 +209,8 @@
|
|||||||
"activateSelected": "Activate selected",
|
"activateSelected": "Activate selected",
|
||||||
"bulkDeleteErrorMsg": "Bulk delete failed: ",
|
"bulkDeleteErrorMsg": "Bulk delete failed: ",
|
||||||
"bulkDeleteSuccessMsg": "Bulk delete success",
|
"bulkDeleteSuccessMsg": "Bulk delete success",
|
||||||
|
"bulkRemoveErrorMsg": "Bulk remove failed: ",
|
||||||
|
"bulkRemoveSuccessMsg": "Bulk remove success",
|
||||||
"createBy": "Create by",
|
"createBy": "Create by",
|
||||||
"createErrorMsg": "Create error",
|
"createErrorMsg": "Create error",
|
||||||
"createSuccessMsg": "Create success",
|
"createSuccessMsg": "Create success",
|
||||||
@@ -261,7 +263,8 @@
|
|||||||
"updateSuccessMsg": "Update success",
|
"updateSuccessMsg": "Update success",
|
||||||
"SelectProperties": "Select properties",
|
"SelectProperties": "Select properties",
|
||||||
"ObjectNotFoundOrDeletedMsg": "Resource lost or deleted",
|
"ObjectNotFoundOrDeletedMsg": "Resource lost or deleted",
|
||||||
"removeSelected": "Remove selected"
|
"removeSelected": "Remove selected",
|
||||||
|
"removeWarningMsg": "Are you sure to remove "
|
||||||
},
|
},
|
||||||
"dashboard": {
|
"dashboard": {
|
||||||
"ActiveAsset": "Asset active",
|
"ActiveAsset": "Asset active",
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<IBox :fa="icon" :type="type" :title="title" v-bind="$attrs">
|
<IBox :fa="icon" :type="type" :title="title" v-bind="$attrs">
|
||||||
<table class="run-info">
|
<table class="run-info">
|
||||||
<tr>
|
<tr v-for="content in contents" :key="content.hostname">
|
||||||
<td>{{ content.hostname }}</td>
|
<td>{{ content.hostname }}</td>
|
||||||
<td>{{ content.result }}</td>
|
<td>{{ content.result }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -26,9 +26,9 @@ export default {
|
|||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: ''
|
||||||
},
|
},
|
||||||
content: {
|
contents: {
|
||||||
type: Object,
|
type: Array,
|
||||||
default: () => ({})
|
default: () => ([])
|
||||||
},
|
},
|
||||||
url: {
|
url: {
|
||||||
type: String,
|
type: String,
|
||||||
|
@@ -4,8 +4,8 @@
|
|||||||
<DetailCard :title="cardTitle" :items="detailCardItems" />
|
<DetailCard :title="cardTitle" :items="detailCardItems" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="10">
|
<el-col :span="10">
|
||||||
<RunInfoCard v-for="config in RunSuccessConfigs" :key="config.host" type="info" v-bind="config" />
|
<RunInfoCard type="danger" style="margin-top: 15px" v-bind="RunFailedConfig" />
|
||||||
<RunInfoCard v-for="config in RunFailedConfigs" :key="config.host" type="danger" style="margin-top: 15px" v-bind="config" />
|
<RunInfoCard type="info" v-bind="RunSuccessConfig" />
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
@@ -29,30 +29,17 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
const last_success = toLastSucessDisplay(this.object.latest_execution)
|
|
||||||
const last_failure = toLastFailureDisplay(this.object.latest_execution)
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
RunSuccessConfigs: last_success.map(host => {
|
RunSuccessConfig: {
|
||||||
return {
|
icon: 'fa-info',
|
||||||
icon: 'fa-info',
|
title: this.$t('ops.lastRunSuccessHosts'),
|
||||||
title: this.$t('ops.lastRunSuccessHosts'),
|
contents: toLastSucessDisplay(this.object.latest_execution)
|
||||||
content: {
|
},
|
||||||
hostname: host,
|
RunFailedConfig: {
|
||||||
result: ''
|
icon: 'fa-info',
|
||||||
}
|
title: this.$t('ops.lastRunFailedHosts'),
|
||||||
}
|
contents: toLastFailureDisplay(this.object.latest_execution)
|
||||||
}),
|
}
|
||||||
RunFailedConfigs: last_failure.map(([host, msg]) => {
|
|
||||||
return {
|
|
||||||
icon: 'fa-info',
|
|
||||||
title: this.$t('ops.lastRunFailedHosts'),
|
|
||||||
content: {
|
|
||||||
hostname: host,
|
|
||||||
result: msg
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@@ -4,8 +4,8 @@
|
|||||||
<DetailCard :title="cardTitle" :items="detailCardItems" />
|
<DetailCard :title="cardTitle" :items="detailCardItems" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="10">
|
<el-col :span="10">
|
||||||
<RunInfoCard v-for="config in RunSuccessConfigs" :key="config.host" type="info" v-bind="config" />
|
<RunInfoCard type="danger" style="margin-top: 15px" v-bind="RunFailedConfig" />
|
||||||
<RunInfoCard v-for="config in RunFailedConfigs" :key="config.host" type="danger" style="margin-top: 15px" v-bind="config" />
|
<RunInfoCard type="info" v-bind="RunSuccessConfig" />
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
@@ -29,30 +29,17 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
const last_success = toLastSucessDisplay(this.object)
|
|
||||||
const last_failure = toLastFailureDisplay(this.object)
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
RunSuccessConfigs: last_success.map(host => {
|
RunSuccessConfig: {
|
||||||
return {
|
icon: 'fa-info',
|
||||||
icon: 'fa-info',
|
title: this.$t('ops.lastRunSuccessHosts'),
|
||||||
title: this.$t('ops.lastRunSuccessHosts'),
|
contents: toLastSucessDisplay(this.object)
|
||||||
content: {
|
},
|
||||||
hostname: host,
|
RunFailedConfig: {
|
||||||
result: ''
|
icon: 'fa-info',
|
||||||
}
|
title: this.$t('ops.lastRunFailedHosts'),
|
||||||
}
|
contents: toLastFailureDisplay(this.object)
|
||||||
}),
|
}
|
||||||
RunFailedConfigs: last_failure.map(([host, msg]) => {
|
|
||||||
return {
|
|
||||||
icon: 'fa-info',
|
|
||||||
title: this.$t('ops.lastRunFailedHosts'),
|
|
||||||
content: {
|
|
||||||
hostname: host,
|
|
||||||
result: msg
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@@ -4,8 +4,8 @@
|
|||||||
<DetailCard :title="cardTitle" :items="detailCardItems" />
|
<DetailCard :title="cardTitle" :items="detailCardItems" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="10">
|
<el-col :span="10">
|
||||||
<RunInfoCard v-for="config in RunSuccessConfigs" :key="config.host" type="info" v-bind="config" />
|
<RunInfoCard type="danger" style="margin-top: 15px" v-bind="RunFailedConfig" />
|
||||||
<RunInfoCard v-for="config in RunFailedConfigs" :key="config.host" type="danger" style="margin-top: 15px" v-bind="config" />
|
<RunInfoCard type="info" v-bind="RunSuccessConfig" />
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
@@ -28,30 +28,17 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
const last_success = toLastSucessDisplay(this.object.latest_execution)
|
|
||||||
const last_failure = toLastFailureDisplay(this.object.latest_execution)
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
RunSuccessConfigs: last_success.map(host => {
|
RunSuccessConfig: {
|
||||||
return {
|
icon: 'fa-info',
|
||||||
icon: 'fa-info',
|
title: this.$t('ops.lastRunSuccessHosts'),
|
||||||
title: this.$t('ops.lastRunSuccessHosts'),
|
contents: toLastSucessDisplay(this.object.latest_execution)
|
||||||
content: {
|
},
|
||||||
hostname: host,
|
RunFailedConfig: {
|
||||||
result: ''
|
icon: 'fa-info',
|
||||||
}
|
title: this.$t('ops.lastRunFailedHosts'),
|
||||||
}
|
contents: toLastFailureDisplay(this.object.latest_execution)
|
||||||
}),
|
},
|
||||||
RunFailedConfigs: last_failure.map(([host, msg]) => {
|
|
||||||
return {
|
|
||||||
icon: 'fa-info',
|
|
||||||
title: this.$t('ops.lastRunFailedHosts'),
|
|
||||||
content: {
|
|
||||||
hostname: host,
|
|
||||||
result: msg
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
taskData: {}
|
taskData: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@@ -1,24 +1,36 @@
|
|||||||
|
|
||||||
export const toLastSucessDisplay = function(object) {
|
export const toLastSucessDisplay = function(object) {
|
||||||
if (!object) return ['']
|
const last_success = object && object.last_success
|
||||||
const last_success = object.last_success
|
|
||||||
last_success.length || last_success.push('')
|
if (!(last_success instanceof Array)) return []
|
||||||
return last_success
|
return last_success.map(host => {
|
||||||
|
return {
|
||||||
|
hostname: host,
|
||||||
|
result: ''
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export const toLastFailureDisplay = function(object) {
|
export const toLastFailureDisplay = function(object) {
|
||||||
if (!object) return [['', '']]
|
const last_failure = object && object.last_failure
|
||||||
const last_failure = []
|
if (!(last_failure instanceof Object)) return []
|
||||||
for (const host in object.last_failure) {
|
|
||||||
const task = object.last_failure[host]
|
const ret = []
|
||||||
|
|
||||||
|
for (const host in last_failure) {
|
||||||
|
const task = last_failure[host]
|
||||||
const msgs = []
|
const msgs = []
|
||||||
for (const name in task) {
|
for (const name in task) {
|
||||||
msgs.push(`${name} => ${task[name].msg}`)
|
msgs.push(`${name} => ${task[name].msg}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
last_failure.push([host, msgs.join('\n')])
|
ret.push(
|
||||||
|
{
|
||||||
|
hostname: host,
|
||||||
|
result: msgs.join('\n')
|
||||||
|
}
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
last_failure.length || last_failure.push(['', ''])
|
return ret
|
||||||
return last_failure
|
|
||||||
}
|
}
|
||||||
|
@@ -197,7 +197,11 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
bulkDeleteCallback({ selectedRows, reloadTable }) {
|
bulkDeleteCallback({ selectedRows, reloadTable }) {
|
||||||
const msg = this.$t('common.deleteWarningMsg') + ' ' + selectedRows.length + ' ' + this.$t('common.rows') + ' ?'
|
let msgPrefix = this.$t('common.deleteWarningMsg')
|
||||||
|
if (!this.currentOrgIsDefault) {
|
||||||
|
msgPrefix = this.$t('common.removeWarningMsg')
|
||||||
|
}
|
||||||
|
const msg = msgPrefix + ' ' + selectedRows.length + ' ' + this.$t('common.rows') + ' ?'
|
||||||
const title = this.$t('common.Info')
|
const title = this.$t('common.Info')
|
||||||
const performDelete = this.performBulkDelete
|
const performDelete = this.performBulkDelete
|
||||||
this.$alert(msg, title, {
|
this.$alert(msg, title, {
|
||||||
@@ -211,9 +215,17 @@ export default {
|
|||||||
await performDelete(selectedRows)
|
await performDelete(selectedRows)
|
||||||
done()
|
done()
|
||||||
reloadTable()
|
reloadTable()
|
||||||
this.$message.success(this.$t('common.bulkDeleteSuccessMsg'))
|
let successMsg = this.$t('common.bulkDeleteSuccessMsg')
|
||||||
|
if (!this.currentOrgIsDefault) {
|
||||||
|
successMsg = this.$t('common.bulkRemoveSuccessMsg')
|
||||||
|
}
|
||||||
|
this.$message.success(successMsg)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.$message.error(this.$t('common.bulkDeleteErrorMsg') + error)
|
let errorMsg = this.$t('common.bulkDeleteErrorMsg')
|
||||||
|
if (!this.currentOrgIsDefault) {
|
||||||
|
errorMsg = this.$t('common.bulkRemoveErrorMsg')
|
||||||
|
}
|
||||||
|
this.$message.error(errorMsg + error)
|
||||||
} finally {
|
} finally {
|
||||||
instance.confirmButtonLoading = false
|
instance.confirmButtonLoading = false
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user