Compare commits

...

28 Commits

Author SHA1 Message Date
jym503558564
ae6d76704b fix(opsTask): 去掉任务详情中多余的ID字段 2020-08-11 10:32:56 +08:00
ibuler
6112c62f70 ci(docker): 使用docker缓存,使用npm mirror 2020-08-03 14:04:08 +08:00
OrangeM21
13e7bf387c fix(dialog): 修复当有搜索条件时禁用导出所有选项
Closes https://github.com/jumpserver/trello/issues/74
2020-07-31 10:50:01 +08:00
OrangeM21
30737b6fee fix: 修复创建远程应用密码框显示明文的问题
Closes https://github.com/jumpserver/trello/issues/133
2020-07-31 10:43:57 +08:00
OrangeM21
2ecc8dacec fix(preload): 开启Preload
开启preload,提高首屏加载速度
2020-07-31 10:36:49 +08:00
jym503558564
4c7f1aeee0 fix(detailCard): 修复详情页数据如果没有ID字段,则不显示ID 2020-07-31 10:31:19 +08:00
jym503558564
2d3f40f9f7 fix(ticket): 优化工单详情 2020-07-28 16:05:31 +08:00
jym503558564
4d9ef60343 fix(ticket): 优化工单详情 2020-07-28 16:05:31 +08:00
jym503558564
9fe9b5d68c fix(tableList): 优化列表组件一些字段的宽度 2020-07-28 16:05:00 +08:00
jym503558564
82a251bbd2 fix(sessions_cmd_storage): 优化创建命令存储的提示文案 2020-07-28 16:03:44 +08:00
jym503558564
4e4be19edc fix(sessions_cmd_storage): 优化创建命令存储的提示文案 2020-07-28 16:03:44 +08:00
jym503558564
f0dfb4d266 fix(sessions_cmd_storage): 优化创建命令存储的提示文案 2020-07-28 16:03:44 +08:00
jym503558564
261450c369 fix(xpack): 更新xpack指向 2020-07-27 17:40:52 +08:00
jym503558564
6f842bee99 fix(assets): 优化资产详情中网域字段名的显示 2020-07-27 16:21:37 +08:00
jym503558564
3811757104 fix(permissions): 优化授权列表各列宽度 2020-07-27 16:21:37 +08:00
jym503558564
eb681f9324 fix(detailCard): detailCard 增加ID字段 2020-07-27 16:21:15 +08:00
jym503558564
91abc8fff6 fix(sessionDetailTimeFormat): 优化会话详情中时间字段的显示格式 2020-07-27 16:21:15 +08:00
fit2bot
d0143ab0fe fix(perms): 优化授权列表添加刷新按钮 (#245)
* fix(perms): 优化授权列表添加刷新按钮

* fix(perms): 优化授权列表添加导入导出按钮

Co-authored-by: jym503558564 <503558564@qq.com>
2020-07-27 16:20:50 +08:00
OrangeM21
3e5fc8d64f fix(CommandExecution): 修复命令过滤执行的系统用户选择 2020-07-24 11:36:23 +08:00
OrangeM21
63dfc9edd2 fix(el-data-table): 修复翻页搜索结果不正确的问题
Closes https://github.com/jumpserver/trello/issues/69
Closes https://github.com/jumpserver/trello/issues/68
2020-07-24 10:52:47 +08:00
fit2bot
3c4b8a7581 fix(select2): 默认添加clearable属性 (#241)
* fix(select2): 默认添加clearable属性

* fix:

Co-authored-by: OrangeM21 <orangemtony@gmail.com>
2020-07-24 10:34:41 +08:00
jym503558564
ebc3821edf fix(Xpack): 更新xpack指向 2020-07-21 15:44:42 +08:00
OrangeM21
8fe92911c4 fix: 添加form组件的refs 2020-07-21 15:03:56 +08:00
Orange
9853150939 Merge pull request #227 from jumpserver/pr@v2.1@ci_add_generic_handler
ci(github): 添加通用action
2020-07-21 13:08:55 +08:00
github-actions
afbac1b119 ci(github): 添加通用action 2020-07-21 05:05:55 +00:00
Orange
6a24fa1f95 Merge pull request #211 from jumpserver/pr_v2.1_ci-change
ci(pull-request): 添加自动pr打标签功能
2020-07-17 16:16:23 +08:00
ibuler
4694d2b73c ci(pull-request): 添加自动pr打标签功能 2020-07-17 16:09:09 +08:00
OrangeM21
993748b081 feat: 发布2.1版本 2020-07-16 18:14:54 +08:00
49 changed files with 257 additions and 107 deletions

View 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 }}

