Compare commits

..

1 Commits

Author SHA1 Message Date
zhaojisen
cf094cbb88 perf:Optimize the execution efficiency of all and reverse selection 2024-12-05 12:47:05 +08:00
38 changed files with 1940 additions and 2165 deletions

1
GITSHA
View File

@@ -1 +0,0 @@
81b3c79ac15dd02e31090e2bee138fbeca56799d

View File

@@ -72,6 +72,7 @@
"vue-i18n": "^8.15.5",
"vue-json-editor": "^1.4.3",
"vue-markdown": "^2.2.4",
"vue-moment": "^4.1.0",
"vue-password-strength-meter": "^1.7.2",
"vue-router": "3.0.6",
"vue-select": "^3.9.5",

View File

@@ -3,7 +3,7 @@
<table style="width: 100%">
<tr>
<td colspan="2">
<AssetSelect ref="assetSelect" :can-select="canSelect" :disabled="disabled" :tree-setting="treeSetting" />
<AssetSelect ref="assetSelect" :can-select="canSelect" :disabled="disabled" />
</td>
</tr>
<tr>
@@ -59,10 +59,6 @@ export default {
default(row, index) {
return true
}
},
treeSetting: {
type: Object,
default: () => {}
}
},
data() {

View File

@@ -108,11 +108,6 @@ export default {
url: this.typeUrl,
nodeUrl: this.treeSetting?.nodeUrl || this.nodeUrl,
treeUrl: `${this.typeUrl}?assets=${showAssets ? '1' : '0'}&count_resource=${this.treeSetting.countResource || 'asset'}`,
edit: {
drag: {
isMove: false
}
},
callback: {
onSelected: (event, treeNode) => this.getAssetsUrl(treeNode)
}

View File

@@ -51,11 +51,6 @@ export default {
url: this.tableUrl,
// ?assets=0不显示资产. =1显示资产
treeUrl: this.treeUrl,
edit: {
drag: {
isMove: false
}
},
callback: {
onSelected: (event, node) => vm.onSelected(node, vm),
refresh: vm.refreshObjectAssetPermission

View File

@@ -78,7 +78,7 @@ export default {
formatterData = data
}
return (
<span style={{ whiteSpace: 'pre-wrap', wordBreak: 'break-word', lineHeight: '1.2' }}>{formatterData}</span>
<span>{formatterData}</span>
)
}
if (this.value instanceof Array) {

View File

@@ -13,28 +13,15 @@ class StrategyAbstract {
this.onSelect = this.onSelect.bind(this)
this.onSelectAll = this.onSelectAll.bind(this)
}
get elTable() {
return this.elDataTable.$refs.table
}
onSelectionChange() {
}
onSelect() {
}
onSelectAll() {
}
toggleRowSelection() {
}
clearSelection() {
}
updateElTableSelection() {
}
onSelectionChange() {}
onSelect() {}
onSelectAll() {}
toggleRowSelection() {}
clearSelection() {}
updateElTableSelection() {}
}
/**
@@ -56,7 +43,7 @@ class StrategyNormal extends StrategyAbstract {
}
clearSelection() {
return this.elTable?.clearSelection()
return this.elTable.clearSelection()
}
}
@@ -65,12 +52,12 @@ class StrategyNormal extends StrategyAbstract {
*/
class StrategyPersistSelection extends StrategyAbstract {
/**
* el-tableselection-change事件不适用于开启跨页保存的情况。
* 比如当开启persistSelection时发生以下两个场景
* el-tableselection-change 事件不适用于开启跨页保存的情况。
* 比如,当开启 persistSelection时发生以下两个场景
* 1. 用户点击翻页
* 2. 用户点击行首的切换全选项按钮,清空当前页多选项数据
* 其中场景1应该保持selected不变而场景2只应该从selected移除当前页所有行保留其他页面的多选状态。
* 但el-tableselection-change事件在两个场景中无差别发生所以这里不处理这个事件
* 其中场景 1 应该保持 selected 不变;而场景 2 只应该从 selected 移除当前页所有行,保留其他页面的多选状态。
* 但 el-tableselection-change 事件在两个场景中无差别发生,所以这里不处理这个事件
*/
/**
@@ -78,60 +65,66 @@ class StrategyPersistSelection extends StrategyAbstract {
*/
onSelect(selection, row) {
const isChosen = selection.indexOf(row) > -1
this.toggleRowSelection(row, isChosen)
}
/**
* 用户切换当前页的多选
*/
onSelectAll(selection, selectable = () => true) {
const { id, selected, data } = this.elDataTable
const selectableRows = data.filter(selectable)
// const isSelected = !!selection.length
// 创建已选择项的 id 集合,用于快速查找
const selectedIds = new Set(selected.map(r => r[id]))
const currentPageIds = new Set(selectableRows.map(row => row[id]))
// 前页面的选中状态
const currentPageSelectedCount = selectableRows.filter(row =>
selectedIds.has(row[id])
).length
// 获取当前所有已选择的项
const selectedRows = data.filter(r => selection.includes(r))
// 判断是全选还是取消全选
const shouldSelectAll = currentPageSelectedCount < selectableRows.length
// 判断是否已全选
const isSelected = data.every(r => selectable(r) && selectedRows.includes(r))
this.elTable?.clearSelection()
const rowsToSelect = []
const rowsToDeselect = []
if (shouldSelectAll) {
selectableRows.forEach(row => {
if (!selectedIds.has(row[id])) selected.push(row)
data.forEach(r => {
if (selectable(r)) {
const isRowSelected = selectedIds.has(r[id])
this.elTable.toggleRowSelection(row, true)
if (isSelected && !isRowSelected) {
rowsToSelect.push(r)
} else if (!isSelected && isRowSelected) {
rowsToDeselect.push(r)
}
}
})
// ! 这里需要触发事件,否则在 el-table 中无法触发 selection-change 事件
this.elDataTable.$emit('toggle-row-selection', true, row)
if (isSelected) {
rowsToSelect.forEach(row => {
selected.push(row)
selectedIds.add(row[id])
})
rowsToDeselect.forEach(row => {
this.elDataTable.toggleRowSelection(row, true)
})
} else {
const newSelected = []
selected.forEach(row => {
if (!currentPageIds.has(row[id])) {
newSelected.push(row)
} else {
this.elDataTable.$emit('toggle-row-selection', false, row)
rowsToDeselect.forEach(row => {
const index = selected.findIndex(item => item[id] === row[id])
if (index !== -1) {
selected.splice(index, 1)
}
selectedIds.delete(row[id])
})
rowsToSelect.forEach(row => {
this.elDataTable.toggleRowSelection(row, false)
})
this.elDataTable.selected = newSelected
}
this.elDataTable.$emit('selection-change', this.elDataTable.selected)
// this.elTable.selected = Array.from(selectedIds).map(id => {
// return data.find(r => r[id] === id)
// })
}
/**
* toggleRowSelectionclearSelection管理elDataTableselected数组
* 记得最后要将状态同步到el-table中
* toggleRowSelectionclearSelection 管理 elDataTableselected 数组
* 记得最后要将状态同步到 el-table
*/
toggleRowSelection(row, isSelected) {
const { id, selected } = this.elDataTable
@@ -161,17 +154,18 @@ class StrategyPersistSelection extends StrategyAbstract {
*/
updateElTableSelection() {
const { data, id, selected } = this.elDataTable
const selectedIds = new Set(selected.map(r => r[id]))
this.elTable?.clearSelection()
// 历史勾选的行已经不在当前页了所以要将当前页的行数据和selected合并
const mergeData = _.uniqWith([...data, ...selected], _.isEqual)
data.forEach(row => {
const shouldBeSelected = selectedIds.has(row[id])
if (!this.elTable) return
mergeData.forEach(r => {
const isSelected = !!selected.find(r2 => r[id] === r2[id])
if (shouldBeSelected) {
this.elTable.toggleRowSelection(row, true)
if (!this.elTable) {
return
}
this.elTable.toggleRowSelection(r, isSelected)
})
}
}

View File

@@ -122,13 +122,8 @@ export default {
})
},
iExportOptions() {
// const options = assignIfNot(this.exportOptions, { url: this.tableUrl })
// return options
return {
url: this.tableUrl,
...this.exportOptions
}
const options = assignIfNot(this.exportOptions, { url: this.tableUrl })
return options
}
},
methods: {

View File

@@ -9,7 +9,7 @@
class="text edit-input"
@blur="onEditBlur"
/>
<span class="action">
<span v-if="realValue" class="action">
<template v-for="(item, index) in iActions">
<el-tooltip
v-if="item.has"

View File

@@ -157,7 +157,7 @@ export default {
</a>`
const treeActions = `${showSearch ? searchIcon : ''}${showRefresh ? refreshIcon : ''}`
const icons = `
<span>
<span style="float: right; margin-right: 10px">
${treeActions}
</span>`
if (rootNode) {

View File

@@ -39,7 +39,7 @@ export default {
showRenameBtn: false,
drag: {
isCopy: false,
isMove: !this.$store.getters.currentOrgIsRoot
isMove: true
}
},
callback: {

View File

@@ -54,24 +54,24 @@ export default {
resizeObserver: null,
span: 12,
isShow: true,
iValue: this.sanitizeContent(this.value)
iValue: this.value
}
},
computed: {
sanitizedValue() {
const content = this.iValue.replace(/\\/g, '\\\\').replace(/\$/g, '\\$')
// 转义特殊字符
let content = this.iValue.replace(/\\/g, '\\\\').replace(/\$/g, '\\$')
return this.sanitizeContent(content)
}
},
watch: {
value(newVal) {
this.iValue = this.sanitizeContent(newVal)
// 使用 DOMPurify 进行 XSS 过滤
content = DOMPurify.sanitize(content)
return content
}
},
mounted() {
this.$nextTick(() => {
this.resizeObserver = new ResizeObserver(entries => {
// 监听高度变化
const height = entries[0].target.offsetHeight
if (height) {
this.height = height
@@ -91,19 +91,8 @@ export default {
this.resizeObserver = null
},
methods: {
sanitizeContent(content) {
if (!content) return ''
return DOMPurify.sanitize(content, {
ALLOWED_TAGS: ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'ul', 'ol', 'li', 'strong', 'em', 'code', 'pre', 'blockquote', 'a'],
FORBID_TAGS: ['script', 'style', 'iframe', 'frame', 'object', 'embed'],
FORBID_ATTR: ['onerror', 'onload', 'onclick', 'onmouseover']
})
},
onChange() {
const sanitizedValue = this.sanitizeContent(this.iValue)
this.iValue = sanitizedValue
this.$emit('change', sanitizedValue)
this.$emit('change', this.iValue)
},
onView() {
this.isShow = !this.isShow

View File

@@ -81,7 +81,7 @@ export default {
},
{
label: this.$t('common.Version'),
value: 'v3.10.19'
value: 'version-dev'
},
{
label: this.$t('common.PermissionCompany'),

View File

@@ -74,11 +74,9 @@ export default {
},
async logout() {
const currentOrg = this.$store.getters.currentOrg
if (currentOrg.autoEnter || currentOrg.is_system) {
if (currentOrg.autoEnter) {
await this.$store.dispatch('users/setCurrentOrg', this.$store.getters.preOrg)
}
window.location.href = `${process.env.VUE_APP_LOGOUT_PATH}?next=${this.$route.fullPath}`
}
}

View File

@@ -24,8 +24,6 @@ import { message } from '@/utils/message'
import xss from '@/utils/xss'
import request from '@/utils/request'
import ElTableTooltipPatch from '@/utils/elTableTooltipPatch.js'
import moment from 'moment'
moment.locale('zh-cn')
/**
* If you don't want to use mock-server
@@ -52,7 +50,11 @@ Vue.config.productionTip = false
Vue.use(VueCookie)
window.$cookie = VueCookie
Vue.prototype.$moment = moment
const moment = require('moment')
require('moment/locale/zh-cn')
Vue.use(require('vue-moment'), {
moment
})
Vue.use(VueLogger, loggerOptions)

View File

@@ -71,12 +71,10 @@ const mutations = {
state.consoleOrgs = state.consoleOrgs.filter(i => i.id !== org.id)
},
SET_CURRENT_ORG(state, org) {
// 系统组织不设置成 Pre org
const currentOrg = state.currentOrg
if (currentOrg && !currentOrg.autoEnter && !currentOrg.is_system) {
state.preOrg = currentOrg
setPreOrgLocal(state.username, currentOrg)
// 系统组织和全局组织不设置成 Pre org
if (!state.currentOrg?.autoEnter && !state.currentOrg?.is_root) {
state.preOrg = state.currentOrg
setPreOrgLocal(state.username, state.currentOrg)
}
state.currentOrg = org
saveCurrentOrgLocal(state.username, org)
@@ -146,7 +144,6 @@ const actions = {
const systemOrg = {
id: orgUtil.SYSTEM_ORG_ID,
name: 'SystemSetting',
is_system: true,
autoEnter: new Date().getTime()
}
commit('SET_CURRENT_ORG', systemOrg)

View File

@@ -42,14 +42,8 @@ export function getCurrentOrgLocal(username) {
export function saveCurrentOrgLocal(username, org) {
const key = CURRENT_ORG_KEY + '_' + username
if (org) {
localStorage.setItem(key, JSON.stringify(org))
VueCookie.set('X-JMS-ORG', org.id)
} else {
localStorage.removeItem(key)
VueCookie.delete('X-JMS-ORG')
}
localStorage.setItem(key, JSON.stringify(org))
VueCookie.set('X-JMS-ORG', org.id)
}
export function setPreOrgLocal(username, org) {

View File

@@ -366,32 +366,16 @@ export function download(downloadUrl, filename) {
const iframe = document.createElement('iframe')
iframe.style.display = 'none'
document.body.appendChild(iframe)
const timeout = 1000 * 60 * 30
const a = document.createElement('a')
a.href = downloadUrl
if (filename) {
fetch(downloadUrl)
.then(response => response.blob())
.then(blob => {
const url = URL.createObjectURL(blob)
const a = iframe.contentWindow.document.createElement('a')
a.href = url
a.download = filename
iframe.contentWindow.document.body.appendChild(a)
a.click()
setTimeout(() => {
URL.revokeObjectURL(url)
document.body.removeChild(iframe)
}, timeout) // If you can't download it in half an hour, don't download it.
})
.catch(() => {
document.body.removeChild(iframe)
})
} else {
iframe.src = downloadUrl
setTimeout(() => {
document.body.removeChild(iframe)
}, timeout) // If you can't download it in half an hour, don't download it.
a.download = filename
}
iframe.contentWindow.document.body.appendChild(a)
a.click()
setTimeout(() => {
document.body.removeChild(iframe)
}, 1000 * 60 * 30) // If you can't download it in half an hour, don't download it.
}
export function diffObject(object, base) {

View File

@@ -17,7 +17,7 @@ function getPropOrg() {
if (defaultOrg) {
return defaultOrg
}
return orgs.filter(item => !item['is_root'] && !item['is_system'])[0]
return orgs.filter(item => !item['is_root'] && item.id !== SYSTEM_ORG_ID)[0]
}
async function change2PropOrg() {

View File

@@ -90,20 +90,10 @@ function ifBadRequest({ response, error }) {
}
}
export function logout() {
window.location.href = `${process.env.VUE_APP_LOGOUT_PATH}?next=${location.pathname}`
}
export function flashErrorMsg({ response, error }) {
if (!response.config.disableFlashErrorMsg) {
const responseErrorMsg = getErrorResponseMsg(error)
const msg = responseErrorMsg || error.message
if (response.status === 403 && msg === 'CSRF Failed: CSRF token missing.') {
setTimeout(() => {
logout()
}, 1000)
}
message({
message: msg,
type: 'error',

View File

@@ -8,10 +8,7 @@ import orgs from '@/api/orgs'
import { getPropView, isViewHasOrgs } from '@/utils/jms'
const whiteList = ['/login', process.env.VUE_APP_LOGIN_PATH] // no redirect whitelist
const autoEnterOrgs = [
'00000000-0000-0000-0000-000000000001',
'00000000-0000-0000-0000-000000000000'
]
const autoEnterOrgs = ['00000000-0000-0000-0000-000000000001', '00000000-0000-0000-0000-000000000000']
function reject(msg) {
return new Promise((resolve, reject) => reject(msg))
@@ -26,19 +23,6 @@ async function checkLogin({ to, from, next }) {
return await store.dispatch('users/getProfile')
} catch (e) {
Vue.$log.error(e)
// remove currentOrg: System org item
for (let i = 0; i < localStorage.length; i++) {
const key = localStorage.key(i)
if (!key.startsWith('jms_current_org_')) {
continue
}
let value = localStorage.getItem(key)
value = JSON.parse(value)
if (!value.is_system) {
continue
}
localStorage.removeItem(key)
}
const status = e.response.status
if (store.getters.currentOrg.autoEnter) {
await store.dispatch('users/setCurrentOrg', store.getters.preOrg)
@@ -170,24 +154,18 @@ export async function startup({ to, from, next }) {
if (store.getters.inited) {
return true
}
await store.dispatch('app/init')
try {
await store.dispatch('app/init')
// set page title
// await getOpenPublicSetting({ to, from, next })
await getPublicSetting({ to, from, next }, true)
await checkLogin({ to, from, next })
await getPublicSetting({ to, from, next }, false)
await changeCurrentViewIfNeed({ to, from, next })
await changeCurrentOrgIfNeed({ to, from, next })
await generatePageRoutes({ to, from, next })
await checkUserFirstLogin({ to, from, next })
await store.dispatch('assets/getAssetCategories')
} catch (e) {
Vue.$log.error('Startup error: ', e)
}
// set page title
// await getOpenPublicSetting({ to, from, next })
await getPublicSetting({ to, from, next }, true)
await checkLogin({ to, from, next })
await getPublicSetting({ to, from, next }, false)
await changeCurrentViewIfNeed({ to, from, next })
await changeCurrentOrgIfNeed({ to, from, next })
await generatePageRoutes({ to, from, next })
await checkUserFirstLogin({ to, from, next })
await store.dispatch('assets/getAssetCategories')
return true
}

View File

@@ -30,12 +30,7 @@ export default {
showMenu: false,
showAssets: true,
url: '/api/v1/accounts/accounts/',
countResource: 'account',
edit: {
drag: {
isMove: false
}
}
countResource: 'account'
}
}
}

View File

@@ -122,53 +122,9 @@ export default {
return {
name: 'AccountChangeSecretCreate'
}
},
extraMoreActions: [
{
name: 'BatchDisable',
title: this.$t('common.BatchDisable'),
icon: 'fa fa-ban',
can: ({ selectedRows }) => selectedRows.length > 0 && this.$hasPerm('accounts.change_changesecretautomation'),
callback: ({ selectedRows, reloadTable }) => this.bulkDisableCallback(selectedRows, reloadTable)
},
{
name: 'BatchActivate',
title: this.$t('common.BatchActivate'),
icon: 'fa fa-check-circle-o',
can: ({ selectedRows }) => selectedRows.length > 0 && this.$hasPerm('accounts.change_changesecretautomation'),
callback: ({ selectedRows, reloadTable }) => this.bulkActivateCallback(selectedRows, reloadTable)
}
]
}
}
}
},
methods: {
bulkDisableCallback(selectedRows, reloadTable) {
const url = '/api/v1/accounts/change-secret-automations/'
const data = selectedRows.map(row => {
return { id: row.id, is_active: false }
})
if (data.length === 0) return
this.$axios.patch(url, data).then(() => {
reloadTable()
this.$message.success(this.$t('common.disableSuccessMsg'))
}).catch(error => {
this.$message.error(this.$t('common.updateError') + ' ' + error)
})
},
bulkActivateCallback(selectedRows, reloadTable) {
const url = '/api/v1/accounts/change-secret-automations/'
const data = selectedRows.map(row => {
return { id: row.id, is_active: true }
})
if (data.length === 0) return
this.$axios.patch(url, data).then(() => {
reloadTable()
this.$message.success(this.$t('common.activateSuccessMsg'))
}).catch(error => {
this.$message.error(this.$t('common.updateError') + ' ' + error)
})
}
}
}
</script>

View File

@@ -127,58 +127,9 @@ export default {
headerActions: {
hasRefresh: true,
hasExport: false,
hasImport: false,
createRoute: () => {
return {
name: 'AccountPushCreate'
}
},
extraMoreActions: [
{
name: 'BatchDisable',
title: this.$t('common.BatchDisable'),
icon: 'fa fa-ban',
can: ({ selectedRows }) => selectedRows.length > 0 && this.$hasPerm('accounts.change_pushaccountautomation'),
callback: ({ selectedRows, reloadTable }) => this.bulkDisableCallback(selectedRows, reloadTable)
},
{
name: 'BatchActivate',
title: this.$t('common.BatchActivate'),
icon: 'fa fa-check-circle-o',
can: ({ selectedRows }) => selectedRows.length > 0 && this.$hasPerm('accounts.change_pushaccountautomation'),
callback: ({ selectedRows, reloadTable }) => this.bulkActivateCallback(selectedRows, reloadTable)
}
]
hasImport: false
}
}
},
methods: {
bulkDisableCallback(selectedRows, reloadTable) {
const url = '/api/v1/accounts/push-account-automations/'
const data = selectedRows.map(row => {
return { id: row.id, is_active: false }
})
if (data.length === 0) return
this.$axios.patch(url, data).then(() => {
reloadTable()
this.$message.success(this.$t('common.disableSuccessMsg'))
}).catch(error => {
this.$message.error(this.$t('common.updateError') + ' ' + error)
})
},
bulkActivateCallback(selectedRows, reloadTable) {
const url = '/api/v1/accounts/push-account-automations/'
const data = selectedRows.map(row => {
return { id: row.id, is_active: true }
})
if (data.length === 0) return
this.$axios.patch(url, data).then(() => {
reloadTable()
this.$message.success(this.$t('common.activateSuccessMsg'))
}).catch(error => {
this.$message.error(this.$t('common.updateError') + ' ' + error)
})
}
}
}
</script>

View File

@@ -65,11 +65,9 @@ export default {
columns: ['name', 'username', 'secret_type', 'privileged'],
columnsMeta: {
name: {
formatter: (row) => <span>{row.name}</span>
// 暂禁用远程应用中账号模板的详情跳转
// formatterArgs: {
// route: 'AccountTemplateDetail'
// }
formatterArgs: {
route: 'AccountTemplateDetail'
}
},
privileged: {
width: '100px'

View File

@@ -102,7 +102,7 @@ export const ACCOUNT_PROVIDER_ATTRS_MAP = {
[vmware]: {
name: vmware,
title: 'VMware',
attrs: ['host', 'port', 'username', 'password', 'auto_sync_node']
attrs: ['host', 'port', 'username', 'password']
},
[nutanix]: {
name: nutanix,

View File

@@ -20,8 +20,7 @@ export const platformFieldsMeta = (vm) => {
'change_secret_enabled', 'change_secret_method', 'change_secret_params',
'push_account_enabled', 'push_account_method', 'push_account_params',
'verify_account_enabled', 'verify_account_method', 'verify_account_params',
'gather_accounts_enabled', 'gather_accounts_method', 'gather_accounts_params',
'remove_account_enabled', 'remove_account_method', 'remove_account_params'
'gather_accounts_enabled', 'gather_accounts_method', 'gather_accounts_params'
],
fieldsMeta: {
ansible_config: {
@@ -29,15 +28,12 @@ export const platformFieldsMeta = (vm) => {
hidden: (formValue) => !formValue['ansible_enabled']
},
gather_facts_enabled: {},
remove_account_enabled: {},
ping_method: {},
ping_params: {
label: ''
},
gather_facts_method: {},
push_account_method: {},
remove_account_method: {},
remove_account_params: {},
push_account_params: {
label: ''
},

View File

@@ -36,11 +36,6 @@ export default {
this.tableConfig.url = `/api/v1/perms/users/self/nodes/${currentNodeId}/assets/?cache_policy=1`
}
}.bind(this)
},
edit: {
drag: {
isMove: false
}
}
},
tableConfig: {

View File

@@ -205,11 +205,6 @@ export default {
view: {
dblClickExpand: false,
showLine: true
},
edit: {
drag: {
isMove: false
}
}
},
iShowTree: true,

View File

@@ -290,11 +290,6 @@ export default {
view: {
dblClickExpand: false,
showLine: true
},
edit: {
drag: {
isMove: false
}
}
},
iShowTree: true

View File

@@ -11,6 +11,7 @@
<script>
import { GenericCreateUpdatePage } from '@/layout/components'
import AssetSelect from '@/components/Apps/AssetSelect'
import { getDayFuture } from '@/utils/common'
import AccountFormatter from './components/AccountFormatter'
import { AllAccount } from '../const'
import ProtocolsSelect from '@/components/Form/FormFields/AllOrSpec.vue'
@@ -33,6 +34,7 @@ export default {
initial: {
is_active: true,
date_start: new Date().toISOString(),
date_expired: getDayFuture(25550, new Date()).toISOString(),
nodes: nodesInitial,
assets: assetsInitial,
accounts: [AllAccount]

View File

@@ -107,13 +107,6 @@ export default {
this.$log.debug('AssetSelect value', that.assets)
this.$message.success(this.$tc('common.updateSuccessMsg'))
this.$store.commit('common/reload')
},
treeSetting: {
edit: {
drag: {
isMove: false
}
}
}
},
nodeRelationConfig: {

View File

@@ -39,12 +39,7 @@ export default {
notShowBuiltinTree: true,
url: '/api/v1/perms/asset-permissions/',
nodeUrl: '/api/v1/perms/asset-permissions/',
treeUrl: '/api/v1/assets/nodes/children/tree/?assets=1',
edit: {
drag: {
isMove: false
}
}
treeUrl: '/api/v1/assets/nodes/children/tree/?assets=1'
},
tableConfig: {
url: '/api/v1/perms/asset-permissions/',

View File

@@ -24,7 +24,6 @@
v-model="requestForm.accounts"
:nodes="requestForm.nodes"
:assets="requestForm.assets"
:oid="requestForm.oid"
:show-add-template="false"
style="width: 50% !important"
/>
@@ -84,7 +83,6 @@ export default {
assets: this.object.apply_assets?.map(i => i.id),
accounts: this.object.apply_accounts,
actions: this.object.apply_actions,
oid: this.object.org_id,
apply_date_expired: this.object.apply_date_expired,
apply_date_start: this.object.apply_date_start
},

View File

@@ -134,7 +134,7 @@ export default {
},
onMonitor() {
const joinUrl = `/luna/monitor/${this.session.id}?ticket_id=${this.object.id}`
window.open(joinUrl, '_blank', 'height=600, width=850, top=400, left=400, toolbar=no, menubar=no, scrollbars=no, location=no, status=no')
window.open(joinUrl, 'height=600, width=850, top=400, left=400, toolbar=no, menubar=no, scrollbars=no, location=no, status=no')
},
onToggleLock() {
const url = '/api/v1/terminal/tasks/toggle-lock-session-for-ticket/'

View File

@@ -54,11 +54,6 @@ export default {
showRefresh: true,
showSearch: false,
treeUrl: '',
edit: {
drag: {
isMove: false
}
},
check: {
enable: true
},

View File

@@ -121,9 +121,6 @@ export default {
system_roles: {
component: Select2,
label: this.$t('users.SystemRoles'),
rules: [
rules.Required
],
el: {
multiple: true,
ajax: {

3635
yarn.lock

File diff suppressed because it is too large Load Diff