Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/clusters/clusters_bundle.js')
-rw-r--r--app/assets/javascripts/clusters/clusters_bundle.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/app/assets/javascripts/clusters/clusters_bundle.js b/app/assets/javascripts/clusters/clusters_bundle.js
index 1f213d5aaf2..28850710f80 100644
--- a/app/assets/javascripts/clusters/clusters_bundle.js
+++ b/app/assets/javascripts/clusters/clusters_bundle.js
@@ -39,6 +39,7 @@ export default class Clusters {
updateKnativePath,
installPrometheusPath,
managePrometheusPath,
+ clusterEnvironmentsPath,
hasRbac,
clusterType,
clusterStatus,
@@ -79,6 +80,7 @@ export default class Clusters {
installJupyterEndpoint: installJupyterPath,
installKnativeEndpoint: installKnativePath,
updateKnativeEndpoint: updateKnativePath,
+ clusterEnvironmentsEndpoint: clusterEnvironmentsPath,
});
this.installApplication = this.installApplication.bind(this);
@@ -109,6 +111,10 @@ export default class Clusters {
this.initApplications(clusterType);
this.initEnvironments();
+ if (clusterEnvironmentsPath) {
+ this.fetchEnvironments();
+ }
+
this.updateContainer(null, this.store.state.status, this.store.state.statusReason);
this.addListeners();
@@ -162,6 +168,7 @@ export default class Clusters {
render(createElement) {
return createElement(Environments, {
props: {
+ isFetching: this.state.fetchingEnvironments,
environments: this.state.environments,
environmentsHelpPath: this.state.environmentsHelpPath,
clustersHelpPath: this.state.clustersHelpPath,
@@ -172,6 +179,18 @@ export default class Clusters {
});
}
+ fetchEnvironments() {
+ this.store.toggleFetchEnvironments(true);
+
+ this.service
+ .fetchClusterEnvironments()
+ .then(data => {
+ this.store.toggleFetchEnvironments(false);
+ this.store.updateEnvironments(data.data);
+ })
+ .catch(() => Clusters.handleError());
+ }
+
static initDismissableCallout() {
const callout = document.querySelector('.js-cluster-security-warning');
PersistentUserCallout.factory(callout);