Files
threshold-ui/addons/api/addon/models/recording.js
T
Zhihe Li b9cf61932b feat: 🎸 Add session recording models (#100)
* feat: 🎸 Add session recording models

✅ Closes: ICU-8075
2023-03-07 16:38:41 -05:00

26 lines
630 B
JavaScript

import GeneratedRecordingModel from '../generated/models/recording';
import { hasMany } from '@ember-data/model';
export const TYPE_RECORDING_SSH = 'ssh';
export const TYPES_RECORDING = Object.freeze([TYPE_RECORDING_SSH]);
export default class RecordingModel extends GeneratedRecordingModel {
@hasMany('connection') connections;
/**
* True if the recording type is `ssh`.
* @type {boolean}
*/
get isSSH() {
return this.type === TYPE_RECORDING_SSH;
}
/**
* True if the recording is an unknown type.
* @type {boolean}
*/
get isUnknown() {
return !TYPES_RECORDING.includes(this.type);
}
}