{\n value = [];\n }\n this.lacpGroupConfig = value;\n this.hasPendingRequest = false;\n });\n }\n\n public selectionChanged(lag: LacpGroupConfig): void {\n if (lag !== null) {\n this.propertiesData = this.lagPropertiesService.getPropertyViewData(lag);\n this.selectedLagName = lag.name;\n this.hasSelection = true;\n } else {\n this.hasSelection = false;\n }\n }\n\n }\n\n angular.module(\"com.vmware.vsphere.client.dvs\")\n .component(\"lacpConfig\", new LacpConfigComponent());\n}\n\n","/* Copyright 2017 VMware, Inc. All rights reserved. -- VMware Confidential */\n\nnamespace dvs_ui {\n export class LagConstants {\n static Mode = class {\n public static readonly ACTIVE: string = \"active\";\n public static readonly PASSIVE: string = \"passive\";\n };\n\n static Vlan = class {\n public static readonly OUT_RANGE_DELIMITER: string = \", \";\n public static readonly OUT_RANGE_DIVIDER: string = \"-\";\n };\n }\n}","/* Copyright 2017 VMware, Inc. All rights reserved. -- VMware Confidential */\nnamespace dvs_ui {\n\n import NumericRange = com.vmware.vim.binding.vim.NumericRange;\n import LacpGroupConfig = com.vmware.vim.binding.vim.dvs.VmwareDistributedVirtualSwitch$LacpGroupConfig;\n import LagConstants = dvs_ui.LagConstants;\n\n export class LagPropertiesFormattingService {\n\n static $inject = [\"i18nService\"];\n\n constructor(private i18nService: any) {\n }\n\n public getLacpModeText(lacpMode: string): string {\n switch (lacpMode) {\n case LagConstants.Mode.ACTIVE:\n return this.i18nService.getString(\"DvsUi\", \"lag.mode.active\");\n case LagConstants.Mode.PASSIVE:\n return this.i18nService.getString(\"DvsUi\", \"lag.mode.passive\");\n default:\n return \"\";\n }\n }\n\n public getLoadBalancingModeText(loadBalancingMode: string): string {\n return this.i18nService.getString(\"DvsUi\", \"lag.loadBalancingMode.\" +\n loadBalancingMode);\n }\n\n public getVlanText(lag: LacpGroupConfig): string {\n if (!lag || lag.vlan === null || lag.vlan.vlanId === null ||\n lag.vlan.vlanId.length === 0) {\n return this.i18nService.getString(\"DvsUi\", \"lag.vlan.inherit\");\n }\n\n let vlanTrunkRanges: string = \"\";\n\n _.forEach(lag.vlan.vlanId, (range: NumericRange) => {\n if (range.start === range.end) {\n vlanTrunkRanges += range.start.toString();\n } else {\n vlanTrunkRanges += range.start.toString() +\n LagConstants.Vlan.OUT_RANGE_DIVIDER +\n range.end.toString();\n }\n vlanTrunkRanges += LagConstants.Vlan.OUT_RANGE_DELIMITER;\n });\n\n if (vlanTrunkRanges.length > 0) {\n vlanTrunkRanges = vlanTrunkRanges.substring(0,\n vlanTrunkRanges.length -\n LagConstants.Vlan.OUT_RANGE_DELIMITER.length);\n }\n\n return vlanTrunkRanges;\n }\n\n public getIpfixText(lag: LacpGroupConfig): string {\n if (!lag || lag.ipfix === null || lag.ipfix.ipfixEnabled === null) {\n return this.i18nService.getString(\"DvsUi\", \"lag.ipfix.inherit\");\n }\n\n return lag.ipfix.ipfixEnabled ?\n this.i18nService.getString(\"DvsUi\", \"lag.ipfix.on\") :\n this.i18nService.getString(\"DvsUi\", \"lag.ipfix.off\");\n }\n }\n\n angular.module(\"com.vmware.vsphere.client.dvs\")\n .service(\"lagPropertiesFormattingService\", LagPropertiesFormattingService);\n}\n","/* Copyright 2017 VMware, Inc. All rights reserved. -- VMware Confidential */\n\nnamespace dvs_ui {\n\n import VmwareDistributedVirtualSwitch$LacpGroupConfig = com.vmware.vim.binding.vim.dvs.VmwareDistributedVirtualSwitch$LacpGroupConfig;\n export class LagPropertiesService {\n\n public static $inject = [\n \"lagPropertiesFormattingService\",\n \"vxPropertyViewService\",\n \"i18nService\"];\n\n constructor(private formattingService: LagPropertiesFormattingService,\n private vxPropertyViewService: any,\n private i18n: any) {\n }\n\n public getPropertyViewData(lag: VmwareDistributedVirtualSwitch$LacpGroupConfig): any {\n let builder: any = this.vxPropertyViewService.createPropertyViewBuilder();\n\n let generalCategory: any = builder.category(\"general\");\n let generalSection: any = generalCategory.section(\"generalSection\");\n let policySection: any = generalCategory.section(\"policies\").title(\n this.i18n.getString(\"DvsUi\", \"lag.properties.policies\"));\n\n generalSection.property(this.i18n.getString(\"DvsUi\", \"lag.properties.name\"), lag.name);\n\n generalSection.property(\n this.i18n.getString(\"DvsUi\", \"lag.properties.numPorts\"),\n lag.uplinkNum.toString());\n\n generalSection.property(\n this.i18n.getString(\"DvsUi\", \"lag.properties.mode\"),\n this.formattingService.getLacpModeText(lag.mode));\n\n generalSection.property(\n this.i18n.getString(\"DvsUi\", \"lag.properties.loadBalancing\"),\n this.formattingService.getLoadBalancingModeText(\n lag.loadbalanceAlgorithm));\n\n policySection.property(\n this.i18n.getString(\"DvsUi\", \"lag.properties.vlanLabel\"),\n this.formattingService.getVlanText(lag));\n\n policySection.property(\n this.i18n.getString(\"DvsUi\", \"lag.properties.ipfixLabel\"),\n this.formattingService.getIpfixText(lag));\n\n return builder.build();\n }\n }\n\n angular.module(\"com.vmware.vsphere.client.dvs\")\n .service(\"lagPropertiesService\", LagPropertiesService);\n}\n","/* Copyright 2017 VMware, Inc. All rights reserved. -- VMware Confidential */\nnamespace dvs_ui {\n\n export class DvsLagPageComponent {\n\n public bindings: any;\n public controller: any;\n public templateUrl: string;\n\n constructor() {\n this.bindings = {\n wizardModel: \"<\"\n };\n\n this.controller = DvsLagPageComponentController;\n\n this.templateUrl = \"dvs-ui/resources/dvs/lacpupgrade/components/\" +\n \"dvsLagPageComponentTemplate.html\";\n }\n }\n\n class DvsLagPageComponentController {\n\n static $inject = [\n \"i18nService\",\n \"vxPropertyViewService\",\n \"vxValidatorFactory\",\n \"lagPropertiesFormattingService\",\n \"dvsLagPageValidator\"\n ];\n\n public wizardModel: DvsUpgradeLacpWizardModel | DvsUpgradeWizardModel;\n\n private uplinkNum: string;\n private lagMode: string;\n private loadBalancing: string;\n private vlan: string;\n private netFlow: string;\n private i18n: any;\n private lagNameValidator: any;\n\n constructor(private i18nService: any,\n private vxPropertyViewService: any,\n priva