-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: apply escalation policy API (#5304)
* feat: apply escalation policy create API Signed-off-by: NaYeong,Kim <[email protected]> * feat: create update / delete / state modal Signed-off-by: NaYeong,Kim <[email protected]> * chore: fixed minor issue (note, props name) Signed-off-by: NaYeong,Kim <[email protected]> * chore: update translations Signed-off-by: NaYeong,Kim <[email protected]> --------- Signed-off-by: NaYeong,Kim <[email protected]>
- Loading branch information
Showing
17 changed files
with
938 additions
and
612 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
70 changes: 70 additions & 0 deletions
70
...ices/alert-manager-v2/components/ServiceDetailTabsSettingsEscalationPolicyDeleteModal.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,70 @@ | ||
<script lang="ts" setup> | ||
import { | ||
reactive, | ||
} from 'vue'; | ||
import { SpaceConnector } from '@cloudforet/core-lib/space-connector'; | ||
import { | ||
PButtonModal, | ||
} from '@cloudforet/mirinae'; | ||
import type { EscalationPolicyDeleteParameters } from '@/schema/alert-manager/escalation-policy/api-verbs/delete'; | ||
import type { EscalationPolicyModel } from '@/schema/alert-manager/escalation-policy/model'; | ||
import ErrorHandler from '@/common/composables/error/errorHandler'; | ||
import { useProxyValue } from '@/common/composables/proxy-state'; | ||
interface Props { | ||
visible: boolean; | ||
selectedItem: EscalationPolicyModel; | ||
} | ||
const props = withDefaults(defineProps<Props>(), { | ||
visible: false, | ||
selectedItem: undefined, | ||
}); | ||
const emit = defineEmits<{(e: 'update:visible'): void; | ||
(e: 'close'): void; | ||
}>(); | ||
const state = reactive({ | ||
loading: false, | ||
proxyVisible: useProxyValue<boolean>('visible', props, emit), | ||
}); | ||
const handleClose = () => { | ||
state.proxyVisible = false; | ||
emit('close'); | ||
}; | ||
const handleConfirm = async () => { | ||
state.loading = true; | ||
try { | ||
await SpaceConnector.clientV2.alertManager.escalationPolicy.delete<EscalationPolicyDeleteParameters>({ | ||
escalation_policy_id: props.selectedItem.escalation_policy_id, | ||
}); | ||
handleClose(); | ||
} catch (e) { | ||
ErrorHandler.handleError(e, true); | ||
} finally { | ||
state.loading = false; | ||
} | ||
}; | ||
</script> | ||
<template> | ||
<p-button-modal class="service-detail-tabs-settings-escalation-policy-delete-modal" | ||
:visible="state.proxyVisible" | ||
:header-title="$t('ALERT_MANAGER.ESCALATION_POLICY.MODAL_DELETE_TITLE')" | ||
:loading="state.loading" | ||
theme-color="alert" | ||
size="sm" | ||
@confirm="handleConfirm" | ||
@cancel="handleClose" | ||
@close="handleClose" | ||
> | ||
<template #confirm-button> | ||
{{ $t('ALERT_MANAGER.ESCALATION_POLICY.MODAL_DELETE_BUTTON') }} | ||
</template> | ||
</p-button-modal> | ||
</template> |
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
Oops, something went wrong.