Pushed global thresholds inside create if branch
This commit is contained in:
1 parent
0ecbf48f5d
commit
5e46a9f2d5
1 file changed
+8
-8
@@ -93,18 +93,18 @@ const CreateInfrastructureMonitor = () => {
|
|||||||
// Populate form fields if editing
|
// Populate form fields if editing
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const globalThresholds = globalSettings?.data?.settings?.globalThresholds;
|
|
||||||
const defaultThresholds = {
|
|
||||||
cpu: "",
|
|
||||||
memory: "",
|
|
||||||
disk: "",
|
|
||||||
temperature: "",
|
|
||||||
};
|
|
||||||
|
|
||||||
if (isCreate) {
|
if (isCreate) {
|
||||||
// If global settings are not loaded yet, use default thresholds
|
// If global settings are not loaded yet, use default thresholds
|
||||||
if (globalSettingsLoading) return;
|
if (globalSettingsLoading) return;
|
||||||
// Create mode: use global thresholds
|
// Create mode: use global thresholds
|
||||||
|
const globalThresholds = globalSettings?.data?.settings?.globalThresholds;
|
||||||
|
const defaultThresholds = {
|
||||||
|
cpu: "",
|
||||||
|
memory: "",
|
||||||
|
disk: "",
|
||||||
|
temperature: "",
|
||||||
|
};
|
||||||
|
|
||||||
setInfrastructureMonitor((prev) => ({
|
setInfrastructureMonitor((prev) => ({
|
||||||
...prev,
|
...prev,
|
||||||
url: "",
|
url: "",
|
||||||
|
|||||||
Reference in new issue
Block a user