Compare commits

..

7 Commits

Author SHA1 Message Date
“huailei000”
9d3874a61c fix: 批量更新不请求接口 2022-09-06 19:06:42 +08:00
Jiangjie.Bai
d222ca0684 Revert "fix: form表单组件增加是否回显配置;批量更新弹窗组件默认设置为不回显"
This reverts commit 40655ca239.
2022-09-06 18:30:31 +08:00
“huailei000”
40655ca239 fix: form表单组件增加是否回显配置;批量更新弹窗组件默认设置为不回显 2022-09-06 18:12:20 +08:00
“huailei000”
ec28702181 fix: moment.js 插件升级修复官方漏洞 2022-09-05 13:55:17 +08:00
Jiangjie.Bai
4bb4d3fbf4 fix: 修复上传json文件上传问题 2022-08-19 13:39:17 +08:00
“huailei000”
a34fff2caa fix: 修复LDAP用户导入失败弹出提示 2022-08-19 11:06:11 +08:00
“huailei000”
a9eb32de6c fix: 升级lodash 2022-08-19 11:05:51 +08:00
33 changed files with 123 additions and 457 deletions

View File

@@ -247,15 +247,6 @@ td .el-button.el-button--mini {
border-top-color: #676a6c;
}
.text-link {
color: info!important;
}
.text-link:hover {
color: info!important;
filter: opacity(65%)!important;
}
.text-danger {
color: danger;
}

View File

@@ -45,20 +45,3 @@ export const JsonRequired = {
}
}
}
export const JsonRequiredUserNameMapped = {
required: true,
trigger: 'change',
validator: (rule, value, callback) => {
try {
JSON.parse(value)
const hasUserName = _.map(JSON.parse(value), (value) => value)
if (!hasUserName.includes('username')) {
callback(new Error(i18n.t('common.requiredHasUserNameMapped')))
}
callback()
} catch (e) {
callback(new Error(i18n.t('common.InvalidJson')))
}
}
}

View File

@@ -267,12 +267,6 @@
"IPLoginLimit": "IP login limit",
"Setting": "Setting",
"Certificate": "Certificate",
"CACertificate": "CA Certificate",
"ClientCertificate": "Client certificate",
"CertificateKey": "Certificate key file",
"AllowInvalidCert": "Allow invalid cert",
"UseSSL": "Use SSL/TLS",
"SecretKey": "Secret key",
"Scope": "Type",
"Builtin": "Builtin",
"DateCreated": "Date created",
@@ -414,7 +408,6 @@
"disableSelected": "Disable selected",
"disableSuccessMsg": "Disable success",
"fieldRequiredError": "This field is required",
"requiredHasUserNameMapped": "The mapping of the username field must be included, such as {'uid': 'username'}",
"getErrorMsg": "Get failed",
"fileType": "File type",
"Status": "Status",
@@ -779,7 +772,7 @@
"OperateLog": "Operation Logs",
"PasswordChangeLog": "Password Update Logs",
"Perms": "Permissions",
"PersonalInformationImprovement": "Personal information improvement",
"PersonalInformationImprovement": "PersonalInformationImprovement",
"PlatformCreate": "Platform create",
"PlatformDetail": "Platform detail",
"PlatformList": "Platforms",
@@ -933,9 +926,6 @@
"SMS": "SMS",
"AlibabaCloud": "Alibaba cloud",
"TencentCloud": "Tencent cloud",
"HuaweiCloud": "Huawei cloud",
"SignChannelNum": "Signature Channel Number",
"AppEndpoint": "App access address",
"CMPP2": "CMPP v2.0",
"VerifySignTmpl": "Verification code template",
"Radius": "Radius",
@@ -1150,10 +1140,6 @@
"reply": "Reply",
"status": "Status",
"title": "Title",
"RelevantApp": "App",
"RelevantAsset": "Asset",
"RelevantCommand": "Command",
"RelevantSystemUser": "System user",
"type": "Type",
"user": "User",
"Status": "Status",
@@ -1422,11 +1408,9 @@
"IPNetworkSegment": "Ip Network Segment",
"Aliyun": "Ali Cloud",
"Qcloud": "Tencent Cloud",
"QcloudLighthouse": "Tencent Cloud(Lighthouse)",
"QingyunPrivatecloud": "Qingyun Private Cloud",
"HuaweiPrivatecloud": "Huawei Private Cloud",
"OpenStack": "OpenStack",
"CTYunPrivate": "CTYun Private Cloud",
"GCP": "Google Cloud Platform",
"FC": "Fusion Compute",
"LAN": "LAN",

View File

