mirror of https://github.com/rancher/ui.git
Fixes
This commit is contained in:
parent
cc87384fcc
commit
ccd2a840db
|
|
@ -0,0 +1,4 @@
|
|||
import DriverView from 'ui/hosts/new/driver-view';
|
||||
|
||||
export default DriverView.extend({
|
||||
});
|
||||
|
|
@ -29,6 +29,8 @@ const defaultStateMap = {
|
|||
'unhealthy': {icon: 'icon icon-alert', color: 'text-danger' },
|
||||
'updating': {icon: 'icon icon-tag', color: 'text-info' },
|
||||
'updating-active': {icon: 'icon icon-tag', color: 'text-info' },
|
||||
'updating-healthy': {icon: 'icon icon-tag', color: 'text-info' },
|
||||
'updating-unhealthy': {icon: 'icon icon-tag', color: 'text-info' },
|
||||
'updating-reinitializing': {icon: 'icon icon-alert', color: 'text-info' },
|
||||
'updating-inactive': {icon: 'icon icon-tag', color: 'text-info' },
|
||||
};
|
||||
|
|
@ -507,7 +509,7 @@ export default Ember.Mixin.create({
|
|||
doAction: function(name, data, opt) {
|
||||
var promise = this._super.apply(this, arguments);
|
||||
|
||||
if ( opt && opt.catchGrowl !== false )
|
||||
if ( !opt || opt.catchGrowl !== false )
|
||||
{
|
||||
return promise.catch((err) => {
|
||||
this.get('growl').fromError(Util.ucFirst(name) + ' Error', err);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import Ember from 'ember';
|
||||
import Resource from 'ember-api-store/models/resource';
|
||||
import C from 'ui/utils/constants';
|
||||
import Util from 'ui/utils/util';
|
||||
|
||||
var Container = Resource.extend({
|
||||
// Common to all instances
|
||||
|
|
@ -158,6 +159,18 @@ var Container = Resource.extend({
|
|||
return this.get('primaryAssociatedIpAddress') || this.get('primaryIpAddress') || new Ember.Handlebars.SafeString('<span class="text-muted">None</span>');
|
||||
}.property('primaryIpAddress','primaryAssociatedIpAddress'),
|
||||
|
||||
sortIp: function() {
|
||||
var ip = this.get('primaryAssociatedIpAddress') || this.get('primaryIpAddress');
|
||||
if ( !ip ) {
|
||||
return '';
|
||||
}
|
||||
var match = ip.match(/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/);
|
||||
if ( match )
|
||||
{
|
||||
return match.slice(1).map((octet) => { return Util.strPad(octet,3,'0',false); }).join(".");
|
||||
}
|
||||
}.property('primaryIpAddress','primaryAssociatedIpAddress'),
|
||||
|
||||
canDelete: function() {
|
||||
return ['removed','removing','purging','purged'].indexOf(this.get('state')) === -1;
|
||||
}.property('state'),
|
||||
|
|
|
|||
|
|
@ -10,7 +10,8 @@ export default Ember.Controller.extend(Sortable, ContainerSparkStats, {
|
|||
sorts: {
|
||||
state: ['stateSort','name','id'],
|
||||
name: ['name','id'],
|
||||
ip: ['displayIp','name','id'],
|
||||
ip: ['sortIp','name','id'],
|
||||
host: ['primaryHost.displayName','name','id'],
|
||||
image: ['imageUuid','command','name','id'],
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -112,7 +112,12 @@ export default Ember.Service.extend({
|
|||
session.setProperties(interesting);
|
||||
return res;
|
||||
}).catch((res) => {
|
||||
var err = JSON.parse(res.xhr.responseText);
|
||||
let err;
|
||||
try {
|
||||
err = JSON.parse(res.xhr.responseText);
|
||||
} catch(e) {
|
||||
err = {type: 'error', message: 'Error logging in'};
|
||||
}
|
||||
return Ember.RSVP.reject(err);
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -2,9 +2,10 @@ import Ember from 'ember';
|
|||
|
||||
export default Ember.Service.extend({
|
||||
choices() {
|
||||
var store = this.get('store');
|
||||
return Ember.RSVP.hash({
|
||||
environments: this.get('store').findAllUnremoved('environment'),
|
||||
services: this.get('store').findAllUnremoved('service'),
|
||||
environments: store.findAllUnremoved('environment'),
|
||||
services: store.find('service', null, {forceReload: true}) // Need force-reload to get response with mixed types
|
||||
}).then((hash) => {
|
||||
return hash.services.map((service) => {
|
||||
return {
|
||||
|
|
|
|||
Loading…
Reference in New Issue