mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-23 20:17:54 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -3,7 +3,7 @@ export default {
|
|||||||
name: 'ItemValue',
|
name: 'ItemValue',
|
||||||
props: {
|
props: {
|
||||||
value: {
|
value: {
|
||||||
type: [String, Function, Array],
|
type: [String, Function, Array, Object],
|
||||||
default: ''
|
default: ''
|
||||||
},
|
},
|
||||||
item: {
|
item: {
|
||||||
|
@@ -773,6 +773,16 @@
|
|||||||
"LicenseDetail": "许可证详情",
|
"LicenseDetail": "许可证详情",
|
||||||
"ImportLicense": "导入许可证",
|
"ImportLicense": "导入许可证",
|
||||||
"LicenseFile": "许可证文件",
|
"LicenseFile": "许可证文件",
|
||||||
"ImportLicenseTip": "请导入许可证"
|
"ImportLicenseTip": "请导入许可证",
|
||||||
|
"logoLogoutTip": "提示:将会显示在企业版用户退出页面(建议图片大小为:82px*82px)",
|
||||||
|
"logoIndexTip": "提示:将会显示在管理页面左上方(建议图片大小为: 185px*55px)",
|
||||||
|
"faviconTip": "提示:网站图标(建议图片大小为: 16px*16px)",
|
||||||
|
"loginImageTip": "提示:将会显示在企业版用户登录页面(建议图片大小为: 492*472px)",
|
||||||
|
"loginTitleTip": "提示:将会显示在企业版用户登录页面(eg: 欢迎使用JumpServer开源堡垒机)",
|
||||||
|
"restoreDialogTitle": "你确认吗",
|
||||||
|
"restoreDialogMessage": "您确定要恢复默认初始化吗?",
|
||||||
|
"import": "导入",
|
||||||
|
"technologyConsult": "技术咨询",
|
||||||
|
"consult": "咨询"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -9,11 +9,13 @@
|
|||||||
<script>
|
<script>
|
||||||
import { GenericDetailPage, TabPage } from '@/layout/components'
|
import { GenericDetailPage, TabPage } from '@/layout/components'
|
||||||
import HistoryExecutionDetail from './HistoryExecutionDetail'
|
import HistoryExecutionDetail from './HistoryExecutionDetail'
|
||||||
|
import CeleryTaskLog from '../../CeleryTaskLog'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
HistoryExecutionDetail,
|
HistoryExecutionDetail,
|
||||||
GenericDetailPage,
|
GenericDetailPage,
|
||||||
|
CeleryTaskLog,
|
||||||
TabPage
|
TabPage
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -29,7 +31,7 @@ export default {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: this.$t('jobcenter.output'),
|
title: this.$t('jobcenter.output'),
|
||||||
name: 'OutPut'
|
name: 'CeleryTaskLog'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
hasRightSide: false,
|
hasRightSide: false,
|
||||||
|
@@ -72,9 +72,10 @@ export default {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: this.$t('jobcenter.latestVersion'),
|
key: this.$t('jobcenter.latestVersion'),
|
||||||
value: this.object.latest_execution.adhoc_short_id,
|
value: this.object.latest_execution,
|
||||||
callback: function(row, data) {
|
callback: function(row, data) {
|
||||||
return <a href=''>{ data }</a>
|
const url = `/ops/adhoc/${data.adhoc}`
|
||||||
|
return <a href={ url }>{ data.adhoc_short_id }</a>
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@@ -11,9 +11,11 @@ import { GenericDetailPage, TabPage } from '@/layout/components'
|
|||||||
import TaskDetail from './TaskDetail'
|
import TaskDetail from './TaskDetail'
|
||||||
import TaskHistory from './TaskHistory'
|
import TaskHistory from './TaskHistory'
|
||||||
import TaskAdhoc from './TaskAdhoc'
|
import TaskAdhoc from './TaskAdhoc'
|
||||||
|
import CeleryTaskLog from '../CeleryTaskLog'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
GenericDetailPage,
|
GenericDetailPage,
|
||||||
|
CeleryTaskLog,
|
||||||
TaskHistory,
|
TaskHistory,
|
||||||
TaskDetail,
|
TaskDetail,
|
||||||
TaskAdhoc,
|
TaskAdhoc,
|
||||||
@@ -39,7 +41,7 @@ export default {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: this.$t('jobcenter.laskExecutionOutput'),
|
title: this.$t('jobcenter.laskExecutionOutput'),
|
||||||
name: 'laskExecutionOutput'
|
name: 'CeleryTaskLog'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
hasRightSide: false
|
hasRightSide: false
|
||||||
|
@@ -50,7 +50,7 @@ export default {
|
|||||||
fieldsMeta: {
|
fieldsMeta: {
|
||||||
login_title: {
|
login_title: {
|
||||||
label: this.$t('xpack.loginTitle'),
|
label: this.$t('xpack.loginTitle'),
|
||||||
helpText: '提示:将会显示在企业版用户登录页面(eg: 欢迎使用JumpServer开源堡垒机)'
|
helpText: this.$t('xpack.loginTitleTip')
|
||||||
},
|
},
|
||||||
login_image: {
|
login_image: {
|
||||||
component: UploadField,
|
component: UploadField,
|
||||||
@@ -58,7 +58,7 @@ export default {
|
|||||||
el: {
|
el: {
|
||||||
width: '10%',
|
width: '10%',
|
||||||
height: '10%',
|
height: '10%',
|
||||||
tip: '提示:将会显示在企业版用户登录页面(建议图片大小为: 492*472px)'
|
tip: this.$t('xpack.loginImageTip')
|
||||||
},
|
},
|
||||||
on: {
|
on: {
|
||||||
fileChange: ([value], updateForm) => {
|
fileChange: ([value], updateForm) => {
|
||||||
@@ -73,7 +73,7 @@ export default {
|
|||||||
el: {
|
el: {
|
||||||
width: '5%',
|
width: '5%',
|
||||||
height: '5%',
|
height: '5%',
|
||||||
tip: '提示:网站图标(建议图片大小为: 16px*16px)'
|
tip: this.$t('xpack.faviconTip')
|
||||||
},
|
},
|
||||||
on: {
|
on: {
|
||||||
fileChange: ([value], updateForm) => {
|
fileChange: ([value], updateForm) => {
|
||||||
@@ -87,7 +87,7 @@ export default {
|
|||||||
el: {
|
el: {
|
||||||
width: '10%',
|
width: '10%',
|
||||||
height: '10%',
|
height: '10%',
|
||||||
tip: '提示:将会显示在管理页面左上方(建议图片大小为: 185px*55px)'
|
tip: this.$t('xpack.logoIndexTip')
|
||||||
},
|
},
|
||||||
on: {
|
on: {
|
||||||
fileChange: ([value], updateForm) => {
|
fileChange: ([value], updateForm) => {
|
||||||
@@ -101,7 +101,7 @@ export default {
|
|||||||
el: {
|
el: {
|
||||||
width: '5%',
|
width: '5%',
|
||||||
height: '5%',
|
height: '5%',
|
||||||
tip: '提示:将会显示在企业版用户退出页面(建议图片大小为:82px*82px)'
|
tip: this.$t('xpack.logoLogoutTip')
|
||||||
},
|
},
|
||||||
on: {
|
on: {
|
||||||
fileChange: ([value], updateForm) => {
|
fileChange: ([value], updateForm) => {
|
||||||
@@ -115,11 +115,12 @@ export default {
|
|||||||
{
|
{
|
||||||
title: this.$t('xpack.RestoreButton'),
|
title: this.$t('xpack.RestoreButton'),
|
||||||
callback: function(value, form) {
|
callback: function(value, form) {
|
||||||
this.$confirm('您确定要恢复默认初始化吗?', '你确认吗?', {
|
this.$confirm(this.$t('xpack.restoreDialogMessage'),
|
||||||
confirmButtonText: '确定',
|
this.$t('xpack.restoreDialogTitle'), {
|
||||||
cancelButtonText: '取消',
|
confirmButtonText: this.$t('common.Confirm'),
|
||||||
type: 'warning'
|
cancelButtonText: this.$t('common.Cancel'),
|
||||||
}).then(() => {
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
restoreInterface().then(res => {
|
restoreInterface().then(res => {
|
||||||
this.$message.success(res.success)
|
this.$message.success(res.success)
|
||||||
location.reload()
|
location.reload()
|
||||||
|
@@ -10,26 +10,7 @@
|
|||||||
<DetailCard :title="cardTitle" :items="detailItems" />
|
<DetailCard :title="cardTitle" :items="detailItems" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="10">
|
<el-col :span="10">
|
||||||
<el-card class="box-card primary">
|
<QuickActions type="primary" :actions="quickActions" />
|
||||||
<div slot="header" class="clearfix">
|
|
||||||
<i class="fa fa-info" />
|
|
||||||
<span>{{ cardActions }}</span>
|
|
||||||
</div>
|
|
||||||
<el-table class="el-table" :data="cardActionData" :show-header="false">
|
|
||||||
<el-table-column prop="name" />
|
|
||||||
<el-table-column prop="button" align="right">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
size="mini"
|
|
||||||
@click="handleButtonAction(scope.$index, scope.row)"
|
|
||||||
>
|
|
||||||
{{ scope.row.button }}
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
</el-card>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
@@ -51,6 +32,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { GenericDetailPage } from '@/layout/components'
|
import { GenericDetailPage } from '@/layout/components'
|
||||||
|
import { QuickActions } from '@/components'
|
||||||
import DetailCard from '@/components/DetailCard/index'
|
import DetailCard from '@/components/DetailCard/index'
|
||||||
import { importLicense } from '@/views/xpack/api'
|
import { importLicense } from '@/views/xpack/api'
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
@@ -59,7 +41,8 @@ export default {
|
|||||||
name: 'License',
|
name: 'License',
|
||||||
components: {
|
components: {
|
||||||
GenericDetailPage,
|
GenericDetailPage,
|
||||||
DetailCard
|
DetailCard,
|
||||||
|
QuickActions
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -79,7 +62,30 @@ export default {
|
|||||||
actions: {
|
actions: {
|
||||||
detailApiUrl: '/api/v1/xpack/license/detail'
|
detailApiUrl: '/api/v1/xpack/license/detail'
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
quickActions: [
|
||||||
|
{
|
||||||
|
title: this.$t('xpack.ImportLicense'),
|
||||||
|
attrs: {
|
||||||
|
type: 'primary',
|
||||||
|
label: this.$t('xpack.import')
|
||||||
|
},
|
||||||
|
callbacks: {
|
||||||
|
click: this.importAction
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: this.$t('xpack.technologyConsult'),
|
||||||
|
attrs: {
|
||||||
|
type: 'primary',
|
||||||
|
label: this.$t('xpack.consult')
|
||||||
|
},
|
||||||
|
callbacks: {
|
||||||
|
click: this.consultAction
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -92,23 +98,6 @@ export default {
|
|||||||
cardTitle() {
|
cardTitle() {
|
||||||
return ''
|
return ''
|
||||||
},
|
},
|
||||||
cardActions() {
|
|
||||||
return this.$t('sessions.quickModify')
|
|
||||||
},
|
|
||||||
cardActionData() {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
name: '导入许可证',
|
|
||||||
button: '导入',
|
|
||||||
value: 'import'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '技术咨询',
|
|
||||||
button: '咨询',
|
|
||||||
value: 'consult'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
detailItems() {
|
detailItems() {
|
||||||
if (!this.publicSettings.XPACK_LICENSE_IS_VALID) {
|
if (!this.publicSettings.XPACK_LICENSE_IS_VALID) {
|
||||||
return [
|
return [
|
||||||
@@ -143,18 +132,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleButtonAction: function(index, row) {
|
|
||||||
switch (row.value) {
|
|
||||||
case 'import':
|
|
||||||
this.importAction()
|
|
||||||
break
|
|
||||||
case 'consult':
|
|
||||||
this.consultAction()
|
|
||||||
break
|
|
||||||
default:
|
|
||||||
console.log('No Match button action: ' + row.value)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
importAction: function() {
|
importAction: function() {
|
||||||
this.dialogLicenseImport = true
|
this.dialogLicenseImport = true
|
||||||
},
|
},
|
||||||
|
@@ -1,38 +0,0 @@
|
|||||||
<template>
|
|
||||||
<el-popover
|
|
||||||
placement="bottom"
|
|
||||||
trigger="click"
|
|
||||||
>
|
|
||||||
<span v-for="item in getCellValue" :key="item">{{ item }} <br></span>
|
|
||||||
<el-button slot="reference" type="text">{{ getCellValueLength }}</el-button>
|
|
||||||
</el-popover>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import BaseFormatter from '@/components/ListTable/formatters/base'
|
|
||||||
export default {
|
|
||||||
name: 'LengthFormatter',
|
|
||||||
extends: BaseFormatter,
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
visible: false,
|
|
||||||
dataContent: this.cellValue
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
getCellValueLength() {
|
|
||||||
if (this.cellValue instanceof Array) {
|
|
||||||
return this.cellValue.length
|
|
||||||
}
|
|
||||||
return this.cellValue
|
|
||||||
},
|
|
||||||
getCellValue() {
|
|
||||||
return this.cellValue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
|
|
||||||
</style>
|
|
@@ -45,8 +45,9 @@ export default {
|
|||||||
performAdd: (items) => {
|
performAdd: (items) => {
|
||||||
const objectId = this.object.id
|
const objectId = this.object.id
|
||||||
const relationUrl = `/api/v1/orgs/orgs/${objectId}/`
|
const relationUrl = `/api/v1/orgs/orgs/${objectId}/`
|
||||||
const usersId = items.map(v => v.value)
|
const objectRelationUsers = this.object.users
|
||||||
const data = { users: usersId }
|
items.map(v => objectRelationUsers.push(v.value))
|
||||||
|
const data = { users: objectRelationUsers }
|
||||||
return this.$axios.patch(relationUrl, data)
|
return this.$axios.patch(relationUrl, data)
|
||||||
},
|
},
|
||||||
performDelete: (item) => {
|
performDelete: (item) => {
|
||||||
@@ -72,20 +73,21 @@ export default {
|
|||||||
return { results: results, pagination: more, total: data.count }
|
return { results: results, pagination: more, total: data.count }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
hasObjectsId: this.object.admin_users,
|
hasObjectsId: this.object.admins,
|
||||||
performAdd: (items) => {
|
performAdd: (items) => {
|
||||||
const objectId = this.object.id
|
const objectId = this.object.id
|
||||||
const relationUrl = `/api/v1/orgs/orgs/${objectId}/`
|
const relationUrl = `/api/v1/orgs/orgs/${objectId}/`
|
||||||
const adminUsersId = items.map(v => v.value)
|
const objectRelationAdmin = this.object.admins
|
||||||
const data = { admin_users: adminUsersId }
|
items.map(v => objectRelationAdmin.push(v.value))
|
||||||
|
const data = { admins: objectRelationAdmin }
|
||||||
return this.$axios.patch(relationUrl, data)
|
return this.$axios.patch(relationUrl, data)
|
||||||
},
|
},
|
||||||
performDelete: (item) => {
|
performDelete: (item) => {
|
||||||
const objectId = this.object.id
|
const objectId = this.object.id
|
||||||
const relationUrl = `/api/v1/orgs/orgs/${objectId}/`
|
const relationUrl = `/api/v1/orgs/orgs/${objectId}/`
|
||||||
const objectOldRelationAdminUsers = this.object.admin_users
|
const objectOldRelationAdmin = this.object.admins
|
||||||
const objectNewRelationAdminUsers = objectOldRelationAdminUsers.filter(v => v !== item.value)
|
const objectNewRelationAdmin = objectOldRelationAdmin.filter(v => v !== item.value)
|
||||||
const data = { system_users: objectNewRelationAdminUsers }
|
const data = { admins: objectNewRelationAdmin }
|
||||||
return this.$axios.patch(relationUrl, data)
|
return this.$axios.patch(relationUrl, data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { GenericListPage } from '@/layout/components'
|
import { GenericListPage } from '@/layout/components'
|
||||||
import OrgFieldsFormatter from './OrgFieldsFormatter'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@@ -14,53 +13,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
tableConfig: {
|
tableConfig: {
|
||||||
url: '/api/v1/orgs/orgs/',
|
url: '/api/v1/orgs/orgs/',
|
||||||
columns: [
|
columns: ['name', 'comment', 'actions']
|
||||||
'name', 'admins', 'auditors', 'users', 'user_groups', 'assets', 'domains',
|
|
||||||
'admin_users', 'system_users', 'labels', 'perms', 'comment', 'actions'
|
|
||||||
],
|
|
||||||
columnsMeta: {
|
|
||||||
admins: {
|
|
||||||
label: this.$t('xpack.Admin'),
|
|
||||||
formatter: OrgFieldsFormatter
|
|
||||||
},
|
|
||||||
auditors: {
|
|
||||||
label: this.$t('xpack.Auditor'),
|
|
||||||
formatter: OrgFieldsFormatter
|
|
||||||
},
|
|
||||||
users: {
|
|
||||||
label: this.$t('xpack.User'),
|
|
||||||
formatter: OrgFieldsFormatter
|
|
||||||
},
|
|
||||||
user_groups: {
|
|
||||||
label: this.$t('xpack.UserGroup'),
|
|
||||||
formatter: OrgFieldsFormatter
|
|
||||||
},
|
|
||||||
assets: {
|
|
||||||
label: this.$t('xpack.Asset'),
|
|
||||||
formatter: OrgFieldsFormatter
|
|
||||||
},
|
|
||||||
domains: {
|
|
||||||
label: this.$t('xpack.Domain'),
|
|
||||||
formatter: OrgFieldsFormatter
|
|
||||||
},
|
|
||||||
admin_users: {
|
|
||||||
label: this.$t('xpack.AdminUser'),
|
|
||||||
formatter: OrgFieldsFormatter
|
|
||||||
},
|
|
||||||
system_users: {
|
|
||||||
label: this.$t('xpack.SystemUser'),
|
|
||||||
formatter: OrgFieldsFormatter
|
|
||||||
},
|
|
||||||
labels: {
|
|
||||||
label: this.$t('xpack.Admin'),
|
|
||||||
formatter: OrgFieldsFormatter
|
|
||||||
},
|
|
||||||
perms: {
|
|
||||||
label: this.$t('xpack.Label'),
|
|
||||||
formatter: OrgFieldsFormatter
|
|
||||||
}
|
|
||||||
},
|
|
||||||
detailRoute: 'OrganizationDetail'
|
|
||||||
},
|
},
|
||||||
headerActions: {
|
headerActions: {
|
||||||
hasExport: false,
|
hasExport: false,
|
||||||
|
Reference in New Issue
Block a user