File tree Expand file tree Collapse file tree
src/angular/src/app/pages/api Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -77,10 +77,15 @@ export class ApiComponent implements OnInit {
7777 }
7878 forgeSiteStats ( groups : { [ key : string ] : string ; } , obj : string , extra_param : string ) : string {
7979 let url = "" ;
80+ this . obj_name = obj . substr ( 0 , obj . length - 1 ) . toUpperCase ( ) ;
8081 if ( groups . detail && groups . detail != "new" ) {
8182 this . obj_id = groups . uuid_1 ;
8283 this . site_id = groups . uuid_2 ;
8384 url = "https://api." + groups . host + "/api/v1/sites/" + groups . uuid_2 + "/stats/" + obj + "/" + groups . uuid_1 ;
85+ } else {
86+ this . site_id = groups . uuid_1 ;
87+ url = "https://api." + groups . host + "/api/v1/sites/" + groups . uuid_1 + "/stats/" + obj ;
88+ if ( extra_param ) url += "?" + extra_param
8489 }
8590 return url ;
8691 }
@@ -90,10 +95,9 @@ export class ApiComponent implements OnInit {
9095 this . api_url_stats_obj = "" ;
9196 const re = / h t t p s : \/ \/ m a n a g e \. (?< host > [ a - z 0 - 1 . ] * m i s t \. c o m ) \/ a d m i n \/ \? o r g _ i d = (?< org_id > [ 0 - 9 a - f - ] * ) # ! (?< obj > [ a - z ] + ) \/ ? (?< detail > d e t a i l | t e m p l a t e | s i t e | r f T e m p l a t e | a d m i n | e d g e d e t a i l | c l u s t e r d e t a i l | n e w ) ? \/ ? ( [ 0 - 9 ] ) * ?\/ ? (?< uuid_1 > [ 0 - 9 a - f - ] * ) ? \/ ? (?< uuid_2 > [ 0 - 9 a - f - ] * ) ? / gi;
9297 let res = re . exec ( this . tabUrl ) ;
93- console . log ( res )
9498 if ( res ) {
9599 this . org_id = res . groups . org_id ;
96- if ( res . groups . host && res . groups . org_id && res . groups . obj ) {
100+ if ( res . groups . host && res . groups . org_id && res . groups . obj ) {
97101 switch ( res . groups . obj . toLowerCase ( ) ) {
98102 // SITE
99103 case "ap" :
You can’t perform that action at this time.
0 commit comments