mirror of
https://github.com/jumpserver/lina.git
synced 2025-11-09 11:19:11 +00:00
Compare commits
26 Commits
pr@dev@per
...
revert-508
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0de9220714 | ||
|
|
80e42d12f3 | ||
|
|
958de2badf | ||
|
|
5efe66b481 | ||
|
|
df69e93cca | ||
|
|
4bd14e340c | ||
|
|
d5f8bc85f2 | ||
|
|
8d349a874b | ||
|
|
a1cc4c9263 | ||
|
|
834073fae1 | ||
|
|
2d5aa403a2 | ||
|
|
74fcd9e1db | ||
|
|
e90a3f701a | ||
|
|
0a54151b9a | ||
|
|
f310eb9855 | ||
|
|
aa02a19793 | ||
|
|
083b7762b1 | ||
|
|
b45257b284 | ||
|
|
d6051d6bcb | ||
|
|
f8e7d12252 | ||
|
|
8a74ce1d4b | ||
|
|
6715465dda | ||
|
|
aaca037e02 | ||
|
|
d1552e67d1 | ||
|
|
926967111a | ||
|
|
0b27a01013 |
11
.prettierrc
Normal file
11
.prettierrc
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"printWidth": 100,
|
||||
"tabWidth": 2,
|
||||
"useTabs": false,
|
||||
"singleQuote": true,
|
||||
"semi": false,
|
||||
"trailingComma": "none",
|
||||
"bracketSpacing": true,
|
||||
"arrowParens": "avoid",
|
||||
"endOfLine": "lf"
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM jumpserver/lina-base:20250616_083043 AS stage-build
|
||||
FROM jumpserver/lina-base:20250709_063112 AS stage-build
|
||||
|
||||
ARG VERSION
|
||||
ENV VERSION=$VERSION
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
"deepmerge": "^4.2.2",
|
||||
"dompurify": "^3.1.6",
|
||||
"echarts": "4.7.0",
|
||||
"element-ui": "2.15.14",
|
||||
"elementui-lts": "^2.16.0",
|
||||
"eslint-plugin-html": "^6.0.0",
|
||||
"highlight.js": "^11.9.0",
|
||||
"install": "^0.13.0",
|
||||
@@ -103,7 +103,6 @@
|
||||
"compression-webpack-plugin": "^6.1.1",
|
||||
"connect": "3.6.6",
|
||||
"deasync": "^0.1.29",
|
||||
"element-theme-chalk": "^2.13.1",
|
||||
"eslint": "^5.15.3",
|
||||
"eslint-plugin-vue": "5.2.2",
|
||||
"eslint-plugin-vue-i18n": "^0.3.0",
|
||||
@@ -113,6 +112,7 @@
|
||||
"less-loader": "^5.0.0",
|
||||
"lint-staged": "^10.1.2",
|
||||
"mockjs": "1.0.1-beta3",
|
||||
"pretty-bytes": "^5.6.0",
|
||||
"runjs": "^4.3.2",
|
||||
"sass": "~1.32.6",
|
||||
"sass-loader": "^7.1.0",
|
||||
|
||||
@@ -85,6 +85,7 @@ export default {
|
||||
hasTree: true,
|
||||
columnsExtra: ['view_account'],
|
||||
columnsExclude: ['spec_info'],
|
||||
columns: ['id', 'name', 'address', 'platform', 'view_account', 'actions'],
|
||||
columnsShow: {
|
||||
min: ['name', 'address', 'accounts'],
|
||||
default: ['name', 'address', 'platform', 'view_account', 'actions']
|
||||
|
||||
@@ -1,25 +1,23 @@
|
||||
<template>
|
||||
<tr>
|
||||
<td>{{ getActionTitle(action) }}</td>
|
||||
<td>
|
||||
<el-popover
|
||||
:content="action.attrs.tip"
|
||||
:disabled="!action.attrs.showTip"
|
||||
placement="left-end"
|
||||
trigger="hover"
|
||||
>
|
||||
<span slot="reference">
|
||||
<component
|
||||
:is="iType"
|
||||
v-model="action.attrs.model"
|
||||
:title="label"
|
||||
v-bind="action.attrs"
|
||||
v-on="callbacks"
|
||||
>
|
||||
{{ label }}
|
||||
</component>
|
||||
</span>
|
||||
</el-popover>
|
||||
{{ getActionTitle(action) }}
|
||||
<el-tooltip v-if="action.attrs.showTip" :content="action.attrs.tip" :open-delay="500" effect="dark">
|
||||
<i class="fa fa-question-circle-o" />
|
||||
</el-tooltip>
|
||||
</td>
|
||||
<td>
|
||||
<span slot="reference">
|
||||
<component
|
||||
:is="iType"
|
||||
v-model="action.attrs.model"
|
||||
:title="label"
|
||||
v-bind="action.attrs"
|
||||
v-on="callbacks"
|
||||
>
|
||||
{{ label }}
|
||||
</component>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
|
||||
@@ -196,18 +196,23 @@ export default {
|
||||
}
|
||||
|
||||
let title = this.title
|
||||
|
||||
if (!title && this.resource) {
|
||||
title = this.resource
|
||||
}
|
||||
|
||||
if (!title) {
|
||||
title = this.$route.meta?.title
|
||||
title = title.replace('List', '').replace('列表', '')
|
||||
title = _.trimEnd(title, 's')
|
||||
}
|
||||
|
||||
if (!title) {
|
||||
title = this.$t('NoTitle')
|
||||
}
|
||||
|
||||
let actionLabel = ''
|
||||
|
||||
if (action === 'clone' || action === 'create') {
|
||||
actionLabel = this.$t('Create')
|
||||
} else if (action === 'update') {
|
||||
@@ -215,7 +220,9 @@ export default {
|
||||
} else if (action === 'detail') {
|
||||
actionLabel = this.$t('Detail')
|
||||
}
|
||||
|
||||
title = actionLabel + this.$t('WordSep') + toLowerCaseExcludeAbbr(title)
|
||||
|
||||
return title
|
||||
},
|
||||
getDefaultDrawer(action) {
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
<template>
|
||||
<el-popover
|
||||
:title="title"
|
||||
placement="left-start"
|
||||
placement="left"
|
||||
trigger="click"
|
||||
width="300"
|
||||
@show="getAsyncItems"
|
||||
>
|
||||
<div v-if="!loading" class="detail-content">
|
||||
|
||||
@@ -104,8 +104,9 @@ export default {
|
||||
// 使用 dialog 的高度
|
||||
const dialogs = [...document.getElementsByClassName('el-dialog__body')]
|
||||
if (dialogs.length > 0) {
|
||||
const dialog = dialogs.find((d) => d.innerHTML.indexOf(this.iZTreeID) !== -1) || dialogs[dialogs.length - 1]
|
||||
const dialog = dialogs.find((d) => d.innerHTML.indexOf(this.iZTreeID) !== -1)
|
||||
if (dialog) {
|
||||
// 对话框内的 zTree 才需要重新计算高度
|
||||
const dialogRect = dialog.getBoundingClientRect()
|
||||
tree.style.height = `${dialogRect.height - 60}px`
|
||||
return
|
||||
@@ -439,21 +440,21 @@ div.rMenu li {
|
||||
}
|
||||
|
||||
.menu-item {
|
||||
font-size: 12px;
|
||||
padding: 0 16px;
|
||||
position: relative;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
color: #606266;
|
||||
height: 24px;
|
||||
line-height: 24px;
|
||||
box-sizing: border-box;
|
||||
cursor: pointer;
|
||||
font-size: 12px;
|
||||
padding: 0 16px;
|
||||
position: relative;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
color: #606266;
|
||||
height: 24px;
|
||||
line-height: 24px;
|
||||
box-sizing: border-box;
|
||||
cursor: pointer;
|
||||
|
||||
i {
|
||||
width: 15px;
|
||||
}
|
||||
i {
|
||||
width: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
.dropdown-menu {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// i18n.js
|
||||
import Vue from 'vue'
|
||||
import locale from 'element-ui/lib/locale'
|
||||
import locale from 'elementui-lts/lib/locale'
|
||||
import VueI18n from 'vue-i18n'
|
||||
import messages from './langs'
|
||||
import date from './date'
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import zhLocale from 'element-ui/lib/locale/lang/zh-CN'
|
||||
import zhTWLocale from 'element-ui/lib/locale/lang/zh-TW'
|
||||
import enLocale from 'element-ui/lib/locale/lang/en'
|
||||
import jaLocale from 'element-ui/lib/locale/lang/ja'
|
||||
import ptBrLocale from 'element-ui/lib/locale/lang/pt-br'
|
||||
import esLocale from 'element-ui/lib/locale/lang/es'
|
||||
import ruLocale from 'element-ui/lib/locale/lang/ru-RU'
|
||||
import koLocale from 'element-ui/lib/locale/lang/ko'
|
||||
import zhLocale from 'elementui-lts/lib/locale/lang/zh-CN'
|
||||
import zhTWLocale from 'elementui-lts/lib/locale/lang/zh-TW'
|
||||
import enLocale from 'elementui-lts/lib/locale/lang/en'
|
||||
import jaLocale from 'elementui-lts/lib/locale/lang/ja'
|
||||
import ptBrLocale from 'elementui-lts/lib/locale/lang/pt-br'
|
||||
import esLocale from 'elementui-lts/lib/locale/lang/es'
|
||||
import ruLocale from 'elementui-lts/lib/locale/lang/ru-RU'
|
||||
import koLocale from 'elementui-lts/lib/locale/lang/ko'
|
||||
import zh from './zh.json'
|
||||
import zhHant from './zh_hant.json'
|
||||
import en from './en.json'
|
||||
|
||||
@@ -33,8 +33,8 @@ export default {
|
||||
return this.$t('PasswordExpired')
|
||||
}
|
||||
if (securityPasswordExpirationTime - intervalTime <= 5) {
|
||||
return this.$t('PasswordWillExpiredPrefixMsg') +
|
||||
(securityPasswordExpirationTime - intervalTime) +
|
||||
return this.$t('PasswordWillExpiredPrefixMsg') + ' ' +
|
||||
(securityPasswordExpirationTime - intervalTime) + ' ' +
|
||||
this.$t('PasswordWillExpiredSuffixMsg')
|
||||
}
|
||||
return false
|
||||
|
||||
@@ -156,8 +156,7 @@ export default {
|
||||
overflow-x: hidden;
|
||||
|
||||
.el-alert {
|
||||
margin: -5px 0 5px 0!important;
|
||||
width: calc(100% - 10px);
|
||||
margin: -5px 0 5px 0 !important;
|
||||
}
|
||||
|
||||
.page-content {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Vue from 'vue'
|
||||
import ElementUI from 'element-ui'
|
||||
import ElementUI from 'elementui-lts'
|
||||
import locale from 'elementLocale'
|
||||
import '@/styles/index.scss' // global css
|
||||
import App from './App'
|
||||
|
||||
@@ -4,6 +4,7 @@ import i18n from '@/i18n/i18n'
|
||||
import SessionRoutes from './sessions'
|
||||
import LogRoutes from './audits'
|
||||
import JobRoutes from './jobs'
|
||||
import TicketRoutes from './tickets'
|
||||
import empty from '@/layout/empty'
|
||||
import store from '@/store'
|
||||
|
||||
@@ -67,6 +68,18 @@ export default {
|
||||
permissions: ['audits.view_joblog']
|
||||
},
|
||||
children: JobRoutes
|
||||
},
|
||||
{
|
||||
path: '/audit/tickets',
|
||||
component: empty,
|
||||
redirect: '',
|
||||
name: 'TicketRoutes',
|
||||
meta: {
|
||||
title: i18n.t('TicketsAudit'),
|
||||
icon: 'job',
|
||||
permissions: ['tickets.view_ticket']
|
||||
},
|
||||
children: TicketRoutes
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
29
src/router/audit/tickets.js
Normal file
29
src/router/audit/tickets.js
Normal file
@@ -0,0 +1,29 @@
|
||||
import i18n from '@/i18n/i18n'
|
||||
import empty from '@/layout/empty'
|
||||
|
||||
export default [
|
||||
{
|
||||
path: 'ticket-list',
|
||||
name: 'TicketList',
|
||||
component: empty,
|
||||
redirect: {
|
||||
name: 'TicketList'
|
||||
},
|
||||
meta: {
|
||||
title: i18n.t('TicketList'),
|
||||
icon: 'audit',
|
||||
permissions: ['audits.view_joblog']
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
name: 'AuditTicketList',
|
||||
component: () => import('@/views/audits/TicketList'),
|
||||
meta: {
|
||||
title: i18n.t('TicketList'),
|
||||
permissions: []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -993,5 +993,5 @@ $--breakpoints-spec: (
|
||||
'xl-only' : (min-width: $--xl),
|
||||
);
|
||||
|
||||
$--font-path: '~element-ui/lib/theme-chalk/fonts';
|
||||
@import "~element-ui/packages/theme-chalk/src/index";
|
||||
$--font-path: '~elementui-lts/lib/theme-chalk/fonts';
|
||||
@import "~elementui-lts/packages/theme-chalk/src/index";
|
||||
|
||||
@@ -50,7 +50,8 @@
|
||||
|
||||
|
||||
.ztree li span.button, .view_icon {
|
||||
&.windows_ico_docu {
|
||||
&.windows_ico_docu,
|
||||
&.windows_ad_ico_docu {
|
||||
background: url('./icons/windows.png') no-repeat center left transparent;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// 鼠标可移入tooltip功能
|
||||
import { Table } from 'element-ui'
|
||||
import { getCell, getColumnByCell } from 'element-ui/packages/table/src/util'
|
||||
import { getStyle, hasClass } from 'element-ui/src/utils/dom'
|
||||
import { Table } from 'elementui-lts'
|
||||
import { getCell, getColumnByCell } from 'elementui-lts/packages/table/src/util'
|
||||
import { getStyle, hasClass } from 'elementui-lts/src/utils/dom'
|
||||
import { copy } from './common'
|
||||
|
||||
Object.assign(Table.components.TableBody.methods, {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// 重置message,防止重复点击重复弹出message弹框
|
||||
import { Message as elMessage } from 'element-ui'
|
||||
import { Message as elMessage } from 'elementui-lts'
|
||||
import { toSentenceCase } from '@/utils/common'
|
||||
|
||||
let messageDom = null
|
||||
|
||||
@@ -3,7 +3,7 @@ import i18n from '@/i18n/i18n'
|
||||
import { eventBus } from '@/utils/const'
|
||||
import { getTokenFromCookie } from '@/utils/auth'
|
||||
import { getErrorResponseMsg } from '@/utils/common'
|
||||
import { MessageBox } from 'element-ui'
|
||||
import { MessageBox } from 'elementui-lts'
|
||||
import { message } from '@/utils/message'
|
||||
import store from '@/store'
|
||||
import axiosRetry from 'axios-retry'
|
||||
|
||||
@@ -131,7 +131,7 @@ export default {
|
||||
})
|
||||
},
|
||||
handleConfirm() {
|
||||
const url = '/api/v1/accounts/gathered-accounts/'
|
||||
const url = `/api/v1/accounts/gathered-accounts/${this.account.id}/`
|
||||
this.$axios.delete(url, {
|
||||
params: {
|
||||
username: this.account.username,
|
||||
|
||||
@@ -98,6 +98,21 @@ export default {
|
||||
this.updateTaskData({ 'release_assets': val })
|
||||
}.bind(this)
|
||||
}
|
||||
},
|
||||
{
|
||||
title: this.$t('IsAlwaysUpdate'),
|
||||
type: 'switch',
|
||||
attrs: {
|
||||
showTip: true,
|
||||
tip: this.$t('IsAlwaysUpdateHelpTip'),
|
||||
model: this.object.task.is_always_update,
|
||||
disabled: !this.hasEditPerm()
|
||||
},
|
||||
callbacks: {
|
||||
change: function(val) {
|
||||
this.updateTaskData({ 'is_always_update': val })
|
||||
}.bind(this)
|
||||
}
|
||||
}
|
||||
],
|
||||
quickExecuteActions: [
|
||||
|
||||
@@ -109,8 +109,7 @@ export default {
|
||||
options: [],
|
||||
value: [],
|
||||
ajax: {
|
||||
url: '',
|
||||
clearable: false,
|
||||
url: '/api/v1/assets/platforms/',
|
||||
transformOption: (item) => {
|
||||
let display
|
||||
switch (this.resourceType) {
|
||||
@@ -157,6 +156,7 @@ export default {
|
||||
el: {
|
||||
hidden: true,
|
||||
settingReadonly: true,
|
||||
showSetting: () => false,
|
||||
choices: []
|
||||
}
|
||||
}
|
||||
|
||||
26
src/views/audits/TicketList.vue
Normal file
26
src/views/audits/TicketList.vue
Normal file
@@ -0,0 +1,26 @@
|
||||
<template>
|
||||
<BaseTicketList :url="url" v-bind="$data" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import BaseTicketList from '@/views/tickets/BaseTicketList'
|
||||
|
||||
export default {
|
||||
name: 'AuditTicketList',
|
||||
components: {
|
||||
BaseTicketList
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
extraTicketAction: {
|
||||
hasImport: false
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
url() {
|
||||
return `/api/v1/tickets/tickets/`
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -232,7 +232,7 @@ export default {
|
||||
fold: {
|
||||
timeout: {
|
||||
type: 'select',
|
||||
name: this.$t('Timeout'),
|
||||
name: this.$t('Timeout(s)'),
|
||||
align: 'left',
|
||||
value: 60,
|
||||
options: [
|
||||
@@ -443,8 +443,8 @@ export default {
|
||||
this.toolbar.left.run.icon = 'fa fa-spinner fa-spin'
|
||||
this.toolbar.left.run.isVisible = true
|
||||
this.executionInfo.cancel = setInterval(() => {
|
||||
this.executionInfo.timeCost += 0.1
|
||||
}, 100)
|
||||
this.executionInfo.timeCost += 1
|
||||
}, 1000)
|
||||
},
|
||||
|
||||
getSelectedNodesAndHosts() {
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</span>
|
||||
<span class="status-item">
|
||||
<span>{{ $tc('TimeDelta') }}: </span>
|
||||
<span>{{ executionInfo.timeCost.toFixed(2) }}s</span>
|
||||
<span>{{ executionInfo.timeCost }}s</span>
|
||||
</span>
|
||||
</div>
|
||||
<div v-if="showToolBar" class="actions">
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
</span>
|
||||
<span>
|
||||
<span><b>{{ $tc('TimeDelta') }}: </b></span>
|
||||
<span>{{ executionInfo.timeCost.toFixed(2) }}</span>
|
||||
<span>{{ executionInfo.timeCost }}</span>
|
||||
</span>
|
||||
</span>
|
||||
<div class="output">
|
||||
@@ -325,8 +325,8 @@ export default {
|
||||
this.runButton.icon = 'fa fa-spinner fa-spin'
|
||||
this.runButton.disabled = true
|
||||
this.executionInfo.cancel = setInterval(() => {
|
||||
this.executionInfo.timeCost += 0.1
|
||||
}, 100)
|
||||
this.executionInfo.timeCost += 1
|
||||
}, 1000)
|
||||
},
|
||||
getSelectedNodesAndHosts() {
|
||||
const hosts = this.getSelectedNodes().filter((item) => {
|
||||
@@ -424,6 +424,7 @@ export default {
|
||||
}
|
||||
createJob(data).then(res => {
|
||||
this.progressLength = 0
|
||||
this.executionInfo.timeCost = 0
|
||||
this.ShowProgress = true
|
||||
const form = new FormData()
|
||||
for (const file of this.uploadFileList) {
|
||||
@@ -438,7 +439,6 @@ export default {
|
||||
this.progressLength += 1
|
||||
}, 100)
|
||||
JobUploadFile(form).then(res => {
|
||||
this.executionInfo.timeCost = 0
|
||||
this.executionInfo.status = 'running'
|
||||
this.currentTaskId = res.task_id
|
||||
this.xtermConfig = { taskId: this.currentTaskId, type: 'shortcut_cmd' }
|
||||
@@ -450,7 +450,6 @@ export default {
|
||||
})
|
||||
},
|
||||
execute_stop() {
|
||||
this.executionInfo.timeCost = 0
|
||||
this.progressLength = 0
|
||||
this.ShowProgress = false
|
||||
this.runButton.disabled = false
|
||||
|
||||
@@ -187,9 +187,12 @@ export default {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
realRadioSelected(val) {
|
||||
this.showSpecZone = val === this.SPEC
|
||||
this.showExcludeZone = val === this.EXCLUDE
|
||||
realRadioSelected: {
|
||||
handler(val) {
|
||||
this.showSpecZone = val === this.SPEC
|
||||
this.showExcludeZone = val === this.EXCLUDE
|
||||
},
|
||||
sync: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -209,17 +212,20 @@ export default {
|
||||
},
|
||||
initDefaultChoice() {
|
||||
const value = this.value || []
|
||||
|
||||
if (value.length === 0) {
|
||||
value.push(this.ALL)
|
||||
}
|
||||
|
||||
const specAccountsInput = this.getSpecValues(value)
|
||||
|
||||
// const excludeAccountsInput = this.getExcludeChoices(value)
|
||||
// 先清理 radio
|
||||
const isAll = value.includes(this.ALL)
|
||||
|
||||
if (isAll) {
|
||||
this.realRadioSelected = this.ALL
|
||||
} else if (specAccountsInput.length > 0) {
|
||||
} else if (specAccountsInput.length > 0 || value.includes(this.SPEC)) {
|
||||
this.realRadioSelected = this.SPEC
|
||||
this.specAccountsInput = specAccountsInput
|
||||
// } else if (excludeAccountsInput.length > 0) {
|
||||
@@ -250,7 +256,6 @@ export default {
|
||||
}, 100)
|
||||
},
|
||||
handleVirtualChecked(evt, checked) {
|
||||
console.log('Vhcek cch')
|
||||
this.outputValue()
|
||||
},
|
||||
handleRadioChanged(value) {
|
||||
@@ -262,6 +267,7 @@ export default {
|
||||
outputValue() {
|
||||
// 这是真是的
|
||||
let choicesSelected = []
|
||||
|
||||
if (this.realRadioSelected === this.ALL) {
|
||||
choicesSelected = [this.ALL]
|
||||
} else if (this.realRadioSelected === this.SPEC && this.showSpecZone) {
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
</template>
|
||||
|
||||
<script type="text/jsx">
|
||||
import prettyBytes from 'pretty-bytes'
|
||||
import { DrawerListTable as ListTable } from '@/components'
|
||||
import { timeOffset } from '@/utils/time'
|
||||
import { ActionsFormatter, ChoicesFormatter, DetailFormatter } from '@/components/Table/TableFormatters'
|
||||
@@ -156,6 +157,12 @@ export default {
|
||||
showFalse: true
|
||||
}
|
||||
},
|
||||
replay_size: {
|
||||
width: '120px',
|
||||
formatter: (row) => {
|
||||
return prettyBytes(Number(row.replay_size))
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
prop: 'actions',
|
||||
label: this.$t('Actions'),
|
||||
|
||||
@@ -42,9 +42,16 @@ export default {
|
||||
'applet.display_name', 'applet.version',
|
||||
'date_updated', 'status', 'actions'
|
||||
],
|
||||
columnsShow: {
|
||||
min: ['name', 'actions'],
|
||||
default: [
|
||||
'applet.display_name', 'status', 'actions'
|
||||
]
|
||||
},
|
||||
columnsMeta: {
|
||||
'applet.display_name': {
|
||||
label: this.$t('DisplayName'),
|
||||
width: '160px',
|
||||
formatter: DetailFormatter,
|
||||
formatterArgs: {
|
||||
drawer: true,
|
||||
@@ -61,7 +68,7 @@ export default {
|
||||
label: this.$t('Version')
|
||||
},
|
||||
status: {
|
||||
label: this.$t('PublishStatus'),
|
||||
label: this.$t('Status'),
|
||||
formatter: (row) => {
|
||||
const typeMapper = {
|
||||
'pending': 'success',
|
||||
@@ -77,7 +84,7 @@ export default {
|
||||
label: this.$t('Date')
|
||||
},
|
||||
actions: {
|
||||
width: '160px',
|
||||
width: '138px',
|
||||
formatterArgs: {
|
||||
hasUpdate: false,
|
||||
hasDelete: false,
|
||||
|
||||
@@ -64,7 +64,7 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
url() {
|
||||
return `/api/v1/tickets/tickets/?assignees__id=${this.currentUser.id}`
|
||||
return `/api/v1/tickets/tickets/?assignees__id=${this.currentUser.id}&state=pending`
|
||||
},
|
||||
...mapGetters([
|
||||
'currentUser'
|
||||
|
||||
@@ -133,6 +133,9 @@ export default {
|
||||
label: this.$t('Date'),
|
||||
sortable: 'custom',
|
||||
formatter: (row) => toSafeLocalDateStr(row.date_created)
|
||||
},
|
||||
actions: {
|
||||
has: this.$route.name !== 'AuditTicketList'
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -143,14 +146,6 @@ export default {
|
||||
canCreate: this.$hasPerm('tickets.view_ticket'),
|
||||
hasBulkDelete: false,
|
||||
searchConfig: {
|
||||
default: {
|
||||
state: {
|
||||
key: 'state',
|
||||
label: this.$t('Action'),
|
||||
value: 'pending',
|
||||
valueLabel: this.$t('Open')
|
||||
}
|
||||
},
|
||||
exclude: ['id', 'title', 'type', 'applicant'],
|
||||
options: [
|
||||
{
|
||||
|
||||
@@ -27,7 +27,7 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
url() {
|
||||
return `/api/v1/tickets/tickets/?applicant=${this.currentUser.id}`
|
||||
return `/api/v1/tickets/tickets/?applicant=${this.currentUser.id}&state=pending`
|
||||
},
|
||||
...mapGetters([
|
||||
'currentUser'
|
||||
|
||||
@@ -19,11 +19,11 @@
|
||||
</template>
|
||||
<slot />
|
||||
<el-form ref="comments" :model="form" label-width="45px" style="padding-top: 20px">
|
||||
<el-form-item :label="$tc('Reply')">
|
||||
<el-form-item v-if="!isAuditRoute" :label="$tc('Reply')">
|
||||
<el-input v-model="form.comments" :autosize="{ minRows: 4 }" type="textarea" />
|
||||
</el-form-item>
|
||||
<el-form-item style="float: right">
|
||||
<template v-if="hasActionPerm">
|
||||
<template v-if="hasActionPerm && !isAuditRoute">
|
||||
<el-button
|
||||
:disabled="isDisabled || object.status.value === 'closed'"
|
||||
size="small"
|
||||
@@ -42,7 +42,7 @@
|
||||
</el-button>
|
||||
</template>
|
||||
<el-button
|
||||
v-if="isSelfTicket"
|
||||
v-if="isSelfTicket && !isAuditRoute"
|
||||
:disabled="isDisabled || object.status.value === 'closed'"
|
||||
size="small"
|
||||
type="danger"
|
||||
@@ -51,6 +51,7 @@
|
||||
<i class="fa fa-times" /> {{ $t('CancelTicket') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="!isAuditRoute"
|
||||
:disabled="object.status.value === 'closed'"
|
||||
size="small"
|
||||
type="info"
|
||||
@@ -103,6 +104,9 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
isAuditRoute() {
|
||||
return this.$route.name === 'AuditTicketList'
|
||||
},
|
||||
hasActionPerm() {
|
||||
return this.object.process_map.filter(
|
||||
item => item.approval_level === this.object.approval_step.value
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
</el-row>
|
||||
</div>
|
||||
<el-divider />
|
||||
<div class="bottom-btn">
|
||||
<div v-if="!isAuditRoute" class="bottom-btn">
|
||||
<el-button
|
||||
:disabled="!session.can_terminate"
|
||||
size="small"
|
||||
@@ -88,7 +88,11 @@ export default {
|
||||
supportedLock: false
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
isAuditRoute() {
|
||||
return this.$route.name === 'AuditTicketList'
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.object.state.value === 'approved' && this.object.type.value === 'login_asset_confirm') {
|
||||
this.init()
|
||||
|
||||
@@ -216,7 +216,7 @@ export default {
|
||||
width: '120px',
|
||||
formatter: (row) => {
|
||||
const phoneObj = row.phone
|
||||
return <div>{phoneObj?.code}{phoneObj?.phone}</div>
|
||||
return phoneObj?.phone ? <div>{phoneObj?.code}{phoneObj?.phone}</div> : ''
|
||||
}
|
||||
},
|
||||
login_blocked: {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { createLocalVue, mount } from '@vue/test-utils'
|
||||
import VueRouter from 'vue-router'
|
||||
import ElementUI from 'element-ui'
|
||||
import ElementUI from 'elementui-lts'
|
||||
import Breadcrumb from '@/components/Widgets/Breadcrumb/index.vue'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
|
||||
@@ -98,8 +98,8 @@ module.exports = {
|
||||
alias: {
|
||||
'@': resolve('src'),
|
||||
elementCss: resolve(
|
||||
'node_modules/element-ui/lib/theme-chalk/index.css'),
|
||||
elementLocale: resolve('node_modules/element-ui/lib/locale/lang/en.js')
|
||||
'node_modules/elementui-lts/lib/theme-chalk/index.css'),
|
||||
elementLocale: resolve('node_modules/elementui-lts/lib/locale/lang/en.js')
|
||||
},
|
||||
extensions: ['.vue', '.js', '.json']
|
||||
}
|
||||
|
||||
24
yarn.lock
24
yarn.lock
@@ -4448,19 +4448,15 @@ electron-to-chromium@^1.4.601:
|
||||
resolved "https://registry.npmmirror.com/electron-to-chromium/-/electron-to-chromium-1.4.611.tgz"
|
||||
integrity sha512-ZtRpDxrjHapOwxtv+nuth5ByB8clyn8crVynmRNGO3wG3LOp8RTcyZDqwaI6Ng6y8FCK2hVZmJoqwCskKbNMaw==
|
||||
|
||||
element-theme-chalk@^2.13.1:
|
||||
version "2.15.14"
|
||||
resolved "https://registry.npmmirror.com/element-theme-chalk/-/element-theme-chalk-2.15.14.tgz"
|
||||
integrity sha512-jgMTD6Qg6UPRDjBzARl42xit7lfCg+gE8x+QaUmmrhWv2TsnFoerhOupn0smxKTfO0Oh9Kh53Q+thXeZO7/0rQ==
|
||||
|
||||
element-ui@2.15.14:
|
||||
version "2.15.14"
|
||||
resolved "https://registry.npmmirror.com/element-ui/-/element-ui-2.15.14.tgz"
|
||||
integrity sha512-2v9fHL0ZGINotOlRIAJD5YuVB8V7WKxrE9Qy7dXhRipa035+kF7WuU/z+tEmLVPBcJ0zt8mOu1DKpWcVzBK8IA==
|
||||
elementui-lts@^2.16.0:
|
||||
version "2.16.0"
|
||||
resolved "https://registry.npmmirror.com/elementui-lts/-/elementui-lts-2.16.0.tgz#2add8f3625ada83d553b7862b75a986f6eaca993"
|
||||
integrity sha512-HFezWcsZTJN4HIGg5WUggte8XEhg2KQ2rR6covLwjY56cMkPkdv2s5Q4ww28dO+RauJC1daldOMp8wXSir7M8w==
|
||||
dependencies:
|
||||
async-validator "~1.8.1"
|
||||
babel-helper-vue-jsx-merge-props "^2.0.0"
|
||||
deepmerge "^1.2.0"
|
||||
lodash-es "^4.17.21"
|
||||
normalize-wheel "^1.0.1"
|
||||
resize-observer-polyfill "^1.5.0"
|
||||
throttle-debounce "^1.0.1"
|
||||
@@ -8139,6 +8135,11 @@ locate-path@^6.0.0:
|
||||
dependencies:
|
||||
p-locate "^5.0.0"
|
||||
|
||||
lodash-es@^4.17.21:
|
||||
version "4.17.21"
|
||||
resolved "https://registry.npmmirror.com/lodash-es/-/lodash-es-4.17.21.tgz#43e626c46e6591b7750beb2b50117390c609e3ee"
|
||||
integrity sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==
|
||||
|
||||
lodash.clonedeep@^4.5.0:
|
||||
version "4.5.0"
|
||||
resolved "https://registry.npmmirror.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz"
|
||||
@@ -10542,6 +10543,11 @@ prettier@1.16.3:
|
||||
resolved "https://registry.npmmirror.com/prettier/-/prettier-2.8.8.tgz"
|
||||
integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==
|
||||
|
||||
pretty-bytes@^5.6.0:
|
||||
version "5.6.0"
|
||||
resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.6.0.tgz#356256f643804773c82f64723fe78c92c62beaeb"
|
||||
integrity sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg==
|
||||
|
||||
pretty-error@^2.0.2:
|
||||
version "2.1.2"
|
||||
resolved "https://registry.npmmirror.com/pretty-error/-/pretty-error-2.1.2.tgz"
|
||||
|
||||
Reference in New Issue
Block a user