github.com/hernad/nomad@v1.6.112/ui/app/serializers/job-scale.js (about)

     1  /**
     2   * Copyright (c) HashiCorp, Inc.
     3   * SPDX-License-Identifier: MPL-2.0
     4   */
     5  
     6  import ApplicationSerializer from './application';
     7  import classic from 'ember-classic-decorator';
     8  
     9  @classic
    10  export default class JobScale extends ApplicationSerializer {
    11    mapToArray = [{ beforeName: 'TaskGroups', afterName: 'TaskGroupScales' }];
    12  
    13    normalize(modelClass, hash) {
    14      hash.PlainJobId = hash.JobID;
    15      hash.ID = JSON.stringify([hash.JobID, hash.Namespace || 'default']);
    16      hash.JobID = hash.ID;
    17  
    18      return super.normalize(modelClass, hash);
    19    }
    20  }