Final cleanup of changes to EditMonitor.vue

Reverts unintentional changes committed in: d92003e172
This commit is contained in:
Matt Visnovsky 2024-05-07 10:02:05 -06:00
parent 2015142b00
commit 8b4b27f359
2 changed files with 10 additions and 9 deletions

View file

@ -103,19 +103,19 @@
</div> </div>
<!-- URL --> <!-- URL -->
<div v-if="monitor.type === 'http' || monitor.type === 'keyword' || monitor.type === 'json-query' || monitor.type === 'real-browser'" class="my-3"> <div v-if="monitor.type === 'http' || monitor.type === 'keyword' || monitor.type === 'json-query' || monitor.type === 'real-browser' " class="my-3">
<label for="url" class="form-label">{{ $t("URL") }}</label> <label for="url" class="form-label">{{ $t("URL") }}</label>
<input id="url" v-model="monitor.url" type="url" class="form-control" pattern="https?://.+" required> <input id="url" v-model="monitor.url" type="url" class="form-control" pattern="https?://.+" required>
</div> </div>
<!-- gRPC URL --> <!-- gRPC URL -->
<div v-if="monitor.type === 'grpc-keyword'" class="my-3"> <div v-if="monitor.type === 'grpc-keyword' " class="my-3">
<label for="grpc-url" class="form-label">{{ $t("URL") }}</label> <label for="grpc-url" class="form-label">{{ $t("URL") }}</label>
<input id="grpc-url" v-model="monitor.grpcUrl" type="text" class="form-control" required> <input id="grpc-url" v-model="monitor.grpcUrl" type="text" class="form-control" required>
</div> </div>
<!-- Push URL --> <!-- Push URL -->
<div v-if="monitor.type === 'push'" class="my-3"> <div v-if="monitor.type === 'push' " class="my-3">
<label for="push-url" class="form-label">{{ $t("PushUrl") }}</label> <label for="push-url" class="form-label">{{ $t("PushUrl") }}</label>
<CopyableInput id="push-url" v-model="pushURL" type="url" disabled="disabled" /> <CopyableInput id="push-url" v-model="pushURL" type="url" disabled="disabled" />
<div class="form-text"> <div class="form-text">
@ -1183,8 +1183,8 @@ message HealthCheckResponse {
// Only groups, not itself, not a decendant // Only groups, not itself, not a decendant
result = result.filter( result = result.filter(
monitor => monitor.type === "group" && monitor => monitor.type === "group" &&
monitor.id !== this.monitor.id && monitor.id !== this.monitor.id &&
!this.monitor.childrenIDs?.includes(monitor.id) !this.monitor.childrenIDs?.includes(monitor.id)
); );
// Filter result by active state, weight and alphabetical // Filter result by active state, weight and alphabetical
@ -1698,9 +1698,9 @@ message HealthCheckResponse {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "../assets/vars.scss"; @import "../assets/vars.scss";
textarea { textarea {
min-height: 200px; min-height: 200px;
} }
</style> </style>

View file

@ -642,3 +642,4 @@ export function intHash(str : string, length = 10) : number {
// Normalize the hash to the range [0, 10] // Normalize the hash to the range [0, 10]
return (hash % length + length) % length; // Ensure the result is non-negative return (hash % length + length) % length; // Ensure the result is non-negative
} }