Fix clusters display

This commit is contained in:
Vincent Fiduccia 2017-11-29 12:39:39 -07:00
parent c28f50659a
commit 602f92c9d4
No known key found for this signature in database
GPG Key ID: 2B29AD6BB2BB2582
8 changed files with 17 additions and 15 deletions

View File

@ -6,7 +6,7 @@ export default Route.extend({
scope: service(),
model: function() {
return this.get('clusterStore').find('node', null, {filter: {clusterId: this.get('scope.currentCluster.id')}}).then((nodes) => {
return this.get('clusterStore').find('clusterNode', null, {filter: {clusterId: this.get('scope.currentCluster.id')}}).then((nodes) => {
return {
hosts: nodes,
};

View File

@ -2,6 +2,6 @@ import Route from '@ember/routing/route';
export default Route.extend({
redirect() {
this.transitionTo('authenticated.clusters.cluster.hosts');
this.transitionTo('authenticated.clusters.cluster.projects');
},
});

View File

@ -8,10 +8,15 @@ export default Route.extend({
k8s: service(),
model() {
return EmberObject.create({
stacks: [],
});
/*
return hash({
stacks: this.get('clusterStore').find('stack'),
}).then((hash) => {
return EmberObject.create(hash);
});
*/
},
});

View File

@ -65,6 +65,13 @@ const rootNav = [
},
// Cluster
{
scope: 'cluster',
id: 'cluster-projects',
localizedLabel: 'nav.cluster.projects',
route: 'authenticated.clusters.cluster.projects.index',
ctx: [getClusterId],
},
{
scope: 'cluster',
id: 'cluster-hosts',
@ -77,7 +84,6 @@ const rootNav = [
id: 'cluster-k8s',
localizedLabel: 'nav.cluster.k8s',
route: 'authenticated.clusters.cluster.k8s',
condition: function() { return this.get(`cluster.isKubernetes`); },
ctx: [getClusterId],
},
{
@ -94,13 +100,6 @@ const rootNav = [
route: 'authenticated.clusters.cluster.storage',
ctx: [getClusterId],
},
{
scope: 'cluster',
id: 'cluster-projects',
localizedLabel: 'nav.cluster.projects',
route: 'authenticated.clusters.cluster.projects.index',
ctx: [getClusterId],
},
]
export function initialize(/*appInstance*/) {

View File

@ -12,8 +12,6 @@ var Cluster = Resource.extend(PolledResource, {
type: 'cluster',
state: 'active', // @TODO-2.0
actions: {
edit() {
this.get('router').transitionTo('authenticated.clusters.cluster.edit', this.get('id'));

View File

@ -4,7 +4,7 @@ import Resource from 'ember-api-store/models/resource';
import { parseExternalId } from 'ui/utils/parse-externalid';
import C from 'ui/utils/constants';
import { download } from 'shared/utils/util';
import { hasMany } from 'ember-api-store/utils/denormalize';
import { hasMany, reference } from 'ember-api-store/utils/denormalize';
import StateCounts from 'ui/mixins/state-counts';
export function activeIcon(ns)
@ -58,6 +58,7 @@ var Namespace = Resource.extend(StateCounts, {
pods: hasMany('id', 'pod', 'namespaceId'),
workloads: hasMany('id', 'workload', 'namespaceId'),
project: reference('projectId'),
init() {
this._super(...arguments);

View File

@ -18,8 +18,6 @@ var Project = Resource.extend(PolledResource, {
cookies: service(),
clusterStore: service('cluster-store'),
state: 'active', // @TODO-2.0
type: 'project',
name: null,
description: null,

View File

@ -0,0 +1 @@
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><style>.cls-1{fill:#4052d7;}.cls-2{fill:#387efa;}</style></defs><title>providers-resize</title><polygon class="cls-1" points="61.83 41.67 72 48.2 72 24.48 52.03 12.95 52.03 24.69 61.83 30.35 61.83 41.67"/><polygon class="cls-2" points="59.64 45.06 49.89 50.76 38.12 43.88 38.12 30.11 47.87 24.41 47.87 12.59 28 24.2 28 49.79 49.89 62.59 69.22 51.29 59.64 45.06"/><path class="cls-1" d="M54.86,43.76h-1.8l-4.8-6.38L46.88,38.6v5.16H45.35V30.6h1.53v6.53l6-6.53h1.81l-5.29,5.72Z"/><path class="cls-1" d="M11.8,74.19h1.52l3.59,10.61H15.47l-1-3.24H10.6l-1,3.24H8.21Zm-.86,6.29h3.19l-.5-1.62c-.39-1.18-.73-2.35-1.07-3.57h-.06c-.32,1.23-.66,2.39-1.05,3.57Z"/><path class="cls-1" d="M18.28,76.94h1.1l.11,1.13h0A3.45,3.45,0,0,1,22,76.75a2.06,2.06,0,0,1,2.17,1.5,3.71,3.71,0,0,1,2.59-1.5c1.62,0,2.39,1.07,2.39,3.07v5H27.81V80c0-1.47-.47-2.1-1.46-2.1a2.89,2.89,0,0,0-2,1.21v5.69H23.05V80c0-1.47-.47-2.1-1.47-2.1a3,3,0,0,0-2,1.21v5.69H18.28Z"/><path class="cls-1" d="M31.2,82.77c0-1.72,1.47-2.57,4.82-2.94,0-1-.32-2-1.62-2a4.28,4.28,0,0,0-2.35.84l-.52-.92a5.84,5.84,0,0,1,3.09-1c1.93,0,2.73,1.28,2.73,3.24v4.82h-1.1l-.11-.94h0A4.19,4.19,0,0,1,33.49,85,2.14,2.14,0,0,1,31.2,82.77Zm4.82.11V80.7c-2.62.32-3.53,1-3.53,2s.61,1.26,1.39,1.26A3.18,3.18,0,0,0,36,82.88Z"/><path class="cls-1" d="M39,84.09,43.15,78H39.46V76.94h5.37v.71l-4.14,6.07H45v1.08H39Z"/><path class="cls-1" d="M46,80.89c0-2.64,1.71-4.14,3.64-4.14s3.64,1.5,3.64,4.14S51.52,85,49.6,85,46,83.5,46,80.89Zm5.9,0c0-1.81-.91-3-2.26-3s-2.26,1.23-2.26,3,.92,3,2.26,3S51.86,82.69,51.86,80.89Z"/><path class="cls-1" d="M55.3,76.94h1.1l.11,1.13h0a3.71,3.71,0,0,1,2.64-1.33c1.65,0,2.39,1.07,2.39,3.07v5H60.27V80c0-1.47-.45-2.1-1.49-2.1-.81,0-1.36.42-2.15,1.21v5.69H55.3Z"/><path class="cls-1" d="M67.51,74.19h6.11v1.13H68.85v3.33h4v1.15h-4v3.85h4.93v1.15H67.51Z"/><path class="cls-1" d="M76,74.19h1.34v5.32h0l4.42-5.32h1.52l-3.32,4,3.83,6.57h-1.5L79.2,79.29l-1.83,2.15v3.37H76Z"/><path class="cls-1" d="M84.47,83.43l.81-.94a4.15,4.15,0,0,0,2.93,1.33c1.39,0,2.22-.7,2.22-1.73s-.76-1.42-1.76-1.88l-1.52-.66A3,3,0,0,1,85,76.81C85,75.2,86.39,74,88.32,74a4.41,4.41,0,0,1,3.14,1.31l-.73.87a3.38,3.38,0,0,0-2.41-1c-1.18,0-2,.6-2,1.55s.92,1.41,1.76,1.76l1.5.65c1.23.53,2.18,1.26,2.18,2.83s-1.37,3-3.61,3A5.15,5.15,0,0,1,84.47,83.43Z"/></svg>

After

Width:  |  Height:  |  Size: 2.3 KiB