mirror of
https://github.com/jumpserver/lina.git
synced 2025-11-10 11:50:35 +00:00
Compare commits
28 Commits
pr@v3@fix_
...
v2.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ae6d76704b | ||
|
|
6112c62f70 | ||
|
|
13e7bf387c | ||
|
|
30737b6fee | ||
|
|
2ecc8dacec | ||
|
|
4c7f1aeee0 | ||
|
|
2d3f40f9f7 | ||
|
|
4d9ef60343 | ||
|
|
9fe9b5d68c | ||
|
|
82a251bbd2 | ||
|
|
4e4be19edc | ||
|
|
f0dfb4d266 | ||
|
|
261450c369 | ||
|
|
6f842bee99 | ||
|
|
3811757104 | ||
|
|
eb681f9324 | ||
|
|
91abc8fff6 | ||
|
|
d0143ab0fe | ||
|
|
3e5fc8d64f | ||
|
|
63dfc9edd2 | ||
|
|
3c4b8a7581 | ||
|
|
ebc3821edf | ||
|
|
8fe92911c4 | ||
|
|
9853150939 | ||
|
|
afbac1b119 | ||
|
|
6a24fa1f95 | ||
|
|
4694d2b73c | ||
|
|
993748b081 |
12
.github/workflows/jms-generic-action-handler.yml
vendored
Normal file
12
.github/workflows/jms-generic-action-handler.yml
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
on: [push, pull_request, release]
|
||||||
|
|
||||||
|
name: JumpServer repos generic handler
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
generic_handler:
|
||||||
|
name: Run generic handler
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: jumpserver/action-generic-handler@master
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.PRIVATE_TOKEN }}
|
||||||
14
Dockerfile
14
Dockerfile
@@ -1,10 +1,22 @@
|
|||||||
FROM node:10 as stage-build
|
FROM node:10 as stage-build
|
||||||
ARG VERSION
|
ARG VERSION
|
||||||
ENV VERSION=$VERSION
|
ENV VERSION=$VERSION
|
||||||
|
ARG NPM_REGISTRY="https://registry.npm.taobao.org"
|
||||||
|
ENV NPM_REGISTY=$NPM_REGISTRY
|
||||||
|
ARG SASS_BINARY_SITE="https://npm.taobao.org/mirrors/node-sass"
|
||||||
|
ENV SASS_BINARY_SITE=$SASS_BINARY_SITE
|
||||||
|
|
||||||
WORKDIR /data
|
WORKDIR /data
|
||||||
|
|
||||||
|
RUN npm config set sass_binary_site=${SASS_BINARY_SITE}
|
||||||
|
RUN npm config set registry ${NPM_REGISTRY}
|
||||||
|
RUN yarn config set registry ${NPM_REGISTRY}
|
||||||
|
COPY package.json yarn.lock /data/
|
||||||
|
COPY utils /data/utils/
|
||||||
|
RUN ls && cd utils && bash -xieu build.sh dep
|
||||||
|
|
||||||
ADD . /data
|
ADD . /data
|
||||||
RUN cd utils && bash -xieu build.sh
|
RUN cd utils && bash -xieu build.sh build
|
||||||
|
|
||||||
FROM nginx:alpine
|
FROM nginx:alpine
|
||||||
COPY --from=stage-build /data/release/lina /opt/lina
|
COPY --from=stage-build /data/release/lina /opt/lina
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ export default {
|
|||||||
{
|
{
|
||||||
prop: 'ip',
|
prop: 'ip',
|
||||||
label: this.$t('assets.ip'),
|
label: this.$t('assets.ip'),
|
||||||
width: 140
|
width: '120px'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'username',
|
prop: 'username',
|
||||||
@@ -130,7 +130,7 @@ export default {
|
|||||||
{
|
{
|
||||||
prop: 'version',
|
prop: 'version',
|
||||||
label: this.$t('assets.Version'),
|
label: this.$t('assets.Version'),
|
||||||
width: '50px'
|
width: '70px'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'date_created',
|
prop: 'date_created',
|
||||||
|
|||||||
@@ -76,6 +76,9 @@ export default {
|
|||||||
case 'field':
|
case 'field':
|
||||||
type = ''
|
type = ''
|
||||||
field.component = Select2
|
field.component = Select2
|
||||||
|
if (fieldMeta.required) {
|
||||||
|
field.el.clearable = false
|
||||||
|
}
|
||||||
break
|
break
|
||||||
case 'string':
|
case 'string':
|
||||||
type = 'input'
|
type = 'input'
|
||||||
|
|||||||
@@ -953,6 +953,8 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
search(attrs, reset) {
|
search(attrs, reset) {
|
||||||
|
// 重置搜索结果到第一页
|
||||||
|
this.page = defaultFirstPage
|
||||||
// Orange 重置查询对象
|
// Orange 重置查询对象
|
||||||
if (reset) {
|
if (reset) {
|
||||||
this.innerQuery = merge({}, attrs)
|
this.innerQuery = merge({}, attrs)
|
||||||
@@ -962,6 +964,8 @@ export default {
|
|||||||
return this.getList()
|
return this.getList()
|
||||||
},
|
},
|
||||||
searchDate(attrs) {
|
searchDate(attrs) {
|
||||||
|
// 重置搜索结果到第一页
|
||||||
|
this.page = defaultFirstPage
|
||||||
this.innerQuery = merge(this.innerQuery, attrs)
|
this.innerQuery = merge(this.innerQuery, attrs)
|
||||||
return this.getList()
|
return this.getList()
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<IBox :title="title" fa="fa-info-circle">
|
<IBox :title="title" fa="fa-info-circle">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
<el-row v-if="this.$route.params.id" :gutter="10" class="item">
|
||||||
|
<el-col :span="6"><div :style="{ 'text-align': align }" class="item-label"><label>ID: </label></div></el-col>
|
||||||
|
<el-col :span="18"><div class="item-text">{{ this.$route.params.id }}</div></el-col>
|
||||||
|
</el-row>
|
||||||
<el-row v-for="item in items" :key="'card-' + item.key" :gutter="10" class="item">
|
<el-row v-for="item in items" :key="'card-' + item.key" :gutter="10" class="item">
|
||||||
<el-col :span="6"><div :style="{ 'text-align': align }" class="item-label"><label>{{ item.key }}: </label></div></el-col>
|
<el-col :span="6"><div :style="{ 'text-align': align }" class="item-label"><label>{{ item.key }}: </label></div></el-col>
|
||||||
<el-col :span="18"><div class="item-text">
|
<el-col :span="18"><div class="item-text">
|
||||||
|
|||||||
@@ -67,6 +67,8 @@ export default {
|
|||||||
const query = listTableRef.dataTable.getQuery()
|
const query = listTableRef.dataTable.getQuery()
|
||||||
delete query['limit']
|
delete query['limit']
|
||||||
delete query['offset']
|
delete query['offset']
|
||||||
|
delete query['date_from']
|
||||||
|
delete query['date_to']
|
||||||
return query
|
return query
|
||||||
},
|
},
|
||||||
tableHasQuery() {
|
tableHasQuery() {
|
||||||
@@ -77,7 +79,7 @@ export default {
|
|||||||
{
|
{
|
||||||
label: this.$t('common.imExport.ExportAll'),
|
label: this.$t('common.imExport.ExportAll'),
|
||||||
value: 'all',
|
value: 'all',
|
||||||
can: this.canExportAll
|
can: this.canExportAll && !this.tableHasQuery
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$t('common.imExport.ExportOnlySelectedItems'),
|
label: this.$t('common.imExport.ExportOnlySelectedItems'),
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
:remote-method="filterOptions"
|
:remote-method="filterOptions"
|
||||||
:multiple="multiple"
|
:multiple="multiple"
|
||||||
filterable
|
filterable
|
||||||
|
:clearable="clearable"
|
||||||
popper-append-to-body
|
popper-append-to-body
|
||||||
class="select2"
|
class="select2"
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
@@ -69,6 +70,10 @@ export default {
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true
|
||||||
},
|
},
|
||||||
|
clearable: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
// 初始化值,也就是选中的值
|
// 初始化值,也就是选中的值
|
||||||
value: {
|
value: {
|
||||||
type: [Array, String, Number, Boolean],
|
type: [Array, String, Number, Boolean],
|
||||||
|
|||||||
@@ -555,7 +555,12 @@
|
|||||||
},
|
},
|
||||||
"Monitor": "监控",
|
"Monitor": "监控",
|
||||||
"sessionMonitor": "监控",
|
"sessionMonitor": "监控",
|
||||||
"TerminateTaskSendSuccessMsg": "终断任务已下发,请稍后刷新查看"
|
"TerminateTaskSendSuccessMsg": "终断任务已下发,请稍后刷新查看",
|
||||||
|
"helpText": {
|
||||||
|
"esUrl": "提示:如果有多台主机,请使用逗号 ( , ) 进行分割。(eg: http://www.jumpserver.a.com,http://www.jumpserver.b.com)",
|
||||||
|
"esIndex": "es提供默认index:jumpserver",
|
||||||
|
"esDocType": "es默认文档类型:command"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"setting": {
|
"setting": {
|
||||||
"ApiKeyList": "API Key 列表",
|
"ApiKeyList": "API Key 列表",
|
||||||
@@ -686,12 +691,12 @@
|
|||||||
},
|
},
|
||||||
"tickets": {
|
"tickets": {
|
||||||
"Accept": "接受",
|
"Accept": "接受",
|
||||||
"AssignedMe": "待处理",
|
"AssignedMe": "待我审批",
|
||||||
"Assignee": "处理人",
|
"Assignee": "处理人",
|
||||||
"Assignees": "待处理人",
|
"Assignees": "待处理人",
|
||||||
"Close": "关闭",
|
"Close": "关闭",
|
||||||
"Comment": "备注",
|
"Comment": "备注",
|
||||||
"MyTickets": "我的工单",
|
"MyTickets": "我发起的",
|
||||||
"Reject": "拒绝",
|
"Reject": "拒绝",
|
||||||
"date": "日期",
|
"date": "日期",
|
||||||
"reply": "回复",
|
"reply": "回复",
|
||||||
@@ -700,7 +705,12 @@
|
|||||||
"type": "类型",
|
"type": "类型",
|
||||||
"user": "用户",
|
"user": "用户",
|
||||||
"Status": "状态",
|
"Status": "状态",
|
||||||
"Open": "打开"
|
"Open": "打开",
|
||||||
|
"Applicant": "申请人",
|
||||||
|
"Pending": "未处理",
|
||||||
|
"Approved": "已同意",
|
||||||
|
"Rejected": "已拒绝",
|
||||||
|
"Closed": "已关闭"
|
||||||
},
|
},
|
||||||
"tree": {
|
"tree": {
|
||||||
"AddAssetToNode": "添加资产到节点",
|
"AddAssetToNode": "添加资产到节点",
|
||||||
|
|||||||
@@ -554,7 +554,12 @@
|
|||||||
},
|
},
|
||||||
"Monitor": "Monitor",
|
"Monitor": "Monitor",
|
||||||
"sessionMonitor": "Session Monitor",
|
"sessionMonitor": "Session Monitor",
|
||||||
"TerminateTaskSendSuccessMsg": "Terminate task has been send, Please check later"
|
"TerminateTaskSendSuccessMsg": "Terminate task has been send, Please check later",
|
||||||
|
"helpText": {
|
||||||
|
"esUrl": "Tip: If you have multiple hosts, use comma (,) to split (eg: http://www.jumpserver.a.com,http://www.jumpserver.b.com)",
|
||||||
|
"esIndex":"Es provides the default index: jumpserver",
|
||||||
|
"esDocType": "Es provides the default document type: command"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"setting": {
|
"setting": {
|
||||||
"ApiKeyList": "Api key list",
|
"ApiKeyList": "Api key list",
|
||||||
@@ -699,7 +704,13 @@
|
|||||||
"type": "Type",
|
"type": "Type",
|
||||||
"user": "User",
|
"user": "User",
|
||||||
"Status": "Status",
|
"Status": "Status",
|
||||||
"Open": "Open"
|
"Open": "Open",
|
||||||
|
"Applicant": "Applicant",
|
||||||
|
"Pending": "Pending",
|
||||||
|
"Approved": "Approved",
|
||||||
|
"Rejected": "Rejected",
|
||||||
|
"Closed": "Closed"
|
||||||
|
|
||||||
},
|
},
|
||||||
"tree": {
|
"tree": {
|
||||||
"AddAssetToNode": "Add asset to node",
|
"AddAssetToNode": "Add asset to node",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<Page>
|
<Page>
|
||||||
<IBox>
|
<IBox>
|
||||||
<GenericCreateUpdateForm v-bind="$attrs" v-on="$listeners" />
|
<GenericCreateUpdateForm ref="createUpdateForm" v-bind="$attrs" v-on="$listeners" />
|
||||||
</IBox>
|
</IBox>
|
||||||
</Page>
|
</Page>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -18,7 +18,14 @@ export default {
|
|||||||
],
|
],
|
||||||
columnsMeta: {
|
columnsMeta: {
|
||||||
get_type_display: {
|
get_type_display: {
|
||||||
label: this.$t('applications.type')
|
label: this.$t('applications.type'),
|
||||||
|
width: '80px'
|
||||||
|
},
|
||||||
|
host: {
|
||||||
|
width: '140px'
|
||||||
|
},
|
||||||
|
port: {
|
||||||
|
width: '60px'
|
||||||
},
|
},
|
||||||
database: {
|
database: {
|
||||||
showOverflowTooltip: true
|
showOverflowTooltip: true
|
||||||
|
|||||||
@@ -21,7 +21,8 @@ export default {
|
|||||||
],
|
],
|
||||||
columnsMeta: {
|
columnsMeta: {
|
||||||
type: {
|
type: {
|
||||||
displayKey: 'get_type_display'
|
displayKey: 'get_type_display',
|
||||||
|
width: '140px'
|
||||||
},
|
},
|
||||||
asset: {
|
asset: {
|
||||||
showOverflowTooltip: true,
|
showOverflowTooltip: true,
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export const REMOTE_APP_TYPE_FIELDS_MAP = {
|
|||||||
label: i18n.t('applications.chrome_username')
|
label: i18n.t('applications.chrome_username')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'chrome_password', el: {}, attrs: {}, type: 'input', prop: 'chrome_password',
|
id: 'chrome_password', el: { 'show-password': true }, attrs: {}, type: 'input', prop: 'chrome_password',
|
||||||
label: i18n.t('applications.chrome_password')
|
label: i18n.t('applications.chrome_password')
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -36,7 +36,7 @@ export const REMOTE_APP_TYPE_FIELDS_MAP = {
|
|||||||
label: i18n.t('applications.mysql_workbench_username')
|
label: i18n.t('applications.mysql_workbench_username')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'mysql_workbench_password', el: {}, attrs: {}, type: 'input', prop: 'mysql_workbench_password',
|
id: 'mysql_workbench_password', el: { 'show-password': true }, attrs: {}, type: 'input', prop: 'mysql_workbench_password',
|
||||||
label: i18n.t('applications.mysql_workbench_password')
|
label: i18n.t('applications.mysql_workbench_password')
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -50,7 +50,7 @@ export const REMOTE_APP_TYPE_FIELDS_MAP = {
|
|||||||
label: i18n.t('applications.vmware_username')
|
label: i18n.t('applications.vmware_username')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'vmware_password', el: {}, attrs: {}, type: 'input', prop: 'vmware_password',
|
id: 'vmware_password', el: { 'show-password': true }, attrs: {}, type: 'input', prop: 'vmware_password',
|
||||||
label: i18n.t('applications.vmware_password')
|
label: i18n.t('applications.vmware_password')
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -68,7 +68,7 @@ export const REMOTE_APP_TYPE_FIELDS_MAP = {
|
|||||||
label: i18n.t('applications.custom_username')
|
label: i18n.t('applications.custom_username')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'custom_password', el: {}, attrs: {}, type: 'input', prop: 'custom_password',
|
id: 'custom_password', el: { 'show-password': true }, attrs: {}, type: 'input', prop: 'custom_password',
|
||||||
label: i18n.t('applications.custom_password')
|
label: i18n.t('applications.custom_password')
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -33,7 +33,8 @@ export default {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'assets_amount',
|
prop: 'assets_amount',
|
||||||
label: this.$t('assets.Assets')
|
label: this.$t('assets.Assets'),
|
||||||
|
width: '80px'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'comment',
|
prop: 'comment',
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ export default {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: this.$t('assets.Domain'),
|
key: this.$t('assets.Domain'),
|
||||||
value: this.object.domain
|
value: this.object.domain_display
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: this.$t('assets.Vendor'),
|
key: this.$t('assets.Vendor'),
|
||||||
|
|||||||
@@ -22,6 +22,15 @@ export default {
|
|||||||
url: `/api/v1/assets/cmd-filters/${this.object.id}/rules/`,
|
url: `/api/v1/assets/cmd-filters/${this.object.id}/rules/`,
|
||||||
columns: ['type', 'content', 'priority', 'action', 'comment', 'actions'],
|
columns: ['type', 'content', 'priority', 'action', 'comment', 'actions'],
|
||||||
columnsMeta: {
|
columnsMeta: {
|
||||||
|
type: {
|
||||||
|
width: '100px'
|
||||||
|
},
|
||||||
|
priority: {
|
||||||
|
width: '70px'
|
||||||
|
},
|
||||||
|
action: {
|
||||||
|
width: '90px'
|
||||||
|
},
|
||||||
content: {
|
content: {
|
||||||
showOverflowTooltip: true
|
showOverflowTooltip: true
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -25,8 +25,15 @@ export default {
|
|||||||
sortable: 'custom',
|
sortable: 'custom',
|
||||||
formatter: DisplayFormatter
|
formatter: DisplayFormatter
|
||||||
},
|
},
|
||||||
|
ip: {
|
||||||
|
width: '140px'
|
||||||
|
},
|
||||||
|
port: {
|
||||||
|
width: '60px'
|
||||||
|
},
|
||||||
protocol: {
|
protocol: {
|
||||||
sortable: 'custom'
|
sortable: 'custom',
|
||||||
|
width: '100px'
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
formatterArgs: {
|
formatterArgs: {
|
||||||
|
|||||||
@@ -29,7 +29,8 @@ export default {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'asset_count',
|
prop: 'asset_count',
|
||||||
label: this.$t('assets.Assets')
|
label: this.$t('assets.Assets'),
|
||||||
|
width: '80px'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'id',
|
prop: 'id',
|
||||||
|
|||||||
@@ -28,7 +28,8 @@ export default {
|
|||||||
{
|
{
|
||||||
prop: 'base',
|
prop: 'base',
|
||||||
label: this.$t('assets.BasePlatform'),
|
label: this.$t('assets.BasePlatform'),
|
||||||
sortable: 'custom'
|
sortable: 'custom',
|
||||||
|
width: '140px'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'comment',
|
prop: 'comment',
|
||||||
|
|||||||
@@ -34,15 +34,18 @@ export default {
|
|||||||
{
|
{
|
||||||
prop: 'protocol',
|
prop: 'protocol',
|
||||||
label: this.$t('assets.Protocol'),
|
label: this.$t('assets.Protocol'),
|
||||||
sortable: 'custom'
|
sortable: 'custom',
|
||||||
|
width: '100px'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'login_mode_display',
|
prop: 'login_mode_display',
|
||||||
label: this.$t('assets.LoginModel')
|
label: this.$t('assets.LoginModel'),
|
||||||
|
width: '120px'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'assets_amount',
|
prop: 'assets_amount',
|
||||||
label: this.$t('assets.Assets')
|
label: this.$t('assets.Assets'),
|
||||||
|
width: '80px'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'comment',
|
prop: 'comment',
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ export default {
|
|||||||
],
|
],
|
||||||
columnsMeta: {
|
columnsMeta: {
|
||||||
hosts: {
|
hosts: {
|
||||||
|
width: '60px',
|
||||||
formatter: (row, col, cellValue) => {
|
formatter: (row, col, cellValue) => {
|
||||||
const onClick = () => {
|
const onClick = () => {
|
||||||
vm.relationDialog.tableConfig.url = setUrlParam(vm.relationDialog.tableConfig.url, 'commandexecution', row.id)
|
vm.relationDialog.tableConfig.url = setUrlParam(vm.relationDialog.tableConfig.url, 'commandexecution', row.id)
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ export default {
|
|||||||
showOverflowTooltip: true
|
showOverflowTooltip: true
|
||||||
},
|
},
|
||||||
operate: {
|
operate: {
|
||||||
width: '90px'
|
width: '100px'
|
||||||
},
|
},
|
||||||
is_success: {
|
is_success: {
|
||||||
width: '80px'
|
width: '80px'
|
||||||
|
|||||||
@@ -27,17 +27,20 @@ export default {
|
|||||||
showOverflowTooltip: true
|
showOverflowTooltip: true
|
||||||
},
|
},
|
||||||
ip: {
|
ip: {
|
||||||
width: '140px'
|
width: '110px'
|
||||||
|
},
|
||||||
|
city: {
|
||||||
|
width: '90px'
|
||||||
},
|
},
|
||||||
status: {
|
status: {
|
||||||
width: '80px'
|
width: '85px'
|
||||||
},
|
},
|
||||||
mfa: {
|
mfa: {
|
||||||
label: 'MFA',
|
label: 'MFA',
|
||||||
width: '80px'
|
width: '80px'
|
||||||
},
|
},
|
||||||
type: {
|
type: {
|
||||||
width: '100px'
|
width: '110px'
|
||||||
},
|
},
|
||||||
datetime: {
|
datetime: {
|
||||||
width: '160px'
|
width: '160px'
|
||||||
|
|||||||
@@ -23,7 +23,8 @@ export default {
|
|||||||
showOverflowTooltip: true
|
showOverflowTooltip: true
|
||||||
},
|
},
|
||||||
resource_type: {
|
resource_type: {
|
||||||
showOverflowTooltip: true
|
showOverflowTooltip: true,
|
||||||
|
width: '180px'
|
||||||
},
|
},
|
||||||
resource: {
|
resource: {
|
||||||
showOverflowTooltip: true
|
showOverflowTooltip: true
|
||||||
@@ -32,7 +33,7 @@ export default {
|
|||||||
width: '160px'
|
width: '160px'
|
||||||
},
|
},
|
||||||
remote_addr: {
|
remote_addr: {
|
||||||
width: '140px'
|
width: '120px'
|
||||||
},
|
},
|
||||||
action: {
|
action: {
|
||||||
width: '90px'
|
width: '90px'
|
||||||
|
|||||||
@@ -26,7 +26,8 @@ export default {
|
|||||||
showOverflowTooltip: true
|
showOverflowTooltip: true
|
||||||
},
|
},
|
||||||
remote_addr: {
|
remote_addr: {
|
||||||
showOverflowTooltip: true
|
showOverflowTooltip: true,
|
||||||
|
width: '120px'
|
||||||
},
|
},
|
||||||
datetime: {
|
datetime: {
|
||||||
width: '180px'
|
width: '180px'
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
<el-option
|
<el-option
|
||||||
v-for="item in options"
|
v-for="item in options"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:disabled="item.protocol !== 'ssh' && item.login_mode!== 'auto'"
|
:disabled="item.protocol !== 'ssh' || item.login_mode!== 'auto'"
|
||||||
:label="`${item.name}(${item.username})`"
|
:label="`${item.name}(${item.username})`"
|
||||||
:value="item.id"
|
:value="item.id"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -48,10 +48,6 @@ export default {
|
|||||||
},
|
},
|
||||||
detailCardItems() {
|
detailCardItems() {
|
||||||
return [
|
return [
|
||||||
{
|
|
||||||
key: this.$t('ops.ID'),
|
|
||||||
value: this.object.id
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
key: this.$t('ops.hosts'),
|
key: this.$t('ops.hosts'),
|
||||||
value: JSON.stringify(this.object.hosts.length)
|
value: JSON.stringify(this.object.hosts.length)
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export default {
|
|||||||
stat: {
|
stat: {
|
||||||
label: this.$t('ops.stat'),
|
label: this.$t('ops.stat'),
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: '80px',
|
width: '100px',
|
||||||
formatter: function(row) {
|
formatter: function(row) {
|
||||||
const summary = <div>
|
const summary = <div>
|
||||||
<span class='text-primary'>{row.stat.success}</span>/
|
<span class='text-primary'>{row.stat.success}</span>/
|
||||||
@@ -52,16 +52,17 @@ export default {
|
|||||||
},
|
},
|
||||||
is_finished: {
|
is_finished: {
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: '200px',
|
width: '100px',
|
||||||
label: this.$t('ops.isFinished')
|
label: this.$t('ops.isFinished')
|
||||||
},
|
},
|
||||||
is_success: {
|
is_success: {
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: '200px',
|
width: '100px',
|
||||||
label: this.$t('ops.isSuccess')
|
label: this.$t('ops.isSuccess')
|
||||||
},
|
},
|
||||||
timedelta: {
|
timedelta: {
|
||||||
label: this.$t('ops.time'),
|
label: this.$t('ops.time'),
|
||||||
|
width: '100px',
|
||||||
formatter: function(row) {
|
formatter: function(row) {
|
||||||
return row.timedelta.toFixed(2) + 's'
|
return row.timedelta.toFixed(2) + 's'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,10 +48,6 @@ export default {
|
|||||||
},
|
},
|
||||||
detailCardItems() {
|
detailCardItems() {
|
||||||
return [
|
return [
|
||||||
{
|
|
||||||
key: this.$t('ops.ID'),
|
|
||||||
value: this.object.id
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
key: this.$t('ops.taskName'),
|
key: this.$t('ops.taskName'),
|
||||||
value: this.object.task_display.replace('@', '')
|
value: this.object.task_display.replace('@', '')
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ export default {
|
|||||||
},
|
},
|
||||||
hosts: {
|
hosts: {
|
||||||
label: this.$t('ops.hosts'),
|
label: this.$t('ops.hosts'),
|
||||||
|
width: '80px',
|
||||||
formatter: (row, column, cellValue) => {
|
formatter: (row, column, cellValue) => {
|
||||||
if (cellValue instanceof Array) {
|
if (cellValue instanceof Array) {
|
||||||
return cellValue.length
|
return cellValue.length
|
||||||
@@ -43,7 +44,8 @@ export default {
|
|||||||
showOverflowTooltip: true
|
showOverflowTooltip: true
|
||||||
},
|
},
|
||||||
pattern: {
|
pattern: {
|
||||||
label: this.$t('ops.pattern')
|
label: this.$t('ops.pattern'),
|
||||||
|
width: '80px'
|
||||||
},
|
},
|
||||||
run_as: {
|
run_as: {
|
||||||
label: this.$t('ops.runAs'),
|
label: this.$t('ops.runAs'),
|
||||||
@@ -67,6 +69,7 @@ export default {
|
|||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
prop: 'id',
|
prop: 'id',
|
||||||
|
width: '80px',
|
||||||
formatterArgs: {
|
formatterArgs: {
|
||||||
hasEdit: false,
|
hasEdit: false,
|
||||||
hasDelete: false,
|
hasDelete: false,
|
||||||
|
|||||||
@@ -49,10 +49,6 @@ export default {
|
|||||||
},
|
},
|
||||||
detailCardItems() {
|
detailCardItems() {
|
||||||
return [
|
return [
|
||||||
{
|
|
||||||
key: this.$t('ops.ID'),
|
|
||||||
value: this.object.id
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
key: this.$t('common.Name'),
|
key: this.$t('common.Name'),
|
||||||
value: this.object.name
|
value: this.object.name
|
||||||
|
|||||||
@@ -27,12 +27,13 @@ export default {
|
|||||||
],
|
],
|
||||||
columnsMeta: {
|
columnsMeta: {
|
||||||
date_start: {
|
date_start: {
|
||||||
formatter: (row) => toSafeLocalDateStr(row.date_start)
|
formatter: (row) => toSafeLocalDateStr(row.date_start),
|
||||||
|
width: '160px'
|
||||||
},
|
},
|
||||||
stat: {
|
stat: {
|
||||||
label: this.$t('ops.stat'),
|
label: this.$t('ops.stat'),
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: '80px',
|
width: '100px',
|
||||||
formatter: function(row) {
|
formatter: function(row) {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
@@ -57,16 +58,17 @@ export default {
|
|||||||
},
|
},
|
||||||
is_finished: {
|
is_finished: {
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: '200px',
|
width: '100px',
|
||||||
label: this.$t('ops.isFinished')
|
label: this.$t('ops.isFinished')
|
||||||
},
|
},
|
||||||
is_success: {
|
is_success: {
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: '200px',
|
width: '100px',
|
||||||
label: this.$t('ops.isSuccess')
|
label: this.$t('ops.isSuccess')
|
||||||
},
|
},
|
||||||
timedelta: {
|
timedelta: {
|
||||||
label: this.$t('ops.time'),
|
label: this.$t('ops.time'),
|
||||||
|
width: '100px',
|
||||||
formatter: function(row) {
|
formatter: function(row) {
|
||||||
return row.timedelta.toFixed(2) + 's'
|
return row.timedelta.toFixed(2) + 's'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ export default {
|
|||||||
},
|
},
|
||||||
tableConfig: {
|
tableConfig: {
|
||||||
url: '/api/v1/perms/asset-permissions/',
|
url: '/api/v1/perms/asset-permissions/',
|
||||||
hasSelection: false,
|
|
||||||
hasTree: true,
|
hasTree: true,
|
||||||
columns: ['name', 'users_amount', 'user_groups_amount', 'assets_amount', 'nodes_amount', 'system_users_amount', 'is_valid', 'actions'],
|
columns: ['name', 'users_amount', 'user_groups_amount', 'assets_amount', 'nodes_amount', 'system_users_amount', 'is_valid', 'actions'],
|
||||||
columnsMeta: {
|
columnsMeta: {
|
||||||
@@ -36,6 +35,7 @@ export default {
|
|||||||
},
|
},
|
||||||
users_amount: {
|
users_amount: {
|
||||||
label: this.$t('perms.User'),
|
label: this.$t('perms.User'),
|
||||||
|
width: '60px',
|
||||||
formatter: DetailFormatter,
|
formatter: DetailFormatter,
|
||||||
formatterArgs: {
|
formatterArgs: {
|
||||||
routeQuery: {
|
routeQuery: {
|
||||||
@@ -45,6 +45,7 @@ export default {
|
|||||||
},
|
},
|
||||||
user_groups_amount: {
|
user_groups_amount: {
|
||||||
label: this.$t('perms.UserGroups'),
|
label: this.$t('perms.UserGroups'),
|
||||||
|
width: '100px',
|
||||||
formatter: DetailFormatter,
|
formatter: DetailFormatter,
|
||||||
formatterArgs: {
|
formatterArgs: {
|
||||||
routeQuery: {
|
routeQuery: {
|
||||||
@@ -54,6 +55,7 @@ export default {
|
|||||||
},
|
},
|
||||||
assets_amount: {
|
assets_amount: {
|
||||||
label: this.$t('perms.Asset'),
|
label: this.$t('perms.Asset'),
|
||||||
|
width: '60px',
|
||||||
formatter: DetailFormatter,
|
formatter: DetailFormatter,
|
||||||
formatterArgs: {
|
formatterArgs: {
|
||||||
routeQuery: {
|
routeQuery: {
|
||||||
@@ -63,6 +65,7 @@ export default {
|
|||||||
},
|
},
|
||||||
nodes_amount: {
|
nodes_amount: {
|
||||||
label: this.$t('perms.Node'),
|
label: this.$t('perms.Node'),
|
||||||
|
width: '60px',
|
||||||
formatter: DetailFormatter,
|
formatter: DetailFormatter,
|
||||||
formatterArgs: {
|
formatterArgs: {
|
||||||
routeQuery: {
|
routeQuery: {
|
||||||
@@ -72,6 +75,7 @@ export default {
|
|||||||
},
|
},
|
||||||
system_users_amount: {
|
system_users_amount: {
|
||||||
label: this.$t('perms.SystemUser'),
|
label: this.$t('perms.SystemUser'),
|
||||||
|
width: '100px',
|
||||||
formatter: DetailFormatter,
|
formatter: DetailFormatter,
|
||||||
formatterArgs: {
|
formatterArgs: {
|
||||||
routeQuery: {
|
routeQuery: {
|
||||||
@@ -129,7 +133,6 @@ export default {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
hasRightActions: false,
|
|
||||||
hasBulkDelete: false,
|
hasBulkDelete: false,
|
||||||
hasBulkUpdate: false,
|
hasBulkUpdate: false,
|
||||||
extraMoreActions: [
|
extraMoreActions: [
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ export default {
|
|||||||
},
|
},
|
||||||
users_amount: {
|
users_amount: {
|
||||||
label: this.$t('perms.User'),
|
label: this.$t('perms.User'),
|
||||||
|
width: '110px',
|
||||||
formatter: DetailFormatter,
|
formatter: DetailFormatter,
|
||||||
formatterArgs: {
|
formatterArgs: {
|
||||||
routeQuery: {
|
routeQuery: {
|
||||||
@@ -35,6 +36,7 @@ export default {
|
|||||||
},
|
},
|
||||||
user_groups_amount: {
|
user_groups_amount: {
|
||||||
label: this.$t('perms.UserGroups'),
|
label: this.$t('perms.UserGroups'),
|
||||||
|
width: '110px',
|
||||||
formatter: DetailFormatter,
|
formatter: DetailFormatter,
|
||||||
formatterArgs: {
|
formatterArgs: {
|
||||||
routeQuery: {
|
routeQuery: {
|
||||||
@@ -44,6 +46,7 @@ export default {
|
|||||||
},
|
},
|
||||||
database_apps_amount: {
|
database_apps_amount: {
|
||||||
label: this.$t('perms.databaseApp'),
|
label: this.$t('perms.databaseApp'),
|
||||||
|
width: '110px',
|
||||||
formatter: DetailFormatter,
|
formatter: DetailFormatter,
|
||||||
formatterArgs: {
|
formatterArgs: {
|
||||||
routeQuery: {
|
routeQuery: {
|
||||||
@@ -53,6 +56,7 @@ export default {
|
|||||||
},
|
},
|
||||||
system_users_amount: {
|
system_users_amount: {
|
||||||
label: this.$t('perms.SystemUser'),
|
label: this.$t('perms.SystemUser'),
|
||||||
|
width: '110px',
|
||||||
formatter: DetailFormatter,
|
formatter: DetailFormatter,
|
||||||
formatterArgs: {
|
formatterArgs: {
|
||||||
routeQuery: {
|
routeQuery: {
|
||||||
@@ -63,7 +67,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
headerActions: {
|
headerActions: {
|
||||||
hasRightActions: false,
|
|
||||||
hasBulkDelete: false
|
hasBulkDelete: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ export default {
|
|||||||
},
|
},
|
||||||
users_amount: {
|
users_amount: {
|
||||||
label: this.$t('users.Users'),
|
label: this.$t('users.Users'),
|
||||||
|
width: '110px',
|
||||||
formatter: DetailFormatter,
|
formatter: DetailFormatter,
|
||||||
formatterArgs: {
|
formatterArgs: {
|
||||||
routeQuery: {
|
routeQuery: {
|
||||||
@@ -39,6 +40,7 @@ export default {
|
|||||||
},
|
},
|
||||||
user_groups_amount: {
|
user_groups_amount: {
|
||||||
label: this.$t('users.UserGroups'),
|
label: this.$t('users.UserGroups'),
|
||||||
|
width: '110px',
|
||||||
formatter: DetailFormatter,
|
formatter: DetailFormatter,
|
||||||
formatterArgs: {
|
formatterArgs: {
|
||||||
routeQuery: {
|
routeQuery: {
|
||||||
@@ -48,6 +50,7 @@ export default {
|
|||||||
},
|
},
|
||||||
remote_apps_amount: {
|
remote_apps_amount: {
|
||||||
label: this.$t('assets.RemoteApps'),
|
label: this.$t('assets.RemoteApps'),
|
||||||
|
width: '110px',
|
||||||
formatter: DetailFormatter,
|
formatter: DetailFormatter,
|
||||||
formatterArgs: {
|
formatterArgs: {
|
||||||
routeQuery: {
|
routeQuery: {
|
||||||
@@ -57,6 +60,7 @@ export default {
|
|||||||
},
|
},
|
||||||
system_users_amount: {
|
system_users_amount: {
|
||||||
label: this.$t('assets.SystemUsers'),
|
label: this.$t('assets.SystemUsers'),
|
||||||
|
width: '110px',
|
||||||
formatter: DetailFormatter,
|
formatter: DetailFormatter,
|
||||||
formatterArgs: {
|
formatterArgs: {
|
||||||
routeQuery: {
|
routeQuery: {
|
||||||
@@ -67,7 +71,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
headerActions: {
|
headerActions: {
|
||||||
hasRightActions: false,
|
|
||||||
hasBulkDelete: false
|
hasBulkDelete: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ export default {
|
|||||||
},
|
},
|
||||||
risk_level: {
|
risk_level: {
|
||||||
label: this.$t('sessions.riskLevel'),
|
label: this.$t('sessions.riskLevel'),
|
||||||
width: '120px',
|
width: '105px',
|
||||||
formatter: (row, col, cellValue) => {
|
formatter: (row, col, cellValue) => {
|
||||||
const display = row.risk_level_display
|
const display = row.risk_level_display
|
||||||
if (cellValue === 0) {
|
if (cellValue === 0) {
|
||||||
|
|||||||
@@ -51,19 +51,22 @@ export default {
|
|||||||
label: this.$t('sessions.hosts'),
|
label: this.$t('sessions.hosts'),
|
||||||
rules: [
|
rules: [
|
||||||
{ required: true, message: this.$t('common.fieldRequiredError') }
|
{ required: true, message: this.$t('common.fieldRequiredError') }
|
||||||
]
|
],
|
||||||
|
helpText: this.$t('sessions.helpText.esUrl')
|
||||||
},
|
},
|
||||||
index: {
|
index: {
|
||||||
label: this.$t('sessions.index'),
|
label: this.$t('sessions.index'),
|
||||||
rules: [
|
rules: [
|
||||||
{ required: true, message: this.$t('common.fieldRequiredError') }
|
{ required: true, message: this.$t('common.fieldRequiredError') }
|
||||||
]
|
],
|
||||||
|
helpText: this.$t('sessions.helpText.esIndex')
|
||||||
},
|
},
|
||||||
doc_type: {
|
doc_type: {
|
||||||
label: this.$t('sessions.docType'),
|
label: this.$t('sessions.docType'),
|
||||||
rules: [
|
rules: [
|
||||||
{ required: true, message: this.$t('common.fieldRequiredError') }
|
{ required: true, message: this.$t('common.fieldRequiredError') }
|
||||||
]
|
],
|
||||||
|
helpText: this.$t('sessions.helpText.esDocType')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fieldsMap: {
|
fieldsMap: {
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ export default {
|
|||||||
},
|
},
|
||||||
timestamp: {
|
timestamp: {
|
||||||
label: this.$t('sessions.date'),
|
label: this.$t('sessions.date'),
|
||||||
|
width: '160px',
|
||||||
sortable: 'custom',
|
sortable: 'custom',
|
||||||
formatter: function(row) {
|
formatter: function(row) {
|
||||||
return toSafeLocalDateStr(row.timestamp * 1000)
|
return toSafeLocalDateStr(row.timestamp * 1000)
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
import DetailCard from '@/components/DetailCard/index'
|
import DetailCard from '@/components/DetailCard/index'
|
||||||
import QuickActions from '@/components/QuickActions'
|
import QuickActions from '@/components/QuickActions'
|
||||||
import { terminateSession } from '@/api/sessions'
|
import { terminateSession } from '@/api/sessions'
|
||||||
|
import { toSafeLocalDateStr } from '@/utils/common'
|
||||||
export default {
|
export default {
|
||||||
name: 'SessionDetailCard',
|
name: 'SessionDetailCard',
|
||||||
components: {
|
components: {
|
||||||
@@ -59,11 +60,11 @@ export default {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: this.$t('sessions.dateStart'),
|
key: this.$t('sessions.dateStart'),
|
||||||
value: this.sessionData.date_start
|
value: toSafeLocalDateStr(this.sessionData.date_start)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: this.$t('sessions.dateEnd'),
|
key: this.$t('sessions.dateEnd'),
|
||||||
value: this.sessionData.date_end
|
value: toSafeLocalDateStr(this.sessionData.date_end)
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ export default {
|
|||||||
index: {
|
index: {
|
||||||
label: this.$t('sessions.id'),
|
label: this.$t('sessions.id'),
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: '60px',
|
width: '40px',
|
||||||
formatter: function(row, column, cellValue, index) {
|
formatter: function(row, column, cellValue, index) {
|
||||||
const label = index + 1
|
const label = index + 1
|
||||||
const route = { to: { name: 'SessionDetail', params: { id: row.id }}}
|
const route = { to: { name: 'SessionDetail', params: { id: row.id }}}
|
||||||
@@ -51,18 +51,19 @@ export default {
|
|||||||
},
|
},
|
||||||
command_amount: {
|
command_amount: {
|
||||||
label: this.$t('sessions.command'),
|
label: this.$t('sessions.command'),
|
||||||
width: '100px'
|
width: '90px'
|
||||||
},
|
},
|
||||||
system_user: {
|
system_user: {
|
||||||
showOverflowTooltip: true
|
showOverflowTooltip: true,
|
||||||
|
width: '100px'
|
||||||
},
|
},
|
||||||
login_from: {
|
login_from: {
|
||||||
label: this.$t('sessions.loginFrom'),
|
label: this.$t('sessions.loginFrom'),
|
||||||
width: '120px',
|
width: '115px',
|
||||||
showOverflowTooltip: true
|
showOverflowTooltip: true
|
||||||
},
|
},
|
||||||
remote_addr: {
|
remote_addr: {
|
||||||
width: '120px'
|
width: '105px'
|
||||||
},
|
},
|
||||||
protocol: {
|
protocol: {
|
||||||
label: this.$t('sessions.protocol'),
|
label: this.$t('sessions.protocol'),
|
||||||
|
|||||||
@@ -32,7 +32,8 @@ export default {
|
|||||||
label: this.$t('sessions.alive')
|
label: this.$t('sessions.alive')
|
||||||
},
|
},
|
||||||
session_online: {
|
session_online: {
|
||||||
label: this.$t('sessions.session')
|
label: this.$t('sessions.session'),
|
||||||
|
width: '80px'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -39,9 +39,9 @@
|
|||||||
<el-form-item style="float: right">
|
<el-form-item style="float: right">
|
||||||
<template v-if="hasActionPerm">
|
<template v-if="hasActionPerm">
|
||||||
<el-button :disabled="object.status === 'closed'" type="primary" size="small" @click="handleApprove"><i class="fa fa-check" />{{ $t('tickets.Accept') }}</el-button>
|
<el-button :disabled="object.status === 'closed'" type="primary" size="small" @click="handleApprove"><i class="fa fa-check" />{{ $t('tickets.Accept') }}</el-button>
|
||||||
<el-button :disabled="object.status === 'closed'" type="warning" size="small" @click="handleReject"><i class="fa fa-ban" />{{ $t('tickets.Reject') }}</el-button>
|
<el-button :disabled="object.status === 'closed'" type="danger" size="small" @click="handleReject"><i class="fa fa-ban" />{{ $t('tickets.Reject') }}</el-button>
|
||||||
</template>
|
</template>
|
||||||
<el-button :disabled="object.status === 'closed'" type="danger" size="small" @click="handleClosed"><i class="fa fa-times" />{{ $t('tickets.Close') }}</el-button>
|
<el-button :disabled="object.status === 'closed'" type="warning" size="small" @click="handleClosed"><i class="fa fa-times" />{{ $t('tickets.Close') }}</el-button>
|
||||||
<el-button :disabled="object.status === 'closed'" type="info" size="small" @click="handleComment"><i class="fa fa-pencil" />{{ $t('tickets.Comment') }}</el-button>
|
<el-button :disabled="object.status === 'closed'" type="info" size="small" @click="handleComment"><i class="fa fa-pencil" />{{ $t('tickets.Comment') }}</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
@@ -54,6 +54,7 @@
|
|||||||
import DetailCard from '@/components/DetailCard'
|
import DetailCard from '@/components/DetailCard'
|
||||||
import { formatTime, getDateTimeStamp } from '@/utils/index'
|
import { formatTime, getDateTimeStamp } from '@/utils/index'
|
||||||
import { toSafeLocalDateStr } from '@/utils/common'
|
import { toSafeLocalDateStr } from '@/utils/common'
|
||||||
|
import { STATUS_MAP } from '../const'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'TicketDetail',
|
name: 'TicketDetail',
|
||||||
@@ -68,6 +69,7 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
statusMap: this.object.status === 'open' ? STATUS_MAP[this.object.status] : STATUS_MAP[this.object.action],
|
||||||
imageUrl: require('@/assets/img/admin.png'),
|
imageUrl: require('@/assets/img/admin.png'),
|
||||||
form: {
|
form: {
|
||||||
comments: ''
|
comments: ''
|
||||||
@@ -80,10 +82,9 @@ export default {
|
|||||||
return this.object.title
|
return this.object.title
|
||||||
},
|
},
|
||||||
detailCardItems() {
|
detailCardItems() {
|
||||||
const vm = this
|
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
key: this.$t('tickets.user'),
|
key: this.$t('tickets.Applicant'),
|
||||||
value: this.object.user_display
|
value: this.object.user_display
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -93,13 +94,8 @@ export default {
|
|||||||
{
|
{
|
||||||
key: this.$t('tickets.status'),
|
key: this.$t('tickets.status'),
|
||||||
value: this.object.status,
|
value: this.object.status,
|
||||||
callback: function(row, data) {
|
formatter: (item, val) => {
|
||||||
const open = vm.$t('common.Open')
|
return <el-tag type={this.statusMap.type}> { this.statusMap.title }</el-tag>
|
||||||
const close = vm.$t('common.Close')
|
|
||||||
if (data === 'open') {
|
|
||||||
return <el-button type='primary' size='mini'>{open}</el-button>
|
|
||||||
}
|
|
||||||
return <el-button type='danger' size='mini'>{close}</el-button>
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -39,13 +39,14 @@ export default {
|
|||||||
{
|
{
|
||||||
prop: 'type_display',
|
prop: 'type_display',
|
||||||
label: this.$t('tickets.type'),
|
label: this.$t('tickets.type'),
|
||||||
sortable: 'custom'
|
sortable: 'custom',
|
||||||
|
width: '110px'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'status',
|
prop: 'status',
|
||||||
label: this.$t('tickets.status'),
|
label: this.$t('tickets.status'),
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: '100px',
|
width: '90px',
|
||||||
sortable: 'custom',
|
sortable: 'custom',
|
||||||
formatter: row => {
|
formatter: row => {
|
||||||
if (row.status === 'open') {
|
if (row.status === 'open') {
|
||||||
@@ -58,7 +59,8 @@ export default {
|
|||||||
prop: 'date_created',
|
prop: 'date_created',
|
||||||
label: this.$t('tickets.date'),
|
label: this.$t('tickets.date'),
|
||||||
sortable: 'custom',
|
sortable: 'custom',
|
||||||
formatter: (row) => toSafeLocalDateStr(row.date_created)
|
formatter: (row) => toSafeLocalDateStr(row.date_created),
|
||||||
|
width: '160px'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
21
src/views/tickets/const.js
Normal file
21
src/views/tickets/const.js
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
import i18n from '@/i18n/i18n'
|
||||||
|
|
||||||
|
export const OPEN = 'open'
|
||||||
|
export const APPROVE = 'approve'
|
||||||
|
export const REJECT = 'reject'
|
||||||
|
export const OTHER = ''
|
||||||
|
|
||||||
|
export const STATUS_MAP = {
|
||||||
|
[OPEN]: {
|
||||||
|
type: 'success', title: i18n.t('tickets.Pending')
|
||||||
|
},
|
||||||
|
[APPROVE]: {
|
||||||
|
type: 'primary', title: i18n.t('tickets.Approved')
|
||||||
|
},
|
||||||
|
[REJECT]: {
|
||||||
|
type: 'danger', title: i18n.t('tickets.Rejected')
|
||||||
|
},
|
||||||
|
[OTHER]: {
|
||||||
|
type: 'info', title: i18n.t('tickets.Closed')
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,7 +16,8 @@ export default {
|
|||||||
columns: ['name', 'users_amount', 'comment', 'actions'],
|
columns: ['name', 'users_amount', 'comment', 'actions'],
|
||||||
columnsMeta: {
|
columnsMeta: {
|
||||||
users_amount: {
|
users_amount: {
|
||||||
label: this.$t('users.Users')
|
label: this.$t('users.Users'),
|
||||||
|
width: '120px'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
detailRoute: 'UserGroupDetail'
|
detailRoute: 'UserGroupDetail'
|
||||||
|
|||||||
Submodule src/views/xpack updated: 10b5dcccec...a44e787f62
@@ -5,34 +5,52 @@ utils_dir=$(pwd)
|
|||||||
project_dir=$(dirname "$utils_dir")
|
project_dir=$(dirname "$utils_dir")
|
||||||
release_dir=${project_dir}/release
|
release_dir=${project_dir}/release
|
||||||
|
|
||||||
if [[ $(uname) == 'Darwin' ]];then
|
if [[ $(uname) == 'Darwin' ]]; then
|
||||||
alias sedi="sed -i ''"
|
alias sedi="sed -i ''"
|
||||||
else
|
else
|
||||||
alias sedi='sed -i'
|
alias sedi='sed -i'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
function change_version() {
|
function change_version() {
|
||||||
sedi "s@Version <strong>.*</strong>@Version <strong>${VERSION}</strong>@g" "${project_dir}/src/layout/components/Footer/index.vue" || return 2
|
sedi "s@Version <strong>.*</strong>@Version <strong>${VERSION}</strong>@g" "${project_dir}/src/layout/components/Footer/index.vue" || return 2
|
||||||
}
|
}
|
||||||
|
|
||||||
# 修改版本号文件
|
function install_deps() {
|
||||||
if [[ -n ${VERSION-''} ]]; then
|
# 下载依赖模块并构建
|
||||||
change_version || exit 2
|
cd "${project_dir}" || exit 3
|
||||||
fi
|
yarn install --verbose || exit 4
|
||||||
|
npm rebuild node-sass || exit 5
|
||||||
|
}
|
||||||
|
|
||||||
# 下载依赖模块并构建
|
function build() {
|
||||||
cd "${project_dir}" || exit 3
|
cd "${project_dir}" || exit 1
|
||||||
yarn || exit 4
|
# 修改版本号文件
|
||||||
rm -rf lina dist
|
if [[ -n ${VERSION-''} ]]; then
|
||||||
yarn build:prod || exit 5
|
change_version || exit 2
|
||||||
|
fi
|
||||||
|
rm -rf lina dist
|
||||||
|
yarn build:prod || exit 5
|
||||||
|
# 打包
|
||||||
|
rm -rf "${release_dir:?}"/*
|
||||||
|
mkdir -p "${release_dir}"
|
||||||
|
to_dir="${release_dir}/lina"
|
||||||
|
|
||||||
# 打包
|
if [[ -d "dist" ]]; then
|
||||||
rm -rf "${release_dir:?}"/*
|
mv dist "${to_dir}"
|
||||||
mkdir -p "${release_dir}"
|
elif [[ -d "lina" ]]; then
|
||||||
to_dir="${release_dir}/lina"
|
mv lina "${to_dir}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
if [[ -d "dist" ]];then
|
case "${1-}" in
|
||||||
mv dist "${to_dir}"
|
dep)
|
||||||
elif [[ -d "lina" ]]; then
|
install_deps
|
||||||
mv lina "${to_dir}"
|
;;
|
||||||
fi
|
build)
|
||||||
|
build
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
install_deps
|
||||||
|
build
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|||||||
@@ -71,8 +71,11 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
chainWebpack(config) {
|
chainWebpack(config) {
|
||||||
config.plugins.delete('preload') // TODO: need test
|
// it can improve the speed of the first screen, it is recommended to turn on preload
|
||||||
config.plugins.delete('prefetch') // TODO: need test
|
// config.plugins.delete('preload')
|
||||||
|
|
||||||
|
// when there are many pages, it will cause too many meaningless requests
|
||||||
|
config.plugins.delete('prefetch')
|
||||||
|
|
||||||
// set svg-sprite-loader
|
// set svg-sprite-loader
|
||||||
config.module
|
config.module
|
||||||
|
|||||||
Reference in New Issue
Block a user