mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-23 14:54:05 +00:00
Feat: Don't allow commas in tag names
This commit is contained in:
parent
f38da99c11
commit
d3a5b224cc
1 changed files with 14 additions and 2 deletions
|
@ -17,11 +17,15 @@
|
|||
v-model="tag.name"
|
||||
type="text"
|
||||
class="form-control"
|
||||
:class="{'is-invalid': nameInvalid}"
|
||||
:class="{'is-invalid': nameInvalid || nameContainsComma}"
|
||||
required
|
||||
>
|
||||
<div class="invalid-feedback">
|
||||
{{ $t("Tag with this name already exist.") }}
|
||||
{{
|
||||
nameInvalid
|
||||
? $t("Tag with this name already exist.")
|
||||
: $t("Tag name contains a comma.")
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -160,6 +164,7 @@ export default {
|
|||
addingMonitor: [],
|
||||
selectedAddMonitor: null,
|
||||
nameInvalid: false,
|
||||
nameContainsComma: false,
|
||||
};
|
||||
},
|
||||
|
||||
|
@ -260,6 +265,13 @@ export default {
|
|||
this.nameInvalid = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
this.nameContainsComma = false;
|
||||
if (this.tag?.name?.includes(",")) {
|
||||
this.nameContainsComma = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue