|
|
@@ -44,6 +44,8 @@ const IsTwoActive = ref(true)
|
|
|
const IsThreeActive = ref(true)
|
|
|
const IsFourActive = ref(true)
|
|
|
const UnableSaveVisible = ref(false)
|
|
|
+const SaveVisibleError = ref(false)
|
|
|
+const SaveVisibleDetected = ref(false)
|
|
|
const SaveedVisible = ref(false)
|
|
|
const DelayedDeparturedList = ref()
|
|
|
const DelayedAirdList = ref()
|
|
|
@@ -529,19 +531,48 @@ const missingmessage = ref('')
|
|
|
const SaveSuceessful = () => {
|
|
|
$api
|
|
|
.MonitoringSave({
|
|
|
- ...savesubscribeobj
|
|
|
+ ...savesubscribeobj,
|
|
|
+ is_similar_rule: false
|
|
|
})
|
|
|
.then((res: any) => {
|
|
|
if (res.code === 200) {
|
|
|
- SaveedVisible.value = true
|
|
|
- setTimeout(() => {
|
|
|
- SaveedVisible.value = false
|
|
|
- sessionStorage.setItem('activeTab', 'Monitoring Settings')
|
|
|
- router.push({
|
|
|
- path: '/SystemSettings',
|
|
|
- query: {}
|
|
|
- })
|
|
|
- }, 3000)
|
|
|
+ console.log(res.data)
|
|
|
+ if(res.data.msg == 'Update Successful') {
|
|
|
+ SaveedVisible.value = true
|
|
|
+ setTimeout(() => {
|
|
|
+ SaveedVisible.value = false
|
|
|
+ sessionStorage.setItem('activeTab', 'Monitoring Settings')
|
|
|
+ router.push({
|
|
|
+ path: '/SystemSettings',
|
|
|
+ query: {}
|
|
|
+ })
|
|
|
+ }, 3000)
|
|
|
+ } else if(res.data.msg == 'Similar Rule Detected') {
|
|
|
+ SaveVisibleDetected.value = true
|
|
|
+ } else if(res.data.msg == 'Unable to Save')
|
|
|
+ SaveVisibleError.value = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+const HandelSaveVisibleDetected = () => {
|
|
|
+ SaveVisibleDetected.value = false
|
|
|
+ $api
|
|
|
+ .MonitoringSave({
|
|
|
+ ...savesubscribeobj,
|
|
|
+ is_similar_rule: true
|
|
|
+ })
|
|
|
+ .then((res: any) => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ SaveedVisible.value = true
|
|
|
+ setTimeout(() => {
|
|
|
+ SaveedVisible.value = false
|
|
|
+ sessionStorage.setItem('activeTab', 'Monitoring Settings')
|
|
|
+ router.push({
|
|
|
+ path: '/SystemSettings',
|
|
|
+ query: {}
|
|
|
+ })
|
|
|
+ }, 3000)
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
@@ -1123,6 +1154,65 @@ defineExpose({
|
|
|
<div style="text-align: center"><el-image :src="submitsucessful" /></div>
|
|
|
<div style="text-align: center; margin-top: 20px">Saved successfully</div>
|
|
|
</el-dialog>
|
|
|
+ <!-- 保存失败 -->
|
|
|
+ <el-dialog v-model="SaveVisibleError" width="480">
|
|
|
+ <div>Duplicate Rule Error.</div>
|
|
|
+ <div>This rule exactly matches an existing rule.</div>
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer">
|
|
|
+ <el-button
|
|
|
+ class="el-button--danger"
|
|
|
+ @click="SaveVisibleError = false"
|
|
|
+ style="width: 100px"
|
|
|
+ >
|
|
|
+ OK
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template #header>
|
|
|
+ <div class="cancel_header">
|
|
|
+ <span class="iconfont_icon iconfont_warning">
|
|
|
+ <svg class="iconfont icon_danger" aria-hidden="true">
|
|
|
+ <use xlink:href="#icon-icon_fail_fill_b"></use>
|
|
|
+ </svg>
|
|
|
+ </span>
|
|
|
+ Unable to Save
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+ <!-- 三项重合提示 -->
|
|
|
+ <el-dialog v-model="SaveVisibleDetected" width="480">
|
|
|
+ <div>A similar configuration rule already exists.</div>
|
|
|
+ <div>Would you like to proceed with creating this rule?</div>
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer">
|
|
|
+ <el-button
|
|
|
+ class="el-button--default"
|
|
|
+ @click="SaveVisibleDetected = false"
|
|
|
+ style="width: 100px"
|
|
|
+ >
|
|
|
+ Cancel
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ class="el-button--warning"
|
|
|
+ @click="HandelSaveVisibleDetected"
|
|
|
+ style="width: 100px"
|
|
|
+ >
|
|
|
+ Save
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template #header>
|
|
|
+ <div class="cancel_header">
|
|
|
+ <span class="iconfont_icon iconfont_warning">
|
|
|
+ <svg class="iconfont icon_warning" aria-hidden="true">
|
|
|
+ <use xlink:href="#icon-icon_tipsfilled_b"></use>
|
|
|
+ </svg>
|
|
|
+ </span>
|
|
|
+ Similar Rule Detected
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
</template>
|
|
|
|
|
|
<style lang="scss" scoped>
|