@@ -272,12 +272,6 @@
"IPLoginLimit": "IPログイン制限",
"Setting": "設定",
"Certificate": "証明書",
"CACertificate": "CA 証明書",
"ClientCertificate": "クライアント証明書",
"CertificateKey": "証明書秘密鍵ファイル",
"AllowInvalidCert": "証明書チェックを無視する",
"UseSSL": "使う SSL/TLS",
"SecretKey": "鍵",
"Scope": "カテゴリ",
"Builtin": "内蔵",
"DateCreated": "作成日",
@@ -423,7 +417,6 @@
"disableSelected": "選択した無効",
"disableSuccessMsg": "成功を無効にする",
"fieldRequiredError": "このフィールドは必須項目です",
"requiredHasUserNameMapped": "usernameフィールドのマッピングを含める必要があります, {'uid':'username'}など",
"getErrorMsg": "の取得に失敗しました",
"MFAErrorMsg": "MFAエラーです。チェックしてください",
"Total": "合計",
@@ -952,9 +945,6 @@
"Feature": "機能",
"AlibabaCloud": "Alibaba cloud",
"TencentCloud": "テンセント雲",
"HuaweiCloud": "ファーウェイ雲",
"SignChannelNum": "サインパス番号",
"AppEndpoint": "アクセスアドレスを適用する",
"CMPP2": "CMPP v2.0",
"Radius": "Radius",
"VerifySignTmpl": "認証コードメールテンプレート",
@@ -1182,10 +1172,6 @@
"reply": "返信",
"status": "ステータス",
"title": "タイトル",
"RelevantApp": "するアプリケーション",
"RelevantAsset": "する資産",
"RelevantCommand": "するコマンド",
"RelevantSystemUser": "するシステムユーザー",
"action": "アクション",
"type": "タイプ",
"user": "ユーザー",
@@ -1465,11 +1451,9 @@
"IPNetworkSegment": "IPネットワークセグメント",
"Aliyun": "Alibaba cloud",
"Qcloud": "テンセント雲",
"QcloudLighthouse": "テンセント雲(軽量アプリケーションサーバー)",
"QingyunPrivatecloud": "青雲プライベートクラウド",
"HuaweiPrivatecloud": "ファーウェイプライベートクラウド",
"OpenStack": "OpenStack",
"CTYunPrivate": "天翼プライベート・クラウド",
"GCP": "Googleクラウド",
"FC": "Fusion Compute",
"LAN": "ローカルエリアネットワーク",

View File

@@ -272,12 +272,6 @@
"IPLoginLimit": "IP 登录限制",
"Setting": "设置",
"Certificate": "证书",
"CACertificate": "CA 证书",
"ClientCertificate": "客户端证书",
"CertificateKey": "证书秘钥文件",
"AllowInvalidCert": "忽略证书检查",
"UseSSL": "使用 SSL/TLS",
"SecretKey": "密钥",
"Scope": "类别",
"Builtin": "内置",
"DateCreated": "创建日期",
@@ -423,7 +417,6 @@
"disableSelected": "禁用所选",
"disableSuccessMsg": "禁用成功",
"fieldRequiredError": "这个字段是必填项",
"requiredHasUserNameMapped": "必须包含 username 字段的映射,如 { 'uid': 'username' }",
"getErrorMsg": "获取失败",
"MFAErrorMsg": "MFA错误请检查",
"Total": "总共",
@@ -953,9 +946,6 @@
"Feature": "功能",
"AlibabaCloud": "阿里云",
"TencentCloud": "腾讯云",
"HuaweiCloud": "华为云",
"SignChannelNum": "签名通道号",
"AppEndpoint": "应用接入地址",
"CMPP2": "CMPP v2.0",
"Radius": "Radius",
"VerifySignTmpl": "验证码短信模板",
@@ -1183,10 +1173,6 @@
"reply": "回复",
"status": "状态",
"title": "标题",
"RelevantApp": "应用",
"RelevantAsset": "资产",
"RelevantCommand": "命令",
"RelevantSystemUser": "系统用户",
"action": "动作",
"type": "类型",
"user": "用户",
@@ -1466,10 +1452,8 @@
"IPNetworkSegment": "IP网段",
"Aliyun": "阿里云",
"Qcloud": "腾讯云",
"QcloudLighthouse": "腾讯云(轻量应用服务器)",
"QingyunPrivatecloud": "青云私有云",
"HuaweiPrivatecloud": "华为私有云",
"CTYunPrivate": "天翼私有云",
"OpenStack": "OpenStack",
"GCP": "谷歌云",
"FC": "Fusion Compute",

View File

