github.com/hernad/nomad@v1.6.112/ui/app/controllers/allocations/allocation/fs.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 { computed } from '@ember/object';
     8  
     9  export default class FsController extends Controller {
    10    queryParams = [
    11      {
    12        sortProperty: 'sort',
    13      },
    14      {
    15        sortDescending: 'desc',
    16      },
    17    ];
    18  
    19    sortProperty = 'Name';
    20    sortDescending = false;
    21  
    22    path = null;
    23    allocation = null;
    24    directoryEntries = null;
    25    isFile = null;
    26    stat = null;
    27  
    28    @computed('path')
    29    get pathWithLeadingSlash() {
    30      const path = this.path;
    31  
    32      if (path.startsWith('/')) {
    33        return path;
    34      } else {
    35        return `/${path}`;
    36      }
    37    }
    38  }