fix: show loading-state when activating a cluster or adding new one

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman committed 2020-07-24 18:26:13 +03:00
1 parent 78a9fcde56
commit 4388558d2e
6 files changed
+43 -8

No files matched your search

+9 -2
View File
@@ -77,6 +77,10 @@ export class ClusterStore extends BaseStore<ClusterStoreModel> {
@observable removedClusters = observable.map<ClusterId, Cluster>();
@observable clusters = observable.map<ClusterId, Cluster>();
@computed get activeCluster(): Cluster | null {
return this.getById(this.activeClusterId);
}
@computed get clustersList(): Cluster[] {
return Array.from(this.clusters.values());
}
@@ -194,7 +198,10 @@ export class ClusterStore extends BaseStore<ClusterStoreModel> {
export const clusterStore = ClusterStore.getInstance<ClusterStore>();
export function getHostedClusterId() {
return location.hostname.split(".")[0];
}
export function getHostedCluster(): Cluster {
const clusterId = location.hostname.split(".")[0];
return clusterStore.getById(clusterId);
return clusterStore.getById(getHostedClusterId());
}