mirror of
https://github.com/jumpserver/lina.git
synced 2025-11-10 11:50:35 +00:00
Compare commits
50 Commits
v3.10.10-l
...
pr@v3@perf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf094cbb88 | ||
|
|
66532f4d4b | ||
|
|
42f27eb30f | ||
|
|
57920bf771 | ||
|
|
290772f44e | ||
|
|
f140f2f59e | ||
|
|
7b1883e012 | ||
|
|
352ac7e828 | ||
|
|
1cbd58664c | ||
|
|
e48da6be9b | ||
|
|
fa31b36550 | ||
|
|
6b93a6563d | ||
|
|
d561701049 | ||
|
|
edbf477c1e | ||
|
|
6a2578b339 | ||
|
|
2cb7569cb0 | ||
|
|
9e0c623b9a | ||
|
|
40bf040501 | ||
|
|
efee7c7bbf | ||
|
|
5daecb84ae | ||
|
|
3be325214d | ||
|
|
581509f42f | ||
|
|
654b36b064 | ||
|
|
dcec73ae67 | ||
|
|
00bafa8164 | ||
|
|
da09af79a7 | ||
|
|
b596815ea5 | ||
|
|
cb37273e80 | ||
|
|
c5bf7d0ad2 | ||
|
|
c31195a67a | ||
|
|
1eb59b379a | ||
|
|
b7cee17156 | ||
|
|
f1c8874010 | ||
|
|
5ccaa3b77d | ||
|
|
27d3637330 | ||
|
|
9c8ceb04f0 | ||
|
|
ccd7b319c8 | ||
|
|
55637c7fa1 | ||
|
|
4e95c88318 | ||
|
|
1ff49ca16d | ||
|
|
91c44d0500 | ||
|
|
0b3a9844f7 | ||
|
|
95b58f3c96 | ||
|
|
128b9c79ba | ||
|
|
4eda83f83d | ||
|
|
4cd0071054 | ||
|
|
67a2a9be6a | ||
|
|
f927a2a3cc | ||
|
|
ca40cb34da | ||
|
|
d725e5497d |
@@ -10,3 +10,4 @@ jobs:
|
||||
- uses: jumpserver/action-generic-handler@master
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.PRIVATE_TOKEN }}
|
||||
I18N_TOKEN: ${{ secrets.I18N_TOKEN }}
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
"css-color-function": "^1.3.3",
|
||||
"decimal.js": "^10.4.3",
|
||||
"deepmerge": "^4.2.2",
|
||||
"dompurify": "^3.1.6",
|
||||
"echarts": "4.7.0",
|
||||
"element-ui": "2.13.2",
|
||||
"eslint-plugin-html": "^6.0.0",
|
||||
|
||||
@@ -151,6 +151,3 @@ export default {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
|
||||
@@ -353,7 +353,7 @@ export default {
|
||||
name: 'BulkVerify',
|
||||
title: this.$t('accounts.BulkVerify'),
|
||||
type: 'primary',
|
||||
fa: 'fa-handshake-o',
|
||||
fa: 'fa-link',
|
||||
can: ({ selectedRows }) => {
|
||||
return selectedRows.length > 0 &&
|
||||
['clickhouse', 'redis', 'website', 'chatgpt'].indexOf(selectedRows[0].asset.type.value) === -1 &&
|
||||
|
||||
@@ -83,6 +83,10 @@ export default {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default: 'account'
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: function() {
|
||||
@@ -136,7 +140,8 @@ export default {
|
||||
name: this.secretInfo.name,
|
||||
secret: encryptPassword(this.modifiedSecret)
|
||||
}
|
||||
this.$axios.patch(`/api/v1/accounts/accounts/${this.account.id}/`, params).then(() => {
|
||||
const url = this.type === 'account' ? `/api/v1/accounts/accounts` : `/api/v1/accounts/account-templates`
|
||||
this.$axios.patch(`${url}/${this.account.id}/`, params).then(() => {
|
||||
this.$message.success(this.$tc('common.updateSuccessMsg'))
|
||||
})
|
||||
},
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<Dialog
|
||||
:close-on-click-modal="false"
|
||||
:loading-status="!isLoaded"
|
||||
:title="$tc('assets.Assets')"
|
||||
custom-class="asset-select-dialog"
|
||||
top="2vh"
|
||||
@@ -21,6 +22,7 @@
|
||||
:tree-setting="treeSetting"
|
||||
class="tree-table"
|
||||
v-bind="$attrs"
|
||||
@loaded="handleTableLoaded"
|
||||
/>
|
||||
</Dialog>
|
||||
</template>
|
||||
@@ -63,6 +65,7 @@ export default {
|
||||
data() {
|
||||
const vm = this
|
||||
return {
|
||||
isLoaded: false,
|
||||
dialogVisible: false,
|
||||
rowSelected: _.cloneDeep(this.value) || [],
|
||||
rowsAdd: [],
|
||||
@@ -143,6 +146,9 @@ export default {
|
||||
if (selectValueIndex > -1) {
|
||||
this.rowSelected.splice(selectValueIndex, 1)
|
||||
}
|
||||
},
|
||||
handleTableLoaded() {
|
||||
this.isLoaded = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
<script>
|
||||
import Select2 from '@/components/Form/FormFields/Select2.vue'
|
||||
import AssetSelectDialog from './dialog.vue'
|
||||
import { b } from 'css-color-function/lib/adjusters'
|
||||
|
||||
export default {
|
||||
componentName: 'AssetSelect',
|
||||
@@ -81,7 +80,6 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
b,
|
||||
handleFocus() {
|
||||
this.$refs.select2.selectRef.blur()
|
||||
this.dialogVisible = true
|
||||
|
||||
@@ -31,6 +31,10 @@ export default {
|
||||
type: String,
|
||||
default: '/api/v1/assets/assets/'
|
||||
},
|
||||
typeUrl: {
|
||||
type: String,
|
||||
default: '/api/v1/assets/nodes/category/tree/'
|
||||
},
|
||||
nodeUrl: {
|
||||
type: String,
|
||||
default: '/api/v1/assets/nodes/'
|
||||
@@ -101,9 +105,9 @@ export default {
|
||||
showAssets: false,
|
||||
showSearch: false,
|
||||
customTreeHeaderName: this.$t('assets.BuiltinTree'),
|
||||
url: '/api/v1/assets/nodes/category/tree/',
|
||||
url: this.typeUrl,
|
||||
nodeUrl: this.treeSetting?.nodeUrl || this.nodeUrl,
|
||||
treeUrl: `/api/v1/assets/nodes/category/tree/?assets=${showAssets ? '1' : '0'}&count_resource=${this.treeSetting.countResource || 'asset'}`,
|
||||
treeUrl: `${this.typeUrl}?assets=${showAssets ? '1' : '0'}&count_resource=${this.treeSetting.countResource || 'asset'}`,
|
||||
callback: {
|
||||
onSelected: (event, treeNode) => this.getAssetsUrl(treeNode)
|
||||
}
|
||||
|
||||
@@ -82,6 +82,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import Dialog from '@/components/Dialog/index.vue'
|
||||
import { encryptPassword } from '@/utils/crypto'
|
||||
|
||||
export default {
|
||||
name: 'UserConfirmDialog',
|
||||
@@ -199,7 +200,7 @@ export default {
|
||||
const data = {
|
||||
confirm_type: this.confirmTypeRequired,
|
||||
mfa_type: this.confirmTypeRequired === 'mfa' ? this.subTypeSelected : '',
|
||||
secret_key: this.secretValue
|
||||
secret_key: this.confirmTypeRequired === 'password' ? encryptPassword(this.secretValue) : this.secretValue
|
||||
}
|
||||
this.$axios.post(`/api/v1/authentication/confirm/`, data).then(res => {
|
||||
this.callback()
|
||||
|
||||
@@ -9,11 +9,13 @@
|
||||
v-bind="$attrs"
|
||||
v-on="$listeners"
|
||||
>
|
||||
<slot />
|
||||
<div v-loading="loadingStatus">
|
||||
<slot />
|
||||
</div>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<slot name="footer">
|
||||
<el-button v-if="showCancel && showButtons" @click="onCancel">{{ cancelTitle }}</el-button>
|
||||
<el-button v-if="showConfirm && showButtons" :loading="loadingStatus" type="primary" @click="onConfirm">
|
||||
<el-button v-if="showConfirm && showButtons" :disabled="loadingStatus" type="primary" @click="onConfirm">
|
||||
{{ confirmTitle }}
|
||||
</el-button>
|
||||
</slot>
|
||||
@@ -71,13 +73,16 @@ export default {
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {}
|
||||
return {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
iWidth() {
|
||||
return this.$store.getters.isMobile ? '1000px' : this.width
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
onCancel() {
|
||||
this.$emit('cancel')
|
||||
|
||||
@@ -7,7 +7,6 @@ import BasicTree from '@/components/Form/FormFields/BasicTree.vue'
|
||||
import JsonEditor from '@/components/Form/FormFields/JsonEditor.vue'
|
||||
import { assignIfNot } from '@/utils/common'
|
||||
import TagInput from '@/components/Form/FormFields/TagInput.vue'
|
||||
import TransferSelect from '@/components/Form/FormFields/TransferSelect.vue'
|
||||
|
||||
export class FormFieldGenerator {
|
||||
constructor(emit) {
|
||||
@@ -134,9 +133,6 @@ export class FormFieldGenerator {
|
||||
case 'comment':
|
||||
field.el.type = 'textarea'
|
||||
break
|
||||
case 'users':
|
||||
field.component = TransferSelect
|
||||
field.el.label = field.label
|
||||
}
|
||||
return field
|
||||
}
|
||||
|
||||
@@ -7,18 +7,11 @@
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-radio v-model="radioValue" :label="2">
|
||||
{{ this.$t('common.CronTab.from') }}
|
||||
<el-input-number v-model="cycle01" :max="60" :min="0" size="mini" /> -
|
||||
<el-input-number v-model="cycle02" :max="60" :min="0" size="mini" /> {{ this.$t('common.CronTab.min') }}
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-radio v-model="radioValue" :label="3">
|
||||
{{ this.$t('common.CronTab.from') }}
|
||||
<el-input-number v-model="average02" :max="60" :min="1" size="mini" /> {{ this.$t('common.CronTab.min') }}{{ this.$t('common.CronTab.executeOnce') }}
|
||||
<el-input-number v-model="average02" :max="60" :min="1" size="mini" />
|
||||
{{ this.$t('common.CronTab.min') }}{{ this.$t('common.CronTab.executeOnce') }}
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
|
||||
@@ -33,7 +26,7 @@
|
||||
size="small"
|
||||
style="width:100%"
|
||||
>
|
||||
<el-option v-for="item in 60" :key="item" :value="item-1">{{ item-1 }}</el-option>
|
||||
<el-option v-for="item in 60" :key="item" :value="item-1">{{ item - 1 }}</el-option>
|
||||
</el-select>
|
||||
</el-radio>
|
||||
</el-form-item>
|
||||
@@ -158,7 +151,7 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-form-item--small.el-form-item {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.el-form-item--small.el-form-item {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -225,9 +225,6 @@ export default {
|
||||
handler(newValue, oldValue) {
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
iOptions(val) {
|
||||
this.remote = val.length !== 0
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
/>
|
||||
<Dialog
|
||||
v-if="showTransfer"
|
||||
:loading-status="!isLoaded"
|
||||
:close-on-click-modal="false"
|
||||
:title="label"
|
||||
:visible.sync="showTransfer"
|
||||
@@ -18,6 +19,7 @@
|
||||
width="730px"
|
||||
@cancel="handleTransCancel"
|
||||
@confirm="handleTransConfirm"
|
||||
v-on="$listeners"
|
||||
>
|
||||
<krryPaging v-if="selectInitialized" ref="pageTransfer" class="transfer" v-bind="pagingTransfer" />
|
||||
</Dialog>
|
||||
@@ -77,13 +79,16 @@ export default {
|
||||
if (keyword) {
|
||||
params['search'] = keyword
|
||||
}
|
||||
this.isLoaded = false
|
||||
const data = await this.$axios.get(url, { params })
|
||||
this.isLoaded = true
|
||||
return data['results'].map(item => {
|
||||
const n = transformOption(item)
|
||||
return { id: n.value, label: n.label }
|
||||
})
|
||||
}
|
||||
return {
|
||||
isLoaded: false,
|
||||
showTransfer: false,
|
||||
selectInitialized: false,
|
||||
select2: {
|
||||
@@ -166,7 +171,3 @@ export default {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
||||
@@ -42,7 +42,7 @@ export default {
|
||||
patterns.push([/\d/, i18n.t('common.password.NUMBER_REQUIRED')])
|
||||
}
|
||||
if (passwordRule['SECURITY_PASSWORD_SPECIAL_CHAR']) {
|
||||
const pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]")
|
||||
const pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?_+-]")
|
||||
patterns.push([pattern, i18n.t('common.password.SPECIAL_CHAR_REQUIRED')])
|
||||
}
|
||||
for (const [pattern, msg] of patterns) {
|
||||
|
||||
@@ -34,12 +34,14 @@ class StrategyNormal extends StrategyAbstract {
|
||||
onSelectionChange(val) {
|
||||
this.elDataTable.selected = val
|
||||
}
|
||||
|
||||
/**
|
||||
* toggleRowSelection和clearSelection的表现与el-table一致
|
||||
*/
|
||||
toggleRowSelection(...args) {
|
||||
return this.elTable.toggleRowSelection(...args)
|
||||
}
|
||||
|
||||
clearSelection() {
|
||||
return this.elTable.clearSelection()
|
||||
}
|
||||
@@ -50,12 +52,12 @@ class StrategyNormal extends StrategyAbstract {
|
||||
*/
|
||||
class StrategyPersistSelection extends StrategyAbstract {
|
||||
/**
|
||||
* el-table的selection-change事件不适用于开启跨页保存的情况。
|
||||
* 比如,当开启persistSelection时,发生以下两个场景:
|
||||
* el-table 的 selection-change 事件不适用于开启跨页保存的情况。
|
||||
* 比如,当开启 persistSelection时,发生以下两个场景:
|
||||
* 1. 用户点击翻页
|
||||
* 2. 用户点击行首的切换全选项按钮,清空当前页多选项数据
|
||||
* 其中场景1应该保持selected不变;而场景2只应该从selected移除当前页所有行,保留其他页面的多选状态。
|
||||
* 但el-table的selection-change事件在两个场景中无差别发生,所以这里不处理这个事件
|
||||
* 其中场景 1 应该保持 selected 不变;而场景 2 只应该从 selected 移除当前页所有行,保留其他页面的多选状态。
|
||||
* 但 el-table 的 selection-change 事件在两个场景中无差别发生,所以这里不处理这个事件
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -63,53 +65,106 @@ class StrategyPersistSelection extends StrategyAbstract {
|
||||
*/
|
||||
onSelect(selection, row) {
|
||||
const isChosen = selection.indexOf(row) > -1
|
||||
|
||||
this.toggleRowSelection(row, isChosen)
|
||||
}
|
||||
/**
|
||||
* 用户切换当前页的多选
|
||||
*/
|
||||
onSelectAll(selection, selectable = () => true) {
|
||||
const isSelected = !!selection.length
|
||||
this.elDataTable.data.forEach(r => {
|
||||
const { id, selected, data } = this.elDataTable
|
||||
|
||||
const selectedIds = new Set(selected.map(r => r[id]))
|
||||
|
||||
// 获取当前所有已选择的项
|
||||
const selectedRows = data.filter(r => selection.includes(r))
|
||||
|
||||
// 判断是否已全选
|
||||
const isSelected = data.every(r => selectable(r) && selectedRows.includes(r))
|
||||
|
||||
const rowsToSelect = []
|
||||
const rowsToDeselect = []
|
||||
|
||||
data.forEach(r => {
|
||||
if (selectable(r)) {
|
||||
this.toggleRowSelection(r, isSelected)
|
||||
const isRowSelected = selectedIds.has(r[id])
|
||||
|
||||
if (isSelected && !isRowSelected) {
|
||||
rowsToSelect.push(r)
|
||||
} else if (!isSelected && isRowSelected) {
|
||||
rowsToDeselect.push(r)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
if (isSelected) {
|
||||
rowsToSelect.forEach(row => {
|
||||
selected.push(row)
|
||||
selectedIds.add(row[id])
|
||||
})
|
||||
rowsToDeselect.forEach(row => {
|
||||
this.elDataTable.toggleRowSelection(row, true)
|
||||
})
|
||||
} else {
|
||||
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.elTable.selected = Array.from(selectedIds).map(id => {
|
||||
// return data.find(r => r[id] === id)
|
||||
// })
|
||||
}
|
||||
/**
|
||||
* toggleRowSelection和clearSelection管理elDataTable的selected数组
|
||||
* 记得最后要将状态同步到el-table中
|
||||
* toggleRowSelection 和 clearSelection 管理 elDataTable 的 selected 数组
|
||||
* 记得最后要将状态同步到 el-table 中
|
||||
*/
|
||||
toggleRowSelection(row, isSelected) {
|
||||
const { id, selected } = this.elDataTable
|
||||
const foundIndex = selected.findIndex(r => r[id] === row[id])
|
||||
|
||||
if (typeof isSelected === 'undefined') {
|
||||
isSelected = foundIndex <= -1
|
||||
}
|
||||
|
||||
if (isSelected && foundIndex === -1) {
|
||||
selected.push(row)
|
||||
} else if (!isSelected && foundIndex > -1) {
|
||||
selected.splice(foundIndex, 1)
|
||||
}
|
||||
|
||||
this.elDataTable.$emit('toggle-row-selection', isSelected, row)
|
||||
this.updateElTableSelection()
|
||||
}
|
||||
|
||||
clearSelection() {
|
||||
this.elDataTable.selected = []
|
||||
this.updateElTableSelection()
|
||||
}
|
||||
|
||||
/**
|
||||
* 将selected状态同步到el-table中
|
||||
*/
|
||||
updateElTableSelection() {
|
||||
const { data, id, selected } = this.elDataTable
|
||||
|
||||
// 历史勾选的行已经不在当前页了,所以要将当前页的行数据和selected合并
|
||||
const mergeData = _.uniqWith([...data, ...selected], _.isEqual)
|
||||
|
||||
mergeData.forEach(r => {
|
||||
const isSelected = !!selected.find(r2 => r[id] === r2[id])
|
||||
|
||||
if (!this.elTable) {
|
||||
return
|
||||
}
|
||||
|
||||
this.elTable.toggleRowSelection(r, isSelected)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -153,6 +153,8 @@ export default {
|
||||
this.toggleRowSelection(row, true)
|
||||
}
|
||||
}
|
||||
|
||||
this.$emit('loaded')
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
localStorage.setItem('paginationSize', val)
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
import Dialog from '@/components/Dialog/index.vue'
|
||||
import { createSourceIdCache } from '@/api/common'
|
||||
import * as queryUtil from '@/components/Table/DataTable/compenents/el-data-table/utils/query'
|
||||
import { download } from '@/utils/common'
|
||||
|
||||
export default {
|
||||
name: 'ExportDialog',
|
||||
@@ -187,10 +188,7 @@ export default {
|
||||
})
|
||||
},
|
||||
downloadCsv(url) {
|
||||
const a = document.createElement('a')
|
||||
a.href = url
|
||||
a.click()
|
||||
window.URL.revokeObjectURL(url)
|
||||
download(url)
|
||||
},
|
||||
async defaultPerformExport(selectRows, exportOption, q, exportTypeOption) {
|
||||
const url = (process.env.VUE_APP_ENV === 'production') ? (`${this.url}`) : (`${process.env.VUE_APP_BASE_API}${this.url}`)
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
<script>
|
||||
import Dialog from '@/components/Dialog/index.vue'
|
||||
import ImportTable from '@/components/Table/ListTable/TableAction/ImportTable.vue'
|
||||
import { getErrorResponseMsg } from '@/utils/common'
|
||||
import { download, getErrorResponseMsg } from '@/utils/common'
|
||||
import { createSourceIdCache } from '@/api/common'
|
||||
|
||||
export default {
|
||||
@@ -221,10 +221,7 @@ export default {
|
||||
this.$message.success(msg)
|
||||
},
|
||||
downloadCsv(url) {
|
||||
const a = document.createElement('a')
|
||||
a.href = url
|
||||
a.click()
|
||||
window.URL.revokeObjectURL(url)
|
||||
download(url)
|
||||
},
|
||||
async handleImportConfirm() {
|
||||
await this.$refs['importTable'].performUpload()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-row>
|
||||
<el-row type="flex" align="center">
|
||||
<el-col :md="8" :sm="24">
|
||||
<div class="tableFilter">
|
||||
<el-radio-group v-model="importStatusFilter" size="small">
|
||||
@@ -11,7 +11,7 @@
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :md="8" :sm="24" style="text-align: center">
|
||||
<el-col :md="16" :sm="24" style="text-align: center; display: flex; align-items: center">
|
||||
<span class="summary-item summary-total"> {{ $t('common.Total') }}: {{ totalCount }}</span>
|
||||
<span class="summary-item summary-success"> {{ $t('common.Success') }}: {{ successCount }}</span>
|
||||
<span class="summary-item summary-failed"> {{ $t('common.Failed') }}: {{ failedCount }}</span>
|
||||
|
||||
@@ -122,6 +122,9 @@ export default {
|
||||
return this.hasLeftActions ? 'right' : 'left'
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$emit('done')
|
||||
},
|
||||
methods: {
|
||||
handleTagSearch(val) {
|
||||
this.searchTable(val)
|
||||
@@ -144,119 +147,121 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang='scss' scoped>
|
||||
.table-header {
|
||||
/*display: flex;*/
|
||||
/*flex-direction: row;*/
|
||||
/*justify-content: space-between;*/
|
||||
}
|
||||
.table-header {
|
||||
/*display: flex;*/
|
||||
/*flex-direction: row;*/
|
||||
/*justify-content: space-between;*/
|
||||
}
|
||||
|
||||
.right-side-item {
|
||||
}
|
||||
.right-side-item {
|
||||
}
|
||||
|
||||
.right-side-actions >>> .el-button {
|
||||
border: none;
|
||||
padding: 5px;
|
||||
font-size: 14px;
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
color: #888;
|
||||
background-color: transparent;
|
||||
}
|
||||
.right-side-actions > > > .el-button {
|
||||
border: none;
|
||||
padding: 5px;
|
||||
font-size: 14px;
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
color: #888;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.right-side-actions >>> .fa {
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
}
|
||||
.right-side-actions > > > .fa {
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
}
|
||||
|
||||
.right-side-actions >>> .el-button:hover {
|
||||
background-color: rgb(0, 0, 0, 0.05);
|
||||
}
|
||||
.right-side-actions > > > .el-button:hover {
|
||||
background-color: rgb(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.action-search >>> .el-input__suffix i {
|
||||
font-weight: 500;
|
||||
color: #888;
|
||||
}
|
||||
.action-search > > > .el-input__suffix i {
|
||||
font-weight: 500;
|
||||
color: #888;
|
||||
}
|
||||
|
||||
.action-search >>> .el-cascader {
|
||||
line-height: 32px !important;
|
||||
}
|
||||
.action-search > > > .el-cascader {
|
||||
line-height: 32px !important;
|
||||
}
|
||||
|
||||
.right-side-actions {
|
||||
display: flex;
|
||||
padding-left: 10px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.right-side-actions {
|
||||
display: flex;
|
||||
padding-left: 10px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.table-action-right-side {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
.table-action-right-side {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.export-item {
|
||||
display: block;
|
||||
padding: 5px 20px;
|
||||
}
|
||||
.export-item {
|
||||
display: block;
|
||||
padding: 5px 20px;
|
||||
}
|
||||
|
||||
.datepicker {
|
||||
margin-left: 10px;
|
||||
}
|
||||
.datepicker {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.table-header {
|
||||
line-height: 32px;
|
||||
}
|
||||
.table-header {
|
||||
line-height: 32px;
|
||||
}
|
||||
|
||||
.left-side {
|
||||
float: left;
|
||||
display: block;
|
||||
&>>> .action-item.el-dropdown {
|
||||
height: 33px;
|
||||
&> .el-button {
|
||||
height: 100%;
|
||||
}
|
||||
.left-side {
|
||||
float: left;
|
||||
display: block;
|
||||
|
||||
& > > > .action-item.el-dropdown {
|
||||
height: 33px;
|
||||
|
||||
& > .el-button {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.right-side {
|
||||
float: right;
|
||||
}
|
||||
.right-side {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.search {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
.search {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.mobile .search {
|
||||
display: inherit;
|
||||
}
|
||||
.mobile .search {
|
||||
display: inherit;
|
||||
}
|
||||
|
||||
.mobile .search .datepicker {
|
||||
margin-left: 0;
|
||||
}
|
||||
.mobile .search .datepicker {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.search.left {
|
||||
float: left;
|
||||
padding: 0 !important;
|
||||
}
|
||||
.search.left {
|
||||
float: left;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.search.right {
|
||||
float: right;
|
||||
}
|
||||
.search.right {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.mobile .search.right {
|
||||
float: none;
|
||||
}
|
||||
.mobile .search.right {
|
||||
float: none;
|
||||
}
|
||||
|
||||
.mobile .search.right .action-search {
|
||||
width: 100%;
|
||||
}
|
||||
.mobile .search.right .action-search {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.mobile .right-side {
|
||||
padding-top: 5px;
|
||||
}
|
||||
.mobile .right-side {
|
||||
padding-top: 5px;
|
||||
}
|
||||
|
||||
.filter-field.right-side-item.action-search {
|
||||
height: 34px;
|
||||
}
|
||||
.filter-field.right-side-item.action-search {
|
||||
height: 34px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@@ -8,9 +8,11 @@
|
||||
:selected-rows="selectedRows"
|
||||
:table-url="tableUrl"
|
||||
v-bind="iHeaderActions"
|
||||
@done="handleActionInitialDone"
|
||||
/>
|
||||
<IBox class="table-content">
|
||||
<AutoDataTable
|
||||
v-if="actionInit"
|
||||
ref="dataTable"
|
||||
:config="iTableConfig"
|
||||
:filter-table="filter"
|
||||
@@ -73,7 +75,10 @@ export default {
|
||||
return {
|
||||
selectedRows: [],
|
||||
init: false,
|
||||
extraQuery: extraQuery
|
||||
isDeactivated: false,
|
||||
extraQuery: extraQuery,
|
||||
actionInit: this.headerActions.has === false,
|
||||
initQuery: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -166,14 +171,36 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleActionInitialDone() {
|
||||
setTimeout(() => {
|
||||
this.actionInit = true
|
||||
}, 100)
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.selectedRows = val
|
||||
},
|
||||
reloadTable() {
|
||||
this.dataTable.getList()
|
||||
},
|
||||
updateInitQuery(attrs) {
|
||||
if (!this.actionInit) {
|
||||
this.initQuery = attrs
|
||||
for (const key in attrs) {
|
||||
this.$set(this.extraQuery, key, attrs[key])
|
||||
}
|
||||
return true
|
||||
}
|
||||
const removeKeys = Object.keys(this.initQuery).filter(key => !attrs[key])
|
||||
for (const key of removeKeys) {
|
||||
this.$delete(this.extraQuery, key)
|
||||
}
|
||||
},
|
||||
search(attrs) {
|
||||
this.$log.debug('ListTable: search table', attrs)
|
||||
const init = this.updateInitQuery(attrs)
|
||||
if (init) {
|
||||
return
|
||||
}
|
||||
this.$emit('TagSearch', attrs)
|
||||
this.$refs.dataTable?.$refs.dataTable?.search(attrs, true)
|
||||
},
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<span>{{ value }}</span>
|
||||
<span class="date">{{ dateValue }}</span>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -10,24 +10,31 @@ export default {
|
||||
name: 'DateFormatter',
|
||||
extends: BaseFormatter,
|
||||
data() {
|
||||
let value
|
||||
if (this.cellValue) {
|
||||
value = toSafeLocalDateStr(this.cellValue)
|
||||
} else {
|
||||
value = '-'
|
||||
}
|
||||
// let value
|
||||
// if (this.cellValue) {
|
||||
// value = toSafeLocalDateStr(this.cellValue)
|
||||
// } else {
|
||||
// value = '-'
|
||||
// }
|
||||
// const locale = this.$i18n.locale
|
||||
// const value = dt.toLocaleString(locale, { hourCycle: 'h23' })
|
||||
// debug(this.$i18n.locale)
|
||||
return {
|
||||
value: value
|
||||
}
|
||||
// return {
|
||||
// value: value
|
||||
// }
|
||||
// return {
|
||||
// value: `${year}-${month}-${date} ${hour}:${minutes}:${seconds}`
|
||||
// }
|
||||
return {}
|
||||
},
|
||||
computed: {
|
||||
dateValue() {
|
||||
if (this.cellValue) {
|
||||
return toSafeLocalDateStr(this.cellValue)
|
||||
} else {
|
||||
return '-'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
||||
@@ -64,7 +64,7 @@ export default {
|
||||
}
|
||||
return text
|
||||
}
|
||||
return '-'
|
||||
return this.items?.distribution || '-'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</a>
|
||||
<a
|
||||
v-if="formatterArgs.showEditBtn"
|
||||
class="edit-btn"
|
||||
:class="[{ 'disabled-link': this.$store.getters.currentOrgIsRoot },'edit-btn']"
|
||||
style="padding-left: 5px"
|
||||
@click="showDialog = true"
|
||||
>
|
||||
@@ -269,4 +269,11 @@ export default {
|
||||
.tag-tip {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.disabled-link {
|
||||
pointer-events: none;
|
||||
color: grey;
|
||||
cursor: default;
|
||||
text-decoration: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -213,12 +213,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) {
|
||||
|
||||
@@ -18,14 +18,15 @@
|
||||
/>
|
||||
</el-col>
|
||||
<el-col v-show="isShow" :span="span">
|
||||
<VueMarkdown class="result-html" :source="iValue" :show="true" :html="false" />
|
||||
<VueMarkdown class="result-html" :source="sanitizedValue" :html="false" :show="true" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<VueMarkdown v-else class="source" :source="iValue" :html="false" />
|
||||
<VueMarkdown v-else class="source" :html="false" :source="sanitizedValue" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import DOMPurify from 'dompurify'
|
||||
import VueMarkdown from 'vue-markdown'
|
||||
import 'github-markdown-css/github-markdown-light.css'
|
||||
|
||||
@@ -56,6 +57,17 @@ export default {
|
||||
iValue: this.value
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
sanitizedValue() {
|
||||
// 转义特殊字符
|
||||
let content = this.iValue.replace(/\\/g, '\\\\').replace(/\$/g, '\\$')
|
||||
|
||||
// 使用 DOMPurify 进行 XSS 过滤
|
||||
content = DOMPurify.sanitize(content)
|
||||
|
||||
return content
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.resizeObserver = new ResizeObserver(entries => {
|
||||
|
||||
@@ -48,6 +48,7 @@ export default {
|
||||
fontFamily: 'monaco, Consolas, "Lucida Console", monospace',
|
||||
lineHeight: 1.2,
|
||||
fontSize: 13,
|
||||
scrollback: 9999999,
|
||||
rightClickSelectsWord: true,
|
||||
theme: {
|
||||
background: '#fff',
|
||||
|
||||
@@ -721,6 +721,7 @@
|
||||
"BatchActivate": "Batch activate",
|
||||
"SyncSelected": "Sync selected",
|
||||
"bulkDeploy": "Bulk deploy",
|
||||
"BulkVerify": "Bulk verify",
|
||||
"bulkDeleteErrorMsg": "Bulk delete failed: ",
|
||||
"bulkDeleteSuccessMsg": "Bulk delete success",
|
||||
"bulkRemoveErrorMsg": "Bulk remove failed: ",
|
||||
@@ -1930,6 +1931,7 @@
|
||||
"CheckViewAcceptor": "View more acceptor",
|
||||
"Assignees": "Assignees",
|
||||
"Close": "Close",
|
||||
"CancelTicket": "Cancel Ticket",
|
||||
"OpenStatus": "Open",
|
||||
"CloseStatus": "Close",
|
||||
"Comment": "Comment",
|
||||
|
||||
@@ -717,6 +717,7 @@
|
||||
"SyncSuccessMsg": "同期に成功しました",
|
||||
"SyncSelected": "選択した同期",
|
||||
"bulkDeploy": "一括デプロイ",
|
||||
"BulkVerify": "一括テスト",
|
||||
"bulkSyncErrorMsg": "一括同期に失敗しました:",
|
||||
"bulkDeleteErrorMsg": "一括削除に失敗しました:",
|
||||
"bulkDeleteSuccessMsg": "一括削除に成功しました",
|
||||
@@ -1926,6 +1927,7 @@
|
||||
"Assignee": "処理者",
|
||||
"Assignees": "処理待ち",
|
||||
"Close": "閉じる",
|
||||
"CancelTicket": "作業指示をキャンセルする",
|
||||
"OpenStatus": "オン",
|
||||
"CloseStatus": "閉じる",
|
||||
"Comment": "備考",
|
||||
|
||||
@@ -771,6 +771,7 @@
|
||||
"BatchActivate": "批量激活",
|
||||
"SyncSelected": "同步所选",
|
||||
"bulkDeploy": "批量部署",
|
||||
"BulkVerify": "批量测试",
|
||||
"bulkDeleteErrorMsg": "批量删除失败: ",
|
||||
"bulkDeleteSuccessMsg": "批量删除成功",
|
||||
"bulkRemoveErrorMsg": "批量移除失败: ",
|
||||
@@ -1912,6 +1913,7 @@
|
||||
"Assignee": "处理人",
|
||||
"Assignees": "待处理人",
|
||||
"Close": "关闭",
|
||||
"CancelTicket": "取消工单",
|
||||
"OpenStatus": "审批中",
|
||||
"CloseStatus": "已完成",
|
||||
"Comment": "备注",
|
||||
|
||||
@@ -771,6 +771,7 @@
|
||||
"BatchActivate": "批次啟用",
|
||||
"SyncSelected": "同步所選",
|
||||
"bulkDeploy": "批次部署",
|
||||
"BulkVerify": "批次測試",
|
||||
"bulkDeleteErrorMsg": "批次刪除失敗: ",
|
||||
"bulkDeleteSuccessMsg": "批次刪除成功",
|
||||
"bulkRemoveErrorMsg": "批次移除失敗: ",
|
||||
@@ -1912,6 +1913,7 @@
|
||||
"Assignee": "處理人",
|
||||
"Assignees": "待處理人",
|
||||
"Close": "關閉",
|
||||
"CancelTicket": "取消工單",
|
||||
"OpenStatus": "審批中",
|
||||
"CloseStatus": "已完成",
|
||||
"Comment": "備註",
|
||||
|
||||
@@ -61,7 +61,6 @@ export default {
|
||||
break
|
||||
case 'logout':
|
||||
this.logout()
|
||||
window.location.href = `${process.env.VUE_APP_LOGOUT_PATH}?next=${this.$route.fullPath}`
|
||||
break
|
||||
case 'apiKey':
|
||||
this.$router.push('/profile/api-keys')
|
||||
@@ -73,7 +72,12 @@ export default {
|
||||
this.$router.push('/profile/user/setting')
|
||||
}
|
||||
},
|
||||
logout() {
|
||||
async logout() {
|
||||
const currentOrg = this.$store.getters.currentOrg
|
||||
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}`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BIN
src/styles/icons/dameng.png
Normal file
BIN
src/styles/icons/dameng.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.0 KiB |
@@ -92,6 +92,10 @@
|
||||
background: url('./icons/db2.png') no-repeat center left transparent;
|
||||
}
|
||||
|
||||
&.dameng_ico_docu {
|
||||
background: url('./icons/dameng.png') no-repeat center left transparent;
|
||||
}
|
||||
|
||||
&.private_ico_docu {
|
||||
background: url('./icons/private.png') no-repeat center left transparent;
|
||||
}
|
||||
|
||||
@@ -363,13 +363,19 @@ export function downloadText(content, filename) {
|
||||
}
|
||||
|
||||
export function download(downloadUrl, filename) {
|
||||
const iframe = document.createElement('iframe')
|
||||
iframe.style.display = 'none'
|
||||
document.body.appendChild(iframe)
|
||||
const a = document.createElement('a')
|
||||
a.href = downloadUrl
|
||||
if (filename) {
|
||||
a.download = filename
|
||||
}
|
||||
iframe.contentWindow.document.body.appendChild(a)
|
||||
a.click()
|
||||
window.URL.revokeObjectURL(downloadUrl)
|
||||
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) {
|
||||
|
||||
@@ -24,6 +24,9 @@ async function checkLogin({ to, from, next }) {
|
||||
} catch (e) {
|
||||
Vue.$log.error(e)
|
||||
const status = e.response.status
|
||||
if (store.getters.currentOrg.autoEnter) {
|
||||
await store.dispatch('users/setCurrentOrg', store.getters.preOrg)
|
||||
}
|
||||
if (status === 401 || status === 403) {
|
||||
setTimeout(() => {
|
||||
window.location = process.env.VUE_APP_LOGIN_PATH
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
:account="account"
|
||||
:show-password-record="false"
|
||||
:url="secretUrl"
|
||||
type="template"
|
||||
:visible.sync="showViewSecretDialog"
|
||||
/>
|
||||
</div>
|
||||
@@ -31,7 +32,7 @@ export default {
|
||||
tableConfig: {
|
||||
url: '/api/v1/accounts/account-templates/',
|
||||
columns: null,
|
||||
columnsExclude: ['spec_info'],
|
||||
columnsExclude: ['spec_info', 'password_rules', 'push_params'],
|
||||
columnsShow: {
|
||||
min: ['name', 'actions'],
|
||||
default: ['name', 'username', 'secret_type', 'has_secret', 'privileged', 'actions']
|
||||
|
||||
@@ -222,6 +222,30 @@ export default {
|
||||
getUrlQuery: false
|
||||
},
|
||||
extraMoreActions: [
|
||||
{
|
||||
name: 'BulkVerify',
|
||||
title: this.$t('common.BulkVerify'),
|
||||
type: 'primary',
|
||||
icon: 'fa fa-link',
|
||||
can: ({ selectedRows }) =>
|
||||
this.$hasPerm('assets.test_assetconnectivity') &&
|
||||
!this.$store.getters.currentOrgIsRoot &&
|
||||
selectedRows.length > 0 &&
|
||||
selectedRows[0].auto_config?.ansible_enabled &&
|
||||
selectedRows[0].auto_config?.ping_enabled,
|
||||
callback: function({ selectedRows }) {
|
||||
const ids = selectedRows.map(v => {
|
||||
return v.id
|
||||
})
|
||||
this.$axios.post(
|
||||
'/api/v1/assets/assets/tasks/',
|
||||
{ action: 'test', assets: ids }).then(res => {
|
||||
openTaskPage(res['task'])
|
||||
}).catch(err => {
|
||||
this.$message.error(this.$tc('common.bulkVerifyErrorMsg' + ' ' + err))
|
||||
})
|
||||
}.bind(this)
|
||||
},
|
||||
{
|
||||
name: 'DeactiveSelected',
|
||||
title: this.$t('common.BatchDisable'),
|
||||
|
||||
@@ -10,13 +10,11 @@
|
||||
@click="onSetting"
|
||||
/>
|
||||
<Dialog
|
||||
v-if="isVisible"
|
||||
width="60%"
|
||||
:visible.sync="isVisible"
|
||||
:title="title"
|
||||
:show-cancel="false"
|
||||
:show-confirm="false"
|
||||
:destroy-on-close="true"
|
||||
@close="onDialogClose"
|
||||
>
|
||||
<AutoDataForm
|
||||
@@ -34,7 +32,7 @@
|
||||
<script>
|
||||
import Dialog from '../../../components/Dialog'
|
||||
import AutoDataForm from '../../../components/Form/AutoDataForm'
|
||||
import { DynamicInput } from '../../../components/Form/FormFields'
|
||||
import { DynamicInput, Switcher } from '../../../components/Form/FormFields'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -147,6 +145,9 @@ export default {
|
||||
case 'list':
|
||||
component = DynamicInput
|
||||
break
|
||||
case 'boolean':
|
||||
component = Switcher
|
||||
break
|
||||
}
|
||||
|
||||
if (param) {
|
||||
|
||||
@@ -100,7 +100,7 @@ export default {
|
||||
this.data.total_count_job_logs = data?.total_count_job_logs
|
||||
this.data.total_count_job_logs_running = data?.total_count_job_logs_running
|
||||
this.data.total_count_job_logs_failed = data?.total_count_job_logs_failed
|
||||
if (totalCountSession.length > 1) {
|
||||
if (totalCountSession.length > 0) {
|
||||
this.chartConfig.secondaryData = totalCountSession
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,8 +16,7 @@ export default {
|
||||
Title,
|
||||
LineChart
|
||||
},
|
||||
props: {
|
||||
},
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
@@ -48,10 +47,10 @@ export default {
|
||||
const activeUsers = data?.dates_metrics_total_count_active_users
|
||||
const activeAssets = data?.dates_metrics_total_count_active_assets
|
||||
this.lineChartConfig.datesMetrics = data.dates_metrics_date
|
||||
if (activeUsers.length > 1) {
|
||||
if (activeUsers.length > 0) {
|
||||
this.lineChartConfig.primaryData = activeUsers
|
||||
}
|
||||
if (activeAssets.length > 1) {
|
||||
if (activeAssets.length > 0) {
|
||||
this.lineChartConfig.secondaryData = activeAssets
|
||||
}
|
||||
}
|
||||
@@ -64,6 +63,7 @@ export default {
|
||||
margin-top: 16px;
|
||||
padding: 20px;
|
||||
background: #fff;
|
||||
|
||||
.head {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
@@ -128,7 +128,8 @@ export default {
|
||||
tip += current.label + ':' + current.total + '<br/>'
|
||||
}
|
||||
return tip
|
||||
}
|
||||
},
|
||||
appendToBody: true
|
||||
},
|
||||
grid: {
|
||||
top: '60%',
|
||||
|
||||
@@ -66,7 +66,16 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
async getResourcesCount() {
|
||||
return this.$axios.get('/api/v1/index/?total_count=1')
|
||||
return this.$axios.get(
|
||||
'/api/v1/index/',
|
||||
{
|
||||
params: {
|
||||
total_count_online_sessions: 1,
|
||||
total_count_online_users: 1,
|
||||
total_count_today_failed_sessions: 1
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,6 +98,7 @@ export default {
|
||||
el: {
|
||||
baseUrl: '/api/v1/perms/users/self/assets/',
|
||||
baseNodeUrl: '/api/v1/perms/users/self/nodes/',
|
||||
typeUrl: '/api/v1/perms/users/self/nodes/children-with-assets/category/tree',
|
||||
value: []
|
||||
}
|
||||
},
|
||||
|
||||
@@ -105,6 +105,7 @@ export default {
|
||||
formatter: AmountFormatter,
|
||||
formatterArgs: {
|
||||
async: true,
|
||||
cellValueToRemove: ['@SPEC'],
|
||||
routeQuery: {
|
||||
activeTab: 'AssetPermissionUser'
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ export default {
|
||||
component: PhoneInput
|
||||
},
|
||||
mfa_level: {
|
||||
hidden: (formValue) => {
|
||||
disabled: (formValue) => {
|
||||
return formValue.mfa_level === 2
|
||||
},
|
||||
helpText: this.$t('users.HelpText.MFAOfUserFirstLoginPersonalInformationImprovementPage')
|
||||
@@ -90,8 +90,7 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
}
|
||||
methods: {}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ import isFalsey from '@/components/Table/DataTable/compenents/el-data-table/util
|
||||
import deepmerge from 'deepmerge'
|
||||
import * as queryUtil from '@/components/Table/DataTable/compenents/el-data-table/utils/query'
|
||||
import { createSourceIdCache } from '@/api/common'
|
||||
import { download } from '@/utils/common'
|
||||
|
||||
export default {
|
||||
name: 'CommandList',
|
||||
@@ -144,10 +145,7 @@ export default {
|
||||
queryUtil.stringify(query, '=', '&')
|
||||
url = url + queryStr
|
||||
this.$log.debug('Export url: ', this.url, '=>', url)
|
||||
const a = document.createElement('a')
|
||||
a.href = url
|
||||
a.click()
|
||||
window.URL.revokeObjectURL(url + queryStr)
|
||||
download(url + queryStr)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -55,8 +55,7 @@ export default {
|
||||
fieldsMeta: {
|
||||
EMAIL_HOST_USER: {
|
||||
rules: [
|
||||
rules.EmailCheck,
|
||||
rules.Required
|
||||
rules.EmailCheck
|
||||
]
|
||||
},
|
||||
EMAIL_FROM: {
|
||||
|
||||
@@ -12,25 +12,24 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
config: {
|
||||
initial: {
|
||||
},
|
||||
initial: {},
|
||||
url: '/api/v1/orgs/orgs/',
|
||||
fields: [
|
||||
['', ['name', 'comment']]
|
||||
],
|
||||
hasSaveContinue: false,
|
||||
fieldsMeta: {
|
||||
},
|
||||
fieldsMeta: {},
|
||||
onPerformSuccess(res, method) {
|
||||
const order_params = { params: { order: '-date_created' }}
|
||||
switch (method) {
|
||||
case 'post':
|
||||
this.$store.dispatch('users/addAdminOrg', { id: res.id, name: res.name })
|
||||
this.$message.success(this.$tc('common.createSuccessMsg'))
|
||||
return this.$router.push({ name: 'OrganizationList' })
|
||||
return this.$router.push({ name: 'OrganizationList', ...order_params })
|
||||
case 'put':
|
||||
this.$store.dispatch('users/modifyOrg', { id: res.id, name: res.name })
|
||||
this.$message.success(this.$tc('common.updateSuccessMsg'))
|
||||
return this.$router.push({ name: 'OrganizationList' })
|
||||
return this.$router.push({ name: 'OrganizationList', ...order_params })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,6 +137,14 @@ export default {
|
||||
canCreate: this.$hasPerm('tickets.view_ticket'),
|
||||
hasBulkDelete: false,
|
||||
searchConfig: {
|
||||
default: {
|
||||
state: {
|
||||
key: 'state',
|
||||
label: this.$t('tickets.action'),
|
||||
value: 'pending',
|
||||
valueLabel: this.$t('common.Open')
|
||||
}
|
||||
},
|
||||
exclude: ['id', 'title', 'type', 'applicant'],
|
||||
options: [
|
||||
{
|
||||
@@ -180,7 +188,7 @@ export default {
|
||||
},
|
||||
{
|
||||
value: 'relevant_command',
|
||||
label: this.$t('tickets.RelevantSystemUser')
|
||||
label: this.$t('tickets.ApplyRunCommand')
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -48,7 +48,12 @@ export default {
|
||||
}
|
||||
],
|
||||
select2Option: {
|
||||
url: '/api/v1/users/users/?oid=root'
|
||||
url: '/api/v1/users/users/?oid=root',
|
||||
ajax: {
|
||||
transformOption: (item) => {
|
||||
return { label: item.name + '(' + item.username + ')', value: item.id }
|
||||
}
|
||||
}
|
||||
},
|
||||
fields: [
|
||||
]
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<el-form-item style="float: right">
|
||||
<template v-if="hasActionPerm">
|
||||
<el-button
|
||||
:disabled="object.status.value === 'closed'"
|
||||
:disabled="isDisabled || object.status.value === 'closed'"
|
||||
size="small"
|
||||
type="primary"
|
||||
@click="handleApprove"
|
||||
@@ -35,7 +35,7 @@
|
||||
<i class="fa fa-check" /> {{ $t('tickets.Accept') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
:disabled="object.status.value === 'closed'"
|
||||
:disabled="isDisabled || object.status.value === 'closed'"
|
||||
size="small"
|
||||
type="warning"
|
||||
@click="handleReject"
|
||||
@@ -45,12 +45,12 @@
|
||||
</template>
|
||||
<el-button
|
||||
v-if="isSelfTicket"
|
||||
:disabled="object.status.value === 'closed'"
|
||||
:disabled="isDisabled || object.status.value === 'closed'"
|
||||
size="small"
|
||||
type="danger"
|
||||
@click="handleClose"
|
||||
>
|
||||
<i class="fa fa-times" /> {{ $t('tickets.Close') }}
|
||||
<i class="fa fa-times" /> {{ $t('tickets.CancelTicket') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
:disabled="object.status.value === 'closed'"
|
||||
@@ -94,6 +94,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isDisabled: false,
|
||||
comments: '',
|
||||
type_api: '',
|
||||
imageUrl: require('@/assets/img/avatar.png'),
|
||||
@@ -156,17 +157,35 @@ export default {
|
||||
this.createComment(function() {
|
||||
})
|
||||
const url = `/api/v1/tickets/${this.type_api}/${this.object.id}/approve/`
|
||||
this.$axios.put(url).then(res => this.reloadPage()).catch(err => this.$message.error(err))
|
||||
this.$axios.put(url).then(res => {
|
||||
this.reloadPage()
|
||||
}).catch(err => {
|
||||
this.$message.error(err)
|
||||
}).finally(() => {
|
||||
this.isDisabled = false
|
||||
})
|
||||
},
|
||||
defaultReject() {
|
||||
this.createComment(function() {
|
||||
})
|
||||
const url = `/api/v1/tickets/${this.type_api}/${this.object.id}/reject/`
|
||||
this.$axios.put(url).then(res => this.reloadPage()).catch(err => this.$message.error(err))
|
||||
this.$axios.put(url).then(res => {
|
||||
this.reloadPage()
|
||||
}).catch(err => {
|
||||
this.$message.error(err)
|
||||
}).finally(() => {
|
||||
this.isDisabled = false
|
||||
})
|
||||
},
|
||||
defaultClose() {
|
||||
const url = `/api/v1/tickets/${this.type_api}/${this.object.id}/close/`
|
||||
this.$axios.put(url).then(res => this.reloadPage()).catch(err => this.$message.error(err))
|
||||
this.$axios.put(url).then(res => {
|
||||
this.reloadPage()
|
||||
}).catch(err => {
|
||||
this.$message.error(err)
|
||||
}).finally(() => {
|
||||
this.isDisabled = false
|
||||
})
|
||||
},
|
||||
createComment(successCallback) {
|
||||
const commentText = this.form.comments
|
||||
@@ -187,17 +206,42 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
handleAction(actionType) {
|
||||
if (this.isDisabled) {
|
||||
return
|
||||
}
|
||||
|
||||
this.isDisabled = true
|
||||
let handler
|
||||
switch (actionType) {
|
||||
case 'approve':
|
||||
handler = this.approve || this.defaultApprove
|
||||
break
|
||||
case 'reject':
|
||||
handler = this.reject || this.defaultReject
|
||||
break
|
||||
case 'close':
|
||||
handler = this.close || this.defaultClose
|
||||
break
|
||||
default:
|
||||
handler = null
|
||||
break
|
||||
}
|
||||
|
||||
if (handler) {
|
||||
handler()
|
||||
} else {
|
||||
this.$message.error('No handler for action')
|
||||
}
|
||||
},
|
||||
handleApprove() {
|
||||
const handler = this.approve || this.defaultApprove
|
||||
handler()
|
||||
this.handleAction('approve')
|
||||
},
|
||||
handleReject() {
|
||||
const handler = this.reject || this.defaultReject
|
||||
handler()
|
||||
this.handleAction('reject')
|
||||
},
|
||||
handleClose() {
|
||||
const handler = this.close || this.defaultClose
|
||||
handler()
|
||||
this.handleAction('close')
|
||||
},
|
||||
handleComment() {
|
||||
this.createComment(
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
<script>
|
||||
import { GenericCreateUpdatePage } from '@/layout/components'
|
||||
import TransSelect from '@/components/Form/FormFields/TransferSelect.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -23,7 +22,6 @@ export default {
|
||||
],
|
||||
fieldsMeta: {
|
||||
users: {
|
||||
component: TransSelect,
|
||||
el: {
|
||||
url: '/api/v1/users/users/?fields_size=mini&order=name',
|
||||
ajax: {
|
||||
@@ -38,8 +36,7 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
}
|
||||
methods: {}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
37
yarn.lock
37
yarn.lock
@@ -4463,6 +4463,11 @@ domhandler@^4.0.0, domhandler@^4.2.0, domhandler@^4.2.2, domhandler@^4.3.1:
|
||||
dependencies:
|
||||
domelementtype "^2.2.0"
|
||||
|
||||
dompurify@^3.1.6:
|
||||
version "3.1.6"
|
||||
resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-3.1.6.tgz#43c714a94c6a7b8801850f82e756685300a027e2"
|
||||
integrity sha512-cTOAhc36AalkjtBpfG6O8JimdTMWNXjiePT2xQH/ppBGi/4uIpmj8eKyIkMJErXWARyINV/sB38yf8JCLF5pbQ==
|
||||
|
||||
domready@1.0.8:
|
||||
version "1.0.8"
|
||||
resolved "https://registry.npmmirror.com/domready/-/domready-1.0.8.tgz#91f252e597b65af77e745ae24dd0185d5e26d58c"
|
||||
@@ -12079,7 +12084,7 @@ string-length@^2.0.0:
|
||||
astral-regex "^1.0.0"
|
||||
strip-ansi "^4.0.0"
|
||||
|
||||
"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
|
||||
"string-width-cjs@npm:string-width@^4.2.0":
|
||||
version "4.2.3"
|
||||
resolved "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
|
||||
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
|
||||
@@ -12097,6 +12102,15 @@ string-width@^1.0.1:
|
||||
is-fullwidth-code-point "^1.0.0"
|
||||
strip-ansi "^3.0.0"
|
||||
|
||||
"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
|
||||
version "4.2.3"
|
||||
resolved "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
|
||||
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
|
||||
dependencies:
|
||||
emoji-regex "^8.0.0"
|
||||
is-fullwidth-code-point "^3.0.0"
|
||||
strip-ansi "^6.0.1"
|
||||
|
||||
string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.npmmirror.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e"
|
||||
@@ -12196,7 +12210,7 @@ stringify-package@^1.0.1:
|
||||
resolved "https://registry.npmmirror.com/stringify-package/-/stringify-package-1.0.1.tgz#e5aa3643e7f74d0f28628b72f3dad5cecfc3ba85"
|
||||
integrity sha512-sa4DUQsYciMP1xhKWGuFM04fB0LG/9DlluZoSVywUMRNvzid6XucHK0/90xGxRoHrAaROrcHK1aPKaijCtSrhg==
|
||||
|
||||
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
|
||||
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
|
||||
version "6.0.1"
|
||||
resolved "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
|
||||
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
|
||||
@@ -12224,6 +12238,13 @@ strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0:
|
||||
dependencies:
|
||||
ansi-regex "^4.1.0"
|
||||
|
||||
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
|
||||
version "6.0.1"
|
||||
resolved "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
|
||||
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
|
||||
dependencies:
|
||||
ansi-regex "^5.0.1"
|
||||
|
||||
strip-ansi@^7.0.1, strip-ansi@^7.1.0:
|
||||
version "7.1.0"
|
||||
resolved "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45"
|
||||
@@ -13616,8 +13637,7 @@ worker-farm@^1.7.0:
|
||||
dependencies:
|
||||
errno "~0.1.7"
|
||||
|
||||
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
|
||||
name wrap-ansi-cjs
|
||||
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
|
||||
version "7.0.0"
|
||||
resolved "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
|
||||
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
|
||||
@@ -13652,6 +13672,15 @@ wrap-ansi@^6.2.0:
|
||||
string-width "^4.1.0"
|
||||
strip-ansi "^6.0.0"
|
||||
|
||||
wrap-ansi@^7.0.0:
|
||||
version "7.0.0"
|
||||
resolved "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
|
||||
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
|
||||
dependencies:
|
||||
ansi-styles "^4.0.0"
|
||||
string-width "^4.1.0"
|
||||
strip-ansi "^6.0.0"
|
||||
|
||||
wrap-ansi@^8.1.0:
|
||||
version "8.1.0"
|
||||
resolved "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"
|
||||
|
||||
Reference in New Issue
Block a user