mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-07-27 16:56:03 -04:00
Add a public URL field for monitors and uses it on the status page (#5435)
Co-authored-by: Adam Stachowicz <saibamenppl@gmail.com>
This commit is contained in:
parent
86b3ef9c86
commit
2b3f49a266
8 changed files with 58 additions and 5 deletions
|
@ -10,7 +10,7 @@
|
|||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="my-3 form-check">
|
||||
<input id="show-clickable-link" v-model="monitor.isClickAble" 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" data-testid="show-clickable-link" @click="toggleLink(monitor.group_index, monitor.monitor_index)" />
|
||||
<label class="form-check-label" for="show-clickable-link">
|
||||
{{ $t("Show Clickable Link") }}
|
||||
</label>
|
||||
|
@ -19,6 +19,16 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Custom URL -->
|
||||
<template v-if="monitor.isClickAble">
|
||||
<label for="customUrl" class="form-label">{{ $t("Custom URL") }}</label>
|
||||
<input id="customUrl" :value="monitor.url" type="url" class="form-control" data-testid="custom-url-input" @input="e => changeUrl(monitor.group_index, monitor.monitor_index, e.target!.value)">
|
||||
|
||||
<div class="form-text mb-3">
|
||||
{{ $t("customUrlDescription") }}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<button
|
||||
class="btn btn-primary btn-add-group me-2"
|
||||
@click="$refs.badgeGeneratorDialog.show(monitor.id, monitor.name)"
|
||||
|
@ -29,7 +39,7 @@
|
|||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-danger" data-bs-dismiss="modal">
|
||||
<button type="submit" class="btn btn-danger" data-bs-dismiss="modal" data-testid="monitor-settings-close">
|
||||
{{ $t("Close") }}
|
||||
</button>
|
||||
</div>
|
||||
|
@ -78,6 +88,7 @@ export default {
|
|||
monitor_index: monitor.index,
|
||||
group_index: group.index,
|
||||
isClickAble: this.showLink(monitor),
|
||||
url: monitor.element.url,
|
||||
};
|
||||
|
||||
this.MonitorSettingDialog.show();
|
||||
|
@ -110,6 +121,17 @@ export default {
|
|||
}
|
||||
return monitor.element.sendUrl && monitor.element.url && monitor.element.url !== "https://" && !this.editMode;
|
||||
},
|
||||
|
||||
/**
|
||||
* Toggle the value of sendUrl
|
||||
* @param {number} groupIndex Index of group monitor is member of
|
||||
* @param {number} index Index of monitor within group
|
||||
* @param {string} value The new value of the url
|
||||
* @returns {void}
|
||||
*/
|
||||
changeUrl(groupIndex, index, value) {
|
||||
this.$root.publicGroupList[groupIndex].monitorList[index].url = value;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue