Skip to content

Commit

Permalink
feat(login): validate instance name
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Mertens <git@lukas-mertens.de>

commit-id:30783864
  • Loading branch information
lukas-mertens committed Mar 18, 2024
1 parent 134a9fd commit 3b90914
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/pages/LoginPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@
<v-container>
<v-row>
<v-col cols="12" sm="12">
<v-text-field label="Name of EVerest instance" v-model="edit_item.server.id" hint="For example 'Local', 'Development'...">
<v-text-field
label="Name of EVerest instance"
v-model="edit_item.server.id"
hint="For example 'Local', 'Development'..."
:rules="[validateInstanceName]"
>
</v-text-field>
</v-col>
</v-row>
Expand Down Expand Up @@ -152,6 +157,13 @@ export default defineComponent({
},
};
},
validateInstanceName(value: string): true | string {
if (value.trim().length < 1) {
return 'Please enter a name with at least one character.';
} else {
return true;
}
},
validateDomain(value: string): true | string {
if (value.includes('://')) {
return 'Please enter a domain without any protocol (e.g., "test.pionix.de").';
Expand Down

0 comments on commit 3b90914

Please sign in to comment.