mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add support for Prometheus api prefix (#341)
Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
1 parent
5c1974f07b
commit
bba6eb743d
3 files changed
+14
-4
No files matched your search
@@ -111,7 +111,7 @@ export default {
|
||||
updateValues: function(){
|
||||
if (this.cluster.preferences.prometheus) {
|
||||
const prom = this.cluster.preferences.prometheus;
|
||||
this.prometheusPath = `${prom.namespace}/${prom.service}:${prom.port}`
|
||||
this.prometheusPath = `${prom.namespace}/${prom.service}:${prom.port}${prom.prefix}`
|
||||
} else {
|
||||
this.prometheusPath = ""
|
||||
}
|
||||
@@ -122,11 +122,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]
|
||||
port: parsed[2],
|
||||
prefix: apiPrefix
|
||||
}
|
||||
},
|
||||
expandPath: function(value, event) {
|
||||
|
||||
Reference in new issue
Block a user