Merge branch 'main' into chore-unknown-type
This commit is contained in:
9 files changed
+338
-9
No files matched your search
@@ -4,6 +4,58 @@ import { fragmentArray } from 'ember-data-model-fragments/attributes';
|
||||
export default class HostSetModel extends GeneratedHostSetModel {
|
||||
// =attributes
|
||||
|
||||
/**
|
||||
* Returns if the host-set is static or not.
|
||||
* @type {boolean}
|
||||
*/
|
||||
get isStatic() {
|
||||
return this.type === 'static';
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if the host-set is plugin or not.
|
||||
* @type {boolean}
|
||||
*/
|
||||
get isPlugin() {
|
||||
return this.type === 'plugin';
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if a host-set plugin is AWS or not
|
||||
* @type {boolean}
|
||||
*/
|
||||
get isAWS() {
|
||||
return this.compositeType === 'aws';
|
||||
}
|
||||
|
||||
/**
|
||||
* Return if a host-set plugin is Azure or not.
|
||||
*/
|
||||
get isAzure() {
|
||||
return this.compositeType === 'azure';
|
||||
}
|
||||
|
||||
/**
|
||||
* If a host-set is a plugin return its name,
|
||||
* otherwise returns the host-set type
|
||||
* @type {string}
|
||||
*/
|
||||
get compositeType() {
|
||||
return this.plugin ? this.plugin.name : this.type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets type, if type is different than static, set plugin name to type
|
||||
*/
|
||||
set compositeType(type) {
|
||||
if (type === 'static') {
|
||||
this.type = 'static';
|
||||
} else {
|
||||
this.type = 'plugin';
|
||||
this.plugin = { name: type };
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Host IDs are read-only under normal circumstances. But these can
|
||||
* be persisted via a dedicated call to `addHosts()`.
|
||||
|
||||
Reference in new issue
Block a user