Skip to content

Commit cf83170

Browse files
committed
add quicklink for Org URL when at site level
1 parent 95b86cd commit cf83170

1 file changed

Lines changed: 23 additions & 1 deletion

File tree

src/angular/src/app/pages/api/manage/manage.component.ts

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export class ApiManageComponent implements OnInit {
6666
const events_re = /https:\/\/(manage|integration)\.(?<host>[a-z0-1.]*(mist|mistsys)\.com)\/admin\/\?org_id=(?<org_id>[0-9a-f-]*)#!marvis\/?(?<scope>org|site)?\/?(?<period>[0-9a-z]*)?\/?(?<start>[0-9]*)?\/?(?<stop>[0-9]*)?\/?(?<site_id>[0-9a-z-]*)?/iys;
6767
const floorplans_re = /https:\/\/(manage|integration)\.(?<host>[a-z0-1.]*mist\.com)\/admin\/\?org_id=(?<org_id>[0-9a-f-]*)#!cliLocation\/(?<detail>view|config|validationPath|wayfinding)?\/?(?<uuid>[0-9a-f-]*)\/?(floorplan|beaconsAndZones)?\/?(?<site_id>[0-9a-f-]*)?/iys;
6868
const evpn_re = /https:\/\/(manage|integration)\.(?<host>[a-z0-1.]*(mist|mistsys)\.com)\/admin\/\?org_id=(?<org_id>[0-9a-f-]*)#!evpn\/site\/?([0-9]\/)?(?<site_id>[0-9a-z_-]*)?(\/(?<topology_id>[0-9a-f-]*))?/yis;
69+
const site_wlan_template_re = /https:\/\/(manage|integration)\.(?<host>[a-z0-1.]*(mist|mistsys)\.com)\/admin\/\?org_id=(?<org_id>[0-9a-f-]*)#!wlan\/orgWlanDetail\/(?<template_id>[0-9a-z_-]*)\/(?<wlan_id>[0-9a-f-]*)\/(?<site_id>[0-9a-f-]*)/is;
6970
const site_common_re = /https:\/\/(manage|integration)\.(?<host>[a-z0-1.]*(mist|mistsys)\.com)\/admin\/\?org_id=(?<org_id>[0-9a-f-]*)#!(?<obj>[a-z]+)\/?((?<detail>detail|site|admin|edgedetail|clusterdetail|new|view)\/)?([0-9]\/)?((?<obj_id>[0-9a-z_-]*)\/)?(?<site_id>[0-9a-f-]*)?/yis;
7071
const site_common_objs = ["ap", "gateway", "switch", "assets", "wlan", "tags", "psk", "tunnels", "clients", "sdkclients", "wiredclients", "wxlan", "security", "switchconfig", "pcap"]
7172
const org_common_re = /https:\/\/(manage|integration)\.(?<host>[a-z0-1.]*(mist|mistsys)\.com)\/admin\/\?org_id=(?<org_id>[0-9a-f-]*)#!(?<obj>[a-z]+)\/?((?<detail>detail|site|admin|edgedetail|clusterdetail|new|view|template|rfTemplate)\/)?([0-9]\/)?((?<obj_id>[0-9a-z_-]*))/yis;
@@ -77,6 +78,7 @@ export class ApiManageComponent implements OnInit {
7778
const insights = insights_re.exec(this.tabUrl);
7879
const alarm = alarm_re.exec(this.tabUrl);
7980
const evpn = evpn_re.exec(this.tabUrl);
81+
const site_wlan_template = site_wlan_template_re.exec(this.tabUrl);
8082
const events = events_re.exec(this.tabUrl);
8183
const floorplans = floorplans_re.exec(this.tabUrl);
8284
const site_common = site_common_re.exec(this.tabUrl);
@@ -93,6 +95,8 @@ export class ApiManageComponent implements OnInit {
9395
this.alarmUrl(alarm);
9496
} else if (evpn) {
9597
this.evpnUrl(evpn);
98+
} else if (site_wlan_template) {
99+
this.siteWlanTemplateUrl(site_wlan_template);
96100
} else if (events) {
97101
this.eventsUrl(events);
98102
} else if (floorplans) {
@@ -473,6 +477,24 @@ export class ApiManageComponent implements OnInit {
473477
this.org_id = res.groups.org_id;
474478
}
475479

480+
////////////////////////////////////////////////////////////////////////////////////
481+
////////////////////////////////////////////////////////////////////////////////////
482+
////////////////////// ORG WLANS FUNCTION DISPATCHER FOR SITE URLS
483+
siteWlanTemplateUrl(res: RegExpExecArray): void {
484+
this.org_id = res.groups.org_id;
485+
this.site_id = res.groups.site_id;
486+
this.obj_id = res.groups.wlan_id;
487+
488+
this.quick_links.push(
489+
{
490+
url: "https://api." + res.groups.host + "/api/v1/orgs/" + this.org_id + "/wlans/" + res.groups.wlan_id,
491+
name: "Org Wlan in use"
492+
}, {
493+
url: "https://api." + res.groups.host + "/api/v1/orgs/" + this.org_id + "/templates/" + res.groups.template_id,
494+
name: "Org Config Template in use"
495+
});
496+
}
497+
476498
////////////////////////////////////////////////////////////////////////////////////
477499
////////////////////////////////////////////////////////////////////////////////////
478500
////////////////////// COMMON URL FUNCTION DISPATCHER FOR SITE URLS
@@ -586,7 +608,7 @@ export class ApiManageComponent implements OnInit {
586608
this.setName("org", res.groups.detail);
587609
this.forgeOrg(res.groups.host);
588610
break;
589-
case "configuration":
611+
case "configuration":
590612
this.setName("site", res.groups.detail);
591613
this.forgeSite(res.groups.host, res.groups.detail);
592614
break;

0 commit comments

Comments
 (0)