@@ -1,8 +1,6 @@
import empty from '@/layout/empty'
import i18n from '@/i18n/i18n'
const activateMenu = '/console/assets/assets'
export default [
{
path: 'cloud',
@@ -22,7 +20,7 @@ export default [
hidden: true,
meta: {
title: i18n.t('xpack.Cloud.CloudSync'),
activeMenu: activateMenu
activeMenu: '/console/assets/assets'
}
},
{
@@ -73,7 +71,6 @@ export default [
hidden: true,
meta: {
title: i18n.t('xpack.Cloud.AccountDetail'),
activeMenu: activateMenu,
permissions: ['xpack.view_account']
}
}
@@ -124,8 +121,7 @@ export default [
name: 'SyncInstanceTaskDetail',
hidden: true,
meta: {
title: i18n.t('xpack.Cloud.SyncInstanceTaskDetail'),
activeMenu: activateMenu
title: i18n.t('xpack.Cloud.SyncInstanceTaskDetail')
}
}
]

View File

@@ -72,9 +72,6 @@ const mutations = {
},
ADD_WORKBENCH_ORGS(state, org) {
state.workbenchOrgs.push(org)
},
SET_IS_FIRST_LOGIN(state, flag) {
state.profile.is_first_login = flag
}
}
@@ -143,9 +140,6 @@ const actions = {
const usingOrgs = mapper[viewName] || state.consoleOrgs
Vue.$log.debug('Set using orgs: ', viewName, usingOrgs)
commit('SET_USING_ORGS', usingOrgs)
},
ifFirstLogin({ commit }, flag) {
commit('SET_IS_FIRST_LOGIN', flag)
}
}

View File

