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˦\{nBۄ`mZ,l->sxLPb09ږůE@3:ӡQQ;T2!Qi;oY-”H6Bm'mthh;f%0kTc6l 6|.|i|B3hu:O ^hS_~1e#$?Otg0ǽ݅iE!XÁ.ASpNć7<4|@3d+n` TƲh5'4zM35-ZPI2YWk_Gz{6knUkx'ح4u[-y4=)"#ChGUű1 )a`< Ybn黓ԩ;[a27O:t8OZO19(Q2k3:5(&[_Fa.y4 BLY@շ660Es;AZ9?@@m?VG4<EStQLg#c2;{ӝߜ^0ߣud9q*# n~dghts reserved. -- VMware Confidential */\n\nnamespace h5_client {\n export module common_module_ui {\n /*\n * Category action service.\n */\n import IRootScopeService = angular.IRootScopeService;\n export class CustomAttributesActionService {\n static $inject = ['customAttributesService', 'clarityModalService', 'i18nService', '$q', '$rootScope'];\n\n constructor(private customAttributesService: any, private clarityModalService: any, private i18nService: any, private $q: any, private $rootScope: IRootScopeService) {}\n\n public editCustomAttribute(customAttributeData: any, title: string) {\n let actionEval: any = {\n action: {\n label: title\n }\n };\n let context: any = {\n customAttributeState: angular.copy(customAttributeData),\n title: title\n };\n this.clarityModalService.openModal(actionEval, null, context,\n 'common-module-ui/resources/common-module/views/custom-attributes/add-edit-custom-attribute.html');\n }\n\n public deleteCustomAttribute(customAttributeData: any) {\n let self = this;\n var modalOptions = {\n title: self.i18nService.getString('Common','customFieldAction.delete.confirmation.title'),\n message: self.i18nService.getString('Common','customFieldAction.delete.confirmation.message'),\n icon: 'vsphere-icon-status-warning',\n submit: () => {\n self.customAttributesService.deleteCustomAttribute(customAttributeData)\n .then(() => {\n // deferred promise does not work with $http,\n // so just using a broadcast.\n self.$rootScope.$broadcast('refreshCustomAttributes');\n });\n },\n preserveNewlines: true\n };\n self.clarityModalService.openConfirmationModal(modalOptions);\n }\n }\n\n angular.module('com.vmware.vsphere.client.commonModule').service('customAttributesActionService', CustomAttributesActionService);\n }\n}\n","(function() {\n 'use strict';\n angular.module('com.vmware.vsphere.client.commonModule')\n .factory('customAttributesService', customAttributesService);\n\n customAttributesService.$inject = [\n 'dataService',\n 'mutationService',\n 'i18nService',\n 'defaultUriSchemeUtil',\n 'userSessionService'];\n\n function customAttributesService(\n dataService,\n mutationService,\n i18nService,\n defaultUriSchemeUtil,\n userSessionService) {\n return {\n getCustomAttributes: getCustomAttributes,\n modifyCustomAttributes: modifyCustomAttributes,\n getAllCustomAttributes: getAllCustomAttributes,\n deleteCustomAttribute: deleteCustomAttribute,\n renameCustomAttribute: renameCustomAttribute,\n addCustomAttribute: addCustomAttribute\n };\n\n\n function deleteCustomAttribute(item) {\n return userSessionService.getAllServersInfo().then(function(response) {\n var customAttribute = [{\n key: item.key,\n operationId: 'REMOVE'\n }];\n var rootFolder = defaultUriSchemeUtil.createVmomiUri('Folder', 'group-d1', response.serversInfo[0].serviceGuid);\n return modifyCustomAttributes(rootFolder, customAttribute);\n });\n }\n\n function addCustomAttribute(customAttribute, type) {\n return userSessionService.getAllServersInfo().then(function(response) {\n var customAttr = [{\n attribute: customAttribute.attribute,\n operationId: 'ADD',\n value: '',\n type: type.associableTypeString !== 'global' ? type.associableTypeString : null\n }];\n var rootFolder = defaultUriSchemeUtil.createVmomiUri('Folder', 'group-d1', response.serversInfo[0].serviceGuid);\n return modifyCustomAttributes(rootFolder, customAttr);\n });\n }\n\n function renameCustomAttribute(customAttribute) {\n return userSessionService.getAllServersInfo().then(function(response) {\n var customAttributeSpec = [{\n key: customAttribute.key,\n attribute: customAttribute.attribute,\n operationId: 'RENAME'\n }];\n var rootFolder = defaultUriSchemeUtil.createVmomiUri('Folder', 'group-d1', response.serversInfo[0].serviceGuid);\n return modifyCustomAttributes(rootFolder, customAttributeSpec);\n });\n }\n\n function getCustomAttributes(objectId) {\n return dataService.getProperties(objectId, ['availableField', 'customValue'], {\n queryName: getCustomAttributes.name + \":\" + objectId\n }).then(function(response) {\n return _.map(response.availableField, function(availableField) {\n var key = availableField.key;\n var customValue = _.find(response.customValue, function(customValue) {\n return customValue.key === key;\n }) || {};\n var attributeType = availableField.managedObjectType ?\n availableField.managedObjectType.wsdlName : \"global\";\n var result = {\n attribute: availableField.name,\n value: customValue.value,\n key: key,\n type: attributeType,\n typeLabel: i18nService.getString('Common', \"fieldType.\" + attributeType)\n };\n return result;\n });\n });\n }\n\n function getAllCustomAttributes() {\n return userSessionService.getAllServersInfo().then(function(response) {\n var paramSpec = {\n propertyName: \"customAttributeFields\",\n parameter: 'anyObjectType',\n parameterType: 'java.lang.String'\n };\n var datacenterId = defaultUriSchemeUtil.getVsphereObjectId(response.serversInfo[0].serviceInstance);\n var properties = ['customAttributeFields'];\n return dataService.getProperties(datacenterId, properties, {\n propertyParams: [paramSpec],\n queryName: getAllCustomAttributes.name + \":\" + datacenterId\n }).then(formatAllCustomAttributesList);\n });\n }\n\n function formatAllCustomAttributesList(response) {\n return response.customAttributeFields.map(function(customAttribute) {\n return {\n attribute: customAttribute.fieldDef.name,\n type: customAttribute.fieldDef.managedObjectType ? customAttribute.fieldDef.managedObjectType.wsdlName : 'global',\n key: customAttribute.fieldDef.key\n };\n });\n }\n\n function modifyCustomAttributes(objectId, newAttributeValues) {\n var propertyObjectType = \"com.vmware.vsphere.client.attribute.CustomFieldSpec\";\n var propertySpecs = [];\n var managedObjectReference = defaultUriSchemeUtil.getManagedObjectReference(objectId);\n _.map(newAttributeValues, function(customAttribute) {\n var propertySpec = generatePropertySpec(managedObjectReference, customAttribute);\n propertySpecs.push(propertySpec);\n });\n return mutationService.applyMultiSpec(objectId, propertyObjectType, propertySpecs, \"Modifying Custom Attributes\");\n }\n\n function generatePropertySpec(managedObjectReference, customAttribute) {\n switch (customAttribute.operationId) {\n case 'ADD':\n return {\n \"name\": customAttribute.attribute,\n \"owner\": managedObjectReference,\n \"value\": customAttribute.value,\n \"operationId\": customAttribute.operationId,\n \"typeName\": customAttribute.type !== 'global' ? customAttribute.type : null\n };\n case 'REMOVE':\n return {\n \"owner\": managedObjectReference,\n \"operationId\": customAttribute.operationId,\n \"key\": customAttribute.key\n };\n default:\n return {\n \"name\": customAttribute.attribute,\n \"owner\": managedObjectReference,\n \"value\": customAttribute.value,\n \"operationId\": customAttribute.operationId,\n \"key\": customAttribute.key\n };\n }\n }\n }\n})();\n","module common_module_ui {\n\n export class DrsFaultsViewService {\n\n public static $inject: string[] = [\"vuiConstants\", \"i18nService\",\n \"drsFaultsViewConstants\", \"defaultUriSchemeUtil\", \"linksUtil\"];\n\n constructor(private vuiConstants: any, private i18nService: any,\n private drsFaultsViewConstants: any,\n private defaultUriSchemeUtil: any, private linksUtil: any) { }\n\n public getMasterViewGridOptions(): Object {\n return {\n selectionMode: this.vuiConstants.grid.selectionMode.SINGLE,\n sortMode: this.vuiConstants.grid.sortMode.SINGLE,\n searchable: false,\n resizable: true,\n data: [],\n selectedItems: [],\n columnDefs: this.getMasterColumnDefs(),\n height: \"100%\"\n };\n }\n\n public getDetailsViewGridOptions(): Object {\n return {\n selectionMode: this.vuiConstants.grid.selectionMode.NONE,\n sortMode: this.vuiConstants.grid.sortMode.SINGLE,\n searchable: false,\n resizable: true,\n data: [],\n selectedItems: [],\n columnDefs: this.getDetailsColumnDefs(),\n height: \"100%\"\n };\n }\n\n /**\n * Interpolates the template string with the target objects links.\n *\n * @param templateStr\n * @param targetObjects\n * @returns {*}\n */\n public interpolateWithLinks(templateStr: string, targetObjects: any): string {\n let interpolations: string[] = [];\n\n targetObjects.forEach((targetObject: any) => {\n let objectType: any = typeof targetObject;\n let text: string = \"\";\n if (objectType === \"object\") {\n let id = this.defaultUriSchemeUtil.getVsphereObjectId(\n targetObject[this.drsFaultsViewConstants.ID_KEY]);\n text = this.linksUtil.generateObjectLink(id,\n targetObject[this.drsFaultsViewConstants.NAME_KEY]);\n } else if (objectType === \"string\") {\n text = targetObject;\n }\n\n interpolations.push(text);\n });\n\n return this.i18nService.interpolate(templateStr, interpolations);\n }\n\n private getMasterColumnDefs(): any[] {\n return [\n {\n displayName: this.i18nService.getString(\"Common\",\n \"drs.faultControl.reasonColumnHeaderLabel\"),\n field: this.drsFaultsViewConstants.LOCALIZED_REASON,\n type: \"string\",\n template: (data: any) => {\n return this.gridColumnTemplate(\n this.drsFaultsViewConstants.LOCALIZED_REASON,\n this.drsFaultsViewConstants.ICON_FIELD, data);\n }\n },\n {\n displayName: this.i18nService.getString(\"Common\",\n \"drs.faultControl.targetColumnHeaderLabel\"),\n field: this.drsFaultsViewConstants.TARGET_TEXT_FIELD,\n type: \"string\",\n template: (data: any) => {\n return this.gridColumnTemplate(\n this.drsFaultsViewConstants.TARGET_TEXT_FIELD,\n this.drsFaultsViewConstants.ICON_TARGET_FIELD, data);\n }\n }\n ];\n }\n\n private getDetailsColumnDefs(): any[] {\n return [\n {\n displayName: this.i18nService.getString(\"Common\",\n \"drs.faultControl.details.faultColumnHeaderLabel\"),\n field: this.drsFaultsViewConstants.REASON,\n type: \"string\",\n template: (data: any) => {\n return this.gridColumnTemplate(this.drsFaultsViewConstants.REASON,\n this.drsFaultsViewConstants.REASON_ICON_CLASS, data);\n }\n },\n {\n displayName: this.i18nService.getString(\"Common\",\n \"drs.faultControl.details\" +\n \".preventedRecommendationColumnHeaderLabel\"),\n field: this.drsFaultsViewConstants.PREVENTED_RECOMMENDATION,\n type: \"string\",\n template: (data: any) => {\n return this.gridColumnTemplate(\n this.drsFaultsViewConstants.PREVENTED_RECOMMENDATION,\n this.drsFaultsViewConstants.PREVENTED_RECOMMENDATION_ICON_CLASS,\n data);\n }\n }\n ];\n }\n\n private gridColumnTemplate(fieldValue: string, iconValue: string, data: any): string {\n let props: any = {};\n props[this.drsFaultsViewConstants.FIELD_KEY] = fieldValue;\n props[this.drsFaultsViewConstants.ICON_KEY] = iconValue;\n\n return this.iconWithTextItemRenderer(props, data);\n }\n\n /**\n * Renders an icon along with text in a datagrid.\n *\n * @param props\n * @param data\n * @returns {string}\n */\n private iconWithTextItemRenderer(props: any, data: any): string {\n let objData: any = data || {};\n objData.text = this.getNestedObjectProperty(data,\n props[this.drsFaultsViewConstants.FIELD_KEY]);\n objData.icon = this.getNestedObjectProperty(data,\n props[this.drsFaultsViewConstants.ICON_KEY]);\n\n let iconSpan: string = \"\";\n\n return [iconSpan, objData.text].join(\"\");\n }\n\n /**\n * Returns the nested property of the object.\n *\n * @param object\n * @param property\n * @returns {*}\n */\n private getNestedObjectProperty(object: any, property: string): Object {\n let o: any = object;\n\n property.split(\".\").forEach(function(property) {\n o = o[property];\n });\n\n return o;\n }\n }\n\n angular.module(\"com.vmware.vsphere.client.commonModule\")\n .service(\"drsFaultsViewService\", DrsFaultsViewService);\n}\n","module common_module_ui {\n\n export class DrsRecommendationsService {\n\n public createRecommendationsStore(\n recommendationsData: any[]): RecommendationsStore {\n return new RecommendationsStore(\n recommendationsData);\n }\n }\n\n export class RecommendationsStore {\n\n private selectableActionsByKey: _.Dictionary;\n\n private checkedRecommendations: _.Dictionary;\n\n private selectableActionsCount: number;\n\n constructor(private recommendations: any[]) {\n let selectableActions = recommendations.filter(\n function(item) {\n return item.isFirst;\n });\n\n this.selectableActionsByKey = _.indexBy(selectableActions, function(\n action) {\n return action.parentRecommendation.key;\n });\n\n this.checkedRecommendations = {};\n selectableActions.forEach((action) => {\n this.checkedRecommendations[action.parentRecommendation.key] = true;\n });\n\n this.selectableActionsCount = selectableActions.length;\n }\n\n getRecommendationsToApply(): string[] {\n let checkedRecommendationKeys: string[] = [];\n\n this.recommendations.forEach((action) => {\n if (action.isFirst === true) {\n let recKey = action.parentRecommendation.key;\n if (this.checkedRecommendations[recKey] === true) {\n checkedRecommendationKeys.push(recKey);\n }\n }\n });\n\n // Remove prerequisite recommendations from the list\n let recommendationKeysToApply = checkedRecommendationKeys.slice();\n checkedRecommendationKeys.forEach((checkedKey) => {\n let prerequisites = this.selectableActionsByKey[checkedKey]\n .prerequisiteRecommendations;\n recommendationKeysToApply = recommendationKeysToApply.filter(\n (keyToApply) => {\n return prerequisites.indexOf(keyToApply) === -1;\n });\n });\n\n return recommendationKeysToApply;\n }\n\n getCheckedRecommendationCount(): number {\n let checkedNumber = _.filter(this.checkedRecommendations, (recommendation) => {\n return recommendation === true;\n });\n return checkedNumber.length;\n }\n\n getSelectableActionsCount(): number {\n return this.selectableActionsCount;\n }\n\n isRecommendationChecked(key: string): boolean {\n return this.checkedRecommendations[key] === true;\n }\n\n uncheckRecommendation(key: string): boolean {\n let shouldShowNotification = false;\n this.checkedRecommendations[key] = false;\n let action = this.selectableActionsByKey[key];\n action.dependantRecommendations.forEach((dependantKey: string) => {\n if (this.checkedRecommendations[dependantKey] === true) {\n this.checkedRecommendations[dependantKey] = false;\n shouldShowNotification = true;\n }\n });\n return shouldShowNotification;\n }\n\n checkRecommendation(key: string): boolean {\n let shouldShowNotification: boolean = false;\n this.checkedRecommendations[key] = true;\n let action = this.selectableActionsByKey[key];\n action.prerequisiteRecommendations.forEach((prerequisiteKey: string) => {\n if (this.checkedRecommendations[prerequisiteKey] === false) {\n this.checkedRecommendations[prerequisiteKey] = true;\n shouldShowNotification = true;\n }\n });\n return shouldShowNotification;\n }\n\n getRecommendationKeys(): string[] {\n return this.recommendations.map((rec) => rec.parentRecommendation.key);\n }\n }\n\n angular.module(\"com.vmware.vsphere.client.commonModule\")\n .service(\"drsRecommendationsService\", DrsRecommendationsService);\n}\n","(function() {\n 'use strict';\n angular.module('com.vmware.vsphere.client.commonModule')\n .service('iconService', iconService);\n\n function iconService() {\n var iconMap = {\n Datacenter: 'vsphere-icon-datacenter',\n ClusterComputeResource: 'vsphere-icon-cluster',\n HostSystem: 'vsphere-icon-host',\n Folder: 'vsphere-icon-folder',\n Datastore: 'vsphere-icon-datastore'\n };\n\n return {\n getByObjectRef: function(ref) {\n return iconMap[ref.type];\n },\n getByObjectType: function(type) {\n return iconMap[type];\n }\n };\n }\n})();\n","namespace h5_client {\nexport module common_module_ui {\n /*\n * Content library service.\n */\n let DELETE_LIBRARY_SPEC: string = 'com.vmware.vsphere.client.library.specs.DeleteLibrarySpec';\n let ADD_LIBRARY_SPEC: string = 'com.vmware.vsphere.client.library.CreateLibrarySpec';\n let VALIDATE_LIBRARY_SPEC: string = 'com.vmware.vsphere.client.library.specs.SubscriptionUrlValidatorSpec';\n let TARGET_LIBRARIES_PROP: string = \"targetLibraries\";\n let FOLDER: string = \"Folder\";\n let GROUPD1: string = \"group-d1\";\n\n export class LibraryService {\n private static CL_DEFAULT_USERNAME: string = \"vcsp\";\n static $inject = ['mutationService', 'defaultUriSchemeUtil', 'dataService'];\n\n constructor(private mutationService: any, private defaultUriSchemeUtil: any, private dataService: any) {}\n\n /**\n * Confirm and delete a category.\n */\n public deleteContentLibrary(libraryId: any) {\n return this.mutationService.remove(libraryId, DELETE_LIBRARY_SPEC, {});\n }\n\n public addContentLibrary(libraryData: any) {\n\n let librarySpec = {\n name: libraryData.name,\n description: libraryData.description,\n vcServiceGuid: libraryData.vcService.serviceGuid,\n type: libraryData.type,\n subscriptionUrl: libraryData.subscriptionUrl,\n datastoreRefs: [this.defaultUriSchemeUtil.getPartsFromVsphereObjectId(libraryData.datastore.id)],\n isAuthBasic: libraryData.isSubscriptionAuthenticated? true: false,\n isStreamOptimized: false,\n isExternallyPublished: false,\n localPublishedUsername: null,\n localPublishedPassword: null,\n sslThumbprint: libraryData.sslThumbprint ? libraryData.sslThumbprint : '',\n subscribedUsername: libraryData.isSubscriptionAuthenticated? LibraryService.CL_DEFAULT_USERNAME: '',\n subscribedPassword: libraryData.isSubscriptionAuthenticated? libraryData.subscriptionPassword: '',\n storageFileSystemPath: null,\n createLocalCopy: true,\n useFilesystem: false,\n useDatastore: true\n };\n return this.mutationService.add(ADD_LIBRARY_SPEC, librarySpec, 'ADD');\n }\n\n public validate(libraryUrl: any, sslThumbprint?: string, password?: string) {\n let librarySpec = {\n name: '',\n subscriptionUrl: libraryUrl,\n isAuthBasic: password? true: false,\n sslThumbprint: sslThumbprint ? sslThumbprint : '',\n username: password? LibraryService.CL_DEFAULT_USERNAME: '',\n password: password? password: ''\n };\n return this.mutationService.validate(\n 'urn:vapi:com.vmware.content.Library:dummy',\n VALIDATE_LIBRARY_SPEC,\n librarySpec\n );\n }\n\n public getAllContentLibraryInVc(vc: any) {\n let serverGuid = vc.serviceGuid;\n let rootFolder = this.defaultUriSchemeUtil.createVmomiUri(FOLDER, GROUPD1, serverGuid);\n return this.dataService.getProperties(rootFolder, [TARGET_LIBRARIES_PROP]);\n }\n\n }\n\n angular.module('com.vmware.vsphere.client.commonModule').service('libraryService', LibraryService);\n }\n}\n","/* Copyright 2015 VMware, Inc. All rights reserved. -- VMware Confidential */\n\nangular.module('com.vmware.vsphere.client.commonModule')\n.service('managedEntityMutationService',\n['mutationService', function(mutationService) {\n return {\n // operation parameter is optional, to be used in case of error notification\n rename: function(objectId, nameInfo, operation) {\n return mutationService.apply(objectId,\n 'com.vmware.vsphere.client.mixed.ManagedEntityNameInfo', nameInfo, operation);\n }\n };\n}]);","/* Copyright 2015 VMware, Inc. All rights reserved. -- VMware Confidential */\n\n/**\n * Retrieves objects related to given objectId.\n * Used by related objects portlet in entity summary screen.\n */\nangular.module('com.vmware.vsphere.client.commonModule').factory('relatedItemsService', ['$http',\n function ($http) {\n return {\n /**\n * Gets the related objects to given objectId.\n */\n getRelatedItems: function (objectId) {\n return $http({\n method: 'get',\n url: 'relateditems/simple/' + objectId\n }).then(function (resp) {\n return resp.data;\n });\n },\n\n /**\n * Gets the related items for the given objectId for\n * the given relationId.\n * @param objectId Unique relation id. e.g. vmsForHost\n * @param relationId Unique object id. e.g. urn:vmomi:HostSystem:ha-host:null\n * @param defaultProperties\n * If true, only the default properties are fetched (like name, primaryIconId).\n * If false, properties to be fetched are computed based on the relationId.\n * @returns {*}\n */\n getRelatedItemsByRelationId: function (objectId, relationId, defaultProperties) {\n return $http({\n method: 'get',\n url: 'relateditems/' + relationId + '/' + objectId + '?defaultProperties=' + defaultProperties\n }).then(function (resp) {\n return resp.data;\n });\n }\n };\n }]);","/* Copyright 2017 VMware, Inc. All rights reserved. -- VMware Confidential */\n\nnamespace h5_client {\n export module common_module_ui {\n /*\n * Tag action service.\n */\n import IRootScopeService = angular.IRootScopeService;\n export class TagActionService {\n static $inject = [\"tagService\", \"clarityModalService\", \"i18nService\", \"$rootScope\"];\n\n private i18n: Function;\n\n constructor(private tagService: any, private clarityModalService: any, private i18nService: any, private $rootScope: IRootScopeService) {\n this.i18n = (key: string, data: any[]) => this.i18nService.getString(\"CommonModuleUi\", key, data);\n }\n\n /**\n * Confirm and delete a tag.\n */\n public deleteTag(tagMoRef: any) {\n this.tagService.getEntityObjectsCount(tagMoRef).then((count: number) => {\n var modalMessage = this.i18n('tagAction.remove.warning');\n if(count) {\n modalMessage = modalMessage + '\\n' + this.i18n('tagAction.remove.entity.count', count);\n }\n var modalOptions = {\n title: this.i18n('tagAction.remove.dialog.title'),\n message: modalMessage,\n icon: 'vsphere-icon-status-warning',\n submit: () => {\n this.tagService.deleteTag(tagMoRef)\n .then(() => {\n // deferred promise does not work with $http,\n // so just using a broadcast.\n this.$rootScope.$broadcast('refreshTagGrid');\n });\n },\n preserveNewlines: true\n };\n this.clarityModalService.openConfirmationModal(modalOptions);\n });\n }\n\n /**\n * Create/Edit a tag\n *\n * @param modifyTagData\n * @param tagId (Optional) Needed for edit\n */\n public modifyTag(modifyTagData: ModifyTagData, tagId?: string): void {\n let dialogData: any = {\n modifyTagData: modifyTagData,\n categoryData: {}\n };\n\n let modalOptions: any = {\n contentTemplate: \"common-module-ui/resources/common-module/views/tags/modify-tag-dialog.html\",\n title: modifyTagData.mode === ModifyTagMode.ADD ? this.i18n(\"tag.action.add\") : this.i18n(\"tag.action.edit\"),\n defaultButton: \"submit\",\n onSubmit: modifyTagData.mode === ModifyTagMode.ADD\n ? this.onTagAdd.bind(this, dialogData)\n : this.onTagModify.bind(this, tagId, dialogData),\n dialogData: dialogData,\n submitDisabled: true\n };\n\n if (modifyTagData.mode === ModifyTagMode.EDIT) {\n modalOptions.subTitle = {text: angular.copy(modifyTagData.name)};\n }\n\n this.clarityModalService.openOkCancelModal(modalOptions);\n }\n\n private onTagAdd(dialogData: any): boolean {\n return this.tagService\n .createTag(\n dialogData.modifyTagData.name,\n dialogData.modifyTagData.description,\n dialogData.categoryData.selectedCategory.managedObjectReference)\n .then((response: any) => {\n this.$rootScope.$broadcast(\"refreshTagGrid\");\n return response;\n });\n\n }\n\n private onTagModify(tagId: any, dialogData: any): boolean {\n return this.tagService\n .editTag(\n tagId,\n dialogData.modifyTagData.name,\n dialogData.modifyTagData.description)\n .then((response: any) => {\n this.$rootScope.$broadcast(\"refreshTagGrid\");\n return response;\n });\n }\n }\n\n angular.module(\"com.vmware.vsphere.client.commonModule\").service(\"tagActionService\", TagActionService);\n }\n}\n","/* Copyright 2016-2017 VMware, Inc. All rights reserved. -- VMware Confidential */\n/*\n * Tag service\n */\n(function () {\n 'use strict';\n angular\n .module('com.vmware.vsphere.client.commonModule')\n .service('tagService', tagService);\n\n tagService.$inject = ['dataService', 'mutationService', 'defaultUriSchemeUtil', '$http'];\n\n function tagService(dataService, mutationService, defaultUriSchemeUtil, $http) {\n\n var MUTATION_TAG_DETACH_SPEC = 'com.vmware.vsphere.client.tagging.TagDetachSpec';\n var MUTATION_TAG_ATTACH_SPEC = 'com.vmware.vsphere.client.tagging.TagAttachSpec';\n var MUTATION_TAG_CREATE_SPEC = 'com.vmware.vsphere.client.tagging.TagCreateSpec';\n var TAGS_URL = 'tagging-ui/ctrl/tags';\n\n return {\n getTagInfoForObject: getTagInfoForObject,\n getAssignableTagsForObject: getAssignableTagsForObject,\n detachTag: detachTag,\n attachTag: attachTag,\n getAllTags: getAllTags,\n createTag: createTag,\n deleteTag: deleteTag,\n getEntityObjectsCount: getEntityObjectsCount,\n editTag: editTag\n };\n\n function formatTags(tagProperties) {\n var formattedTagsDictionary = {};\n\n _.each(tagProperties, function(value, object) {\n var objRef = defaultUriSchemeUtil.getPartsFromVsphereObjectId(object);\n formattedTagsDictionary[object] = angular.extend({resourceObject: objRef}, value);\n });\n return _.values(formattedTagsDictionary);\n }\n\n function getAllTags() {\n return $http.get(TAGS_URL).then(function(response) {\n return response.data;\n });\n }\n\n function getTagInfoForObject(objectId) {\n var relation = 'entity';\n var targetType = 'inventoryservice:InventoryServiceTag';\n var tagProperties = ['name', 'description', 'categoryName'];\n\n return dataService.getPropertiesByRelation(objectId, relation,\n targetType, tagProperties, { queryName: \"getTagInfoForObject:\" + objectId })\n .then(formatTags);\n }\n\n function getAssignableTagsForObject(objectId) {\n return dataService.getProperties(objectId, ['assignableTagsForTarget'],\n { queryName: \"getAssignableTagsForObject:\" + objectId });\n }\n\n function detachTag(tagObject, objectId) {\n // objectId can be a MoRef or a URI like Library\n var tagDetachSpec = {\n resources: [defaultUriSchemeUtil.getMoRefOrURIref(objectId)]\n };\n return mutationService.apply(defaultUriSchemeUtil.getVsphereObjectId(tagObject), MUTATION_TAG_DETACH_SPEC, tagDetachSpec);\n }\n\n function attachTag(tagObject, objectId) {\n // objectId can be a MoRef or a URI like Library\n var tagAttachSpec = {\n resources: [defaultUriSchemeUtil.getMoRefOrURIref(objectId)],\n ignoreAlreadyAttached: true\n };\n return mutationService.apply(defaultUriSchemeUtil.getVsphereObjectId(tagObject.resourceObject), MUTATION_TAG_ATTACH_SPEC, tagAttachSpec);\n\n }\n\n function createTag(tagName, tagDescription, categoryMoRef) {\n var tagSpec = {\n tagName: tagName,\n tagDescription: tagDescription,\n categoryMoRef: categoryMoRef\n };\n return mutationService.add(MUTATION_TAG_CREATE_SPEC, tagSpec, 'OP_IGNORE_ERROR');\n }\n\n function editTag(tagId, tagName, tagDescription) {\n var tagSpec = {\n tagName: tagName,\n tagDescription: tagDescription\n };\n return mutationService.apply(tagId, MUTATION_TAG_CREATE_SPEC, tagSpec, 'OP_IGNORE_ERROR');\n }\n\n function deleteTag(tagMoRef) {\n var tagId = defaultUriSchemeUtil.getVsphereObjectId(tagMoRef);\n return mutationService.remove(tagId, MUTATION_TAG_CREATE_SPEC, {});\n }\n\n function getEntityObjectsCount(tagMoRef) {\n var entityId = defaultUriSchemeUtil.createVmomiUri(tagMoRef.type, tagMoRef.value, tagMoRef.serverGuid);\n return dataService.getProperties(entityId, [\"entityObjects\"], { queryName: \"getEntityObjectsCount:\" + entityId })\n .then(function(response) {\n return response.entityObjects.totalMatchedObjectCount;\n });\n }\n }\n}());\n","/* Copyright 2018 VMware, Inc. All rights reserved. -- VMware Confidential */\n\nnamespace h5_client {\n /**\n * Implements some stock expressions that can be used to construct more complex\n * validation expressions.\n */\n export class DragAndDropStockExpressionsService {\n public static $inject: string[] = [\n \"defaultUriSchemeUtil\",\n \"managedEntityConstants\"\n ];\n\n private readonly FAILED_STATUS: string = \"__FAILED__\";\n private readonly NOT_FOUND_STATUS: string = \"__NOT_FOUND__\";\n\n private readonly HOST_FOLDER_VALUE: string = \"group-h\";\n private readonly VM_FOLDER_VALUE: string = \"group-v\";\n\n public constructor(\n private defaultUriSchemeUtil: any,\n private managedEntityConstants: any,\n ) {\n }\n\n public isTargetAccessible(dropTargetData: any): boolean {\n // spriteCssClass comes form the data object maintained by the tree,\n // and primaryIconId comes from the data kept in the object navigator\n const objectIconId: string = dropTargetData.spriteCssClass ?\n dropTargetData.spriteCssClass : dropTargetData.primaryIconId;\n switch (objectIconId) {\n case \"vsphere-icon-host-maintenance\":\n case \"vsphere-icon-host-disconnected\":\n case \"vsphere-icon-datastore-inaccessible\":\n case \"vsphere-icon-datastore-error\":\n case \"vsphere-icon-datastore-maintenance\":\n return false;\n default:\n return true;\n }\n }\n\n public isVmFolder(folderId: string): boolean {\n const folderRef: any =\n this.defaultUriSchemeUtil.getManagedObjectReference(folderId);\n\n const folderType: string = folderRef.type;\n const folderValue: string = folderRef.value;\n\n return (folderType === this.managedEntityConstants.FOLDER &&\n folderValue.indexOf(this.VM_FOLDER_VALUE) !== -1);\n }\n\n public isHostFolder(folderId: string): boolean {\n const folderRef: any =\n this.defaultUriSchemeUtil.getManagedObjectReference(folderId);\n const folderType: string = folderRef.type;\n const folderValue: string = folderRef.value;\n\n return (folderType === this.managedEntityConstants.FOLDER\n && folderValue.indexOf(this.HOST_FOLDER_VALUE) !== -1);\n }\n\n public isWithinSameDatacenter(dropTargetData: any, dragObjectsData: any): boolean {\n const result = this.hasCommonParent(\n dropTargetData, dragObjectsData, \"Datacenter\");\n\n if (result === undefined) {\n return true;\n }\n\n return result;\n }\n\n public isVmFolderWithinSameDatacenter(\n dropTargetData: any, dragObjectsData: any): boolean {\n if (!this.isVmFolder(dropTargetData.id)) {\n return false;\n }\n\n return this.isWithinSameDatacenter(dropTargetData, dragObjectsData);\n }\n\n /**\n * Checks if the direct parent of some of the drag objects is the drop target\n * or if the direct parent of the drop target is in the drag objects\n *\n * @param dropTargetData\n * @param dragObjectsData\n * @returns {boolean}\n */\n public hasDirectParent(dropTargetData: any, dragObjectsData: any): boolean {\n if (!dropTargetData || !dragObjectsData) {\n return false;\n }\n\n const dragParentIds = _.map(dragObjectsData, (dragObjectData: any) => {\n return this.getDirectParent(dragObjectData);\n });\n if (_.contains(dragParentIds, this.FAILED_STATUS)) {\n return false;\n }\n const targetIsParent = _.some(dragParentIds, (dragParentId: any) => {\n return dropTargetData.id === dragParentId;\n });\n\n const targetParentId = this.getDirectParent(dropTargetData);\n if (targetParentId === this.FAILED_STATUS) {\n return false;\n }\n const dragObjIsParent = _.some(dragObjectsData, (dragObjectData: any) => {\n return dragObjectData.id === targetParentId;\n });\n\n return targetIsParent || dragObjIsParent;\n }\n\n /**\n * Checks if all the drag objects and the drop target have common first parent\n * of the selected type\n *\n * @param dropTargetData\n * @param dragObjectsData\n * @param parentType\n * @returns {any}\n * returns true if parent is found\n * returns false if parent is not found but the whole chain is traversed\n * returns undefined if parent is not found but not the whole chain is traversed\n * due to some error\n */\n public hasCommonParent(\n dropTargetData: any,\n dragObjectsData: any,\n parentType: string): boolean | undefined {\n const targetParentId: string =\n this.getFirstParentOfType(dropTargetData, parentType);\n switch (targetParentId) {\n case this.FAILED_STATUS:\n return undefined;\n case this.NOT_FOUND_STATUS:\n return false;\n default:\n break;\n }\n\n const dragParentIds = _.map(dragObjectsData, (dragObjectData: any) => {\n return this.getFirstParentOfType(dragObjectData, parentType);\n });\n if (_.contains(dragParentIds, this.FAILED_STATUS)) {\n return undefined;\n }\n\n const isSameParent: boolean = _.every(dragParentIds, (dragParentId: string) => {\n return dragParentId === targetParentId;\n });\n return isSameParent;\n }\n\n public isWithinSameClusterOrHost(\n dropTargetData: any, dragObjectsData: any): boolean {\n\n const sameCluster = this.hasCommonParent(dropTargetData,\n dragObjectsData, \"ClusterComputeResource\");\n if (sameCluster) {\n return true;\n }\n\n const sameHost = this.hasCommonParent(dropTargetData,\n dragObjectsData, \"HostSystem\");\n if ((sameHost === undefined) || (sameCluster === undefined)) {\n return true;\n }\n\n return sameHost;\n }\n\n public isWithinSameStandaloneHost(\d> 鿪ֵ˰ר÷Ʊ3.96Ԫ 23˱ ӱв˰Աܲ˰ ʡй˰Яֲ鴦һٷƱ͵˰ ɽʡе˰ֳָǷ־ơһ 鿪ֵ˰Ʊ ˱ 鿪ֵ˰Ʊ ӷijͺ ൺԺһδ涨߷Ʊ ൺй˰ƻ񡰼Ӫ ٳCPUƭ˰ һżٷƱǣԪ͵˰ ޲鴦鿪ֵ˰ר÷Ʊ 永2513Ԫ ĴʡϪع˰ֳɹ鴦װΪ͵˰ ˰Э նƱĺ һ֤͵˰ ʡƻشۼٷƱ ʲͼƱ Ʊ䷨ ƻش鿪ֵ˰Ʊ ͵˰164򿪷ֵܻ Ϣȶԡ©ܻ ͵˰˶ʳӹ ġϰ ϡۡ˿ Ʒ۹˾ھӦ 鱨¸پҵԱ˰Żвͨ һݵѵй¶ 鱨پҵְƭ˰Ż ʡȨ˰ƻһٷƱ 鿪Ʊ ˰7Ԫ ൺij˾Ŀŵֵ˰ר÷Ʊֿ˰鴦 ڿ˼ҡš ͵ɷʴ ӡ˰ Ĵʡһשҵ ൺе˰ֲ鴦һ⼮Աְ˰38Ԫ !һվݿɴԪ һ仰ҵ͵˰ ̴˰ʮԪ ҵ۳ɱԭ걨Ʒ60 е˾ ͵˰߳ թս һ· ɽʡ˰ֲ鴦һƱ͵˰ ˰17%13%˰450Ԫ ʳҵġ˰ۡ ʡ¦¦ȭ˰ ൺ˰ֲ鴦һʻ͵˰ ˰仯 ൺijó޹˾鿪Ʊ鴦 Ϸ̨¼ǣ׮˰ ҵ ʯͷ׽ ൺ˰ֻعൺ޹˾鿪Ʊ