mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-01-26 03:39:27 -06:00
Pushed global thresholds inside create if branch
This commit is contained in:
@@ -93,18 +93,18 @@ const CreateInfrastructureMonitor = () => {
|
||||
// Populate form fields if editing
|
||||
|
||||
useEffect(() => {
|
||||
const globalThresholds = globalSettings?.data?.settings?.globalThresholds;
|
||||
const defaultThresholds = {
|
||||
cpu: "",
|
||||
memory: "",
|
||||
disk: "",
|
||||
temperature: "",
|
||||
};
|
||||
|
||||
if (isCreate) {
|
||||
// If global settings are not loaded yet, use default thresholds
|
||||
if (globalSettingsLoading) return;
|
||||
// Create mode: use global thresholds
|
||||
const globalThresholds = globalSettings?.data?.settings?.globalThresholds;
|
||||
const defaultThresholds = {
|
||||
cpu: "",
|
||||
memory: "",
|
||||
disk: "",
|
||||
temperature: "",
|
||||
};
|
||||
|
||||
setInfrastructureMonitor((prev) => ({
|
||||
...prev,
|
||||
url: "",
|
||||
|
||||
Reference in New Issue
Block a user