View File

@@ -1,10 +1,22 @@
FROM node:10 as stage-build
ARG 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
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
RUN cd utils && bash -xieu build.sh
RUN cd utils && bash -xieu build.sh build
FROM nginx:alpine
COPY --from=stage-build /data/release/lina /opt/lina

View File

@@ -120,7 +120,7 @@ export default {
{
prop: 'ip',
label: this.$t('assets.ip'),
width: 140
width: '120px'
},
{
prop: 'username',
@@ -130,7 +130,7 @@ export default {
{
prop: 'version',
label: this.$t('assets.Version'),
width: '50px'
width: '70px'
},
{
prop: 'date_created',

View File

@@ -76,6 +76,9 @@ export default {
case 'field':
type = ''
field.component = Select2
if (fieldMeta.required) {
field.el.clearable = false
}
break
case 'string':
type = 'input'

View File

@@ -953,6 +953,8 @@ export default {
})
},
search(attrs, reset) {
// 重置搜索结果到第一页
this.page = defaultFirstPage
// Orange 重置查询对象
if (reset) {
this.innerQuery = merge({}, attrs)
@@ -962,6 +964,8 @@ export default {
return this.getList()
},
searchDate(attrs) {
// 重置搜索结果到第一页
this.page = defaultFirstPage
this.innerQuery = merge(this.innerQuery, attrs)
return this.getList()
},

View File

@@ -1,6 +1,10 @@
<template>
<IBox :title="title" fa="fa-info-circle">
<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-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">

View File

@@ -67,6 +67,8 @@ export default {
const query = listTableRef.dataTable.getQuery()
delete query['limit']
delete query['offset']
delete query['date_from']
delete query['date_to']
return query
},
tableHasQuery() {
@@ -77,7 +79,7 @@ export default {
{
label: this.$t('common.imExport.ExportAll'),
value: 'all',
can: this.canExportAll
can: this.canExportAll && !this.tableHasQuery
},
{
label: this.$t('common.imExport.ExportOnlySelectedItems'),

View File

@@ -8,6 +8,7 @@
:remote-method="filterOptions"
:multiple="multiple"
filterable
:clearable="clearable"
popper-append-to-body
class="select2"
v-bind="$attrs"
@@ -69,6 +70,10 @@ export default {
type: Boolean,
default: true
},
clearable: {
type: Boolean,
default: true
},
// 初始化值,也就是选中的值
value: {
type: [Array, String, Number, Boolean],

View File

@@ -555,7 +555,12 @@
},
"Monitor": "监控",
"sessionMonitor": "监控",
"TerminateTaskSendSuccessMsg": "终断任务已下发,请稍后刷新查看"
"TerminateTaskSendSuccessMsg": "终断任务已下发,请稍后刷新查看",
"helpText": {
"esUrl": "提示:如果有多台主机,请使用逗号 ( , ) 进行分割。eg: http://www.jumpserver.a.com,http://www.jumpserver.b.com",
"esIndex": "es提供默认indexjumpserver",
"esDocType": "es默认文档类型command"
}
},
"setting": {
"ApiKeyList": "API Key 列表",
@@ -686,12 +691,12 @@
},
"tickets": {
"Accept": "接受",
"AssignedMe": "待处理",
"AssignedMe": "待我审批",
"Assignee": "处理人",
"Assignees": "待处理人",
"Close": "关闭",
"Comment": "备注",
"MyTickets": "我的工单",
"MyTickets": "我发起的",
"Reject": "拒绝",
"date": "日期",
"reply": "回复",
@@ -700,7 +705,12 @@
"type": "类型",
"user": "用户",
"Status": "状态",
"Open": "打开"
"Open": "打开",
"Applicant": "申请人",
"Pending": "未处理",
"Approved": "已同意",
"Rejected": "已拒绝",
"Closed": "已关闭"
},
"tree": {
"AddAssetToNode": "添加资产到节点",

View File

@@ -554,7 +554,12 @@
},
"Monitor": "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": {
"ApiKeyList": "Api key list",
@@ -699,7 +704,13 @@
"type": "Type",
"user": "User",
"Status": "Status",
"Open": "Open"
"Open": "Open",
"Applicant": "Applicant",
"Pending": "Pending",
"Approved": "Approved",
"Rejected": "Rejected",
"Closed": "Closed"
},
"tree": {
"AddAssetToNode": "Add asset to node",

View File

@@ -1,7 +1,7 @@
<template>
<Page>
<IBox>
<GenericCreateUpdateForm v-bind="$attrs" v-on="$listeners" />
<GenericCreateUpdateForm ref="createUpdateForm" v-bind="$attrs" v-on="$listeners" />
</IBox>
</Page>
</template>

View File

@@ -18,7 +18,14 @@ export default {
],
columnsMeta: {
get_type_display: {
label: this.$t('applications.type')
label: this.$t('applications.type'),
width: '80px'
},
host: {
width: '140px'
},
port: {
width: '60px'
},
database: {
showOverflowTooltip: true

View File

@@ -21,7 +21,8 @@ export default {
],
columnsMeta: {
type: {
displayKey: 'get_type_display'
displayKey: 'get_type_display',
width: '140px'
},
asset: {
showOverflowTooltip: true,

View File

@@ -18,7 +18,7 @@ export const REMOTE_APP_TYPE_FIELDS_MAP = {
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')
}
],
@@ -36,7 +36,7 @@ export const REMOTE_APP_TYPE_FIELDS_MAP = {
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')
}
],
@@ -50,7 +50,7 @@ export const REMOTE_APP_TYPE_FIELDS_MAP = {
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')
}
],
@@ -68,7 +68,7 @@ export const REMOTE_APP_TYPE_FIELDS_MAP = {
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')
}
]

View File

@@ -33,7 +33,8 @@ export default {
},
{
prop: 'assets_amount',
label: this.$t('assets.Assets')
label: this.$t('assets.Assets'),
width: '80px'
},
{
prop: 'comment',

View File

@@ -176,7 +176,7 @@ export default {
},
{
key: this.$t('assets.Domain'),
value: this.object.domain
value: this.object.domain_display
},
{
key: this.$t('assets.Vendor'),

View File

@@ -22,6 +22,15 @@ export default {
url: `/api/v1/assets/cmd-filters/${this.object.id}/rules/`,
columns: ['type', 'content', 'priority', 'action', 'comment', 'actions'],
columnsMeta: {
type: {
width: '100px'
},
priority: {
width: '70px'
},
action: {
width: '90px'
},
content: {
showOverflowTooltip: true
},

View File

@@ -25,8 +25,15 @@ export default {
sortable: 'custom',
formatter: DisplayFormatter
},
ip: {
width: '140px'
},
port: {
width: '60px'
},
protocol: {
sortable: 'custom'
sortable: 'custom',
width: '100px'
},
actions: {
formatterArgs: {

View File

@@ -29,7 +29,8 @@ export default {
},
{
prop: 'asset_count',
label: this.$t('assets.Assets')
label: this.$t('assets.Assets'),
width: '80px'
},
{
prop: 'id',

View File

@@ -28,7 +28,8 @@ export default {
{
prop: 'base',
label: this.$t('assets.BasePlatform'),
sortable: 'custom'
sortable: 'custom',
width: '140px'
},
{
prop: 'comment',

View File

@@ -34,15 +34,18 @@ export default {
{
prop: 'protocol',
label: this.$t('assets.Protocol'),
sortable: 'custom'
sortable: 'custom',
width: '100px'
},
{
prop: 'login_mode_display',
label: this.$t('assets.LoginModel')
label: this.$t('assets.LoginModel'),
width: '120px'
},
{
prop: 'assets_amount',
label: this.$t('assets.Assets')
label: this.$t('assets.Assets'),
width: '80px'
},
{
prop: 'comment',

View File

@@ -32,6 +32,7 @@ export default {
],
columnsMeta: {
hosts: {
width: '60px',
formatter: (row, col, cellValue) => {
const onClick = () => {
vm.relationDialog.tableConfig.url = setUrlParam(vm.relationDialog.tableConfig.url, 'commandexecution', row.id)

View File

@@ -38,7 +38,7 @@ export default {
showOverflowTooltip: true
},
operate: {
width: '90px'
width: '100px'
},
is_success: {
width: '80px'

View File

@@ -27,17 +27,20 @@ export default {
showOverflowTooltip: true
},
ip: {
width: '140px'
width: '110px'
},
city: {
width: '90px'
},
status: {
width: '80px'
width: '85px'
},
mfa: {
label: 'MFA',
width: '80px'
},
type: {
width: '100px'
width: '110px'
},
datetime: {
width: '160px'

View File

@@ -23,7 +23,8 @@ export default {
showOverflowTooltip: true
},
resource_type: {
showOverflowTooltip: true
showOverflowTooltip: true,
width: '180px'
},
resource: {
showOverflowTooltip: true
@@ -32,7 +33,7 @@ export default {
width: '160px'
},
remote_addr: {
width: '140px'
width: '120px'
},
action: {
width: '90px'

View File

@@ -26,7 +26,8 @@ export default {
showOverflowTooltip: true
},
remote_addr: {
showOverflowTooltip: true
showOverflowTooltip: true,
width: '120px'
},
datetime: {
width: '180px'

View File

@@ -27,7 +27,7 @@
<el-option
v-for="item in options"
:key="item.id"
:disabled="item.protocol !== 'ssh' && item.login_mode!== 'auto'"
:disabled="item.protocol !== 'ssh' || item.login_mode!== 'auto'"
:label="`${item.name}(${item.username})`"
:value="item.id"
/>

View File

@@ -48,10 +48,6 @@ export default {
},
detailCardItems() {
return [
{
key: this.$t('ops.ID'),
value: this.object.id
},
{
key: this.$t('ops.hosts'),
value: JSON.stringify(this.object.hosts.length)

View File

@@ -28,7 +28,7 @@ export default {
stat: {
label: this.$t('ops.stat'),
align: 'center',
width: '80px',
width: '100px',
formatter: function(row) {
const summary = <div>
<span class='text-primary'>{row.stat.success}</span>/
@@ -52,16 +52,17 @@ export default {
},
is_finished: {
align: 'center',
width: '200px',
width: '100px',
label: this.$t('ops.isFinished')
},
is_success: {
align: 'center',
width: '200px',
width: '100px',
label: this.$t('ops.isSuccess')
},
timedelta: {
label: this.$t('ops.time'),
width: '100px',
formatter: function(row) {
return row.timedelta.toFixed(2) + 's'
}

View File

@@ -48,10 +48,6 @@ export default {
},
detailCardItems() {
return [
{
key: this.$t('ops.ID'),
value: this.object.id
},
{
key: this.$t('ops.taskName'),
value: this.object.task_display.replace('@', '')

View File

@@ -34,6 +34,7 @@ export default {
},
hosts: {
label: this.$t('ops.hosts'),
width: '80px',
formatter: (row, column, cellValue) => {
if (cellValue instanceof Array) {
return cellValue.length
@@ -43,7 +44,8 @@ export default {
showOverflowTooltip: true
},
pattern: {
label: this.$t('ops.pattern')
label: this.$t('ops.pattern'),
width: '80px'
},
run_as: {
label: this.$t('ops.runAs'),
@@ -67,6 +69,7 @@ export default {
},
actions: {
prop: 'id',
width: '80px',
formatterArgs: {
hasEdit: false,
hasDelete: false,

View File

@@ -49,10 +49,6 @@ export default {
},
detailCardItems() {
return [
{
key: this.$t('ops.ID'),
value: this.object.id
},
{
key: this.$t('common.Name'),
value: this.object.name

View File

@@ -27,12 +27,13 @@ export default {
],
columnsMeta: {
date_start: {
formatter: (row) => toSafeLocalDateStr(row.date_start)
formatter: (row) => toSafeLocalDateStr(row.date_start),
width: '160px'
},
stat: {
label: this.$t('ops.stat'),
align: 'center',
width: '80px',
width: '100px',
formatter: function(row) {
return (
<div>
@@ -57,16 +58,17 @@ export default {
},
is_finished: {
align: 'center',
width: '200px',
width: '100px',
label: this.$t('ops.isFinished')
},
is_success: {
align: 'center',
width: '200px',
width: '100px',
label: this.$t('ops.isSuccess')
},
timedelta: {
label: this.$t('ops.time'),
width: '100px',
formatter: function(row) {
return row.timedelta.toFixed(2) + 's'
}

View File

@@ -22,7 +22,6 @@ export default {
},
tableConfig: {
url: '/api/v1/perms/asset-permissions/',
hasSelection: false,
hasTree: true,
columns: ['name', 'users_amount', 'user_groups_amount', 'assets_amount', 'nodes_amount', 'system_users_amount', 'is_valid', 'actions'],
columnsMeta: {
@@ -36,6 +35,7 @@ export default {
},
users_amount: {
label: this.$t('perms.User'),
width: '60px',
formatter: DetailFormatter,
formatterArgs: {
routeQuery: {
@@ -45,6 +45,7 @@ export default {
},
user_groups_amount: {
label: this.$t('perms.UserGroups'),
width: '100px',
formatter: DetailFormatter,
formatterArgs: {
routeQuery: {
@@ -54,6 +55,7 @@ export default {
},
assets_amount: {
label: this.$t('perms.Asset'),
width: '60px',
formatter: DetailFormatter,
formatterArgs: {
routeQuery: {
@@ -63,6 +65,7 @@ export default {
},
nodes_amount: {
label: this.$t('perms.Node'),
width: '60px',
formatter: DetailFormatter,
formatterArgs: {
routeQuery: {
@@ -72,6 +75,7 @@ export default {
},
system_users_amount: {
label: this.$t('perms.SystemUser'),
width: '100px',
formatter: DetailFormatter,
formatterArgs: {
routeQuery: {
@@ -129,7 +133,6 @@ export default {
}
]
},
hasRightActions: false,
hasBulkDelete: false,
hasBulkUpdate: false,
extraMoreActions: [

View File

@@ -26,6 +26,7 @@ export default {
},
users_amount: {
label: this.$t('perms.User'),
width: '110px',
formatter: DetailFormatter,
formatterArgs: {
routeQuery: {
@@ -35,6 +36,7 @@ export default {
},
user_groups_amount: {
label: this.$t('perms.UserGroups'),
width: '110px',
formatter: DetailFormatter,
formatterArgs: {
routeQuery: {
@@ -44,6 +46,7 @@ export default {
},
database_apps_amount: {
label: this.$t('perms.databaseApp'),
width: '110px',
formatter: DetailFormatter,
formatterArgs: {
routeQuery: {
@@ -53,6 +56,7 @@ export default {
},
system_users_amount: {
label: this.$t('perms.SystemUser'),
width: '110px',
formatter: DetailFormatter,
formatterArgs: {
routeQuery: {
@@ -63,7 +67,6 @@ export default {
}
},
headerActions: {
hasRightActions: false,
hasBulkDelete: false
}
}

View File

@@ -30,6 +30,7 @@ export default {
},
users_amount: {
label: this.$t('users.Users'),
width: '110px',
formatter: DetailFormatter,
formatterArgs: {
routeQuery: {
@@ -39,6 +40,7 @@ export default {
},
user_groups_amount: {
label: this.$t('users.UserGroups'),
width: '110px',
formatter: DetailFormatter,
formatterArgs: {
routeQuery: {
@@ -48,6 +50,7 @@ export default {
},
remote_apps_amount: {
label: this.$t('assets.RemoteApps'),
width: '110px',
formatter: DetailFormatter,
formatterArgs: {
routeQuery: {
@@ -57,6 +60,7 @@ export default {
},
system_users_amount: {
label: this.$t('assets.SystemUsers'),
width: '110px',
formatter: DetailFormatter,
formatterArgs: {
routeQuery: {
@@ -67,7 +71,6 @@ export default {
}
},
headerActions: {
hasRightActions: false,
hasBulkDelete: false
}
}

View File

@@ -36,7 +36,7 @@ export default {
},
risk_level: {
label: this.$t('sessions.riskLevel'),
width: '120px',
width: '105px',
formatter: (row, col, cellValue) => {
const display = row.risk_level_display
if (cellValue === 0) {

View File

@@ -51,19 +51,22 @@ export default {
label: this.$t('sessions.hosts'),
rules: [
{ required: true, message: this.$t('common.fieldRequiredError') }
]
],
helpText: this.$t('sessions.helpText.esUrl')
},
index: {
label: this.$t('sessions.index'),
rules: [
{ required: true, message: this.$t('common.fieldRequiredError') }
]
],
helpText: this.$t('sessions.helpText.esIndex')
},
doc_type: {
label: this.$t('sessions.docType'),
rules: [
{ required: true, message: this.$t('common.fieldRequiredError') }
]
],
helpText: this.$t('sessions.helpText.esDocType')
}
},
fieldsMap: {

View File

@@ -39,6 +39,7 @@ export default {
},
timestamp: {
label: this.$t('sessions.date'),
width: '160px',
sortable: 'custom',
formatter: function(row) {
return toSafeLocalDateStr(row.timestamp * 1000)

View File

@@ -13,6 +13,7 @@
import DetailCard from '@/components/DetailCard/index'
import QuickActions from '@/components/QuickActions'
import { terminateSession } from '@/api/sessions'
import { toSafeLocalDateStr } from '@/utils/common'
export default {
name: 'SessionDetailCard',
components: {
@@ -59,11 +60,11 @@ export default {
},
{
key: this.$t('sessions.dateStart'),
value: this.sessionData.date_start
value: toSafeLocalDateStr(this.sessionData.date_start)
},
{
key: this.$t('sessions.dateEnd'),
value: this.sessionData.date_end
value: toSafeLocalDateStr(this.sessionData.date_end)
}
]
},

View File

@@ -36,7 +36,7 @@ export default {
index: {
label: this.$t('sessions.id'),
align: 'center',
width: '60px',
width: '40px',
formatter: function(row, column, cellValue, index) {
const label = index + 1
const route = { to: { name: 'SessionDetail', params: { id: row.id }}}
@@ -51,18 +51,19 @@ export default {
},
command_amount: {
label: this.$t('sessions.command'),
width: '100px'
width: '90px'
},
system_user: {
showOverflowTooltip: true
showOverflowTooltip: true,
width: '100px'
},
login_from: {
label: this.$t('sessions.loginFrom'),
width: '120px',
width: '115px',
showOverflowTooltip: true
},
remote_addr: {
width: '120px'
width: '105px'
},
protocol: {
label: this.$t('sessions.protocol'),

View File

@@ -32,7 +32,8 @@ export default {
label: this.$t('sessions.alive')
},
session_online: {
label: this.$t('sessions.session')
label: this.$t('sessions.session'),
width: '80px'
}
}
},

View File

@@ -39,9 +39,9 @@
<el-form-item style="float: right">
<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="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>
<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-form-item>
</el-form>
@@ -54,6 +54,7 @@
import DetailCard from '@/components/DetailCard'
import { formatTime, getDateTimeStamp } from '@/utils/index'
import { toSafeLocalDateStr } from '@/utils/common'
import { STATUS_MAP } from '../const'
export default {
name: 'TicketDetail',
@@ -68,6 +69,7 @@ export default {
},
data() {
return {
statusMap: this.object.status === 'open' ? STATUS_MAP[this.object.status] : STATUS_MAP[this.object.action],
imageUrl: require('@/assets/img/admin.png'),
form: {
comments: ''
@@ -80,10 +82,9 @@ export default {
return this.object.title
},
detailCardItems() {
const vm = this
return [
{
key: this.$t('tickets.user'),
key: this.$t('tickets.Applicant'),
value: this.object.user_display
},
{
@@ -93,13 +94,8 @@ export default {
{
key: this.$t('tickets.status'),
value: this.object.status,
callback: function(row, data) {
const open = vm.$t('common.Open')
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>
formatter: (item, val) => {
return <el-tag type={this.statusMap.type}> { this.statusMap.title }</el-tag>
}
},
{

View File

@@ -39,13 +39,14 @@ export default {
{
prop: 'type_display',
label: this.$t('tickets.type'),
sortable: 'custom'
sortable: 'custom',
width: '110px'
},
{
prop: 'status',
label: this.$t('tickets.status'),
align: 'center',
width: '100px',
width: '90px',
sortable: 'custom',
formatter: row => {
if (row.status === 'open') {
@@ -58,7 +59,8 @@ export default {
prop: 'date_created',
label: this.$t('tickets.date'),
sortable: 'custom',
formatter: (row) => toSafeLocalDateStr(row.date_created)
formatter: (row) => toSafeLocalDateStr(row.date_created),
width: '160px'
}
]
},

View 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')
}
}

View File

@@ -16,7 +16,8 @@ export default {
columns: ['name', 'users_amount', 'comment', 'actions'],
columnsMeta: {
users_amount: {
label: this.$t('users.Users')
label: this.$t('users.Users'),
width: '120px'
}
},
detailRoute: 'UserGroupDetail'

View File

@@ -5,34 +5,52 @@ utils_dir=$(pwd)
project_dir=$(dirname "$utils_dir")
release_dir=${project_dir}/release
if [[ $(uname) == 'Darwin' ]];then
if [[ $(uname) == 'Darwin' ]]; then
alias sedi="sed -i ''"
else
alias sedi='sed -i'
fi
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
}
# 修改版本号文件
if [[ -n ${VERSION-''} ]]; then
change_version || exit 2
fi
function install_deps() {
# 下载依赖模块并构建
cd "${project_dir}" || exit 3
yarn install --verbose || exit 4
npm rebuild node-sass || exit 5
}
# 下载依赖模块并构建
cd "${project_dir}" || exit 3
yarn || exit 4
rm -rf lina dist
yarn build:prod || exit 5
function build() {
cd "${project_dir}" || exit 1
# 修改版本号文件
if [[ -n ${VERSION-''} ]]; then
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"
# 打包
rm -rf "${release_dir:?}"/*
mkdir -p "${release_dir}"
to_dir="${release_dir}/lina"
if [[ -d "dist" ]]; then
mv dist "${to_dir}"
elif [[ -d "lina" ]]; then
mv lina "${to_dir}"
fi
}
if [[ -d "dist" ]];then
mv dist "${to_dir}"
elif [[ -d "lina" ]]; then
mv lina "${to_dir}"
fi
case "${1-}" in
dep)
install_deps
;;
build)
build
;;
*)
install_deps
build
;;
esac

View File

@@ -71,8 +71,11 @@ module.exports = {
}
},
chainWebpack(config) {
config.plugins.delete('preload') // TODO: need test
config.plugins.delete('prefetch') // TODO: need test
// it can improve the speed of the first screen, it is recommended to turn on preload
// config.plugins.delete('preload')
// when there are many pages, it will cause too many meaningless requests
config.plugins.delete('prefetch')
// set svg-sprite-loader
config.module