Skip to content

Commit 038573c

Browse files
authored
Merge pull request #1612 from tomerlange/istio-ui
ui: add istio network filter
2 parents aaf1fcb + 10866a5 commit 038573c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

statics/js/components/topology.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,10 @@ var TopologyComponent = {
502502
isK8SEnabled: function() {
503503
return app.getConfigValue('k8s_enabled') || (globalVars["probes"].indexOf("k8s") >= 0);
504504
},
505+
506+
isIstioEnabled: function() {
507+
return app.getConfigValue('istio_enabled')
508+
},
505509

506510
metadataLinks: function(m) {
507511
var self = this;
@@ -585,6 +589,14 @@ var TopologyComponent = {
585589
this.addFilterK8s(control, label, this.gremlinK8sTypes(types));
586590
},
587591

592+
addFilterIstio: function(control, label, gremlin) {
593+
this.addFilter(control, "istio " + label, gremlin);
594+
},
595+
596+
addFilterIstioTypes: function(control, label, types) {
597+
this.addFilterIstio(control, label, this.gremlinK8sTypes(types));
598+
},
599+
588600
setGremlinFavoritesFromConfig: function() {
589601
var self = this;
590602

@@ -633,6 +645,11 @@ var TopologyComponent = {
633645
self.addFilterK8sTypes(highlight, "storage", ["persistentvolume", "persistentvolumeclaim", "storageclass"]);
634646
}
635647

648+
if (self.isIstioEnabled()) {
649+
self.addFilterIstioTypes(filter, "network", ["cluster", "container", "namespace", "pod", "virtualservice", "gateway"]);
650+
self.addFilterIstioTypes(highlight, "network", ["pod", "virtualservice", "gateway"]);
651+
}
652+
636653
var default_filter = app.getConfigValue('topology.default_filter');
637654
if (default_filter) {
638655
var value = favorites[default_filter];

0 commit comments

Comments
 (0)