Network Service: Monitor Check Func
This commit is contained in:
1 parent
df97b93a9a
commit
4933d11dfd
3 files changed
+25
No files matched your search
@@ -185,6 +185,23 @@ const useResolveIncident = () => {
|
|||||||
return [resolveIncident, isLoading];
|
return [resolveIncident, isLoading];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const useAckMonitorChecks = () => {
|
||||||
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
const ackMonitorChecks = async (monitorId, setUpdateTrigger) => {
|
||||||
|
try {
|
||||||
|
setIsLoading(true);
|
||||||
|
} catch (error) {
|
||||||
|
createToast({ body: t("checkHooks.failureResolveMonitor") });
|
||||||
|
} finally {
|
||||||
|
setIsLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return [ackMonitorChecks, isLoading];
|
||||||
|
};
|
||||||
|
|
||||||
const useAckAllChecks = () => {
|
const useAckAllChecks = () => {
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@@ -209,5 +226,6 @@ export {
|
|||||||
useFetchChecksTeam,
|
useFetchChecksTeam,
|
||||||
useFetchChecksSummaryByTeamId,
|
useFetchChecksSummaryByTeamId,
|
||||||
useResolveIncident,
|
useResolveIncident,
|
||||||
|
useAckMonitorChecks,
|
||||||
useAckAllChecks,
|
useAckAllChecks,
|
||||||
};
|
};
|
||||||
@@ -631,6 +631,12 @@ class NetworkService {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async updateMonitorChecksStatus(config) {
|
||||||
|
return this.axiosInstance.put(`/checks/monitor/${config.monitorId}`, {
|
||||||
|
ack: config.ack,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
async updateAllChecksStatus(config) {
|
async updateAllChecksStatus(config) {
|
||||||
return this.axiosInstance.put(`/checks/team/`, {
|
return this.axiosInstance.put(`/checks/team/`, {
|
||||||
ack: config.ack,
|
ack: config.ack,
|
||||||
|
|||||||
@@ -218,6 +218,7 @@
|
|||||||
"checkFrequency": "Check frequency",
|
"checkFrequency": "Check frequency",
|
||||||
"checkHooks": {
|
"checkHooks": {
|
||||||
"failureResolveAll": "Failed to resolve all incidents.",
|
"failureResolveAll": "Failed to resolve all incidents.",
|
||||||
|
"failureResolveMonitor": "Failed to resolve monitor incidents.",
|
||||||
"failureResolveOne": "Failed to resolve incident."
|
"failureResolveOne": "Failed to resolve incident."
|
||||||
},
|
},
|
||||||
"checkingEvery": "Checking every",
|
"checkingEvery": "Checking every",
|
||||||
|
|||||||
Reference in new issue
Block a user