Revision d233867a
b/snf-cyclades-app/synnefo/ui/static/snf/css/main.css | ||
---|---|---|
6552 | 6552 |
} |
6553 | 6553 |
|
6554 | 6554 |
.pane-view .collection-list-view .model-view .main-content .entry { |
6555 |
width: 310px;
|
|
6555 |
width: 290px;
|
|
6556 | 6556 |
padding-top: 5px; |
6557 | 6557 |
margin-left: 10px; |
6558 | 6558 |
float: left; |
b/snf-cyclades-app/synnefo/ui/static/snf/js/neutron.js | ||
---|---|---|
68 | 68 |
return this.get('router:external') || this.get('public') |
69 | 69 |
} |
70 | 70 |
], |
71 |
'cidr': [ |
|
72 |
['subnet'], function() { |
|
73 |
var subnet = this.get('subnet'); |
|
74 |
if (subnet && subnet.get('cidr')) { |
|
75 |
return subnet.get('cidr') |
|
76 |
} else { |
|
77 |
return undefined |
|
78 |
} |
|
79 |
} |
|
80 |
], |
|
71 | 81 |
'ext_status': [ |
72 |
['status'], function(st) { |
|
82 |
['status', 'cidr'], function(st) {
|
|
73 | 83 |
if (this.get('ext_status') == 'REMOVING') { |
74 | 84 |
return 'REMOVING' |
75 | 85 |
} |
... | ... | |
78 | 88 |
} else if (this.pending_disconnects) { |
79 | 89 |
return 'DISCONNECTING' |
80 | 90 |
} else { |
81 |
return st
|
|
91 |
return this.get('status')
|
|
82 | 92 |
} |
83 | 93 |
}], |
84 | 94 |
'in_progress': [ |
... | ... | |
91 | 101 |
] |
92 | 102 |
}, |
93 | 103 |
|
104 |
storage_attrs: { |
|
105 |
'subnets': ['subnets', 'subnet', function(model, attr) { |
|
106 |
var subnets = model.get(attr); |
|
107 |
if (subnets.length) { return subnets[0] } |
|
108 |
}] |
|
109 |
}, |
|
110 |
|
|
94 | 111 |
// call rename api |
95 | 112 |
rename: function(new_name, cb) { |
96 | 113 |
this.sync("update", this, { |
... | ... | |
113 | 130 |
pending_disconnects: 0, |
114 | 131 |
|
115 | 132 |
initialize: function() { |
116 |
models.Network.__super__.initialize.apply(this, arguments); |
|
117 | 133 |
var self = this; |
118 | 134 |
this.subnets = new Backbone.FilteredCollection(undefined, { |
119 | 135 |
collection: synnefo.storage.subnets, |
120 | 136 |
collectionFilter: function(m) { |
121 | 137 |
return self.id == m.get('network_id') |
122 |
}
|
|
123 |
});
|
|
138 |
}});
|
|
139 |
models.Network.__super__.initialize.apply(this, arguments);
|
|
124 | 140 |
this.ports = new Backbone.FilteredCollection(undefined, { |
125 | 141 |
collection: synnefo.storage.ports, |
126 | 142 |
collectionFilter: function(m) { |
... | ... | |
186 | 202 |
'status': 'ACTIVE', |
187 | 203 |
'router:external': true, |
188 | 204 |
'shared': false, |
189 |
'rename_disabled': true |
|
205 |
'rename_disabled': true, |
|
206 |
'subnets': [] |
|
190 | 207 |
}, |
191 | 208 |
|
192 | 209 |
initialize: function() { |
b/snf-cyclades-app/synnefo/ui/static/snf/js/ui/web/ui_networks_view.js | ||
---|---|---|
441 | 441 |
return "Internet" |
442 | 442 |
} |
443 | 443 |
|
444 |
status = this.status_map[this.model.get('ext_status')]; |
|
445 |
return status; |
|
444 |
var cidr = this.model.get('cidr'); |
|
445 |
var status = this.model.get('ext_status'); |
|
446 |
if (status != 'REMOVING' && cidr) { |
|
447 |
return cidr |
|
448 |
} |
|
449 |
return this.status_map[status]; |
|
446 | 450 |
}, |
447 | 451 |
|
448 | 452 |
connect_vms: function(vms, cb) { |
... | ... | |
462 | 466 |
e && e.stopPropagation(); |
463 | 467 |
this.model.actions.reset_pending(); |
464 | 468 |
this.model.destroy({ |
465 |
complete: _.bind(function() { |
|
466 |
this.model.set({status: 'REMOVING'}) |
|
467 |
this.model.set({ext_status: 'REMOVING'}) |
|
469 |
success: _.bind(function() { |
|
470 |
this.model.set({status: 'REMOVING'}); |
|
471 |
this.model.set({ext_status: 'REMOVING'}); |
|
472 |
// force status display update |
|
473 |
this.model.set({cidr: 'REMOVING'}); |
|
468 | 474 |
}, this), |
469 | 475 |
silent: true |
470 | 476 |
}); |
b/snf-cyclades-app/synnefo/ui/templates/partials/networks.html | ||
---|---|---|
184 | 184 |
</div> |
185 | 185 |
</div> |
186 | 186 |
<div class="entry-right"> |
187 |
<div data-rv-class="model.status|status_cls" class="status"> |
|
187 |
<div data-rv-class="model.ext_status|status_cls" class="status">
|
|
188 | 188 |
<div class="status-title"> |
189 |
<span data-rv-text="model.status|status_display">STATUS</span>
|
|
189 |
<span data-rv-text="model.cidr|status_display">STATUS</span>
|
|
190 | 190 |
<span data-rv-show="model.in_progress">...</span> |
191 | 191 |
</div> |
192 | 192 |
<div class="status-indicator clearfix"> |
Also available in: Unified diff