mirror of
https://github.com/jumpserver/lina.git
synced 2025-11-07 18:08:50 +00:00
Compare commits
28 Commits
pr@dev@ass
...
v2.1.2
| 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
|
||||
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
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -76,6 +76,9 @@ export default {
|
||||
case 'field':
|
||||
type = ''
|
||||
field.component = Select2
|
||||
if (fieldMeta.required) {
|
||||
field.el.clearable = false
|
||||
}
|
||||
break
|
||||
case 'string':
|
||||
type = 'input'
|
||||
|
||||
@@ -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()
|
||||
},
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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'),
|
||||
|
||||
@@ -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],
|
||||
|
||||
@@ -555,7 +555,12 @@
|
||||
},
|
||||
"Monitor": "监控",
|
||||
"sessionMonitor": "监控",
|
||||
"TerminateTaskSendSuccessMsg": "终断任务已下发,请稍后刷新查看"
|
||||
"TerminateTaskSendSuccessMsg": "终断任务已下发,请稍后刷新查看",
|
||||
"helpText": {
|
||||
"esUrl": "提示:如果有多台主机,请使用逗号 ( , ) 进行分割。(eg: http://www.jumpserver.a.com,http://www.jumpserver.b.com)",
|
||||
"esIndex": "es提供默认index:jumpserver",
|
||||
"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": "添加资产到节点",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -21,7 +21,8 @@ export default {
|
||||
],
|
||||
columnsMeta: {
|
||||
type: {
|
||||
displayKey: 'get_type_display'
|
||||
displayKey: 'get_type_display',
|
||||
width: '140px'
|
||||
},
|
||||
asset: {
|
||||
showOverflowTooltip: true,
|
||||
|
||||
@@ -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')
|
||||
}
|
||||
]
|
||||
|
||||
@@ -33,7 +33,8 @@ export default {
|
||||
},
|
||||
{
|
||||
prop: 'assets_amount',
|
||||
label: this.$t('assets.Assets')
|
||||
label: this.$t('assets.Assets'),
|
||||
width: '80px'
|
||||
},
|
||||
{
|
||||
prop: 'comment',
|
||||
|
||||
@@ -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'),
|
||||
|
||||
@@ -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
|
||||
},
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -29,7 +29,8 @@ export default {
|
||||
},
|
||||
{
|
||||
prop: 'asset_count',
|
||||
label: this.$t('assets.Assets')
|
||||
label: this.$t('assets.Assets'),
|
||||
width: '80px'
|
||||
},
|
||||
{
|
||||
prop: 'id',
|
||||
|
||||
@@ -28,7 +28,8 @@ export default {
|
||||
{
|
||||
prop: 'base',
|
||||
label: this.$t('assets.BasePlatform'),
|
||||
sortable: 'custom'
|
||||
sortable: 'custom',
|
||||
width: '140px'
|
||||
},
|
||||
{
|
||||
prop: 'comment',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -38,7 +38,7 @@ export default {
|
||||
showOverflowTooltip: true
|
||||
},
|
||||
operate: {
|
||||
width: '90px'
|
||||
width: '100px'
|
||||
},
|
||||
is_success: {
|
||||
width: '80px'
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -26,7 +26,8 @@ export default {
|
||||
showOverflowTooltip: true
|
||||
},
|
||||
remote_addr: {
|
||||
showOverflowTooltip: true
|
||||
showOverflowTooltip: true,
|
||||
width: '120px'
|
||||
},
|
||||
datetime: {
|
||||
width: '180px'
|
||||
|
||||
@@ -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"
|
||||
/>
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
|
||||
@@ -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('@', '')
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
|
||||
@@ -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: [
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -39,6 +39,7 @@ export default {
|
||||
},
|
||||
timestamp: {
|
||||
label: this.$t('sessions.date'),
|
||||
width: '160px',
|
||||
sortable: 'custom',
|
||||
formatter: function(row) {
|
||||
return toSafeLocalDateStr(row.timestamp * 1000)
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -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'),
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -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>
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
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'],
|
||||
columnsMeta: {
|
||||
users_amount: {
|
||||
label: this.$t('users.Users')
|
||||
label: this.$t('users.Users'),
|
||||
width: '120px'
|
||||
}
|
||||
},
|
||||
detailRoute: 'UserGroupDetail'
|
||||
|
||||
Submodule src/views/xpack updated: 10b5dcccec...a44e787f62
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user