@@ -90,7 +90,8 @@ export class ApiManageComponent implements OnInit {
9090 const sle_details_re = / h t t p s : \/ \/ ( m a n a g e | i n t e g r a t i o n | m a n a g e - s t a g i n g ) \. (?< host > [ a - z 0 - 9 . ] * ( m i s t | m i s t s y s | m i s t - f e d e r a l ) \. c o m ) \/ a d m i n \/ \? o r g _ i d = (?< org_id > [ 0 - 9 a - f - ] { 36 } ) # ! d a s h b o a r d \/ (?< detail > s e r v i c e L e v e l s | w i r e d s e r v i c e L e v e l s | w a n S e r v i c e L e v e l s | j u n i p e r G a t e w a y ) \/ p a g e 2 \/ ( s t a t s | t i m e l i n e ) \/ [ a - z A - Z - ] + \/ [ a - z A - Z - ] + \/ (?< scope > s i t e | d e v i c e | c l i e n t | j u n i p e r S w i t c h | j u n i p e r G a t e w a y ) \/ (?< scope_id > [ a - f 0 - 9 - ] * ) \/ (?< sle_name > [ a - z - ] * ) \/ (?< sle_sub_1 > [ a - z A - Z - ] + ) \/ (?< sle_sub_2 > [ a - z A - Z - ] + ) ( \/ (?< period > [ 0 - 9 a - z ] * ) ) ? ( \/ (?< start > [ 0 - 9 ] * ) ) ? ( \/ (?< stop > [ 0 - 9 ] * ) ) ? \/ (?< site_id > [ a - f 0 - 9 - ] * ) / iys;
9191 const sle_re = / h t t p s : \/ \/ ( m a n a g e | i n t e g r a t i o n | m a n a g e - s t a g i n g ) \. (?< host > [ a - z 0 - 9 . ] * ( m i s t | m i s t s y s | m i s t - f e d e r a l ) \. c o m ) \/ a d m i n \/ \? o r g _ i d = (?< org_id > [ 0 - 9 a - f - ] { 36 } ) # ! d a s h b o a r d \/ (?< detail > s e r v i c e L e v e l s | w i r e d s e r v i c e L e v e l s | w a n S e r v i c e L e v e l s | j u n i p e r G a t e w a y | a p p l i c a t i o n S e r v i c e L e v e l s ) ( \/ (?< scope > o r g | s i t e | d e v i c e | c l i e n t | j u n i p e r S w i t c h | j u n i p e r G a t e w a y ) ) ? ( \/ (?< scope_id > [ a - f 0 - 9 - ] * ) ) ? ( \/ (?< period > [ 0 - 9 a - z - ] * ) ) ? ( \/ (?< start > [ 0 - 9 ] * ) ) ? ( \/ (?< stop > [ 0 - 9 ] * ) ) ? \/ (?< site_id > [ a - f 0 - 9 - ] * ) ( \? a p p = (?< app > [ a - z A - Z ] * ) ) ? / iys;
9292 const insights_re = / h t t p s : \/ \/ ( m a n a g e | i n t e g r a t i o n | m a n a g e - s t a g i n g ) \. (?< host > [ a - z 0 - 9 . ] * ( m i s t | m i s t s y s | m i s t - f e d e r a l ) \. c o m ) \/ a d m i n \/ \? o r g _ i d = (?< org_id > [ 0 - 9 a - f - ] { 36 } ) # ! d a s h b o a r d \/ (?< detail > i n s i g h t s | i n s i g h t s - f u l l - s t a c k ) \/ ( (?< obj > [ a - z ] + ) \/ ) ? ( (?< obj_id > [ a - z 0 - 9 - ] + ) \/ ) ? ( (?< period > [ a - z 0 - 9 ] + ) \/ ) ? ( (?< start > [ 0 - 9 ] * ) \/ ) ? ( (?< stop > [ 0 - 9 ] * ) \/ ) ? (?< site_id > [ 0 - 9 a - f - ] { 36 } ) ? / iys;
93- const alarm_re = / h t t p s : \/ \/ ( m a n a g e | i n t e g r a t i o n | m a n a g e - s t a g i n g ) \. (?< host > [ a - z 0 - 9 . ] * ( m i s t | m i s t s y s | m i s t - f e d e r a l ) \. c o m ) \/ a d m i n \/ \? o r g _ i d = (?< org_id > [ 0 - 9 a - f - ] { 36 } ) # ! a l e r t s \/ ? (?< scope > o r g | s i t e ) ? \/ ? (?< uuid > [ 0 - 9 a - z - ] * ) \/ ? (?< period > [ 0 - 9 a - z ] * ) ? \/ ? (?< start > [ 0 - 9 ] * ) ? \/ ? (?< stop > [ 0 - 9 ] * ) ? \/ ? (?< show_ack > t r u e | f a l s e ) ? \/ ? (?< group > [ a - z % 0 - 9 ] * ) ? \/ ? (?< show_crit > t r u e | f a l s e ) ? \/ ? (?< show_warn > t r u e | f a l s e ) ? \/ ? (?< show_info > t r u e | f a l s e ) ? \/ ? (?< site_id > [ 0 - 9 a - z - ] * ) ? / iys;
93+ //const alarm_re = /https:\/\/(manage|integration|manage-staging)\.(?<host>[a-z0-9.]*(mist|mistsys|mist-federal)\.com)\/admin\/\?org_id=(?<org_id>[0-9a-f-]{36})#!alerts\/?(?<scope>org|site)?\/?(?<uuid>[0-9a-z-]*)\/?(?<period>[0-9a-z]*)?\/?(?<start>[0-9]*)?\/?(?<stop>[0-9]*)?\/?(?<show_ack>true|false)?\/?(?<group>[a-z%0-9]*)?\/?(?<show_crit>true|false)?\/?(?<show_warn>true|false)?\/?(?<show_info>true|false)?\/?(?<site_id>[0-9a-z-]*)?/iys;
94+ const alarm_re = / h t t p s : \/ \/ ( m a n a g e | i n t e g r a t i o n | m a n a g e - s t a g i n g ) \. (?< host > [ a - z 0 - 9 . ] * ( m i s t | m i s t s y s | m i s t - f e d e r a l ) \. c o m ) \/ a d m i n \/ \? o r g _ i d = (?< org_id > [ 0 - 9 a - f - ] { 36 } ) # ! a l e r t s \/ ? (?< site_id > [ 0 - 9 a - z - ] * ) \? ? (?< query_param > .* ) ? $ / iys;
9495 const events_re = / h t t p s : \/ \/ ( m a n a g e | i n t e g r a t i o n | m a n a g e - s t a g i n g ) \. (?< host > [ a - z 0 - 9 . ] * ( m i s t | m i s t s y s | m i s t - f e d e r a l ) \. c o m ) \/ a d m i n \/ \? o r g _ i d = (?< org_id > [ 0 - 9 a - f - ] { 36 } ) # ! m a r v i s \/ ? (?< scope > o r g | s i t e ) ? \/ ? (?< period > [ 0 - 9 a - z ] * ) ? \/ ? (?< start > [ 0 - 9 ] * ) ? \/ ? (?< stop > [ 0 - 9 ] * ) ? \/ ? (?< site_id > [ 0 - 9 a - z - ] * ) ? / iys;
9596 const floorplans_re = / h t t p s : \/ \/ ( m a n a g e | i n t e g r a t i o n | m a n a g e - s t a g i n g ) \. (?< host > [ a - z 0 - 9 . ] * ( m i s t | m i s t s y s | m i s t - f e d e r a l ) \. c o m ) \/ a d m i n \/ \? o r g _ i d = (?< org_id > [ 0 - 9 a - f - ] { 36 } ) # ! c l i L o c a t i o n \/ (?< detail > v i e w | c o n f i g | v a l i d a t i o n P a t h | w a y f i n d i n g ) ? \/ ? (?< uuid > [ 0 - 9 a - f - ] { 36 } ) \/ ? ( f l o o r p l a n | b e a c o n s A n d Z o n e s ) ? \/ ? (?< site_id > [ 0 - 9 a - f - ] { 36 } ) ? / iys;
9697 const site_evpn_re = / h t t p s : \/ \/ ( m a n a g e | i n t e g r a t i o n | m a n a g e - s t a g i n g ) \. (?< host > [ a - z 0 - 9 . ] * ( m i s t | m i s t s y s | m i s t - f e d e r a l ) \. c o m ) \/ a d m i n \/ \? o r g _ i d = (?< org_id > [ 0 - 9 a - f - ] { 36 } ) # ! e v p n \/ s i t e \/ ? ( [ 0 - 9 ] \/ ) ? (?< site_id > [ 0 - 9 a - z _ - ] * ) ? ( \/ (?< topology_id > [ 0 - 9 a - f - ] { 36 } ) ) ? / yis;
@@ -1181,7 +1182,7 @@ export class ApiManageComponent implements OnInit {
11811182 alarmUrl ( res : RegExpExecArray ) : void {
11821183 this . org_id = res ?. groups ?. org_id ;
11831184 let extra_params = "" ;
1184- let severity_array : string [ ] = [ ] ;
1185+ let extra_params_array : string [ ] = [ ] ;
11851186 let scope = "" ;
11861187 let scope_id : string | undefined = undefined ;
11871188 if ( res ?. groups ?. uuid ) {
@@ -1197,20 +1198,22 @@ export class ApiManageComponent implements OnInit {
11971198 scope_id = res ?. groups ?. org_id ;
11981199 }
11991200
1200- if ( res ?. groups ?. start && res ?. groups ?. stop ) {
1201- extra_params = "start=" + res ?. groups ?. start + "&end=" + res ?. groups ?. stop ;
1201+ if ( res ?. groups ?. query_param ) {
1202+ res ?. groups ?. query_param . split ( "&" ) . forEach ( param => {
1203+ let key = param . split ( "=" ) [ 0 ] ;
1204+ let value = param . split ( "=" ) [ 1 ] ;
1205+ switch ( key . toLowerCase ( ) ) {
1206+ case "start" :
1207+ extra_params_array . push ( "start=" + value ) ;
1208+ break ;
1209+ case "end" :
1210+ extra_params_array . push ( "end=" + value ) ;
1211+ break ;
1212+ }
1213+ } )
12021214 }
1203- if ( res ?. groups ?. show_crit && res ?. groups ?. show_crit == "true" ) severity_array . push ( "critical" ) ;
1204- if ( res ?. groups ?. show_warn && res ?. groups ?. show_warn == "true" ) severity_array . push ( "warn" ) ;
1205- if ( res ?. groups ?. show_info && res ?. groups ?. show_info == "true" ) severity_array . push ( "info" ) ;
1206- if ( severity_array . length > 0 ) extra_params += "&severity=" + severity_array . join ( "," ) ;
1207- //else extra_params += "&severity=none"
1208-
1209- if ( res ?. groups ?. group && res ?. groups ?. group != "any%20type" ) extra_params += "&group=" + res ?. groups ?. group ;
1210-
1211- if ( res ?. groups ?. show_ack && res ?. groups ?. show_ack == "false" ) extra_params += "&acked=false" ;
12121215
1213- if ( extra_params ) extra_params = "?" + extra_params ;
1216+ if ( extra_params_array ) extra_params = "?" + extra_params_array . join ( "&" ) ;
12141217 this . quick_links . push ( {
12151218 url : "https://api." + res ?. groups ?. host + "/api/v1/" + scope + "/" + scope_id + "/alarms/search" + extra_params ,
12161219 name : scope + " Alarms"
0 commit comments