mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-10-01 01:25:45 -04:00
8a92054c2b
* Added JSDoc to eslint rules Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com> * Fixed JSDoc eslint errors Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com> * Update the check-linters workflow to Node.js 20 --------- Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com> Co-authored-by: Louis Lam <louislam@users.noreply.github.com>
64 lines
1.9 KiB
Vue
64 lines
1.9 KiB
Vue
<template>
|
|
<div ref="modal" class="modal fade" tabindex="-1">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title">
|
|
{{ $t("New Group") }}
|
|
</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" />
|
|
</div>
|
|
<div class="modal-body">
|
|
<form @submit.prevent="confirm">
|
|
<div>
|
|
<label for="draftGroupName" class="form-label">{{ $t("Group Name") }}</label>
|
|
<input id="draftGroupName" v-model="groupName" type="text" class="form-control">
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">
|
|
{{ $t("Cancel") }}
|
|
</button>
|
|
<button type="button" class="btn btn-primary" data-bs-dismiss="modal" :disabled="groupName == '' || groupName == null" @click="confirm">
|
|
{{ $t("Confirm") }}
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import { Modal } from "bootstrap";
|
|
|
|
export default {
|
|
props: {},
|
|
emits: [ "added" ],
|
|
data: () => ({
|
|
modal: null,
|
|
groupName: null,
|
|
}),
|
|
mounted() {
|
|
this.modal = new Modal(this.$refs.modal);
|
|
},
|
|
methods: {
|
|
/**
|
|
* Show the confirm dialog
|
|
* @returns {void}
|
|
*/
|
|
show() {
|
|
this.modal.show();
|
|
},
|
|
/**
|
|
* Dialog confirmed
|
|
* @returns {void}
|
|
*/
|
|
confirm() {
|
|
this.$emit("added", this.groupName);
|
|
this.modal.hide();
|
|
},
|
|
},
|
|
};
|
|
</script>
|