Skip to content

Commit

Permalink
adding new quicklinks
Browse files Browse the repository at this point in the history
  • Loading branch information
tmunzer committed Jul 22, 2024
1 parent 5b75426 commit ddc9df1
Show file tree
Hide file tree
Showing 11 changed files with 587 additions and 577 deletions.
Binary file modified .DS_Store
Binary file not shown.
1,097 changes: 545 additions & 552 deletions angular/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion angular/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mist-extension",
"version": "3.8.1",
"version": "3.9.0",
"description": "Generated with @larscom/ng-mist-extension",
"scripts": {
"start": "npm run watch",
Expand Down
48 changes: 30 additions & 18 deletions angular/src/app/pages/api/manage/manage.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ export class ApiManageComponent implements OnInit {

ngOnInit() {
this._browser.getUrl
.then(tabUrl => {
this.tabUrl = tabUrl;
this.generateApiUrl()
})
.error(error => { console.log(error) })
.catch(error => { console.log(error) })
.then(tabUrl => {
this.tabUrl = tabUrl;
this.generateApiUrl()
})
.error(error => { console.log(error) })
.catch(error => { console.log(error) })
}

////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -274,15 +274,22 @@ export class ApiManageComponent implements OnInit {
if (detail && detail != "new") {
// set QUICK LINK
url = "https://api." + host + "/api/v1/sites/" + this.site_id + "/" + obj_name + "/search?mac=" + this.obj_id;
this.quick_links.push({ url: url, name: this.obj_name });
this.quick_links.push({ url: url, name: obj_name.replace(/_/g, " ") });
} else {
// set QUICK LINK
url = "https://api." + host + "/api/v1/sites/" + this.site_id + "/" + obj_name + "/search";
if (extra_param) url += "?" + extra_param;
this.quick_links.push({ url: url, name: this.obj_name });
this.quick_links.push({ url: url, name: obj_name.replace(/_/g, " ") });
}
}

forgeSiteObjectStatsSearch(obj_name: string, host: string, extra_param: string | undefined = undefined): void {
let url = "";
url = "https://api." + host + "/api/v1/sites/" + this.site_id + "/stats/" + obj_name + "/search" ;
if (extra_param) url += "?" + extra_param;
this.quick_links.push({ url: url, name: obj_name.replace(/_/g, " ") + " STATS" });
}

forgeSiteObjectStats(obj_name: string, host: string, detail: string, extra_param: string | undefined = undefined): void {
let url = "";
if (detail && detail != "new") {
Expand Down Expand Up @@ -386,17 +393,17 @@ export class ApiManageComponent implements OnInit {
}
}
}
forgeSiteDeviceSyntheticTest(detail: string | undefined, host: string, device_type:string): void {
forgeSiteDeviceSyntheticTest(detail: string | undefined, host: string, device_type: string): void {
if (detail && this.obj_id) {
const mac = this.getMac(this.obj_id)
if (mac) {
this.quick_links.push({
url: "https://api." + host + "/api/v1/sites/" + this.site_id + "/synthetic_test/search?mac=" + mac,
name: "Marvis Minis Test Results"
})
const mac = this.getMac(this.obj_id)
if (mac) {
this.quick_links.push({
url: "https://api." + host + "/api/v1/sites/" + this.site_id + "/synthetic_test/search?mac=" + mac,
name: "Marvis Minis Test Results"
})
}
}
}
}
////////////////////////////////////////////////////////////////////////////////////
////////////////////// ORG OBJ FUNCTION
forgeOrg(host: string) {
Expand All @@ -409,6 +416,9 @@ export class ApiManageComponent implements OnInit {
}, {
url: "https://api." + host + "/api/v1/orgs/" + this.org_id + "/ssos",
name: "org ssos"
}, {
url: "https://api." + host + "/api/v1/orgs/" + this.org_id + "/ssoroles",
name: "org sso roles"
}, {
url: "https://api." + host + "/api/v1/orgs/" + this.org_id + "/webhooks",
name: "org webhooks"
Expand Down Expand Up @@ -679,6 +689,8 @@ export class ApiManageComponent implements OnInit {
this.forgeSiteObjectEvents("devices", res?.groups?.obj, res?.groups?.host, res?.groups?.detail);
this.forgeSiteDiscoveredSwitchUrl(res?.groups?.host);
this.forgeSiteDeviceSyntheticTest(res?.groups?.detail, res?.groups?.host, res?.groups?.obj);
this.forgeSiteObjectSearch("wired_clients", res?.groups?.host, null, "last_device_mac=" + this.obj_id.split("-")[4]);
this.forgeSiteObjectStatsSearch("switch_ports", res?.groups?.host, "mac=" + this.obj_id.split("-")[4]);
}
break;
case "assets":
Expand Down Expand Up @@ -810,7 +822,7 @@ export class ApiManageComponent implements OnInit {
}
res.groups[key] = value;
})
if (timeInterval)
if (timeInterval)
res.groups["end"] = this.process_time_interval(end, timeInterval);
}

Expand Down Expand Up @@ -1035,7 +1047,7 @@ export class ApiManageComponent implements OnInit {
this.site_id = res?.groups?.site_id;
let query_params = [];
let query_params_string = "";
if (res?.groups?.start) query_params.push("start="+ res?.groups?.start);
if (res?.groups?.start) query_params.push("start=" + res?.groups?.start);
if (res?.groups?.end) query_params.push("end=" + res?.groups?.end);
if (query_params) query_params_string = "?" + query_params.join("&");
if (this.site_id) {
Expand Down
2 changes: 1 addition & 1 deletion angular/src/assets/api.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion angular/src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 3,
"name": "Mist Extension",
"short_name": "mist-extension",
"version": "3.8.1",
"version": "3.9.0",
"description": "Web Browser Extension for Mist Developpers to provide easier access to Mist APIs",
"icons": {
"16": "assets/favicon-16x16.png",
Expand Down
2 changes: 1 addition & 1 deletion angular/src/manifest_chrome.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 3,
"name": "Mist Extension",
"short_name": "mist-extension",
"version": "3.8.1",
"version": "3.9.0",
"description": "Web Browser Extension for Mist Developpers to provide easier access to Mist APIs",
"icons": {
"16": "assets/favicon-16x16.png",
Expand Down
2 changes: 1 addition & 1 deletion angular/src/manifest_ffx.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 3,
"name": "Mist Extension",
"short_name": "mist-extension",
"version": "3.8.1",
"version": "3.9.0",
"description": "Web Browser Extension for Mist Developpers to provide easier access to Mist APIs",
"icons": {
"16": "assets/favicon-16x16.png",
Expand Down
2 changes: 1 addition & 1 deletion api.json

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions firefox_updates.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@
"version": "3.8.1",
"update_link": "https://github.com/Mist-Automation-Programmability/mist_browser_extension/releases/download/3.8.1/mist_extension-3.8.1.xpi",
"update_info_url": "https://github.com/Mist-Automation-Programmability/mist_browser_extension/releases/tag/3.8.1"
},
{
"version": "3.9.0",
"update_link": "https://github.com/Mist-Automation-Programmability/mist_browser_extension/releases/download/3.9.0/mist_extension-3.9.0.xpi",
"update_info_url": "https://github.com/Mist-Automation-Programmability/mist_browser_extension/releases/tag/3.9.0"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion mist_openapi
Submodule mist_openapi updated from ed577a to 2d7561

0 comments on commit ddc9df1

Please sign in to comment.