mirror of
https://github.com/jumpserver/lina.git
synced 2025-11-09 19:31:26 +00:00
Compare commits
22 Commits
v4.10.9-lt
...
pr@dev@fea
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2f79134023 | ||
|
|
c59e6268b3 | ||
|
|
3344e01a9c | ||
|
|
0a42031220 | ||
|
|
686e48f273 | ||
|
|
f16830adfe | ||
|
|
be8d09b777 | ||
|
|
5ed2b6d9c8 | ||
|
|
ece3ebc6e9 | ||
|
|
1afd8dc934 | ||
|
|
a239060798 | ||
|
|
05032d6c78 | ||
|
|
9dc35a603e | ||
|
|
43448aa482 | ||
|
|
8887e98249 | ||
|
|
43e4dcd760 | ||
|
|
94d4be7555 | ||
|
|
8210e2810f | ||
|
|
05be6876f3 | ||
|
|
38f8d88cdf | ||
|
|
3b0def17d7 | ||
|
|
57b0fa0b0e |
@@ -61,13 +61,14 @@ export function stopJob(form) {
|
||||
})
|
||||
}
|
||||
|
||||
export function JobUploadFile(form) {
|
||||
export function JobUploadFile(form, config = {}) {
|
||||
return request({
|
||||
url: '/api/v1/ops/jobs/upload/',
|
||||
method: 'post',
|
||||
headers: { 'Content-Type': 'multipart/form-data' },
|
||||
timeout: 60 * 60 * 1000,
|
||||
data: form
|
||||
data: form,
|
||||
...config
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { BASE_URL } from '@/utils/common/index'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
active: {
|
||||
@@ -41,6 +43,16 @@ export default {
|
||||
},
|
||||
handleExpand() {
|
||||
this.$emit('expand-full')
|
||||
},
|
||||
async openWebsite() {
|
||||
let url = `${BASE_URL}/?_=${Date.now()}`
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
url = url.replace('9528', '5173')
|
||||
}
|
||||
|
||||
const newUrl = new URL(url)
|
||||
window.open(newUrl.toString(), '_blank')
|
||||
return url
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
const [key, value] = toM2MJsonParams(this.object.assets)
|
||||
const org_id = this.object.org_id || this.$store.getters.currentOrg.id
|
||||
return {
|
||||
config: {
|
||||
headerActions: {
|
||||
@@ -33,7 +34,7 @@ export default {
|
||||
hasExport: false
|
||||
},
|
||||
tableConfig: {
|
||||
url: `/api/v1/assets/assets/?${key}=${value}`,
|
||||
url: `/api/v1/assets/assets/?${key}=${value}&oid=${org_id}`,
|
||||
columns: ['name', 'address', 'platform', 'type', 'is_active'],
|
||||
columnsShow: {
|
||||
min: ['name', 'address'],
|
||||
|
||||
@@ -25,6 +25,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
const [key, value] = toM2MJsonParams(this.object.users)
|
||||
const org_id = this.object.org_id || this.$store.getters.currentOrg.id
|
||||
return {
|
||||
config: {
|
||||
headerActions: {
|
||||
@@ -33,7 +34,7 @@ export default {
|
||||
hasExport: false
|
||||
},
|
||||
tableConfig: {
|
||||
url: `/api/v1/users/users/?${key}=${value}`,
|
||||
url: `/api/v1/users/users/?${key}=${value}&oid=${org_id}`,
|
||||
columns: [
|
||||
'name', 'username', 'email', 'groups', 'system_roles',
|
||||
'org_roles', 'source', 'is_valid'
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
ref="dataForm"
|
||||
:fields="totalFields"
|
||||
:form="iForm"
|
||||
:server-errors="serverErrors"
|
||||
v-bind="$attrs"
|
||||
v-on="$listeners"
|
||||
>
|
||||
@@ -65,7 +66,8 @@ export default {
|
||||
totalFields: [],
|
||||
loading: true,
|
||||
groups: [],
|
||||
errors: {}
|
||||
errors: {},
|
||||
serverErrors: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -103,6 +105,8 @@ export default {
|
||||
this.generateColumns()
|
||||
this.$emit('afterGenerateColumns', this.totalFields)
|
||||
this.cleanFormValue()
|
||||
// 初始化时清空错误
|
||||
this.serverErrors = {}
|
||||
this.loading = false
|
||||
},
|
||||
generateColumns() {
|
||||
@@ -139,15 +143,56 @@ export default {
|
||||
cleanFormValue() {
|
||||
this._cleanFormValue(this.iForm, this.remoteMeta)
|
||||
},
|
||||
setFieldError(name, error) {
|
||||
error = error.replace(/[。.]+$/, '')
|
||||
const field = this.totalFields.find((v) => v.prop === name)
|
||||
if (!field) {
|
||||
return
|
||||
_getElFormInstance() {
|
||||
try {
|
||||
return this.$refs?.dataForm?.$refs?.form?.$refs?.elForm || null
|
||||
} catch (e) {
|
||||
return null
|
||||
}
|
||||
if (typeof error === 'string') {
|
||||
field.el.errors = error
|
||||
field.attrs.error = error
|
||||
},
|
||||
/**
|
||||
* @description 仅清理 UI 的错误展示,不触发表单内容重建
|
||||
*/
|
||||
clearAllFieldErrors() {
|
||||
const elForm = this._getElFormInstance()
|
||||
if (elForm && Array.isArray(elForm.fields)) {
|
||||
elForm.fields.forEach((item) => {
|
||||
item.validateMessage = ''
|
||||
item.validateState = ''
|
||||
})
|
||||
}
|
||||
// 不修改 totalFields/attrs,避免触发 content 重建导致输入丢失
|
||||
this.serverErrors = {}
|
||||
},
|
||||
setFieldError(name, error) {
|
||||
error = (error || '').toString().replace(/[。.]+$/, '')
|
||||
const elForm = this._getElFormInstance()
|
||||
if (elForm && Array.isArray(elForm.fields)) {
|
||||
const item = elForm.fields.find(f => f.prop === name)
|
||||
if (item) {
|
||||
item.validateMessage = error
|
||||
item.validateState = error ? 'error' : ''
|
||||
}
|
||||
}
|
||||
// 不写入 totalFields,避免触发 innerContent 变化导致表单值被覆盖
|
||||
this.$set(this.serverErrors, name, error)
|
||||
},
|
||||
setErrors(errors) {
|
||||
const mapped = {}
|
||||
Object.entries(errors || {}).forEach(([k, v]) => {
|
||||
let msg = v
|
||||
if (Array.isArray(v)) msg = v.join('; ')
|
||||
else if (typeof v === 'object' && v !== null) msg = JSON.stringify(v)
|
||||
mapped[k] = String(msg || '')
|
||||
})
|
||||
this.serverErrors = mapped
|
||||
const elForm = this._getElFormInstance()
|
||||
if (elForm && Array.isArray(elForm.fields)) {
|
||||
elForm.fields.forEach((item) => {
|
||||
const msg = mapped[item.prop] || ''
|
||||
item.validateMessage = msg
|
||||
item.validateState = msg ? 'error' : ''
|
||||
})
|
||||
}
|
||||
},
|
||||
groupHidden(group, i) {
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
:prop="prop"
|
||||
:rules="_show && Array.isArray(data.rules) ? data.rules : []"
|
||||
v-bind="data.attrs"
|
||||
:error="errorText"
|
||||
>
|
||||
<template v-if="data.label" #label>
|
||||
<span :title="data.label">
|
||||
@@ -152,6 +153,10 @@ export default {
|
||||
props: {
|
||||
// eslint-disable-next-line vue/require-default-prop
|
||||
data: Object,
|
||||
serverErrors: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
prop: {
|
||||
type: String,
|
||||
default() {
|
||||
@@ -189,6 +194,11 @@ export default {
|
||||
classes() {
|
||||
return 'el-form-item-' + this.data.prop + ' ' + (this.data.attrs?.class || '')
|
||||
},
|
||||
errorText() {
|
||||
const fromAttrs = this.data?.attrs?.error
|
||||
const fromServer = this.serverErrors ? this.serverErrors[this.data.prop] : ''
|
||||
return fromAttrs || fromServer || ''
|
||||
},
|
||||
listeners() {
|
||||
const {
|
||||
data: {
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
:is="item.type === GROUP ? 'render-form-group' : 'render-form-item'"
|
||||
:key="item.id"
|
||||
:data="item"
|
||||
:server-errors="serverErrors"
|
||||
:disabled="disabled || item.disabled"
|
||||
:item-value="value[item.id]"
|
||||
:options="options[item.id]"
|
||||
@@ -47,6 +48,10 @@ export default {
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
serverErrors: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
:label-width="labelWidth"
|
||||
:style="{ '--label-width': labelWidth }"
|
||||
v-bind="$attrs"
|
||||
:server-errors="serverErrors"
|
||||
v-on="$listeners"
|
||||
>
|
||||
<!-- slot 透传 -->
|
||||
@@ -121,6 +122,10 @@ export default {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
serverErrors: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
fields: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
<el-button
|
||||
:type="item.el && item.el.type"
|
||||
class="start-stop-btn"
|
||||
:disabled="item.disabled"
|
||||
size="mini"
|
||||
@click="item.callback()"
|
||||
>
|
||||
|
||||
@@ -244,12 +244,10 @@ export default {
|
||||
delete routeFilter.search
|
||||
}
|
||||
const asFilterTags = _.cloneDeep(this.filterTags)
|
||||
setTimeout(() => {
|
||||
this.filterTags = {
|
||||
...asFilterTags,
|
||||
...routeFilter
|
||||
}
|
||||
}, 100)
|
||||
this.filterTags = {
|
||||
...asFilterTags,
|
||||
...routeFilter
|
||||
}
|
||||
},
|
||||
getValueLabel(key, value) {
|
||||
for (const field of this.options) {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
class="left"
|
||||
>
|
||||
<span v-if="component === 'AutoDataZTree'" class="title">
|
||||
{{ $t('AssetTree') }}
|
||||
{{ title }}
|
||||
</span>
|
||||
<component
|
||||
:is="component"
|
||||
@@ -111,6 +111,13 @@ export default {
|
||||
headerActions: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
title: {
|
||||
// eslint-disable-next-line vue/require-prop-type-constructor
|
||||
type: String,
|
||||
default() {
|
||||
return this.$t('AssetTree')
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
||||
@@ -225,24 +225,9 @@ export default {
|
||||
default(error, method, vm) {
|
||||
const response = error.response
|
||||
const data = response.data
|
||||
if (response.status === 400) {
|
||||
for (const key of Object.keys(data)) {
|
||||
let err = ''
|
||||
let errorTips = data[key]
|
||||
if (errorTips instanceof Array) {
|
||||
errorTips = _.filter(errorTips, (item) => Object.keys(item).length > 0)
|
||||
for (const i of errorTips) {
|
||||
if (i instanceof Object) {
|
||||
err += i?.port?.join(',')
|
||||
} else {
|
||||
err += i
|
||||
}
|
||||
}
|
||||
} else {
|
||||
err = errorTips
|
||||
}
|
||||
this.$refs.form.setFieldError(key, err)
|
||||
}
|
||||
if (response.status === 400 && data && typeof data === 'object') {
|
||||
// 覆盖式设置错误映射,避免触发表单内容重建
|
||||
this.$refs.form.setErrors(data)
|
||||
}
|
||||
this.$emit('performError', data)
|
||||
}
|
||||
|
||||
@@ -137,14 +137,15 @@ export default {
|
||||
this.$emit('submitError', error)
|
||||
const response = error.response
|
||||
const data = response.data
|
||||
if (response.status === 400) {
|
||||
for (const key of Object.keys(data)) {
|
||||
let value = data[key]
|
||||
if (value instanceof Array) {
|
||||
value = value.join(';')
|
||||
}
|
||||
this.$refs.form.setFieldError(key, value)
|
||||
}
|
||||
// 不要逐个设置字段的 attrs.error 或改动 fields 引用。
|
||||
// 这样会触发表单 content 重建,导致用户已输入的内容被覆盖/清空,
|
||||
// 且可能出现只能显示一个字段错误的现象。
|
||||
// 这里改为使用 AutoDataForm 暴露的 setErrors(errors) 覆盖式设置:
|
||||
// - 直接同步到 UI 的 el-form-item.validateMessage
|
||||
// - 支持同时显示多个字段错误
|
||||
// - 不修改 fields/attrs 引用,避免输入丢失
|
||||
if (response.status === 400 && data && typeof data === 'object') {
|
||||
this.$refs.form.setErrors(data)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
10
src/main.js
10
src/main.js
@@ -25,6 +25,7 @@ import xss from '@/utils/secure'
|
||||
import ElTableTooltipPatch from '@/utils/vue/elTableTooltipPatch.js'
|
||||
import VSanitize from 'v-sanitize'
|
||||
import moment from 'moment'
|
||||
|
||||
moment.locale('zh-cn')
|
||||
|
||||
/**
|
||||
@@ -35,10 +36,11 @@ moment.locale('zh-cn')
|
||||
* Currently MockJs will be used in the production environment,
|
||||
* please remove it before going online ! ! !
|
||||
*/
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
const { mockXHR } = require('../mock')
|
||||
mockXHR()
|
||||
}
|
||||
// 使用 mockXHR 无法使用 axios 中的 onUploadProgress 回调函数
|
||||
// if (process.env.NODE_ENV === 'development') {
|
||||
// const { mockXHR } = require('../mock')
|
||||
// mockXHR()
|
||||
// }
|
||||
|
||||
// set ElementUI lang to EN
|
||||
ElementUI.Tooltip.props.openDelay.default = 1000
|
||||
|
||||
@@ -34,7 +34,9 @@ export default [
|
||||
name: 'UserLoginACLList',
|
||||
component: () => import('@/views/acls/UserLoginACL/UserLoginACLList.vue'),
|
||||
meta: {
|
||||
title: i18n.t('UserLoginACLs'), menuTitle: i18n.t('UserLogin'), activeMenu: ''
|
||||
title: i18n.t('UserLoginACLs'),
|
||||
menuTitle: i18n.t('UserLogin'),
|
||||
activeMenu: ''
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -74,7 +76,7 @@ export default [
|
||||
},
|
||||
name: 'CmdACL',
|
||||
meta: {
|
||||
title: i18n.t('CommandFilterACLs',),
|
||||
title: i18n.t('CommandFilterACLs'),
|
||||
menuTitle: i18n.t('CommandFilter'),
|
||||
app: 'acls',
|
||||
resource: 'commandfilteracl'
|
||||
@@ -136,7 +138,11 @@ export default [
|
||||
path: '',
|
||||
name: 'AssetACLList',
|
||||
component: () => import('@/views/acls/AssetLoginACL/AssetLoginAclList.vue'),
|
||||
meta: { title: i18n.t('AssetACLs'), activeMenu: '', menuTitle: i18n.t('AssetConnect') }
|
||||
meta: {
|
||||
title: i18n.t('AssetACLs'),
|
||||
activeMenu: '',
|
||||
menuTitle: i18n.t('AssetConnect')
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'create',
|
||||
@@ -161,6 +167,53 @@ export default [
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: 'data-masking-rules',
|
||||
component: empty,
|
||||
redirect: {
|
||||
name: 'DataMaskingRuleList'
|
||||
},
|
||||
name: 'DataMaskingRules',
|
||||
meta: {
|
||||
title: i18n.t('DataMasking'),
|
||||
licenseRequired: false,
|
||||
app: 'acls',
|
||||
resource: 'datamaskingrule'
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
name: 'DataMaskingRuleList',
|
||||
component: () => import('@/views/acls/DataMaskingRule/DataMaskingRuleList.vue'),
|
||||
meta: {
|
||||
title: i18n.t('DataMasking'),
|
||||
activeMenu: '',
|
||||
menuTitle: i18n.t('DataMasking')
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'create',
|
||||
name: 'DataMaskingRuleCreate',
|
||||
component: () => import('@/views/acls/DataMaskingRule/DataMaskingRuleCreateUpdate.vue'),
|
||||
hidden: true,
|
||||
meta: { title: '', activeMenu: '' }
|
||||
},
|
||||
{
|
||||
path: ':id',
|
||||
name: 'AssetACLDetail',
|
||||
component: () => import('@/views/acls/AssetLoginACL/AssetLoginAclDetail/index'),
|
||||
hidden: true,
|
||||
meta: { title: i18n.t('AssetACLDetail'), activeMenu: '' }
|
||||
},
|
||||
{
|
||||
path: ':id/update',
|
||||
name: 'DataMaskingRuleUpdate',
|
||||
component: () => import('@/views/acls/DataMaskingRule/DataMaskingRuleCreateUpdate.vue'),
|
||||
hidden: true,
|
||||
meta: { title: '', activeMenu: '' }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: 'cmd-groups',
|
||||
component: empty,
|
||||
@@ -237,7 +290,11 @@ export default [
|
||||
path: '',
|
||||
name: 'ConnectMethodACLList',
|
||||
component: () => import('@/views/acls/ConnectMethodACL/ConnectMethodAclList.vue'),
|
||||
meta: { title: i18n.t('ConnectMethodACLs'), activeMenu: '', menuTitle: i18n.t('ConnectMethod') }
|
||||
meta: {
|
||||
title: i18n.t('ConnectMethodACLs'),
|
||||
activeMenu: '',
|
||||
menuTitle: i18n.t('ConnectMethod')
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'create',
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<TwoCol>
|
||||
<AutoDetailCard :fields="detailFields" :object="object" :url="url" />
|
||||
</TwoCol>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AutoDetailCard from '@/components/Cards/DetailCard/auto'
|
||||
import TwoCol from '@/layout/components/Page/TwoColPage.vue'
|
||||
|
||||
export default {
|
||||
name: 'Detail',
|
||||
components: {
|
||||
TwoCol,
|
||||
AutoDetailCard
|
||||
},
|
||||
props: {
|
||||
object: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
url: `/api/v1/acls/login-asset-acls/${this.object.id}/`,
|
||||
detailFields: [
|
||||
'name',
|
||||
{
|
||||
key: this.$t('Action'),
|
||||
value: this.object.action.label
|
||||
},
|
||||
{
|
||||
key: this.$t('Reviewer'),
|
||||
value: this.object.reviewers.map(item => item.name).join(', ')
|
||||
},
|
||||
'priority', 'date_created', 'created_by', 'comment'
|
||||
]
|
||||
}
|
||||
},
|
||||
computed: {}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='less' scoped>
|
||||
|
||||
</style>
|
||||
51
src/views/acls/DataMaskingRule/AssetLoginAclDetail/index.vue
Normal file
51
src/views/acls/DataMaskingRule/AssetLoginAclDetail/index.vue
Normal file
@@ -0,0 +1,51 @@
|
||||
<template>
|
||||
<GenericDetailPage :active-menu.sync="config.activeMenu" :object.sync="instance" v-bind="config" v-on="$listeners">
|
||||
<keep-alive>
|
||||
<component :is="config.activeMenu" :object="instance" />
|
||||
</keep-alive>
|
||||
</GenericDetailPage>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { GenericDetailPage } from '@/layout/components'
|
||||
import Detail from './Detail.vue'
|
||||
import UserJsonTab from '@/components/Apps/ManyJsonTabs/UserJsonTab.vue'
|
||||
import AssetJsonTab from '@/components/Apps/ManyJsonTabs/AssetJsonTab.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
GenericDetailPage,
|
||||
Detail,
|
||||
UserJsonTab,
|
||||
AssetJsonTab
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
instance: {},
|
||||
config: {
|
||||
url: `/api/v1/acls/login-asset-acls/`,
|
||||
activeMenu: 'Detail',
|
||||
submenu: [
|
||||
{
|
||||
title: this.$t('Basic'),
|
||||
name: 'Detail'
|
||||
},
|
||||
{
|
||||
title: this.$t('MenuUsers'),
|
||||
name: 'UserJsonTab'
|
||||
},
|
||||
{
|
||||
title: this.$t('Assets'),
|
||||
name: 'AssetJsonTab'
|
||||
}
|
||||
],
|
||||
hasRightSide: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,59 @@
|
||||
<template>
|
||||
<GenericCreateUpdatePage v-bind="$data" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import GenericCreateUpdatePage from '@/layout/components/GenericCreateUpdatePage'
|
||||
import { userJSONSelectMeta } from '@/views/users/const'
|
||||
import { assetJSONSelectMeta } from '@/views/assets/const'
|
||||
import AccountFormatter from '@/views/perms/AssetPermission/components/AccountFormatter.vue'
|
||||
|
||||
export default {
|
||||
name: 'DataMaskingRuleCreateUpdate',
|
||||
components: {
|
||||
GenericCreateUpdatePage
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
initial: {
|
||||
accounts: ['@ALL']
|
||||
},
|
||||
fields: [
|
||||
[this.$t('Basic'), ['name', 'priority']],
|
||||
[this.$t('Users'), ['users']],
|
||||
[this.$t('Asset'), ['assets']],
|
||||
[this.$t('Accounts'), ['accounts']],
|
||||
[this.$t('Rules'), ['fields_pattern', 'masking_method', 'mask_pattern']],
|
||||
[this.$t('Other'), ['is_active', 'comment']]
|
||||
],
|
||||
fieldsMeta: {
|
||||
assets: assetJSONSelectMeta(this),
|
||||
users: userJSONSelectMeta(this),
|
||||
accounts: {
|
||||
component: AccountFormatter,
|
||||
el: {
|
||||
showAddTemplate: false,
|
||||
enableVirtualAccount: false,
|
||||
value: ['@ALL'],
|
||||
assets: []
|
||||
},
|
||||
hidden: (formValue) => {
|
||||
const ids = formValue.assets?.ids
|
||||
this.fieldsMeta.accounts.el.assets = ids || []
|
||||
}
|
||||
},
|
||||
mask_pattern: {
|
||||
hidden: (formValue) => {
|
||||
return !['fixed_char'].includes(formValue.masking_method)
|
||||
}
|
||||
}
|
||||
},
|
||||
url: '/api/v1/acls/data-masking-rules/'
|
||||
}
|
||||
},
|
||||
methods: {}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
35
src/views/acls/DataMaskingRule/DataMaskingRuleList.vue
Normal file
35
src/views/acls/DataMaskingRule/DataMaskingRuleList.vue
Normal file
@@ -0,0 +1,35 @@
|
||||
<template>
|
||||
<GenericListPage :header-actions="headerActions" :help-tip="helpMsg" :table-config="tableConfig" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { GenericListPage } from '@/layout/components'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
GenericListPage
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
helpMsg: this.$t('DataMaskingRuleHelpHelpMsg'),
|
||||
tableConfig: {
|
||||
url: '/api/v1/acls/data-masking-rules/',
|
||||
columnsExclude: ['users', 'assets', 'accounts', 'rules'],
|
||||
columnsShow: {
|
||||
min: ['name', 'actions'],
|
||||
default: [
|
||||
'name', 'priority', 'is_active', 'comment', 'actions'
|
||||
]
|
||||
}
|
||||
},
|
||||
updateRoute: 'DataMaskingRuleUpdate',
|
||||
headerActions: {
|
||||
createRoute: 'DataMaskingRuleCreate',
|
||||
hasRefresh: true,
|
||||
hasExport: false,
|
||||
hasImport: false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -31,7 +31,7 @@ export default {
|
||||
id: 'connect-asset',
|
||||
display_name: this.$t('AssetACLs'),
|
||||
name: 'AssetACLList',
|
||||
comment: this.$t('AssetLoginACLHelpText'),
|
||||
comment: this.$t('DataMaskingRuleHelpHelpText'),
|
||||
icon: 'assets',
|
||||
edition: 'enterprise',
|
||||
tags: ['asset']
|
||||
|
||||
@@ -20,38 +20,37 @@
|
||||
:assets="classifiedAssets"
|
||||
@submit="onConfirmRunAsset"
|
||||
/>
|
||||
<AssetTreeTable ref="TreeTable" :tree-setting="treeSetting">
|
||||
<template slot="table">
|
||||
<div class="transition-box" style="width: calc(100% - 17px);">
|
||||
<CodeEditor
|
||||
v-if="ready"
|
||||
:options="cmOptions"
|
||||
:toolbar="toolbar"
|
||||
:value.sync="command"
|
||||
style="margin-bottom: 20px"
|
||||
<div class="job-container">
|
||||
<div class="select-assets">
|
||||
<SelectJobAssetDialog @change="handleSelectAssets" />
|
||||
</div>
|
||||
<div class="transition-box" style="width: calc(100% - 17px);">
|
||||
<CodeEditor
|
||||
v-if="ready"
|
||||
:options="cmOptions"
|
||||
:toolbar="toolbar"
|
||||
:value.sync="command"
|
||||
style="margin-bottom: 20px"
|
||||
/>
|
||||
<span v-if="executionInfo.status" style="float: right" />
|
||||
<div class="xterm-container">
|
||||
<QuickJobTerm
|
||||
ref="xterm"
|
||||
:show-tool-bar="true"
|
||||
:select-assets="selectAssets"
|
||||
:xterm-config="xtermConfig"
|
||||
:execution-info="executionInfo"
|
||||
@view-assets="viewConfirmRunAssets"
|
||||
/>
|
||||
<span v-if="executionInfo.status" style="float: right" />
|
||||
<div class="xterm-container">
|
||||
<QuickJobTerm
|
||||
ref="xterm"
|
||||
:show-tool-bar="true"
|
||||
:select-assets="selectAssets"
|
||||
:xterm-config="xtermConfig"
|
||||
:execution-info="executionInfo"
|
||||
@view-assets="viewConfirmRunAssets"
|
||||
/>
|
||||
</div>
|
||||
<div style="display: flex;margin-top:10px;justify-content: space-between" />
|
||||
</div>
|
||||
</template>
|
||||
</AssetTreeTable>
|
||||
<div style="display: flex;margin-top:10px;justify-content: space-between" />
|
||||
</div>
|
||||
</div>
|
||||
</Page>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import $ from '@/utils/jquery-vendor.js'
|
||||
import _isequal from 'lodash.isequal'
|
||||
import AssetTreeTable from '@/components/Apps/AssetTreeTable'
|
||||
import QuickJobTerm from '@/views/ops/Adhoc/components/QuickJobTerm.vue'
|
||||
import CodeEditor from '@/components/Form/FormFields/CodeEditor'
|
||||
import Page from '@/layout/components/Page'
|
||||
@@ -61,15 +60,16 @@ import VariableHelpDialog from './VariableHelpDialog.vue'
|
||||
import ConfirmRunAssetsDialog from './components/ConfirmRunAssetsDialog.vue'
|
||||
import SetVariableDialog from '@/views/ops/Template/components/SetVariableDialog.vue'
|
||||
import { createJob, getJob, getTaskDetail, stopJob } from '@/api/ops'
|
||||
import SelectJobAssetDialog from './components/SelectJobAssetDialog.vue'
|
||||
|
||||
export default {
|
||||
name: 'CommandExecution',
|
||||
components: {
|
||||
SelectJobAssetDialog,
|
||||
VariableHelpDialog,
|
||||
AdhocSaveDialog,
|
||||
AdhocOpenDialog,
|
||||
SetVariableDialog,
|
||||
AssetTreeTable,
|
||||
Page,
|
||||
QuickJobTerm,
|
||||
CodeEditor,
|
||||
@@ -91,7 +91,6 @@ export default {
|
||||
showOpenAdhocSaveDialog: false,
|
||||
showSetVariableDialog: false,
|
||||
showConfirmRunAssetsDialog: false,
|
||||
DataZTree: 0,
|
||||
runas: '',
|
||||
runasPolicy: 'skip',
|
||||
chdir: '',
|
||||
@@ -109,7 +108,7 @@ export default {
|
||||
align: 'left',
|
||||
icon: 'fa fa-play',
|
||||
tip: this.$t('RunCommand'),
|
||||
isVisible: this.$store.getters.currentOrgIsRoot,
|
||||
disabled: this.$store.getters.currentOrgIsRoot,
|
||||
el: {
|
||||
type: 'primary'
|
||||
},
|
||||
@@ -141,7 +140,7 @@ export default {
|
||||
align: 'left',
|
||||
value: '',
|
||||
placeholder: this.$tc('EnterRunUser'),
|
||||
// tip: this.$tc('RunasHelpText'),
|
||||
tip: this.$tc('RunasHelpText'),
|
||||
el: {
|
||||
autoComplete: true,
|
||||
query: (query, cb) => {
|
||||
@@ -295,30 +294,6 @@ export default {
|
||||
lineWrapping: true,
|
||||
mode: 'shell'
|
||||
},
|
||||
treeSetting: {
|
||||
treeUrl: '/api/v1/perms/users/self/nodes/children-with-assets/tree/',
|
||||
searchUrl: '/api/v1/perms/users/self/assets/tree/',
|
||||
showRefresh: true,
|
||||
showMenu: false,
|
||||
showSearch: true,
|
||||
notShowBuiltinTree: true,
|
||||
check: {
|
||||
enable: true
|
||||
},
|
||||
view: {
|
||||
dblClickExpand: false,
|
||||
showLine: true
|
||||
},
|
||||
callback: {
|
||||
onCheck: function(_event, treeId, treeNode) {
|
||||
const treeObj = $.fn.zTree.getZTreeObj(treeId)
|
||||
if (treeNode.checked) {
|
||||
treeObj.expandNode(treeNode, true, false, true)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
iShowTree: true,
|
||||
variableFormData: [],
|
||||
variableQueryParam: '',
|
||||
classifiedAssets: {
|
||||
@@ -328,6 +303,7 @@ export default {
|
||||
},
|
||||
selectAssets: [],
|
||||
selectNodes: [],
|
||||
selectHosts: [],
|
||||
lastRequestPayload: null
|
||||
}
|
||||
},
|
||||
@@ -335,9 +311,6 @@ export default {
|
||||
xterm() {
|
||||
return this.$refs.xterm.xterm
|
||||
},
|
||||
ztree() {
|
||||
return this.$refs.TreeTable.$refs.TreeList.$refs.AutoDataZTree.$refs.AutoDataZTree.$refs.dataztree.$refs.ztree
|
||||
},
|
||||
isRunning() {
|
||||
return this.executionInfo.status.value === 'running'
|
||||
}
|
||||
@@ -357,6 +330,9 @@ export default {
|
||||
async initData() {
|
||||
this.recoverStatus()
|
||||
},
|
||||
handleSelectAssets(assets) {
|
||||
this.selectHosts = assets
|
||||
},
|
||||
recoverStatus() {
|
||||
if (this.$route.query.taskId) {
|
||||
this.currentTaskId = this.$route.query.taskId
|
||||
@@ -432,13 +408,6 @@ export default {
|
||||
msg = JSON.stringify({ task: this.currentTaskId })
|
||||
this.ws.send(msg)
|
||||
},
|
||||
getSelectedNodes() {
|
||||
return this.ztree.getCheckedNodes().filter(node => {
|
||||
const status = node.getCheckStatus()
|
||||
return node.id !== 'search' && status.half === false
|
||||
})
|
||||
},
|
||||
|
||||
setCostTimeInterval() {
|
||||
this.toolbar.left.run.icon = 'fa fa-spinner fa-spin'
|
||||
this.toolbar.left.run.isVisible = true
|
||||
@@ -448,17 +417,8 @@ export default {
|
||||
},
|
||||
|
||||
getSelectedNodesAndHosts() {
|
||||
const hosts = this.getSelectedNodes().filter((item) => {
|
||||
return item.meta.type !== 'node'
|
||||
}).map(function(node) {
|
||||
return node.id
|
||||
})
|
||||
|
||||
const nodes = this.getSelectedNodes().filter((item) => {
|
||||
return item.meta.type === 'node'
|
||||
}).map(function(node) {
|
||||
return node.meta.data.id
|
||||
})
|
||||
const hosts = this.selectHosts
|
||||
const nodes = []
|
||||
return { hosts, nodes }
|
||||
},
|
||||
shouldReRequest(payload) {
|
||||
@@ -470,8 +430,7 @@ export default {
|
||||
execute() {
|
||||
// const size = 'rows=' + this.xterm.rows + '&cols=' + this.xterm.cols
|
||||
const { hosts, nodes } = this.getSelectedNodesAndHosts()
|
||||
|
||||
if (hosts.length === 0 && nodes.length === 0) {
|
||||
if (this.selectHosts.length === 0) {
|
||||
this.$message.error(this.$tc('RequiredAssetOrNode'))
|
||||
return
|
||||
}
|
||||
@@ -572,6 +531,13 @@ export default {
|
||||
|
||||
<style lang="scss" scoped>
|
||||
$container-bg-color: #f7f7f7;
|
||||
.job-container {
|
||||
display: flex;
|
||||
|
||||
.select-assets {
|
||||
width: 23.6%;
|
||||
}
|
||||
}
|
||||
|
||||
.transition-box {
|
||||
display: flex;
|
||||
@@ -608,51 +574,21 @@ $container-bg-color: #f7f7f7;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.el-tree {
|
||||
background-color: inherit !important;
|
||||
}
|
||||
|
||||
.mini {
|
||||
margin-right: 5px;
|
||||
width: 12px !important;
|
||||
}
|
||||
|
||||
.auto-data-ztree {
|
||||
overflow: auto;
|
||||
/*border-right: solid 1px red;*/
|
||||
}
|
||||
|
||||
.vue-codemirror-wrap ::v-deep .CodeMirror {
|
||||
width: 600px;
|
||||
height: 100px;
|
||||
border: 1px solid #eee;
|
||||
}
|
||||
|
||||
.tree-box {
|
||||
margin-right: 2px;
|
||||
border: 1px solid #e0e0e0;
|
||||
|
||||
::v-deep .ztree {
|
||||
.level0 {
|
||||
.node_name {
|
||||
max-width: 100px;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.output {
|
||||
padding-left: 30px;
|
||||
background-color: rgb(247 247 247);
|
||||
border: solid 1px #f3f3f3;;
|
||||
}
|
||||
|
||||
.tree-table-content {
|
||||
::v-deep .left {
|
||||
padding-top: 4px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
378
src/views/ops/Adhoc/components/SelectJobAssetDialog.vue
Normal file
378
src/views/ops/Adhoc/components/SelectJobAssetDialog.vue
Normal file
@@ -0,0 +1,378 @@
|
||||
<template>
|
||||
<div class="asset-select">
|
||||
<el-card>
|
||||
<div slot="header" class="clearfix">
|
||||
<span>已选资产({{ selectAssets.length }})</span>
|
||||
<el-button
|
||||
v-if="selectAssets.length > 0"
|
||||
style="float: right; padding: 3px 0"
|
||||
type="text"
|
||||
@click="handleClick"
|
||||
>
|
||||
请选择资产
|
||||
</el-button>
|
||||
</div>
|
||||
<div
|
||||
v-if="selectAssets.length === 0"
|
||||
class="empty-assets"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
aria-label="Select assets"
|
||||
@click=" handleClick()"
|
||||
>
|
||||
<i class="icon el-icon-plus" />
|
||||
<span class="title">请选择资产</span>
|
||||
<span class="subtitle">点击添加</span>
|
||||
</div>
|
||||
<div v-else class="asset-list">
|
||||
<div
|
||||
v-for="group in groupedAssets"
|
||||
:key="group.key"
|
||||
class="platform-group"
|
||||
>
|
||||
<div class="platform-group-header">
|
||||
<el-checkbox
|
||||
:indeterminate="isPlatformIndeterminate(group)"
|
||||
:value="isPlatformAllSelected(group)"
|
||||
@change="val => togglePlatformAll(group, val)"
|
||||
>
|
||||
<span class="platform-title">
|
||||
<img
|
||||
v-if="group.assets.length"
|
||||
:src="getPlatformLogo(group.assets[0])"
|
||||
class="platform-icon"
|
||||
>
|
||||
{{ group.platformName }} ({{ group.assets.length }})
|
||||
</span>
|
||||
</el-checkbox>
|
||||
</div>
|
||||
<el-checkbox-group
|
||||
v-model="selectAssets"
|
||||
class="platform-group-assets"
|
||||
@change="onCheckboxChange"
|
||||
>
|
||||
<el-checkbox
|
||||
v-for="item in group.assets"
|
||||
:key="item.id"
|
||||
:label="item.id"
|
||||
>
|
||||
<span
|
||||
:title="item.name"
|
||||
class="asset-name"
|
||||
>{{ item.name }}</span>
|
||||
<i
|
||||
class="el-icon-minus asset-remove-icon"
|
||||
title="移除"
|
||||
@click.stop="removeAsset(item)"
|
||||
/>
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<AssetSelectDialog
|
||||
v-if="dialogVisible"
|
||||
ref="dialog"
|
||||
:base-node-url="baseNodeUrl"
|
||||
:base-url="baseUrl"
|
||||
:tree-setting="treeSetting"
|
||||
:tree-url-query="treeUrlQuery"
|
||||
:value="selectAssets"
|
||||
:visible.sync="dialogVisible"
|
||||
v-bind="$attrs"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
v-on="$listeners"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AssetSelectDialog from '@/components/Apps/AssetSelect/dialog.vue'
|
||||
import { loadPlatformIcon } from '@/utils/jms/index'
|
||||
|
||||
export default {
|
||||
componentName: 'SelectJobAssetDialog',
|
||||
components: { AssetSelectDialog },
|
||||
props: {
|
||||
baseUrl: {
|
||||
type: String,
|
||||
default: '/api/v1/perms/users/self/assets/'
|
||||
},
|
||||
defaultPageSize: {
|
||||
type: Number,
|
||||
default: 10
|
||||
},
|
||||
baseNodeUrl: {
|
||||
type: String,
|
||||
default: '/api/v1/perms/users/self/nodes/'
|
||||
},
|
||||
treeUrlQuery: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
}
|
||||
},
|
||||
value: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
treeSetting: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
disabled: {
|
||||
type: [Boolean, Function],
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
selectAssetRows: [],
|
||||
selectAssets: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
groupedAssets() {
|
||||
const map = {}
|
||||
this.selectAssetRows.forEach(a => {
|
||||
const key = a?.type?.value || 'unknown'
|
||||
const name = a?.type?.label || a?.type?.value || 'Unknown'
|
||||
if (!map[key]) {
|
||||
map[key] = { key, platformName: name, assets: [] }
|
||||
}
|
||||
map[key].assets.push(a)
|
||||
})
|
||||
return Object.values(map)
|
||||
.map(g => {
|
||||
g.assets = g.assets.slice().sort((x, y) => (x.name || '').localeCompare(y.name || ''))
|
||||
return g
|
||||
})
|
||||
.sort((a, b) => a.platformName.localeCompare(b.platformName))
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleClick() {
|
||||
this.dialogVisible = true
|
||||
},
|
||||
handleConfirm(valueSelected, rowsAdd) {
|
||||
if (valueSelected === undefined) {
|
||||
return
|
||||
}
|
||||
this.$emit('change', valueSelected)
|
||||
rowsAdd.forEach(item => {
|
||||
if (!this.selectAssetRows.find(i => i.id === item.id)) {
|
||||
this.selectAssetRows.push(item)
|
||||
}
|
||||
})
|
||||
// 移除已经取消选择的资产
|
||||
this.selectAssetRows = this.selectAssetRows.filter(r => valueSelected.includes(r.id))
|
||||
this.selectAssets = valueSelected
|
||||
this.dialogVisible = false
|
||||
},
|
||||
handleCancel() {
|
||||
this.dialogVisible = false
|
||||
},
|
||||
getPlatformLogo(platform) {
|
||||
return loadPlatformIcon(platform.name, platform.type.value)
|
||||
},
|
||||
onCheckboxChange(value) {
|
||||
this.selectAssets = value
|
||||
this.$emit('change', value)
|
||||
},
|
||||
isPlatformAllSelected(group) {
|
||||
return group.assets.length > 0 && group.assets.every(a => this.selectAssets.includes(a.id))
|
||||
},
|
||||
isPlatformIndeterminate(group) {
|
||||
const selected = group.assets.filter(a => this.selectAssets.includes(a.id)).length
|
||||
return selected > 0 && selected < group.assets.length
|
||||
},
|
||||
togglePlatformAll(group, checked) {
|
||||
const ids = group.assets.map(a => a.id)
|
||||
if (checked) {
|
||||
const merged = new Set(this.selectAssets.concat(ids))
|
||||
this.selectAssets = Array.from(merged)
|
||||
} else {
|
||||
this.selectAssets = this.selectAssets.filter(id => !ids.includes(id))
|
||||
}
|
||||
this.$emit('change', this.selectAssets)
|
||||
},
|
||||
removeAsset(asset) {
|
||||
this.selectAssets = this.selectAssets.filter(id => id !== asset.id)
|
||||
this.selectAssetRows = this.selectAssetRows.filter(r => r.id !== asset.id)
|
||||
this.$emit('change', this.selectAssets)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.asset-select {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: #fff;
|
||||
color: var(--color-border);
|
||||
|
||||
::v-deep {
|
||||
.el-card {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.el-card__body {
|
||||
height: calc(100vh - 200px);
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
padding: 10px 16px;
|
||||
}
|
||||
|
||||
.el-checkbox {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
padding: 3px 0;
|
||||
margin-right: 0;
|
||||
align-items: center;
|
||||
|
||||
.asset-remove-icon {
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
cursor: pointer;
|
||||
font-weight: normal;
|
||||
transition: opacity .15s ease;
|
||||
margin-left: auto;
|
||||
color: var(--color-danger);
|
||||
}
|
||||
|
||||
.el-checkbox__label {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 3px;
|
||||
padding-right: 20px;
|
||||
padding-left: 3px;
|
||||
}
|
||||
|
||||
.el-checkbox__label:hover .asset-remove-icon {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.asset-list {
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.asset-name {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
max-width: 180px;
|
||||
}
|
||||
|
||||
.platform-group {
|
||||
margin-bottom: 8px;
|
||||
padding: 6px 8px;
|
||||
}
|
||||
|
||||
.platform-group-header {
|
||||
padding-bottom: 4px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.platform-title {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
color: #a2aabd;
|
||||
font-weight: 800;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.platform-icon {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
}
|
||||
|
||||
.platform-group-assets {
|
||||
padding-left: 15px;
|
||||
margin-left: 3px;
|
||||
border-left: 2px solid var(--color-border);
|
||||
}
|
||||
|
||||
.select-asset-button {
|
||||
position: relative;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%); /* 让中心点对齐 */
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.el-select {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.page ::v-deep .page-heading {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.el-dialog__wrapper ::v-deep .el-dialog__body {
|
||||
padding: 0 0 0 3px;
|
||||
}
|
||||
|
||||
.empty-assets {
|
||||
border: 2px dashed #d9d9d9;
|
||||
border-radius: 6px;
|
||||
padding: 56px 16px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
transition: border-color .2s, background-color .25s, color .2s;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #909399;
|
||||
height: 100%;
|
||||
background: #fff;
|
||||
|
||||
.icon {
|
||||
font-size: 42px;
|
||||
line-height: 1;
|
||||
margin-bottom: 14px;
|
||||
color: #c0c4cc;
|
||||
transition: color .2s;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
font-size: 12px;
|
||||
opacity: .75;
|
||||
}
|
||||
}
|
||||
|
||||
.empty-assets:hover:not(.is-disabled) {
|
||||
border-color: var(--color-primary);
|
||||
background: #f5f9ff;
|
||||
color: var(--color-primary);
|
||||
|
||||
.icon {
|
||||
color: var(--color-primary);
|
||||
}
|
||||
}
|
||||
|
||||
.empty-assets.is-disabled {
|
||||
cursor: not-allowed;
|
||||
opacity: .55;
|
||||
background: #fafafa;
|
||||
|
||||
.disabled-tip {
|
||||
color: #c0c4cc;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -10,136 +10,142 @@
|
||||
{{ tip }}
|
||||
</span>
|
||||
</el-alert>
|
||||
|
||||
<AssetTreeTable ref="AssetTreeTable" :tree-setting="treeSetting">
|
||||
<template slot="table">
|
||||
<div class="transition-box" style="width: calc(100% - 17px);">
|
||||
<div class="upload_input">
|
||||
<el-button
|
||||
:disabled="runButton.disabled"
|
||||
:type="runButton.el&&runButton.el.type"
|
||||
size="small"
|
||||
style="display: inline-block; padding: 6px 10px"
|
||||
@click="runButton.callback()"
|
||||
>
|
||||
<i :class="runButton.icon" style="margin-right: 4px;" />{{ runButton.name }}
|
||||
</el-button>
|
||||
</div>
|
||||
<span style="color: red">*</span>
|
||||
<div class="upload_input">{{ $t('Account') }}:</div>
|
||||
<div class="upload_input">
|
||||
<el-autocomplete
|
||||
v-model="runAsInput.value"
|
||||
:fetch-suggestions="runAsInput.el.query"
|
||||
:placeholder="runAsInput.placeholder"
|
||||
size="mini"
|
||||
style="display: inline-block; margin: 0 2px"
|
||||
@change="runAsInput.callback(runAsInput.value)"
|
||||
@select="runAsInput.callback(runAsInput.value)"
|
||||
/>
|
||||
</div>
|
||||
<div class="upload_input">{{ $t('UploadDir') }}:</div>
|
||||
<div class="upload_input">
|
||||
<el-input
|
||||
v-if="dstPathInput.type==='input'"
|
||||
v-model="dstPath"
|
||||
:placeholder="dstPathInput.placeholder"
|
||||
size="mini"
|
||||
@change="dstPathInput.callback(dstPathInput.value)"
|
||||
>
|
||||
<template slot="prepend">/tmp/</template>
|
||||
</el-input>
|
||||
</div>
|
||||
<div
|
||||
class="file-uploader"
|
||||
<div class="job-container">
|
||||
<div class="select-assets">
|
||||
<SelectJobAssetDialog @change="handleSelectAssets" />
|
||||
</div>
|
||||
<div class="transition-box" style="width: calc(100% - 17px);">
|
||||
<div class="upload_input">
|
||||
<el-button
|
||||
:disabled="runButton.disabled"
|
||||
:type="runButton.el&&runButton.el.type"
|
||||
size="small"
|
||||
style="display: inline-block; padding: 6px 10px"
|
||||
@click="runButton.callback()"
|
||||
>
|
||||
<el-card>
|
||||
<el-upload
|
||||
v-if="ready"
|
||||
ref="upload"
|
||||
:auto-upload="false"
|
||||
:on-change="onFileChange"
|
||||
:value.sync="uploadFileList"
|
||||
action=""
|
||||
drag
|
||||
multiple
|
||||
>
|
||||
<i class="el-icon-upload" />
|
||||
<div class="el-upload__text" style="margin-bottom: 10px;padding: 0 5px 0 5px ">
|
||||
{{ $t('DragUploadFileInfo') }}
|
||||
</div>
|
||||
<span>
|
||||
{{ $t('UploadFileLthHelpText', {limit: SizeLimitMb}) }}
|
||||
</span>
|
||||
<div slot="file" slot-scope="{file}">
|
||||
<li class="el-upload-list__item is-ready" tabindex="0">
|
||||
<a :style="sameFileStyle(file)" class="el-upload-list__item-name">
|
||||
<i class="el-icon-document" />{{ file.name }}
|
||||
<i style="color: #1ab394;float: right;font-weight:normal">
|
||||
{{ formatFileSize(file.size) }}
|
||||
<i class="el-icon-close" @click="removeFile(file)" />
|
||||
</i>
|
||||
</a>
|
||||
</li>
|
||||
</div>
|
||||
<div
|
||||
v-if="uploadFileList.length === 0"
|
||||
slot="tip"
|
||||
class="empty-file-tip"
|
||||
>
|
||||
{{ $tc('NoFiles') }}
|
||||
</div>
|
||||
</el-upload>
|
||||
<el-progress v-if="ShowProgress" :percentage="progressLength" />
|
||||
|
||||
</el-card>
|
||||
</div>
|
||||
<div style="margin-bottom: 5px;font-weight: bold; display: inline-block">{{ $tc('Output') }}:</div>
|
||||
<span v-if="executionInfo.status && summary" style="float: right">
|
||||
<span>
|
||||
<span><b>{{ $tc('Status') }}: </b></span>
|
||||
<span
|
||||
v-if="executionInfo.status==='timeout'"
|
||||
class="status_warning"
|
||||
>{{ $tc('Timeout') }}</span>
|
||||
<span v-else>
|
||||
<span class="status_success">{{ $tc('Success') + ': ' + summary.success }}</span>
|
||||
<span class="status_warning">{{ $tc('Skip') + ': ' + summary.skip }}</span>
|
||||
<span class="status_danger">{{ $tc('Failed') + ': ' + summary.failed }}</span>
|
||||
<i :class="runButton.icon" style="margin-right: 4px;" />{{ runButton.name }}
|
||||
</el-button>
|
||||
</div>
|
||||
<span style="color: red">*</span>
|
||||
<div class="upload_input">{{ $t('Account') }}:</div>
|
||||
<div class="upload_input">
|
||||
<el-autocomplete
|
||||
v-model="runAsInput.value"
|
||||
:fetch-suggestions="runAsInput.el.query"
|
||||
:placeholder="runAsInput.placeholder"
|
||||
size="mini"
|
||||
style="display: inline-block; margin: 0 2px"
|
||||
@change="runAsInput.callback(runAsInput.value)"
|
||||
@select="runAsInput.callback(runAsInput.value)"
|
||||
/>
|
||||
</div>
|
||||
<div class="upload_input">{{ $t('UploadDir') }}:</div>
|
||||
<div class="upload_input">
|
||||
<el-input
|
||||
v-if="dstPathInput.type==='input'"
|
||||
v-model="dstPath"
|
||||
:placeholder="dstPathInput.placeholder"
|
||||
size="mini"
|
||||
@change="dstPathInput.callback(dstPathInput.value)"
|
||||
>
|
||||
<template slot="prepend">/tmp/</template>
|
||||
</el-input>
|
||||
</div>
|
||||
<div
|
||||
class="file-uploader"
|
||||
>
|
||||
<el-card>
|
||||
<el-upload
|
||||
v-if="ready"
|
||||
ref="upload"
|
||||
:auto-upload="false"
|
||||
:on-change="onFileChange"
|
||||
:value.sync="uploadFileList"
|
||||
action=""
|
||||
drag
|
||||
multiple
|
||||
>
|
||||
<i class="el-icon-upload" />
|
||||
<div class="el-upload__text" style="margin-bottom: 10px;padding: 0 5px 0 5px ">
|
||||
{{ $t('DragUploadFileInfo') }}
|
||||
</div>
|
||||
<span>
|
||||
{{ $t('UploadFileLthHelpText', {limit: sizeLimitMb}) }}
|
||||
</span>
|
||||
</span>
|
||||
<span>
|
||||
<span><b>{{ $tc('TimeDelta') }}: </b></span>
|
||||
<span>{{ executionInfo.timeCost }}</span>
|
||||
<div slot="file" slot-scope="{file}">
|
||||
<li class="el-upload-list__item is-ready" tabindex="0">
|
||||
<a :style="sameFileStyle(file)" class="el-upload-list__item-name">
|
||||
<i class="el-icon-document" />{{ file.name }}
|
||||
<i style="color: #1ab394;float: right;font-weight:normal">
|
||||
{{ formatFileSize(file.size) }}
|
||||
<i class="el-icon-close" @click="removeFile(file)" />
|
||||
</i>
|
||||
</a>
|
||||
</li>
|
||||
</div>
|
||||
<div
|
||||
v-if="uploadFileList.length === 0"
|
||||
slot="tip"
|
||||
class="empty-file-tip"
|
||||
>
|
||||
{{ $tc('NoFiles') }}
|
||||
</div>
|
||||
</el-upload>
|
||||
<el-progress
|
||||
v-if="showProgress"
|
||||
:percentage="progressLength"
|
||||
/>
|
||||
<div v-if="showProgress" class="status-info">
|
||||
<span class="left">{{ speedText }}</span>
|
||||
<span class="right">{{ loadedSize }} / {{ totalSize }}</span>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
<div style="margin-bottom: 5px;font-weight: bold; display: inline-block">{{ $tc('Output') }}:</div>
|
||||
<span v-if="executionInfo.status && summary && !showProgress" style="float: right">
|
||||
<span>
|
||||
<span><b>{{ $tc('Status') }}: </b></span>
|
||||
<span
|
||||
v-if="executionInfo.status==='timeout'"
|
||||
class="status_warning"
|
||||
>{{ $tc('Timeout') }}</span>
|
||||
<span v-else>
|
||||
<span class="status_success">{{ $tc('Success') + ': ' + summary.success }}</span>
|
||||
<span class="status_warning">{{ $tc('Skip') + ': ' + summary.skip }}</span>
|
||||
<span class="status_danger">{{ $tc('Failed') + ': ' + summary.failed }}</span>
|
||||
</span>
|
||||
</span>
|
||||
<div class="output">
|
||||
<Term
|
||||
ref="xterm"
|
||||
:show-tool-bar="true"
|
||||
:xterm-config="xtermConfig"
|
||||
/>
|
||||
<div style="height: 2px" />
|
||||
</div>
|
||||
<div style="display: flex; margin-top:10px; justify-content: space-between" />
|
||||
<span>
|
||||
<span><b>{{ $tc('TimeDelta') }}: </b></span>
|
||||
<span>{{ executionInfo.timeCost }}</span>
|
||||
</span>
|
||||
</span>
|
||||
<div class="output">
|
||||
<Term
|
||||
ref="xterm"
|
||||
:show-tool-bar="true"
|
||||
:xterm-config="xtermConfig"
|
||||
/>
|
||||
<div style="height: 2px" />
|
||||
</div>
|
||||
</template>
|
||||
</AssetTreeTable>
|
||||
<div style="display: flex; margin-top:10px; justify-content: space-between" />
|
||||
</div>
|
||||
</div>
|
||||
</Page>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AssetTreeTable from '@/components/Apps/AssetTreeTable'
|
||||
import Term from '@/components/Widgets/Term'
|
||||
import Page from '@/layout/components/Page'
|
||||
import { createJob, getTaskDetail, JobUploadFile } from '@/api/ops'
|
||||
import { formatFileSize } from '@/utils/common/index'
|
||||
import store from '@/store'
|
||||
import SelectJobAssetDialog from '@/views/ops/Adhoc/components/SelectJobAssetDialog.vue'
|
||||
|
||||
export default {
|
||||
name: 'FileTransfer',
|
||||
components: {
|
||||
AssetTreeTable,
|
||||
SelectJobAssetDialog,
|
||||
Page,
|
||||
Term
|
||||
},
|
||||
@@ -154,7 +160,6 @@ export default {
|
||||
cancel: 0
|
||||
},
|
||||
xtermConfig: {},
|
||||
DataZTree: 0,
|
||||
runas: '',
|
||||
dstPath: '',
|
||||
runButton: {
|
||||
@@ -209,27 +214,11 @@ export default {
|
||||
this.chdir = val
|
||||
}
|
||||
},
|
||||
treeSetting: {
|
||||
treeUrl: '/api/v1/perms/users/self/nodes/children-with-assets/tree/',
|
||||
searchUrl: '/api/v1/perms/users/self/assets/tree/',
|
||||
notShowBuiltinTree: true,
|
||||
showRefresh: true,
|
||||
showMenu: false,
|
||||
showSearch: true,
|
||||
check: {
|
||||
enable: true
|
||||
},
|
||||
view: {
|
||||
dblClickExpand: false,
|
||||
showLine: true
|
||||
}
|
||||
},
|
||||
iShowTree: true,
|
||||
progressLength: 0,
|
||||
ShowProgress: false,
|
||||
showProgress: false,
|
||||
upload_interval: null,
|
||||
uploadFileList: [],
|
||||
SizeLimitMb: store.getters.publicSettings['FILE_UPLOAD_SIZE_LIMIT_MB'],
|
||||
sizeLimitMb: store.getters.publicSettings['FILE_UPLOAD_SIZE_LIMIT_MB'],
|
||||
summary: {
|
||||
'success': 0,
|
||||
'failed': 0,
|
||||
@@ -239,15 +228,16 @@ export default {
|
||||
this.$tc('FileTransferBootStepHelpTips1'),
|
||||
this.$tc('FileTransferBootStepHelpTips2'),
|
||||
this.$tc('FileTransferBootStepHelpTips3')
|
||||
]
|
||||
],
|
||||
speedText: '',
|
||||
loadedSize: '',
|
||||
totalSize: '',
|
||||
selectHosts: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
xterm() {
|
||||
return this.$refs.xterm.xterm
|
||||
},
|
||||
ztree() {
|
||||
return this.$refs.AssetTreeTable.$refs.TreeList.$refs.AutoDataZTree.$refs.AutoDataZTree.$refs.dataztree.$refs.ztree
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -301,8 +291,7 @@ export default {
|
||||
if (this.executionInfo.status === 'success') {
|
||||
this.$message.success(this.$tc('RunSucceed'))
|
||||
clearInterval(this.upload_interval)
|
||||
this.progressLength = 100
|
||||
this.ShowProgress = true
|
||||
this.showProgress = false
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -315,13 +304,6 @@ export default {
|
||||
msg = JSON.stringify({ task: this.currentTaskId })
|
||||
this.ws.send(msg)
|
||||
},
|
||||
getSelectedNodes() {
|
||||
return this.ztree.getCheckedNodes().filter(node => {
|
||||
const status = node.getCheckStatus()
|
||||
return node.id !== 'search' && status.half === false
|
||||
})
|
||||
},
|
||||
|
||||
setCostTimeInterval() {
|
||||
this.runButton.icon = 'fa fa-spinner fa-spin'
|
||||
this.runButton.disabled = true
|
||||
@@ -330,17 +312,8 @@ export default {
|
||||
}, 1000)
|
||||
},
|
||||
getSelectedNodesAndHosts() {
|
||||
const hosts = this.getSelectedNodes().filter((item) => {
|
||||
return item.meta.type !== 'node'
|
||||
}).map(function(node) {
|
||||
return node.id
|
||||
})
|
||||
|
||||
const nodes = this.getSelectedNodes().filter((item) => {
|
||||
return item.meta.type === 'node'
|
||||
}).map(function(node) {
|
||||
return node.meta.data.id
|
||||
})
|
||||
const hosts = this.selectHosts
|
||||
const nodes = []
|
||||
return { hosts, nodes }
|
||||
},
|
||||
truncateFileName(fullName) {
|
||||
@@ -366,7 +339,7 @@ export default {
|
||||
return ''
|
||||
},
|
||||
isFileExceedsLimit(file) {
|
||||
const isGtLimit = file.size / 1024 / 1024 > this.SizeLimitMb
|
||||
const isGtLimit = file.size / 1024 / 1024 > this.sizeLimitMb
|
||||
if (isGtLimit) {
|
||||
this.$message.error(this.$tc('FileSizeExceedsLimit'))
|
||||
}
|
||||
@@ -381,6 +354,9 @@ export default {
|
||||
this.uploadFileList.splice(this.uploadFileList.indexOf(file), 1)
|
||||
this.handleSameFile(this.uploadFileList)
|
||||
},
|
||||
formatSpeed(bps) {
|
||||
return `${this.formatFileSize(bps)}/s`
|
||||
},
|
||||
execute() {
|
||||
const { hosts, nodes } = this.getSelectedNodesAndHosts()
|
||||
for (const file of this.uploadFileList) {
|
||||
@@ -426,8 +402,10 @@ export default {
|
||||
createJob(data).then(res => {
|
||||
this.progressLength = 0
|
||||
this.executionInfo.timeCost = 0
|
||||
this.ShowProgress = true
|
||||
this.showProgress = true
|
||||
this.speedText = ''
|
||||
const form = new FormData()
|
||||
const start = Date.now()
|
||||
for (const file of this.uploadFileList) {
|
||||
form.append('files', file.raw)
|
||||
form.append('job_id', res.id)
|
||||
@@ -437,31 +415,59 @@ export default {
|
||||
clearInterval(this.upload_interval)
|
||||
return
|
||||
}
|
||||
this.progressLength += 1
|
||||
}, 100)
|
||||
JobUploadFile(form).then(res => {
|
||||
JobUploadFile(form, {
|
||||
onUploadProgress: (e) => {
|
||||
if (!e.total) return
|
||||
const percent = Math.floor((e.loaded / e.total) * 100)
|
||||
this.progressLength = Math.min(percent, 100)
|
||||
this.loadedSize = formatFileSize(e.loaded)
|
||||
this.totalSize = formatFileSize(e.total)
|
||||
const elapsedSec = (Date.now() - start) / 1000
|
||||
if (elapsedSec > 0) {
|
||||
const speed = e.loaded / elapsedSec
|
||||
this.speedText = this.formatSpeed(speed)
|
||||
}
|
||||
}
|
||||
}).then(res => {
|
||||
this.executionInfo.status = 'running'
|
||||
this.currentTaskId = res.task_id
|
||||
this.xtermConfig = { taskId: this.currentTaskId, type: 'shortcut_cmd' }
|
||||
this.setCostTimeInterval()
|
||||
this.writeExecutionOutput()
|
||||
}).catch(() => {
|
||||
}).catch((error) => {
|
||||
this.$message.error(this.$tc('Error'), error)
|
||||
this.execute_stop()
|
||||
})
|
||||
})
|
||||
},
|
||||
execute_stop() {
|
||||
this.progressLength = 0
|
||||
this.ShowProgress = false
|
||||
this.showProgress = false
|
||||
this.runButton.disabled = false
|
||||
clearInterval(this.upload_interval)
|
||||
this.runButton.icon = 'fa fa-play'
|
||||
},
|
||||
handleSelectAssets(assets) {
|
||||
this.selectHosts = assets
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.job-container {
|
||||
display: flex;
|
||||
|
||||
.select-assets {
|
||||
width: 23.6%;
|
||||
}
|
||||
}
|
||||
|
||||
.transition-box {
|
||||
margin-left: 30px;
|
||||
}
|
||||
|
||||
.mini-button {
|
||||
width: 12px;
|
||||
float: right;
|
||||
@@ -473,19 +479,11 @@ export default {
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.el-tree {
|
||||
background-color: inherit !important;
|
||||
}
|
||||
|
||||
.mini {
|
||||
margin-right: 5px;
|
||||
width: 12px !important;
|
||||
}
|
||||
|
||||
.auto-data-ztree {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.vue-codemirror-wrap ::v-deep .CodeMirror {
|
||||
width: 600px;
|
||||
height: 100px;
|
||||
@@ -496,11 +494,6 @@ export default {
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.tree-box {
|
||||
margin-right: 2px;
|
||||
border: 1px solid #e0e0e0;
|
||||
}
|
||||
|
||||
.status_success {
|
||||
color: var(--color-primary);
|
||||
}
|
||||
@@ -568,6 +561,14 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.el-progress-bar {
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
.el-progress__text {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -580,4 +581,11 @@ export default {
|
||||
.output ::v-deep #terminal {
|
||||
border: dashed 1px #d9d9d9;
|
||||
}
|
||||
|
||||
.status-info {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@@ -189,8 +189,7 @@ export const realChoices = [
|
||||
},
|
||||
{
|
||||
label: AccountLabelMapper[ExcludeAccount],
|
||||
value: ExcludeAccount,
|
||||
tip: i18n.t('ExcludeAccountTip')
|
||||
value: ExcludeAccount
|
||||
},
|
||||
{
|
||||
label: AccountLabelMapper[NoneAccount],
|
||||
|
||||
@@ -20,7 +20,8 @@ export default {
|
||||
hasExport: false,
|
||||
hasImport: false,
|
||||
hasBulkDelete: false,
|
||||
hasCreate: true
|
||||
hasCreate: true,
|
||||
canCreate: true
|
||||
},
|
||||
tableConfig: {
|
||||
hasSelection: true,
|
||||
@@ -41,6 +42,12 @@ export default {
|
||||
date_created: {
|
||||
label: this.$t('DateCreated'),
|
||||
formatter: DateFormatter
|
||||
},
|
||||
actions: {
|
||||
formatterArgs: {
|
||||
canUpdate: true,
|
||||
canClone: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ export default {
|
||||
},
|
||||
callbacks: {
|
||||
click: function() {
|
||||
this.$router.push({ name: 'SSHKeyList', query: { tab: 'SSHKey' } })
|
||||
this.$router.push({ name: 'SSHKeyList', query: { tab: 'SSHKeyList' } })
|
||||
}.bind(this)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
{{ description }}
|
||||
</div>
|
||||
</div>
|
||||
<span v-if="!nav && url" class="export-btn">
|
||||
<span v-if="!nav && url && showReportExportBtn" class="export-btn">
|
||||
<el-button type="text" @click="openNewWindow">
|
||||
<i class="fa fa-external-link" style="font-size: 15px;" />
|
||||
{{ $t('Export') }}
|
||||
@@ -42,6 +42,7 @@
|
||||
<script>
|
||||
import Logo from '@/layout/components/NavLeft/Logo'
|
||||
import RightAction from './RightAction.vue'
|
||||
import store from '@/store'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -84,6 +85,9 @@ export default {
|
||||
computed: {
|
||||
isDescription() {
|
||||
return this.description && this.description.trim() !== ''
|
||||
},
|
||||
showReportExportBtn() {
|
||||
return store.getters.hasValidLicense
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
<TreeTable
|
||||
ref="CommandTreeTable"
|
||||
v-loading="loading"
|
||||
:title="title"
|
||||
:header-actions="headerActions"
|
||||
:table-config="tableConfig"
|
||||
:tree-setting="treeSetting"
|
||||
@@ -39,6 +40,7 @@ export default {
|
||||
const dateFrom = getDaysAgo(7).toISOString()
|
||||
const dateTo = this.$moment(getDayEnd()).add(1, 'day').toISOString()
|
||||
return {
|
||||
title: this.$t('CommandStorage'),
|
||||
loading: true,
|
||||
tableConfig: {
|
||||
url: '/api/v1/terminal/commands/',
|
||||
|
||||
Reference in New Issue
Block a user