diff options
Diffstat (limited to 'catalog-ui/src/app/models/graph/zones')
-rw-r--r-- | catalog-ui/src/app/models/graph/zones/policy-instance.ts | 43 | ||||
-rw-r--r-- | catalog-ui/src/app/models/graph/zones/zone-child.ts | 48 |
2 files changed, 91 insertions, 0 deletions
diff --git a/catalog-ui/src/app/models/graph/zones/policy-instance.ts b/catalog-ui/src/app/models/graph/zones/policy-instance.ts new file mode 100644 index 0000000000..63136e6e21 --- /dev/null +++ b/catalog-ui/src/app/models/graph/zones/policy-instance.ts @@ -0,0 +1,43 @@ +import { PropertyModel } from "app/models"; +import { CommonUtils } from "app/utils"; + + +export class PolicyInstance { + componentName:string; + description:string; + empty:boolean; + invariantName:string; + invariantUUID:string; + isFromCsar:boolean; + + name:string; + normalizedName:string; + policyTypeName:string; + policyTypeUid:string; + policyUUID:string; + properties:Array<PropertyModel>; + targets:Array<string>; + uniqueId:string; + version:string; + + constructor(policy?:PolicyInstance) { + this.componentName = policy.componentName; + this.description = policy.description; + this.empty = policy.empty; + this.invariantName = policy.invariantName; + this.invariantUUID = policy.invariantUUID; + this.isFromCsar = policy.isFromCsar; + + this.name = policy.name; + this.normalizedName =policy.normalizedName; + this.policyTypeName = policy.policyTypeName; + this.policyTypeUid = policy.policyTypeUid; + this.policyUUID = policy.policyUUID; + this.properties = CommonUtils.initProperties(policy.properties); + this.targets = policy.targets; + this.uniqueId = policy.uniqueId; + this.version = policy.version; + + } + +}
\ No newline at end of file diff --git a/catalog-ui/src/app/models/graph/zones/zone-child.ts b/catalog-ui/src/app/models/graph/zones/zone-child.ts new file mode 100644 index 0000000000..d6d7198222 --- /dev/null +++ b/catalog-ui/src/app/models/graph/zones/zone-child.ts @@ -0,0 +1,48 @@ +import { Type, Component } from "@angular/core"; +import { PolicyInstance } from "app/models/graph/zones/policy-instance"; + +export class ZoneConfig { + title:string; + defaultIconText:string; + type:string; 'policy|group'; + tagModeId:string; + instances:Array<ZoneInstanceConfig>; + showZone:boolean; + + + constructor (title:string, defaultText:string, type:string, showZone:boolean) { + this.title = title; + this.defaultIconText = defaultText; + this.type = type; + this.tagModeId = this.type + "-tagging"; + this.instances = []; + this.showZone = showZone; + } +} + +export class ZoneInstanceConfig { + + name:string; + assignments:Array<string>; //targets or members + instanceData:PolicyInstance; // | GroupInstance; + mode:ZoneInstanceMode; + + constructor(instance:PolicyInstance) { /* | GroupInstance */ + + this.name = instance.name; + this.instanceData = instance; + this.mode = ZoneInstanceMode.NONE; + + if(instance instanceof PolicyInstance) { + this.assignments = instance.targets; + } + } + +} + +export enum ZoneInstanceMode { + NONE, + HOVER, + SELECTED, + TAG +}
\ No newline at end of file |