@@ -29,6 +29,7 @@ export default class ApiRequest extends LitElement {
29
29
static get properties ( ) {
30
30
return {
31
31
serverUrl : { type : String , attribute : 'server-url' } ,
32
+ servers : { type : Array } ,
32
33
method : { type : String } ,
33
34
path : { type : String } ,
34
35
parameters : { type : Array } ,
@@ -503,15 +504,20 @@ export default class ApiRequest extends LitElement {
503
504
}
504
505
505
506
apiCallTemplate ( ) {
507
+ // use default server url, if multiple overrides exists show select
508
+ let containerServer = this . serverUrl
509
+ ? html `${ this . serverUrl } `
510
+ : html `< div style ="font-weight:bold;color:var(--red) "> Not Set</ div > ` ;
511
+ if ( this . servers && this . servers . length > 0 ) {
512
+ const opts = this . servers . map ( ( value ) => html `< option value ="${ value . url } " selected ="${ value . url === this . serverUrl } " > ${ value . url } </ option > ` ) ;
513
+ containerServer = html `< select @change ='${ ( e ) => { this . serverUrl = e . target . value ; } } '> ${ opts } </ select > ` ;
514
+ }
506
515
return html `
507
516
< div style ="display:flex; align-items: center; margin:16px 0; font-size:var(--font-size-small); ">
508
517
< div style ="display:flex; flex-direction:column; margin:0; width:calc(100% - 60px); ">
509
518
< div style ="display:flex;flex-direction:row;overflow:hidden; ">
510
519
< div style ="font-weight:bold;padding-right:5px; "> API SERVER: </ div >
511
- ${ this . serverUrl
512
- ? html `${ this . serverUrl } `
513
- : html `< div style ="font-weight:bold;color:var(--red) "> Not Set</ div > `
514
- }
520
+ ${ containerServer }
515
521
</ div >
516
522
< div style ="display:flex; ">
517
523
< div style ="padding-right:5px; "> Authentication: </ div >
0 commit comments