forked from TencentBlueKing/blueking-dbm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(frontend): 告警通知优化 TencentBlueKing#8366
- Loading branch information
Showing
10 changed files
with
1,548 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
120 changes: 120 additions & 0 deletions
120
dbm-ui/frontend/src/views/monitor-alarm-plat/monitor-notice/Index.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
<!-- | ||
* TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. | ||
* | ||
* Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. | ||
* | ||
* Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License athttps://opensource.org/licenses/MIT | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for | ||
* the specific language governing permissions and limitations under the License. | ||
--> | ||
|
||
<template> | ||
<SmartAction> | ||
<BkLoading :loading="isLoading"> | ||
<DbTab | ||
v-model:active="activeTab" | ||
:exclude="[DBTypes.RIAK]" /> | ||
<BkAlert | ||
class="ml-24 mr-24 mt-20" | ||
closable | ||
theme="info" | ||
:title="t('平台配置为各业务的初始化配置,如在业务下做了修改,则全局设置失效')" /> | ||
<div class="password-policy-content"> | ||
<RenderContent :db-type="activeTab" /> | ||
<RenderContentTwo :db-type="activeTab" /> | ||
</div> | ||
</BkLoading> | ||
<template #action> | ||
<AuthButton | ||
action-id="password_policy_set" | ||
class="mr-8" | ||
:loading="isSubmitting" | ||
theme="primary" | ||
@click="handleSubmit"> | ||
{{ t('保存') }} | ||
</AuthButton> | ||
<DbPopconfirm | ||
:confirm-handler="handleReset" | ||
:content="t('重置将会恢复默认设置的内容')" | ||
:title="t('确认重置')"> | ||
<BkButton> | ||
{{ t('重置') }} | ||
</BkButton> | ||
</DbPopconfirm> | ||
</template> | ||
</SmartAction> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { useI18n } from 'vue-i18n'; | ||
import { useRequest } from 'vue-request'; | ||
|
||
import { updatePolicy } from '@services/source/monitor'; | ||
|
||
import { DBTypes } from '@common/const'; | ||
|
||
import DbTab from '@components/db-tab/Index.vue'; | ||
|
||
import { messageSuccess } from '@utils'; | ||
|
||
import RenderContent from './components/Content.vue'; | ||
import RenderContentTwo from './components/Content2.vue'; | ||
|
||
const route = useRoute(); | ||
const { t } = useI18n(); | ||
|
||
const activeTab = ref<DBTypes>(route.query.db_type as DBTypes); | ||
|
||
const isSubmitting = ref(false); | ||
|
||
const { run: runUpdatePolicy, loading: isLoading } = useRequest(updatePolicy, { | ||
manual: true, | ||
onSuccess: (updateResult) => { | ||
if (updateResult.bkm_id) { | ||
messageSuccess(t('保存成功')); | ||
// emits('success'); | ||
// isShow.value = false; | ||
} | ||
}, | ||
}); | ||
|
||
const handleSubmit = async () => { | ||
// await formRef.value.validate(); | ||
// const testRules = [ | ||
// infoRule.value ? infoValueRef.value.getValue() : undefined, | ||
// warnRule.value ? warnValueRef.value.getValue() : undefined, | ||
// dangerRule.value ? dangerValueRef.value.getValue() : undefined, | ||
// ]; | ||
// const reqParams = { | ||
// targets: props.data.targets, | ||
// custom_conditions: props.data.custom_conditions, | ||
// test_rules: testRules.filter((item) => item && item.config.length !== 0), | ||
// notify_rules: formModel.notifyRules, | ||
// notify_groups: props.data.notify_groups, | ||
// }; | ||
runUpdatePolicy(); | ||
}; | ||
|
||
const handleReset = () => { | ||
// updatePasswordPolicyRunAsync({ | ||
// ...passwordPolicyData, | ||
// rule: { | ||
// ...formData, | ||
// symbols_allowed: _.uniq(formData.symbols_allowed.split('')).join(''), | ||
// }, | ||
// reset: true, | ||
// }).then(() => { | ||
// messageSuccess(t('重置成功')); | ||
// fetchData(); | ||
// }); | ||
}; | ||
</script> | ||
|
||
<style lang="less"> | ||
.password-policy-content { | ||
padding: 16px 20px; | ||
} | ||
</style> |
Oops, something went wrong.