feat: 🎸 Add basic type support for host catalog
This commit is contained in:
1 parent
eb36be3688
commit
b3c49c43ea
5 files changed
+55
-6
No files matched your search
@@ -1,6 +1,14 @@
|
||||
import GeneratedHostCatalogModel from '../generated/models/host-catalog';
|
||||
|
||||
export default class HostCatalogModel extends GeneratedHostCatalogModel {
|
||||
/**
|
||||
* Returns if the host-catalog is static type or not.
|
||||
* @type {boolean}
|
||||
*/
|
||||
get isStatic() {
|
||||
return this.type === 'static';
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if the host-catalog is a plugin or not.
|
||||
* @type {boolean}
|
||||
@@ -24,4 +32,12 @@ export default class HostCatalogModel extends GeneratedHostCatalogModel {
|
||||
get isAzure() {
|
||||
return this.plugin.name === 'azure';
|
||||
}
|
||||
|
||||
/** If host-catalog is a plugins returns its name,
|
||||
* otherwise returns the host-catalog type
|
||||
* @type {string}
|
||||
*/
|
||||
get compositeType() {
|
||||
return this.isPlugin ? this.plugin.name : this.type;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user