github.com/hernad/nomad@v1.6.112/ui/app/models/token.js (about) 1 /** 2 * Copyright (c) HashiCorp, Inc. 3 * SPDX-License-Identifier: MPL-2.0 4 */ 5 6 import { alias } from '@ember/object/computed'; 7 import Model from '@ember-data/model'; 8 import { attr } from '@ember-data/model'; 9 import { hasMany } from '@ember-data/model'; 10 11 export default class Token extends Model { 12 @attr('string') secret; 13 @attr('string') name; 14 @attr('boolean') global; 15 @attr('date') createTime; 16 @attr('string') type; 17 @hasMany('policy') policies; 18 @attr() policyNames; 19 @attr('date') expirationTime; 20 21 @alias('id') accessor; 22 23 get isExpired() { 24 return this.expirationTime && this.expirationTime < new Date(); 25 } 26 }