1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Read the whole prometheus api prefix

Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
Lauri Nevala 2020-05-05 18:39:22 +03:00
parent 496c9c62b5
commit b989218604

View File

@ -84,7 +84,6 @@ export default {
},
prometheusPath: "",
prometheusProvider: "",
prometheusProviders: [],
}
},
mounted: async function() {
@ -108,12 +107,13 @@ export default {
}
},
parsePrometheusPath: function(path) {
let parsed = path.split(/\/|:/)
const parsed = path.split(/\/|:/, 3)
const apiPrefix = path.substring(parsed.join("/").length)
return {
namespace: parsed[0],
service: parsed[1],
port: parsed[2],
prefix: parsed[3] ? `/${parsed[3]}` : ''
prefix: apiPrefix
}
},
expandPath: function(value, event) {