mirror of https://github.com/rancher/ui.git
Select project on admin/api tab, fix audit log sort
This commit is contained in:
parent
6b51953e39
commit
be04df203c
|
|
@ -13,13 +13,16 @@ export default Ember.Controller.extend(Sortable, {
|
|||
updateResourceType: function(type) {
|
||||
this.set('filters.resourceType', type);
|
||||
},
|
||||
|
||||
updateAuthType: function(type) {
|
||||
this.set('filters.authType', type.name);
|
||||
this.set('authTypeReadable', type.value);
|
||||
},
|
||||
|
||||
changeSort: function(name) {
|
||||
this._super(name);
|
||||
},
|
||||
|
||||
search: function() {
|
||||
this.setProperties({
|
||||
eventType: this.get('filters.eventType'),
|
||||
|
|
@ -30,6 +33,7 @@ export default Ember.Controller.extend(Sortable, {
|
|||
});
|
||||
this.send('filterLogs');
|
||||
},
|
||||
|
||||
showResponseObjects: function(request, response) {
|
||||
this.get('application').setProperties({
|
||||
showAuditLogResponses: true,
|
||||
|
|
@ -37,6 +41,7 @@ export default Ember.Controller.extend(Sortable, {
|
|||
responseObject: response,
|
||||
});
|
||||
},
|
||||
|
||||
clearAll: function() {
|
||||
this.set('filters', {
|
||||
accountId: null,
|
||||
|
|
@ -53,6 +58,7 @@ export default Ember.Controller.extend(Sortable, {
|
|||
resourceType: null,
|
||||
runtime: null,
|
||||
});
|
||||
|
||||
this.setProperties({
|
||||
eventType: null,
|
||||
resourceType: null,
|
||||
|
|
@ -60,8 +66,9 @@ export default Ember.Controller.extend(Sortable, {
|
|||
clientIp: null,
|
||||
authType: null,
|
||||
});
|
||||
|
||||
this.setProperties({
|
||||
sortBy: 'created',
|
||||
sortBy: 'id',
|
||||
sortOrder: 'desc',
|
||||
});
|
||||
this.set('authTypeReadable', null);
|
||||
|
|
@ -69,7 +76,7 @@ export default Ember.Controller.extend(Sortable, {
|
|||
},
|
||||
},
|
||||
|
||||
sortBy: 'created',
|
||||
sortBy: 'id',
|
||||
sortOrder: 'desc',
|
||||
descending: true,
|
||||
limit: 100,
|
||||
|
|
|
|||
|
|
@ -124,14 +124,14 @@ export default Ember.Route.extend({
|
|||
};
|
||||
if (params) {
|
||||
_.forEach(params, (item, key) => {
|
||||
if (key !== 'sortBy' && key !== 'sortOrder' && key !== 'forceReload') {
|
||||
if ( ['sortBy','sortOrder','forceReload'].indexOf(key) >= 0 ) {
|
||||
returnValue[key] = item;
|
||||
} else {
|
||||
if (item) {
|
||||
returnValue.filter[key] = item;
|
||||
} else {
|
||||
delete returnValue.filter[key];
|
||||
}
|
||||
} else {
|
||||
returnValue[key] = item;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
</div>
|
||||
<table class="grid fixed table table-hover r-mb15">
|
||||
<thead>
|
||||
{{sortable-th sortable=this action="changeSort" name="created" label="Time" width="115" class="r-pl10"}}
|
||||
{{sortable-th sortable=this action="changeSort" name="id" label="Time" width="115" class="r-pl10"}}
|
||||
{{sortable-th sortable=this action="changeSort" name="eventType" width="" class="r-pl10"}}
|
||||
{{sortable-th sortable=this action="changeSort" name="resourceType" label="Resource Type:Id" class="r-pl10"}}
|
||||
{{sortable-th sortable=this action="changeSort" name="clientIp" label="Request IP" width="150" class="r-pl10"}}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ export default Ember.Route.extend({
|
|||
|
||||
beforeModel: function() {
|
||||
this.get('store').findAllUnremoved('host').then((hosts) => {
|
||||
this.controllerFor('authenticated.help').set('hasHosts', hosts.get('length') > 0);
|
||||
this.controller.set('hasHosts', hosts.get('length') > 0);
|
||||
});
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ export default Ember.Route.extend({
|
|||
model(params, transition) {
|
||||
if ( !params.project_id )
|
||||
{
|
||||
// On first login, pick the default project
|
||||
// If there isn't a project, pick one
|
||||
return this.get('projects').selectDefault().then((project) => {
|
||||
if ( project )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -28,6 +28,18 @@ export default Ember.Route.extend({
|
|||
projects: this.loadProjects(),
|
||||
preferences: this.loadPreferences(),
|
||||
settings: this.loadPublicSettings(),
|
||||
}).then((hash) => {
|
||||
if ( transition.params && transition.params['authenticated.project'] && transition.params['authenticated.project'].project_id )
|
||||
{
|
||||
return hash;
|
||||
}
|
||||
else
|
||||
{
|
||||
// If not going to a project-specific page, make sure a project is selected
|
||||
return this.get('projects').selectDefault().then(() => {
|
||||
return hash;
|
||||
});
|
||||
}
|
||||
}).catch((err) => {
|
||||
return this.loadingError(err, transition, Ember.Object.create({
|
||||
projects: [],
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ export default Ember.Controller.extend(Sortable, {
|
|||
filtered: function() {
|
||||
var ns = this.get('model.ns');
|
||||
return (this.get('model.services')||[]).filter((row) => {
|
||||
console.log(row.get('environmentId'), ns.get('id'), row.get('kind'), row.get('state'));
|
||||
return (row.get('environmentId') === ns.get('id')) && row.get('kind').toLowerCase() === 'kubernetesreplicationcontroller' &&
|
||||
(['removing','removed','purging','purged'].indexOf(row.get('state')) === -1);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue