github.com/Ilhicas/nomad@v1.0.4-0.20210304152020-e86851182bc3/ui/app/serializers/task.js (about)

     1  import ApplicationSerializer from './application';
     2  
     3  export default class Task extends ApplicationSerializer {
     4    normalize(typeHash, hash) {
     5      // Lift the reserved resource numbers out of the Resources object
     6      const resources = hash.Resources;
     7      if (resources) {
     8        hash.ReservedMemory = resources.MemoryMB;
     9        hash.ReservedCPU = resources.CPU;
    10        hash.ReservedDisk = resources.DiskMB;
    11        hash.ReservedEphemeralDisk = hash.EphemeralDisk.SizeMB;
    12      }
    13  
    14      return super.normalize(typeHash, hash);
    15    }
    16  }