mirror of https://github.com/rancher/ui.git
Merge pull request #3231 from loganhz/istio
Show refresh btn for istio graph
This commit is contained in:
commit
a400794334
|
|
@ -20,10 +20,17 @@ export default Component.extend({
|
|||
this._super();
|
||||
},
|
||||
|
||||
actions: {
|
||||
refreshGraph() {
|
||||
document.getElementById('kiali-iframe').contentWindow.location.href = this.getKialiUrl();
|
||||
this.namespaceDidChange();
|
||||
}
|
||||
},
|
||||
|
||||
namespaceDidChange: observer('namespace', function() {
|
||||
this.clearInterval();
|
||||
set(this, 'loading', true);
|
||||
set(this, 'url', `/k8s/clusters/${ get(this, 'scope.currentCluster.id') }/api/v1/namespaces/istio-system/services/http:kiali-http:80/proxy/console/graph/namespaces/?edges=noEdgeLabels&graphType=versionedApp&namespaces=${ get(this, 'namespace') }&unusedNodes=true&injectServiceNodes=true&layout=dagre`);
|
||||
set(this, 'url', this.getKialiUrl());
|
||||
|
||||
const intervalAnchor = setInterval(() => {
|
||||
if ( $('#kiali-iframe').contents().find('#root .login-pf').length === 0 && $('#kiali-iframe').contents().find('#root .pf-c-page').length === 1 ) {
|
||||
|
|
@ -41,6 +48,10 @@ export default Component.extend({
|
|||
}
|
||||
})),
|
||||
|
||||
getKialiUrl() {
|
||||
return `/k8s/clusters/${ get(this, 'scope.currentCluster.id') }/api/v1/namespaces/istio-system/services/http:kiali-http:80/proxy/console/graph/namespaces/?edges=noEdgeLabels&graphType=versionedApp&namespaces=${ get(this, 'namespace') }&unusedNodes=true&injectServiceNodes=true&layout=dagre`;
|
||||
},
|
||||
|
||||
clearInterval() {
|
||||
const intervalAnchor = get(this, 'intervalAnchor');
|
||||
|
||||
|
|
|
|||
|
|
@ -1,16 +1,24 @@
|
|||
{{#if namespaces.length}}
|
||||
<div class="row text-left mb-5">
|
||||
<div class="pull-left pl-20 pt-0 mr-10">
|
||||
<label class="acc-label">
|
||||
{{t "generic.namespace"}}:
|
||||
</label>
|
||||
{{new-select
|
||||
content=namespaces
|
||||
classNames="namespace-select text-black"
|
||||
value=namespace
|
||||
optionValuePath="id"
|
||||
optionLabelPath="displayName"
|
||||
}}
|
||||
<div class="inline-block">
|
||||
<label class="acc-label">
|
||||
{{t "generic.namespace"}}:
|
||||
</label>
|
||||
{{new-select
|
||||
content=namespaces
|
||||
classNames="namespace-select text-black"
|
||||
value=namespace
|
||||
optionValuePath="id"
|
||||
optionLabelPath="displayName"
|
||||
}}
|
||||
</div>
|
||||
<button
|
||||
class="btn btn-sm bg-default"
|
||||
{{action "refreshGraph"}}
|
||||
>
|
||||
{{t "istio.refreshGraph"}}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{{#if loading}}
|
||||
|
|
|
|||
|
|
@ -87,6 +87,7 @@ clusterIstioPage:
|
|||
enableMonitoring:
|
||||
label: Enable Monitoring
|
||||
istio:
|
||||
refreshGraph: Refresh Graph
|
||||
noData: Not enough data for graph
|
||||
period: Period
|
||||
table:
|
||||
|
|
|
|||
Loading…
Reference in New Issue