@@ -37,13 +37,10 @@ export function encryptPassword(password) {
if (!password) {
return ''
}
let rsaPublicKeyText = getCookie('jms_public_key')
if (!rsaPublicKeyText) {
return password
}
const aesKey = (Math.random() + 1).toString(36).substring(2)
// public key 是 base64 存储的
rsaPublicKeyText = rsaPublicKeyText.replaceAll('"', '')
const rsaPublicKeyText = getCookie('jms_public_key')
.replaceAll('"', '')
const rsaPublicKey = atob(rsaPublicKeyText)
const keyCipher = rsaEncrypt(aesKey, rsaPublicKey)
const passwordCipher = aesEncrypt(password, aesKey)

View File

@@ -5,9 +5,6 @@
<script>
import { GenericCreateUpdatePage } from '@/layout/components'
import { getDatabaseTypeFieldsMap } from '@/views/applications/DatabaseApp/const'
import { UploadKey } from '@/components'
import { Required } from '@/components/DataForm/rules'
export default {
components: {
GenericCreateUpdatePage
@@ -39,32 +36,6 @@ export default {
fieldsMeta: {
host: {
type: 'input'
},
port: {
rules: [Required]
},
use_ssl: {
label: this.$t('common.UseSSL'),
component: 'el-switch'
},
allow_invalid_cert: {
label: this.$t('common.AllowInvalidCert'),
hidden: (form) => { return !form.use_ssl }
},
ca_cert: {
label: this.$t('common.CACertificate'),
hidden: (form) => { return !form.use_ssl },
component: UploadKey
},
client_cert: {
label: this.$t('common.ClientCertificate'),
hidden: (form) => { return !form.use_ssl },
component: UploadKey
},
cert_key: {
label: this.$t('common.CertificateKey'),
hidden: (form) => { return !form.use_ssl },
component: UploadKey
}
}
}

View File

@@ -1,16 +1,10 @@
import { ORACLE, MONGODB, REDIS } from '../const'
import { ORACLE } from '../const'
export function getDatabaseTypeFieldsMap(type) {
const baseParams = ['host', 'port', 'database']
const tlsParams = ['use_ssl', 'ca_cert']
switch (type) {
case ORACLE:
return baseParams.concat(['version'])
case REDIS:
return baseParams.concat(tlsParams.concat(['client_cert', 'cert_key']))
case MONGODB:
return baseParams.concat(tlsParams.concat(['cert_key', 'allow_invalid_cert']))
return ['host', 'port', 'database', 'version']
default:
return baseParams
return ['host', 'port', 'database']
}
}

View File

@@ -92,27 +92,24 @@ export const DATABASE = [
}
]
const MONGODB_ITEM = {
name: MONGODB,
title: i18n.t(`applications.applicationsType.${MONGODB}`),
type: 'primary',
category: DATABASE_CATEGORY,
group: i18n.t('applications.NoSQLProtocol')
}
const REDIS_ITEM = {
name: REDIS,
title: i18n.t(`applications.applicationsType.${REDIS}`),
type: 'primary',
category: DATABASE_CATEGORY,
has: true
}
export const KV_DATABASE = [
MONGODB_ITEM, REDIS_ITEM
{
name: REDIS,
title: i18n.t(`applications.applicationsType.${REDIS}`),
type: 'primary',
category: DATABASE_CATEGORY,
has: true,
group: i18n.t('applications.NoSQLProtocol')
},
{
name: MONGODB,
title: i18n.t(`applications.applicationsType.${MONGODB}`),
type: 'primary',
category: DATABASE_CATEGORY
}
]
export const AppPlanDatabase = [...DATABASE, MONGODB_ITEM]
export const AppPlanDatabase = DATABASE
export const KUBERNETES = 'k8s'
export const CLOUD_CATEGORY = 'cloud'

View File

@@ -1,40 +1,18 @@
<template>
<IBox
:fa="icon"
:type="type"
:title="title"
v-bind="$attrs"
>
<table class="card-table">
<div v-if="iObjects.length > 0" v-cloak>
<tr v-for="obj of iObjects" :key="obj.value" class="item">
<td>
<el-tooltip
style="margin: 4px;"
effect="dark"
:content="obj.label"
placement="left"
>
<el-link class="detail" @click="goDetail(obj)">
{{ obj.label }}
</el-link>
</el-tooltip>
</td>
<td>
<el-button
size="mini"
type="primary"
style="float: right"
@click="buttonClickCallback(obj)"
>
{{ buttonTitle }}
</el-button>
</td>
</tr>
</div>
<div v-else v-cloak style="text-align: center;">
{{ $t('common.NoData') }}
</div>
<IBox :fa="icon" :type="type" :title="title" v-bind="$attrs">
<table style="width: 100%;table-layout:fixed;" class="CardTable">
<tr v-for="obj of iObjects" :key="obj.value" class="item">
<td style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">
<el-tooltip style="margin: 4px;" effect="dark" :content="obj.label" placement="left">
<el-link class="detail" @click="goDetail(obj)">{{ obj.label }}</el-link>
</el-tooltip>
</td>
<td>
<el-button size="mini" type="primary" style="float: right" @click="buttonClickCallback(obj)">
{{ buttonTitle }}
</el-button>
</td>
</tr>
</table>
</IBox>
</template>
@@ -93,9 +71,9 @@ export default {
methods: {
async loadObjects() {
const data = await this.$axios.get(this.url)
for (const v of data) {
data.forEach((v) => {
v['label'] = v['name']
}
})
this.objects = data
},
goDetail(obj) {
@@ -106,26 +84,18 @@ export default {
</script>
<style lang="scss" scoped>
.card-table {
width: 100%;
table-layout:fixed;
}
[v-cloak]{
display: none!important;
}
b, strong {
font-weight: 700;
font-size: 13px;
}
tr td {
line-height: 1.42857;
padding: 8px;
vertical-align: top;
display: inline;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
tr.item {
border-bottom: 1px solid #e7eaec;
padding: 8px;

View File

@@ -22,7 +22,7 @@ export default {
const accountProviderAttrs = ACCOUNT_PROVIDER_ATTRS_MAP[accountProvider]
function setFieldAttrs() {
const fieldsObject = {}
const updateNotRequiredFields = ['access_key_secret', 'client_secret', 'password', 'sc_password', 'oc_password', 'cert_file', 'key_file']
const updateNotRequiredFields = ['access_key_secret', 'client_secret', 'password', 'sc_password', 'oc_password']
for (const item of accountProviderAttrs?.attrs) {
fieldsObject[item] = {
rules: updateNotRequiredFields.includes(item) && vm.$route.params.id ? [] : [Required]
@@ -61,20 +61,6 @@ export default {
toFormat: 'object'
}
},
cert_file: {
label: this.$t('common.Certificate'),
component: UploadKey,
el: {
toFormat: 'object'
}
},
key_file: {
label: this.$t('common.SecretKey'),
component: UploadKey,
el: {
toFormat: 'object'
}
},
password: {
rules: this.$route.params.id ? [] : [Required]
}

View File

@@ -4,7 +4,7 @@
<script type="text/jsx">
import GenericListTable from '@/layout/components/GenericListTable'
import { ACCOUNT_PROVIDER_ATTRS_MAP, aliyun, aws_china, aws_international, huaweicloud, qcloud, qcloud_lighthouse, azure, azure_international, vmware, nutanix, qingcloud_private, huaweicloud_private, ctyun_private, openstack, gcp, baiducloud, jdcloud, fc, lan } from '../const'
import { ACCOUNT_PROVIDER_ATTRS_MAP, aliyun, aws_china, aws_international, huaweicloud, qcloud, azure, azure_international, vmware, nutanix, qingcloud_private, huaweicloud_private, openstack, gcp, baiducloud, jdcloud, fc, lan } from '../const'
export default {
name: 'AccountList',
@@ -82,10 +82,6 @@ export default {
type: 'primary',
can: true
},
{
name: qcloud_lighthouse,
title: ACCOUNT_PROVIDER_ATTRS_MAP[qcloud_lighthouse].title
},
{
name: huaweicloud,
title: ACCOUNT_PROVIDER_ATTRS_MAP[huaweicloud].title
@@ -131,10 +127,6 @@ export default {
name: huaweicloud_private,
title: ACCOUNT_PROVIDER_ATTRS_MAP[huaweicloud_private].title
},
{
name: ctyun_private,
title: ACCOUNT_PROVIDER_ATTRS_MAP[ctyun_private].title
},
{
name: openstack,
title: ACCOUNT_PROVIDER_ATTRS_MAP[openstack].title

View File

@@ -92,7 +92,6 @@ export default {
component: Select2,
el: {
multiple: true,
allowCreate: true,
value: [],
ajax: {
url: '/api/v1/xpack/cloud/regions/',

View File

@@ -38,7 +38,6 @@ export default {
},
tableConfig: {
url: `/api/v1/xpack/cloud/sync-instance-tasks/${this.object.id}/instances/`,
hasSelection: false,
columns: [
'instance_id',
{

View File

@@ -58,7 +58,10 @@ export default {
formatter: DetailFormatter,
formatterArgs: {
permissions: 'xpack.view_syncinstancedetail',
route: 'SyncInstanceTaskDetail'
route: 'SyncInstanceTaskDetail',
routeQuery: {
activeTab: 'detail'
}
}
},
history_count: {

View File

@@ -1,24 +1,21 @@
import i18n from '@/i18n/i18n'
export const gcp = 'gcp'
export const aliyun = 'aliyun'
export const baiducloud = 'baiducloud'
export const jdcloud = 'jdcloud'
export const aws_international = 'aws_international'
export const aws_china = 'aws_china'
export const huaweicloud = 'huaweicloud'
export const qcloud = 'qcloud'
export const qcloud_lighthouse = 'qcloud_lighthouse'
export const azure = 'azure'
export const azure_international = 'azure_international'
export const vmware = 'vmware'
export const nutanix = 'nutanix'
export const qingcloud_private = 'qingcloud_private'
export const huaweicloud_private = 'huaweicloud_private'
export const ctyun_private = 'ctyun_private'
export const openstack = 'openstack'
export const nutanix = 'nutanix'
export const vmware = 'vmware'
export const gcp = 'gcp'
export const fc = 'fc'
export const baiducloud = 'baiducloud'
export const jdcloud = 'jdcloud'
export const lan = 'lan'
export const ACCOUNT_PROVIDER_ATTRS_MAP = {
@@ -57,11 +54,6 @@ export const ACCOUNT_PROVIDER_ATTRS_MAP = {
title: i18n.t('xpack.Cloud.Qcloud'),
attrs: ['access_key_id', 'access_key_secret']
},
[qcloud_lighthouse]: {
name: qcloud_lighthouse,
title: i18n.t('xpack.Cloud.QcloudLighthouse'),
attrs: ['access_key_id', 'access_key_secret']
},
[azure]: {
name: azure,
title: i18n.t('xpack.Cloud.Azure'),
@@ -72,11 +64,6 @@ export const ACCOUNT_PROVIDER_ATTRS_MAP = {
title: i18n.t('xpack.Cloud.Azure_Int'),
attrs: ['client_id', 'client_secret', 'tenant_id', 'subscription_id']
},
[gcp]: {
name: gcp,
title: i18n.t('xpack.Cloud.GCP'),
attrs: ['service_account_key']
},
[vmware]: {
name: vmware,
title: 'VMware',
@@ -102,16 +89,16 @@ export const ACCOUNT_PROVIDER_ATTRS_MAP = {
title: i18n.t('xpack.Cloud.OpenStack'),
attrs: ['auth_url', 'user_domain_name', 'username', 'password']
},
[gcp]: {
name: gcp,
title: i18n.t('xpack.Cloud.GCP'),
attrs: ['service_account_key']
},
[fc]: {
name: fc,
title: i18n.t('xpack.Cloud.FC'),
attrs: ['api_endpoint', 'username', 'password']
},
[ctyun_private]: {
name: ctyun_private,
title: i18n.t('xpack.Cloud.CTYunPrivate'),
attrs: ['access_key_id', 'access_key_secret', 'api_endpoint', 'cert_file', 'key_file']
},
[lan]: {
name: lan,
title: i18n.t('xpack.Cloud.LAN'),

View File

@@ -81,7 +81,10 @@ export default {
hasRefresh: true,
hasSearch: true,
hasMoreActions: false,
createRoute: 'CommandFilterCreate'
createRoute: 'CommandFilterCreate',
canCreate: () => {
return this.$hasPerm('assets.add_commandfilter')
}
}
}
},

View File

@@ -42,7 +42,7 @@ export default {
vm.relationDialog.tableConfig.url = setUrlParam(vm.relationDialog.tableConfig.url, 'commandexecution', row.id)
vm.relationDialog.show = true
}
return <el-link class='text-link' onClick={onClick}>{ cellValue.length }</el-link>
return <el-link onClick={onClick}>{ cellValue.length }</el-link>
}
},
command: {
@@ -67,7 +67,7 @@ export default {
formatter: (row) => {
const label = this.$t('audits.View')
const route = { to: { name: 'CeleryTaskLog', params: { id: row.id }}}
return <router-link class='text-link' {...{ attrs: route }} target='_blank'>{ label }</router-link>
return <router-link {...{ attrs: route }} target='_blank'>{ label }</router-link>
}
},
date_start: {
@@ -138,4 +138,5 @@ export default {
</script>
<style>
</style>

View File

@@ -78,7 +78,6 @@ export default {
},
onPerformSuccess() {
this.$message.success(this.$t('common.updateSuccessMsg'))
this.$store.dispatch('users/ifFirstLogin', false)
setTimeout(() => this.$router.push({ name: 'ProfileInfo' }), 100)
},
submitMethod() {

View File

@@ -37,8 +37,7 @@ import DetailCard from '@/components/DetailCard'
import QuickActions from '@/components/QuickActions'
import UserConfirmDialog from '@/components/UserConfirmDialog'
import { toSafeLocalDateStr } from '@/utils/common'
import { getProfile } from '@/api/users'
import { mapState } from 'vuex'
import store from '@/store'
export default {
name: 'ProfileInfo',
@@ -48,9 +47,14 @@ export default {
QuickActions,
UserConfirmDialog
},
props: {
object: {
type: Object,
default: () => store.state.users.profile
}
},
data() {
return {
object: this.userProfile || {},
url: `/api/v1/users/profile/`,
showPasswordDialog: false,
currentEdit: '',
@@ -156,7 +160,7 @@ export default {
attrs: {
disabled: true,
name: 'site_msg',
model: this.object?.receive_backends.indexOf('site_msg') !== -1
model: this.object.receive_backends.indexOf('site_msg') !== -1
},
callbacks: {
change: this.updateUserReceiveBackends
@@ -167,7 +171,7 @@ export default {
type: 'switcher',
attrs: {
name: 'email',
model: this.object?.receive_backends.indexOf('email') !== -1
model: this.object.receive_backends.indexOf('email') !== -1
},
callbacks: {
change: this.updateUserReceiveBackends
@@ -178,7 +182,7 @@ export default {
type: 'switcher',
attrs: {
name: 'wecom',
model: this.object?.receive_backends.indexOf('wecom') !== -1
model: this.object.receive_backends.indexOf('wecom') !== -1
},
has: this.$store.getters.publicSettings.AUTH_WECOM,
callbacks: {
@@ -190,7 +194,7 @@ export default {
type: 'switcher',
attrs: {
name: 'dingtalk',
model: this.object?.receive_backends.indexOf('dingtalk') !== -1
model: this.object.receive_backends.indexOf('dingtalk') !== -1
},
has: this.$store.getters.publicSettings.AUTH_DINGTALK,
callbacks: {
@@ -202,7 +206,7 @@ export default {
type: 'switcher',
attrs: {
name: 'feishu',
model: this.object?.receive_backends.indexOf('feishu') !== -1
model: this.object.receive_backends.indexOf('feishu') !== -1
},
has: this.$store.getters.publicSettings.AUTH_FEISHU,
callbacks: {
@@ -213,9 +217,6 @@ export default {
}
},
computed: {
...mapState({
userProfile: state => state.users.profile
}),
detailCardItems() {
return [
{
@@ -298,12 +299,6 @@ export default {
return url
}
},
created() {
getProfile().then(res => {
this.object = res
this.$store.commit('users/SET_PROFILE', res)
})
},
methods: {
updateUserReceiveBackends(val) {
this.$axios.patch(

View File

@@ -8,7 +8,7 @@
<script>
import BaseAuth from './Base'
import { JsonRequiredUserNameMapped } from '@/components/DataForm/rules'
import { JsonRequired } from '@/components/DataForm/rules'
import { JsonEditor } from '@/components/FormFields'
export default {
@@ -25,14 +25,16 @@ export default {
'AUTH_CAS', 'CAS_SERVER_URL', 'CAS_ROOT_PROXIED_AS', 'CAS_VERSION'
]],
[this.$t('common.Other'), [
'CAS_LOGOUT_COMPLETELY', 'CAS_RENAME_ATTRIBUTES', 'CAS_CREATE_USER'
'CAS_LOGOUT_COMPLETELY', 'CAS_USERNAME_ATTRIBUTE',
'CAS_APPLY_ATTRIBUTES_TO_USER', 'CAS_RENAME_ATTRIBUTES',
'CAS_CREATE_USER'
]]
],
fieldsMeta: {
CAS_RENAME_ATTRIBUTES: {
component: JsonEditor,
label: this.$t('setting.authUserAttrMap'),
rules: [JsonRequiredUserNameMapped]
rules: [JsonRequired]
}
},
submitMethod: () => 'patch',
@@ -41,18 +43,9 @@ export default {
return obj
},
cleanFormValue(data) {
let userNameAttribute = ''
const renameAttributes = JSON.parse(data['CAS_RENAME_ATTRIBUTES'])
if (renameAttributes) {
data['CAS_RENAME_ATTRIBUTES'] = renameAttributes
if (data['CAS_RENAME_ATTRIBUTES']) {
data['CAS_RENAME_ATTRIBUTES'] = JSON.parse(data['CAS_RENAME_ATTRIBUTES'])
}
for (const key in renameAttributes) {
if (renameAttributes[key] === 'username') {
userNameAttribute = key
}
}
data['CAS_USERNAME_ATTRIBUTE'] = userNameAttribute
data['CAS_APPLY_ATTRIBUTES_TO_USER'] = true
return data
}
}

View File

@@ -36,11 +36,9 @@ export default {
'AUTH_OAUTH2_SCOPE',
'AUTH_OAUTH2_PROVIDER_AUTHORIZATION_ENDPOINT',
'AUTH_OAUTH2_ACCESS_TOKEN_ENDPOINT',
'AUTH_OAUTH2_PROVIDER_USERINFO_ENDPOINT',
'AUTH_OAUTH2_PROVIDER_END_SESSION_ENDPOINT'
'AUTH_OAUTH2_PROVIDER_USERINFO_ENDPOINT'
]],
[this.$t('common.Other'), [
'AUTH_OAUTH2_LOGOUT_COMPLETELY',
'AUTH_OAUTH2_ALWAYS_UPDATE_USER',
'AUTH_OAUTH2_USER_ATTR_MAP'
]]

View File

@@ -60,7 +60,6 @@ export default {
actions: {
prop: 'id',
formatterArgs: {
canUpdate: this.$hasPerm('orgs.change_organization'),
canDelete: function({ row }) {
return !row.is_default && vm.$hasPerm('orgs.delete_organization')
},

View File

@@ -1,87 +0,0 @@
<template>
<BaseSMS :title="$t('setting.HuaweiCloud')" :config="$data" />
</template>
<script>
import BaseSMS from './Base'
import { UpdateToken } from '@/components/FormFields'
export default {
name: 'SMSHuawei',
components: {
BaseSMS
},
data() {
const vm = this
return {
url: `/api/v1/settings/setting/?category=huawei`,
hasDetailInMsg: false,
visible: false,
moreButtons: [
{
title: this.$t('common.Test'),
loading: false,
callback: function(value, form, btn) {
btn.loading = true
vm.$axios.post(
`/api/v1/settings/sms/huawei/testing/`,
value
).then(res => {
vm.$message.success(res['msg'])
}).catch(() => {
vm.$log.error('err occur')
}).finally(() => { btn.loading = false })
}
}
],
fields: [
[
this.$t('common.BasicInfo'),
[
'HUAWEI_APP_KEY', 'HUAWEI_APP_SECRET', 'HUAWEI_SMS_ENDPOINT'
]
],
[
this.$t('setting.VerifySignTmpl'),
[
'HUAWEI_SIGN_CHANNEL_NUM', 'HUAWEI_VERIFY_SIGN_NAME', 'HUAWEI_VERIFY_TEMPLATE_CODE'
]
],
[
this.$t('common.Other'),
[
'SMS_TEST_PHONE'
]
]
],
fieldsMeta: {
HUAWEI_VERIFY_SIGN_TMPL: {
fields: ['SIGN_NAME', 'TEMPLATE_CODE'],
fieldsMeta: {
}
},
HUAWEI_APP_SECRET: {
component: UpdateToken
},
HUAWEI_SIGN_CHANNEL_NUM: {
label: this.$t('setting.SignChannelNum')
},
HUAWEI_SMS_ENDPOINT: {
label: this.$t('setting.AppEndpoint')
}
},
submitMethod() {
return 'put'
}
}
},
computed: {
},
methods: {
}
}
</script>
<style scoped>
</style>

View File

@@ -6,7 +6,6 @@
import GenericCreateUpdatePage from '@/layout/components/GenericCreateUpdatePage'
import SMSAlibaba from './SMSAlibaba'
import SMSTencent from './SMSTencent'
import SMSHuawei from './SMSHuawei'
import CMPP2 from './CMPP2'
export default {
@@ -25,7 +24,7 @@ export default {
],
[
this.$t('setting.SMSProvider'), [
'ALIYUN', 'QCLOUD', 'HUAWEICLOUD', 'CMPP2'
'ALIYUN', 'QCLOUD', 'CMPP2'
]
]
],
@@ -44,13 +43,6 @@ export default {
return form['SMS_BACKEND'] !== 'tencent'
}
},
HUAWEICLOUD: {
label: this.$t('setting.HuaweiCloud'),
component: SMSHuawei,
hidden: (form) => {
return form['SMS_BACKEND'] !== 'huawei'
}
},
CMPP2: {
label: this.$t('setting.CMPP2'),
component: CMPP2,

View File

@@ -39,10 +39,9 @@ export default {
},
actions: {
formatterArgs: {
canUpdate: this.$hasPerm('terminal.change_endpoint'),
updateRoute: 'EndpointUpdate',
cloneRoute: 'EndpointCreate',
canDelete: ({ row }) => row.id !== '00000000-0000-0000-0000-000000000001' && this.$hasPerm('terminal.delete_endpoint')
canDelete: ({ row }) => row.id !== '00000000-0000-0000-0000-000000000001'
}
}
}

View File

@@ -38,7 +38,6 @@ export default {
},
actions: {
formatterArgs: {
canUpdate: this.$hasPerm('terminal.change_endpointrule'),
updateRoute: 'EndpointRuleUpdate',
cloneRoute: 'EndpointRuleCreate'
}

View File

@@ -1,38 +1,27 @@
<template>
<Page v-bind="$attrs">
<IBox>
<el-form ref="testForm" label-width="20%" :model="testData" :rules="testRules">
<el-form-item :label="$t('setting.basicTools')">
<el-radio-group v-model="testData.tool_type" @change="changeToolType">
<el-radio v-for="t in tools" :key="t" :label="t" />
</el-radio-group>
</el-form-item>
<el-form-item :label="$t('setting.destinationIP')" prop="dest_addr">
<el-input v-model="testData.dest_addr" :placeholder="$t('setting.destinationIP')" />
</el-form-item>
<el-form-item v-if="testData.tool_type=='Telnet'" :label="$t('setting.testPort')" prop="port_num">
<el-input v-model="testData.port_num" :placeholder="$t('setting.testPort')" />
</el-form-item>
<el-form-item>
<el-button
type="primary"
size="small"
:loading="isTesting"
@click="submitTest"
>
{{ $t('setting.testTools') }}
</el-button>
</el-form-item>
<el-form-item>
<el-input
v-model="testResp"
type="textarea"
:readonly="true"
:rows="8"
:placeholder="$t('setting.testHelpText')"
/>
</el-form-item>
</el-form>
<div>
<el-form ref="testForm" label-width="20%" :model="testData" :rules="testRules">
<el-form-item :label="$t('setting.basicTools')">
<el-radio-group v-model="testData.tool_type" @change="changeToolType">
<el-radio v-for="t in tools" :key="t" :label="t" />
</el-radio-group>
</el-form-item>
<el-form-item :label="$t('setting.destinationIP')" prop="dest_addr">
<el-input v-model="testData.dest_addr" :placeholder="$t('setting.destinationIP')" />
</el-form-item>
<el-form-item v-if="testData.tool_type=='Telnet'" :label="$t('setting.testPort')" prop="port_num">
<el-input v-model="testData.port_num" :placeholder="$t('setting.testPort')" />
</el-form-item>
<el-form-item>
<el-button type="primary" :loading="isTesting" @click="submitTest">{{ $t('setting.testTools') }}</el-button>
</el-form-item>
<el-form-item>
<el-input v-model="testResp" type="textarea" :readonly="true" :rows="8" :placeholder="$t('setting.testHelpText')" />
</el-form-item>
</el-form>
</div>
</IBox>
</Page>
</template>
@@ -106,19 +95,20 @@ export default {
}
</script>
<style lang="scss" scoped>
.el-form {
&>>> .el-form-item {
margin-bottom: 12px;
}
&>>> .el-form-item__content {
width: 75%;
}
&>>> .el-form-item__label {
padding: 0 30px 0 0;
}
&>>> .el-form-item__error {
<style scoped>
.el-form ::v-deep .el-form-item {
margin-bottom: 12px;
}
.el-form ::v-deep .el-form-item__content {
width: 75%;
}
.el-form ::v-deep .el-form-item__label {
padding: 0 30px 0 0;
}
.el-form ::v-deep .el-form-item__error {
position: inherit;
}
}
</style>

View File

@@ -141,7 +141,7 @@ export default {
valueLabel: this.$t('tickets.Pending')
}
},
exclude: ['state', 'id', 'title'],
exclude: ['state'],
options: [
{
value: 'state',
@@ -162,30 +162,6 @@ export default {
label: this.$t('tickets.Rejected')
}
]
},
{
value: 'id',
label: 'ID'
},
{
value: 'title',
label: this.$t('tickets.title')
},
{
value: 'relevant_app',
label: this.$t('tickets.RelevantApp')
},
{
value: 'relevant_asset',
label: this.$t('tickets.RelevantAsset')
},
{
value: 'relevant_system_user',
label: this.$t('tickets.RelevantCommand')
},
{
value: 'relevant_command',
label: this.$t('tickets.RelevantSystemUser')
}
]
},

View File

@@ -115,7 +115,6 @@ export default {
actions: {
formatterArgs: {
hasDelete: hasDelete,
canUpdate: this.$hasPerm('users.change_user'),
extraActions: [
{
title: this.$t('users.Remove'),

View File

@@ -42,8 +42,7 @@ export default {
InviteLoading: false,
formConfig: {
url: '/api/v1/users/users/invite/',
getUrl: () => '/api/v1/users/users/invite/',
submitMethod: () => 'post',
method: 'post',
hasReset: false,
hasSaveContinue: false,
createSuccessMsg: this.$t('users.InviteSuccess'),