Merge pull request #1189 from jumpserver/dev

v2.16.0 rc2
This commit is contained in:
Jiangjie.Bai 2021-11-17 19:43:41 +08:00 committed by GitHub
commit cfb7f2be43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
24 changed files with 99 additions and 35 deletions

View File

@ -320,4 +320,8 @@ export default {
.select2 {
width: 100%;
}
.select2 >>> .el-tag.el-tag--info {
height: auto;
white-space: normal;
}
</style>

View File

@ -1,7 +1,13 @@
<template>
<div class="filter-field">
<el-cascader ref="Cascade" :options="options" :props="config" @change="handleMenuItemChange" />
<el-cascader
v-show="options.length > 0"
ref="Cascade"
:options="options"
:props="config"
@change="handleMenuItemChange"
/>
<el-tag
v-for="(v, k) in filterTags"
:key="k"
@ -24,6 +30,7 @@
v-model="filterValue"
:placeholder="placeholder"
class="search-input"
:class="options.length < 1 ? 'search-input2': ''"
@blur="focus = false"
@focus="focus = true"
@change="handleConfirm"
@ -182,10 +189,14 @@ export default {
.filter-field {
display: flex;
align-items: center;
min-width: 198px;
border: 1px solid #dcdee2;
border-radius: 3px;
background-color:#fff;
}
.search-input2 >>> .el-input__inner {
text-indent: 5px;
}
.search-input >>> .el-input__inner {
/*max-width:inherit !important;*/
max-width: 200px;

View File

@ -51,6 +51,10 @@ export default {
type: Function,
default: null
},
hasReset: {
type: Boolean,
default: null
},
//
performSubmit: {
type: Function,

View File

@ -32,11 +32,8 @@ export default {
},
methods: {
initHelpURL() {
const url = '/api/v1/settings/setting/?category=other'
this.$axios.get(url).then(resp => {
this.URLSite.HELP_DOCUMENT_URL = resp.HELP_DOCUMENT_URL
this.URLSite.HELP_SUPPORT_URL = resp.HELP_SUPPORT_URL
})
this.URLSite.HELP_DOCUMENT_URL = this.$store.getters.publicSettings.HELP_DOCUMENT_URL
this.URLSite.HELP_SUPPORT_URL = this.$store.getters.publicSettings.HELP_SUPPORT_URL
},
handleCommand(command) {
switch (command) {

View File

@ -27,6 +27,7 @@ export default {
}
},
url: '/api/v1/acls/login-acls/',
hasDetailInMsg: false,
fields: [
[this.$t('common.Basic'), ['name', 'priority']],
[this.$t('acl.users'), ['user']],

View File

@ -6,6 +6,7 @@
import { GenericCreateUpdatePage } from '@/layout/components'
import { REMOTE_APP_TYPE_FIELDS_MAP, REMOTE_APP_TYPE_META_MAP, REMOTE_APP_PATH_DEFAULT_MAP } from './const'
import rules from '@/components/DataForm/rules'
import { UpdateToken } from '@/components/FormFields'
export default {
components: {
@ -52,6 +53,9 @@ export default {
}
}
}
},
[`${appType === 'vmware_client' ? 'vmware' : appType}_password`]: {
component: UpdateToken
}
}
}

View File

@ -97,7 +97,8 @@ export default {
},
url: '/api/v1/assets/assets/',
updateSuccessNextRoute: { name: 'AssetList' },
createSuccessNextRoute: { name: 'AssetList' }
createSuccessNextRoute: { name: 'AssetList' },
objectDetailRoute: { name: 'AssetDetail' }
}
},
methods: {

View File

@ -128,7 +128,7 @@ export default {
this.$axios.put(
url, { assets: assetsSelected }
).then(res => {
this.dialogVisible = false
this.iVisible = false
this.assetsSelected = []
$('#tree-refresh').trigger('click')
this.$message.success(this.$t('common.updateSuccessMsg'))
@ -137,7 +137,7 @@ export default {
})
},
assetTreeTableDialogHandleCancel() {
this.dialogVisible = false
this.iVisible = false
this.assetsSelected = []
}
}

View File

@ -112,9 +112,8 @@ export default {
performDelete: (item) => {
const objectId = this.object.id
const relationUrl = `/api/v1/perms/application-permissions/${objectId}/`
const objectOldRelationUserGroups = this.object.user_groups
const objectNewRelationUserGroups = objectOldRelationUserGroups.filter(v => v !== item.value)
const data = { user_groups: objectNewRelationUserGroups }
this.object.user_groups = this.object.user_groups.filter(v => v !== item.value)
const data = { user_groups: this.object.user_groups }
return this.$axios.patch(relationUrl, data)
},
onDeleteSuccess: (obj, that) => {

View File

@ -203,7 +203,6 @@ export default {
const queryStr = (url.indexOf('?') > -1 ? '&' : '?') + queryUtil.stringify(_query, '=', '&')
const treeUrl = url + queryStr
this.$set(this.treeSetting, 'treeUrl', treeUrl)
this.treeTable.forceRerenderTree()
},
handleFilterChange(query) {
const _query = this.cleanUrl(query)

View File

@ -10,6 +10,7 @@
<script>
import GenericCreateUpdatePage from '@/layout/components/GenericCreateUpdatePage'
import { STORAGE_TYPE_META_MAP } from './const'
import { UpdateToken } from '@/components/FormFields'
export default {
name: 'ReplayStorageUpdate',
@ -45,7 +46,12 @@ export default {
disabled: true
},
meta: {
fields: storageTypeMeta.meta
fields: storageTypeMeta.meta,
fieldsMeta: {
ACCESS_KEY: {
component: UpdateToken
}
}
},
is_default: {
helpText: this.$t('sessions.SetToDefaultStorage')

View File

@ -17,6 +17,12 @@
import { GenericListPage, GenericCreateUpdateForm } from '@/layout/components'
import Dialog from '@/components/Dialog'
import Select2 from '@/components/FormFields/Select2'
const numTotFixed = (row) => {
if (row && row.stat) {
return row.stat?.memory_used.toFixed(1)
}
}
export default {
components: {
GenericListPage,
@ -102,15 +108,18 @@ export default {
},
'stat.cpu_load': {
label: this.$t('sessions.systemCpuLoad'),
width: '120px'
width: '120px',
formatter: numTotFixed
},
'stat.disk_used': {
label: this.$t('sessions.systemDiskUsedPercent'),
width: '120px'
width: '120px',
formatter: numTotFixed
},
'stat.memory_used': {
label: this.$t('sessions.systemMemoryUsedPercent'),
width: '120px'
width: '120px',
formatter: numTotFixed
},
status: {
label: this.$t('xpack.LoadStatus'),

View File

@ -56,6 +56,7 @@ export default {
},
successUrl: { name: 'Settings', params: { activeMenu: 'Basic' }},
url: '/api/v1/settings/setting/?category=basic',
hasReset: false,
submitMethod() {
return 'patch'
}

View File

@ -23,7 +23,7 @@ export default {
this.$t('common.Logging'),
[
'LOGIN_LOG_KEEP_DAYS', 'TASK_LOG_KEEP_DAYS', 'OPERATE_LOG_KEEP_DAYS',
'FTP_LOG_KEEP_DAYS'
'FTP_LOG_KEEP_DAYS', 'TERMINAL_SESSION_KEEP_DURATION'
]
],
[

View File

@ -4,6 +4,7 @@
<script>
import BaseSMS from './Base'
import { UpdateToken } from '@/components/FormFields'
export default {
name: 'SMSTencent',
@ -56,6 +57,9 @@ export default {
fields: ['SIGN_NAME', 'TEMPLATE_CODE'],
fieldsMeta: {
}
},
TENCENT_SECRET_KEY: {
component: UpdateToken
}
},
submitMethod() {

View File

@ -14,6 +14,7 @@
@confirm="onConfirm()"
>
<GenericCreateUpdateForm
v-bind="$data"
:fields="fields"
:url="url"
:fields-meta="fieldsMeta"
@ -37,15 +38,29 @@ export default {
},
data() {
return {
initial: {
SECURITY_LOGIN_IP_BLACK_LIST: []
},
visible: false,
fields: [
'SECURITY_LOGIN_LIMIT_COUNT', 'SECURITY_LOGIN_LIMIT_TIME',
'SECURITY_LOGIN_LIMIT_COUNT', 'SECURITY_LOGIN_LIMIT_TIME', 'SECURITY_LOGIN_IP_BLACK_LIST',
'USER_LOGIN_SINGLE_MACHINE_ENABLED', 'ONLY_ALLOW_EXIST_USER_AUTH',
'ONLY_ALLOW_AUTH_FROM_SOURCE'
],
successUrl: { name: 'Settings', params: { activeMenu: 'EmailContent' }},
fieldsMeta: {
},
afterGetFormValue(validValues) {
validValues.SECURITY_LOGIN_IP_BLACK_LIST = validValues.SECURITY_LOGIN_IP_BLACK_LIST.toString()
return validValues
},
cleanFormValue(value) {
const ipBlackList = value.SECURITY_LOGIN_IP_BLACK_LIST
if (!Array.isArray(ipBlackList)) {
value.SECURITY_LOGIN_IP_BLACK_LIST = ipBlackList ? ipBlackList.split(',') : []
}
return value
},
url: '/api/v1/settings/setting/?category=security'
}
},

View File

@ -28,12 +28,6 @@ export default {
[
'XRDP_ENABLED', 'TERMINAL_RDP_ADDR'
]
],
[
this.$t('common.Other'),
[
'TERMINAL_SESSION_KEEP_DURATION'
]
]
],
fieldsMeta: {

View File

@ -53,7 +53,7 @@ export default {
]
},
specialCardItems() {
return [
return this.object.type === 'login_confirm' ? [] : [
// apply_login_asset: "114.118.2.76(114.118.2.76)"
// apply_login_system_user: "root()"
// apply_login_user: "Administrator(admin)"

View File

@ -199,6 +199,17 @@ export default {
url: '/api/v1/tickets/tickets/?type=apply_application&action=open',
createSuccessNextRoute: {
name: 'TicketList'
},
cleanFormValue(value) {
const applications = value.meta.apply_applications
const systemUsers = value.meta.apply_system_users
if (applications && Array.isArray(applications) && applications.length < 1) {
delete value.meta.apply_applications
}
if (systemUsers && Array.isArray(systemUsers) && systemUsers.length < 1) {
delete value.meta.apply_system_users
}
return value
}
}
},

View File

@ -52,7 +52,8 @@ export default {
'apply_asset': 'AssetsTicketDetail',
'apply_application': 'AppsTicketDetail',
'login_confirm': 'LoginAssetTicketDetail',
'login_asset_confirm': 'CommandConfirmDetail'
'login_asset_confirm': 'LoginAssetTicketDetail',
'command_confirm': 'CommandConfirmDetail'
}
const routeName = ticketRouteMapper[ticket.type]
setTimeout(() => {

View File

@ -68,7 +68,9 @@ export default {
delete rule.assignees_read_only
}
})
return rules.sort((a, b) => a.level - b.level)
rules = rules.sort((a, b) => a.level - b.level)
this.$emit('input', rules)
return rules
}
},
mounted() {

View File

@ -36,7 +36,7 @@ export default {
return 'AssetsTicketDetail'
} else if (row.type === 'apply_application') {
return 'AppsTicketDetail'
} else if (row.type === 'login_asset_confirm') {
} else if (row.type === 'login_asset_confirm' || row.type === 'login_confirm') {
return 'LoginAssetTicketDetail'
} else if (row.type === 'command_confirm') {
return 'CommandConfirmDetail'

View File

@ -7,12 +7,12 @@
<el-row :gutter="10">
<el-col v-for="item in detailCardItems" :key="'card-' + item.key" :span="12">
<el-row class="item">
<el-col :span="4">
<el-col :span="6">
<div :style="{ 'text-align': 'align' }" class="item-label">
<label>{{ item.key }}: </label>
</div>
</el-col>
<el-col :span="20">
<el-col :span="18">
<div class="item-text">
<ItemValue v-bind="item" />
</div>
@ -24,12 +24,12 @@
<el-row :gutter="10">
<el-col v-for="item in specialCardItems" :key="'card-' + item.key" :span="12">
<el-row class="item">
<el-col :span="4">
<el-col :span="6">
<div :style="{ 'text-align': 'align' }" class="item-label">
<label>{{ item.key }}: </label>
</div>
</el-col>
<el-col :span="20">
<el-col :span="18">
<div class="item-text">
<ItemValue v-bind="item" />
</div>

View File

@ -57,14 +57,14 @@ export default {
title: this.$t('users.quickUpdate.resetMFA'),
attrs: {
type: 'primary',
disabled: !this.object.mfa_enabled || this.object.id === this.$store.state.users.profile.id,
// disabled: !this.object.mfa_enabled || this.object.id === this.$store.state.users.profile.id,
label: this.$t('common.Reset')
},
callbacks: {
click: function() {
const warnMsg = vm.$t('users.quickUpdate.resetMFAWarningMsg')
const warnTitle = vm.$t('common.Info')
const url = `/api/v1/users/users/${vm.object.id}/otp/reset/`
const url = `/api/v1/users/users/${vm.object.id}/mfa/reset/`
const successMsg = vm.$t('users.quickUpdate.resetMFAdSuccessMsg')
vm.$confirm(warnMsg, warnTitle, {
type: 'warning',
@ -121,6 +121,7 @@ export default {
title: this.$t('users.quickUpdate.resetSSHKey'),
attrs: {
type: 'primary',
disabled: !this.$store.state.users.profile.can_public_key_auth,
label: this.$t('users.quickUpdate.send')
},
callbacks: {