open-nomad/ui/app/controllers/servers/index.js
2023-04-10 15:36:59 +00:00

38 lines
795 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import { alias } from '@ember/object/computed';
import Controller, { inject as controller } from '@ember/controller';
import Sortable from 'nomad-ui/mixins/sortable';
export default class IndexController extends Controller.extend(Sortable) {
@controller('servers') serversController;
@alias('serversController.isForbidden') isForbidden;
@alias('model.nodes') nodes;
@alias('model.agents') agents;
queryParams = [
{
currentPage: 'page',
},
{
sortProperty: 'sort',
},
{
sortDescending: 'desc',
},
];
currentPage = 1;
pageSize = 8;
sortProperty = 'isLeader';
sortDescending = true;
@alias('agents') listToSort;
@alias('listSorted') sortedAgents;
}