mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-07-19 15:44:02 +02:00
DEVOPS-000 Fix review comments
This commit is contained in:
parent
9d00424420
commit
a71eac0067
1 changed files with 13 additions and 10 deletions
|
@ -776,7 +776,7 @@
|
||||||
|
|
||||||
<div v-if="monitor.type === 'manual'" class="mb-3">
|
<div v-if="monitor.type === 'manual'" class="mb-3">
|
||||||
<label class="form-label">{{ $t("Manual Status") }}</label>
|
<label class="form-label">{{ $t("Manual Status") }}</label>
|
||||||
<div v-if="!isAdd" class="btn-group w-100 mb-3">
|
<div class="btn-group w-100 mb-3">
|
||||||
<button class="btn btn-success" @click="setManualStatus('up')">
|
<button class="btn btn-success" @click="setManualStatus('up')">
|
||||||
<i class="fas fa-check"></i> {{ $t("Up") }}
|
<i class="fas fa-check"></i> {{ $t("Up") }}
|
||||||
</button>
|
</button>
|
||||||
|
@ -787,9 +787,9 @@
|
||||||
<i class="fas fa-tools"></i> {{ $t("Maintenance") }}
|
<i class="fas fa-tools"></i> {{ $t("Maintenance") }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="alert alert-secondary">
|
<!-- <div v-else class="alert alert-secondary">
|
||||||
{{ $t("Manual status can be set after monitor is created") }}
|
{{ $t("Manual status can be set after monitor is created") }}
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -2035,15 +2035,18 @@ message HealthCheckResponse {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getStatusCode(status) {
|
||||||
|
const statusMap = {
|
||||||
|
"up": 1,
|
||||||
|
"down": 0,
|
||||||
|
"pending": 2,
|
||||||
|
"maintenance": 3
|
||||||
|
};
|
||||||
|
return statusMap[status] ?? 2;
|
||||||
|
},
|
||||||
|
|
||||||
setManualStatus(status) {
|
setManualStatus(status) {
|
||||||
this.monitor.manual_status = this.getStatusCode(status);
|
this.monitor.manual_status = this.getStatusCode(status);
|
||||||
this.$root.getSocket().emit("editMonitor", this.monitor, (res) => {
|
|
||||||
if (res.ok) {
|
|
||||||
this.toast.success(this.$t("Success"));
|
|
||||||
} else {
|
|
||||||
this.toast.error(res.msg);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue