github.com/hernad/nomad@v1.6.112/ui/app/controllers/servers/server/index.js (about)

     1  /**
     2   * Copyright (c) HashiCorp, Inc.
     3   * SPDX-License-Identifier: MPL-2.0
     4   */
     5  
     6  import Controller from '@ember/controller';
     7  import { action, computed } from '@ember/object';
     8  import classic from 'ember-classic-decorator';
     9  
    10  @classic
    11  export default class ServerController extends Controller {
    12    activeTab = 'tags';
    13  
    14    @computed('model.tags')
    15    get sortedTags() {
    16      const tags = this.get('model.tags') || {};
    17      return Object.keys(tags)
    18        .map((name) => ({
    19          name,
    20          value: tags[name],
    21        }))
    22        .sortBy('name');
    23    }
    24  
    25    @action
    26    setTab(tab) {
    27      this.set('activeTab', tab);
    28    }
    29  }