"vxPropertyViewService"]; return DvsNetFlowViewService; }()); dvs_ui.DvsNetFlowViewService = DvsNetFlowViewService; angular.module("com.vmware.vsphere.client.dvs") .service("dvsNetFlowViewService", DvsNetFlowViewService); })(dvs_ui || (dvs_ui = {})); /* Copyright 2017 VMware, Inc. All rights reserved. -- VMware Confidential */ var dvs_ui; (function (dvs_ui) { var DvsEditNetFlowDialogComponent = (function () { function DvsEditNetFlowDialogComponent() { this.bindings = { pageModel: "<" }; this.controller = DvsEditNetFlowController; this.templateUrl = "dvs-ui/resources/dvs/netflow/edit/dvsEditNetFlowDialogTemplate.html"; } return DvsEditNetFlowDialogComponent; }()); dvs_ui.DvsEditNetFlowDialogComponent = DvsEditNetFlowDialogComponent; var DvsEditNetFlowController = (function () { function DvsEditNetFlowController(i18nService, networkUtil, vxValidatorFactory, dvsEditNetFlowDialogValidator) { this.i18nService = i18nService; this.networkUtil = networkUtil; this.vxValidatorFactory = vxValidatorFactory; this.dvsEditNetFlowDialogValidator = dvsEditNetFlowDialogValidator; this.i18n = i18nService.getString; this.validator = vxValidatorFactory.create(); this.validateCollectorIpAddress = this.collectorIpValidator.bind(this); this.validateSwitchIpAddress = this.switchIpValidator.bind(this); this.validateCollectorPort = this.collectorPortValidator.bind(this); this.validateObservationDomainId = this.observationDomainIdValidator.bind(this); this.validateActiveFlowTimeout = this.activeFlowTimeoutValidator.bind(this); this.validateIdleFlowTimeout = this.idleFlowTimeoutValidator.bind(this); this.validateSamplingRate = this.samplingRateValidator.bind(this); } DvsEditNetFlowController.prototype.$onInit = function () { this.collectorIpAddressPlaceholder = this.pageModel.ipv6ForIpfixSupported ? this.i18n("NetworkUi", "NetFlowPage.collector.ipAllPrompt") : this.i18n("NetworkUi", "NetFlowPage.collector.ipv4Prompt"); this.initSwitchAddressSignPost(); this.internalFlowsOnlyOptions = [{ label: this.i18nService.getString("NetworkUi", "NetFlowPage.advanced.internalFlowsOnlyEnabled"), value: dvs_ui.DvsEditNetFlowDialogConstants.INTERNAL_FLOWS_ONLY_ENABLED }, { label: this.i18nService.getString("NetworkUi", "NetFlowPage.advanced.internalFlowsOnlyDisabled"), value: dvs_ui.DvsEditNetFlowDialogConstants.INTERNAL_FLOWS_ONLY_DISABLED }]; }; DvsEditNetFlowController.prototype.collectorIpValidator = function () { var message = null; if (this.pageModel.collectorIpAddress) { message = this.dvsEditNetFlowDialogValidator.getCollectorIpValidationMessage(this.pageModel.collectorIpAddress, this.pageModel.ipv6ForIpfixSupported); } return message ? [message] : []; }; DvsEditNetFlowController.prototype.switchIpValidator = function () { var message = null; if (this.pageModel.switchIpAddress) { message = this.dvsEditNetFlowDialogValidator .getSwitchIpValidationMessage(this.pageModel.switchIpAddress); } return message ? [message] : []; }; DvsEditNetFlowController.prototype.collectorPortValidator = function () { var message = this.dvsEditNetFlowDialogValidator .getCollectorPortValidationMessage(this.pageModel.collectorPort); return message ? [message] : []; }; DvsEditNetFlowController.prototype.observationDomainIdValidator = function () { var message = this.dvsEditNetFlowDialogValidator .getObservationDomainIdValidationMessage(this.pageModel.observationDomainId); return message ? [message] : []; }; DvsEditNetFlowController.prototype.activeFlowTimeoutValidator = function () { var message = this.dvsEditNetFlowDialogValidator .getActiveFlowTimeoutValidationMessage(this.pageModel.activeFlowTimeout); return message ? [message] : []; }; DvsEditNetFlowController.prototype.idleFlowTimeoutValidator = function () { var message = this.dvsEditNetFlowDialogValidator .getIdleFlowTimeoutValidationMessage(this.pageModel.idleFlowTimeout); return message ? [message] : []; }; DvsEditNetFlowController.prototype.samplingRateValidator = function () { var message = this.dvsEditNetFlowDialogValidator .getSamplingRateValidationMessage(this.pageModel.samplingRate); return message ? [message] : []; }; DvsEditNetFlowController.prototype.initSwitchAddressSignPost = function () { var messages = [ this.i18n("NetworkUi", "NetFlowPage.info.switchIp.message") ]; if (this.pageModel.ipv6ForIpfixSupported) { messages.push(this.i18n("NetworkUi", "NetFlowPage.info.switchIp.ipv6Disclaimer")); } this.signPostConfig = { message: this.formatTextMessages(messages), title: this.i18n("NetworkUi", "NetFlowPage.info.switchIp.title"), class: "edit-netflow-switchAddress-signpost" }; }; DvsEditNetFlowController.prototype.formatTextMessages = function (messages) { var formattedMessage = ""; var template = "
%msg%
"; messages.forEach(function (message) { if (formattedMessage) { formattedMessage += "
"; } formattedMessage += template.replace("%msg%", message);