convert sendUrl number -> boolean in toPublicJSON

This commit is contained in:
Ryo Hanafusa 2024-10-27 08:18:46 +00:00
parent 9af201924f
commit 2fb3638bd7
2 changed files with 3 additions and 3 deletions

View file

@ -48,7 +48,7 @@ class Monitor extends BeanModel {
let obj = {
id: this.id,
name: this.name,
sendUrl: this.sendUrl,
sendUrl: !!this.sendUrl,
type: this.type,
};

View file

@ -10,7 +10,7 @@
</div>
<div class="modal-body">
<div class="my-3 form-check">
<input id="show-clickable-link" :checked="monitor.isClickable === 1" class="form-check-input" type="checkbox" @click="toggleLink(monitor.group_index, monitor.monitor_index)" />
<input id="show-clickable-link" v-model="monitor.isClickable" class="form-check-input" type="checkbox" @click="toggleLink(monitor.group_index, monitor.monitor_index)" />
<label class="form-check-label" for="show-clickable-link">
{{ $t("Show Clickable Link") }}
</label>
@ -93,7 +93,7 @@ export default {
* @returns {void}
*/
toggleLink(groupIndex, index) {
this.$root.publicGroupList[groupIndex].monitorList[index].sendUrl = this.$root.publicGroupList[groupIndex].monitorList[index].sendUrl ? 0 : 1;
this.$root.publicGroupList[groupIndex].monitorList[index].sendUrl = !this.$root.publicGroupList[groupIndex].monitorList[index].sendUrl;
},
},
};