@@ -40,8 +40,8 @@ export class ApplicationDetailComponent implements OnInit {
4040 const id = + this . route . snapshot . paramMap . get ( 'id' ) ;
4141 if ( id > 0 ) {
4242 var self = this ;
43- this . applicationService . getResponse ( 'getapp' , function ( obj : Application ) {
44- self . application = obj ;
43+ this . applicationService . getResponse ( 'getapp' , function ( obj : Application ) {
44+ self . application = obj ;
4545 } , id ) ;
4646 } else {
4747 this . readOnlyValue = false ;
@@ -65,6 +65,10 @@ export class ApplicationDetailComponent implements OnInit {
6565 setApplication ( ) {
6666 var self = this ;
6767 this . applicationService . getResponse ( 'updateapp' , function ( obj : Application ) {
68+ if ( obj == null ) {
69+ self . messageService . add ( "Update failed." ) ;
70+ return ;
71+ }
6872 let new_id = obj . id ;
6973 if ( self . application . id == new_id ) {
7074 self . application = obj ;
@@ -153,16 +157,10 @@ export class ApplicationDetailComponent implements OnInit {
153157 return ;
154158 }
155159 this . application . domains . splice ( i , 1 ) ;
156- //console.log(this.application.domains);
157160 }
158161
159162 ngOnInit ( ) {
160163 //init IPMethod enum
161- /*
162- var enum_ip_method_values = Object.values(IPMethod);
163- var ip_method_length = (enum_ip_method_values.length)/2;
164- this.enum_ip_method_values = enum_ip_method_values.slice(ip_method_length);
165- */
166164 for ( var n in IPMethod ) {
167165 if ( typeof IPMethod [ n ] == 'number' ) {
168166 this . enum_ip_method_values . push ( { value : < any > IPMethod [ n ] , name : n } ) ;
@@ -185,15 +183,15 @@ export class ApplicationDetailComponent implements OnInit {
185183 let self = this ;
186184 this . applicationService . getResponseByURL ( '/janusec-admin/oauth/get' ,
187185 function ( obj : OAuthInfo ) {
188- self . oauth = obj ;
186+ self . oauth = obj ;
189187 } ) ;
190188 }
191189
192190
193191 getCertificates ( ) {
194192 var self = this ;
195- this . applicationService . getResponse ( 'getcerts' , function ( obj : Certificate [ ] ) {
196- self . optionCertificates = obj . concat ( self . no_certificate ) ;
193+ this . applicationService . getResponse ( 'getcerts' , function ( obj : Certificate [ ] ) {
194+ self . optionCertificates = obj . concat ( self . no_certificate ) ;
197195 } ) ;
198196 }
199197
0 commit comments