Run some sanity checks/validations on the private key input. Cannot save it unless the field is valid.
This commit is contained in:
@@ -15,6 +15,7 @@ import {
|
||||
setPermission,
|
||||
KINDS,
|
||||
humanPermission,
|
||||
validateKey,
|
||||
} from './utils';
|
||||
|
||||
const log = console.log;
|
||||
@@ -258,6 +259,16 @@ Alpine.data('options', () => ({
|
||||
this.profileName !== this.pristineProfileName
|
||||
);
|
||||
},
|
||||
|
||||
get validKey() {
|
||||
return validateKey(this.privKey);
|
||||
},
|
||||
|
||||
get validKeyClass() {
|
||||
return this.validKey
|
||||
? ''
|
||||
: 'ring-2 ring-rose-500 focus:ring-2 focus:ring-rose-500 border-transparent focus:border-transparent';
|
||||
},
|
||||
}));
|
||||
|
||||
Alpine.start();
|
||||
|
||||
Reference in New Issue
Block a user