mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-03 17:30:11 +00:00
fix for reference error (#5080)
This commit is contained in:
parent
315f9b6dcd
commit
c81c96416a
1 changed files with 12 additions and 3 deletions
|
|
@ -46,14 +46,23 @@ export default {
|
|||
},
|
||||
onClick: function(e) {
|
||||
|
||||
let url;
|
||||
const element = this.getElementAtEvent(e);
|
||||
const httpPrefix = http_prefix || location.origin;
|
||||
|
||||
|
||||
// if you click on at least 1 element ...
|
||||
if (element.length > 0) {
|
||||
|
||||
const dataset = this.config.data.datasets[element[0]._datasetIndex];
|
||||
const data = dataset.data[element[0]._index];
|
||||
window.location.href = new URL(dataset.baseUrl + data.link, httpPrefix).toString(); // Jump to this host
|
||||
|
||||
if (typeof http_prefix === "undefined") {
|
||||
url = new URL(dataset.baseUrl + data.link, location.origin).toString();
|
||||
}
|
||||
else {
|
||||
url = http_prefix + dataset.baseUrl + data.link;
|
||||
}
|
||||
|
||||
window.location.href = url;
|
||||
}
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue