mirror of
https://github.com/louislam/dockge.git
synced 2024-11-27 13:14:03 +00:00
Fix #19
This commit is contained in:
parent
54e8484efd
commit
d76442434f
3 changed files with 14 additions and 5 deletions
|
@ -72,9 +72,9 @@ export class Stack {
|
|||
}
|
||||
|
||||
validate() {
|
||||
// Check name, allows [a-z][A-Z][0-9] _ - only
|
||||
if (!this.name.match(/^[a-zA-Z0-9_-]+$/)) {
|
||||
throw new ValidationError("Stack name can only contain [a-z][A-Z][0-9] _ - only");
|
||||
// Check name, allows [a-z][0-9] _ - only
|
||||
if (!this.name.match(/^[a-z0-9_-]+$/)) {
|
||||
throw new ValidationError("Stack name can only contain [a-z][0-9] _ - only");
|
||||
}
|
||||
|
||||
// Check YAML format
|
||||
|
|
|
@ -68,9 +68,10 @@
|
|||
<h4 class="mb-3">{{ $t("general") }}</h4>
|
||||
<div class="shadow-box big-padding mb-3">
|
||||
<!-- Stack Name -->
|
||||
<div class="mb-3">
|
||||
<div>
|
||||
<label for="name" class="form-label">{{ $t("stackName") }}</label>
|
||||
<input id="name" v-model="stack.name" type="text" class="form-control" required>
|
||||
<input id="name" v-model="stack.name" type="text" class="form-control" required @blur="stackNameToLowercase">
|
||||
<div class="form-text">Lowercase only</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -582,6 +583,10 @@ export default {
|
|||
});
|
||||
},
|
||||
|
||||
stackNameToLowercase() {
|
||||
this.stack.name = this.stack?.name?.toLowerCase();
|
||||
},
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -680,6 +680,10 @@ code {
|
|||
}
|
||||
}
|
||||
|
||||
.form-text {
|
||||
color: $dark-font-color3;
|
||||
}
|
||||
|
||||
// Vue Prism Editor bug - workaround
|
||||
// https://github.com/koca/vue-prism-editor/issues/87
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue