This repository was archived by the owner on Apr 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ const spanPasswordNotice = document.getElementById("spanPasswordNotice") as HTML
1212
1313// Add key listener to password input
1414inputPassword ?. addEventListener ( "keyup" , function ( event ) {
15- if ( event . keyCode === 13 ) {
15+ if ( event . keyCode === 13 || event . key === "Enter" ) {
1616 event . preventDefault ( ) ;
1717 loadFramework ( ) ;
1818 }
Original file line number Diff line number Diff line change @@ -146,6 +146,7 @@ export async function deleteInstance(): Promise<void> {
146146
147147// Create button
148148export async function createInstance ( ) : Promise < void > {
149+ showError ( undefined ) ;
149150 const service = selectService . options [ selectService . options . selectedIndex ] . value ;
150151 const name = inputInstanceName . value ;
151152
@@ -154,7 +155,13 @@ export async function createInstance(): Promise<void> {
154155 instanceName : name ,
155156 } ;
156157
157- await sendAuthenticatedMessage ( "createServiceInstance" , msg ) ;
158+ try {
159+ await sendAuthenticatedMessage ( "createServiceInstance" , msg ) ;
160+ } catch ( e ) {
161+ showError ( e ) ;
162+ return ;
163+ }
164+
158165 // Give the browser some time to create the new instance select option and to add them to the DOM
159166 setTimeout ( ( ) => {
160167 selectServiceInstance ( name ) ;
Original file line number Diff line number Diff line change @@ -45,6 +45,10 @@ export class InstanceManager extends EventEmitter {
4545 * @return void if everything went fine and a string describing the issue if not
4646 */
4747 createServiceInstance ( serviceType : string , instanceName : string ) : Result < void > {
48+ if ( ! instanceName ) {
49+ return error ( "Instance name must not be empty." ) ;
50+ }
51+
4852 // Check if a instance with the same name already exists.
4953 if ( this . serviceInstances [ instanceName ] !== undefined ) {
5054 return error ( "A service instance with the same name already exists." ) ;
You can’t perform that action at this time.
0 commit comments