Windows Azure Pack 관리 포털 계획 사용자 인터페이스 내에서 구성 정보를 표시하는 방법
적용 대상: Windows Azure Pack
<<ExtensionName>>.ServiceOffer.js 리소스 페이지를 로드할 때 필요합니다. 이 파일은 초기화, 명령 실행에 대한 명령 및 동작을 정의하고 페이지에 대한 onOfferSaving 이벤트를 처리합니다.
기본 함수는 호스트에서 구성을 수신하고 사용자 인터페이스 및 executeCommand를 업데이트하는 initializeServiceOffer로, 아래쪽 리본에서 리소스 공급자가 정의한 명령을 수행합니다.
구성 정보를 표시하려면
다음 코드를 사용하여 ServiceOffer.js 구현합니다.
/*globals window,parent,jQuery,document,setTimeout*/ /// <dictionary>jslint,iframe, Addon, </dictionary> /// <disable>JS2076.IdentifierIsMiscased</disable> // for 'Editions' (function ($, global, undefined) { "use strict"; // Executes the commands defined by the resource provider in the bottom command ribbon function executeCommand(commandId, commandParameter) { var i; switch (commandId) { case "X.addAddon": showAddAddonWizard(); break; case "X.editAddon": showEditAddonWizard(); break; case "X.deleteAddon": showDeleteAddonConfirmation(); break; case "X.addEdition": showAddEditionWizard(); break; case "X.editEdition": showEditEditionWizard(); break; case "X.deleteEdition": showDeleteEditionConfirmation(); break; updateAnytingNeededByExtension(); } } // Called after "Save" command for plan is invoked, but before it is sent to a resource provider. Do final validation here and throw an exception if there is an error</summary> function onOfferSaving() { if (!cachedServiceOffer || !cachedServiceOffer.Editions || cachedServiceOffer.Editions.length === 0) { throw resources.InvalidQuotasNoGroup; } } // Receives config from host and updates the UI function initializeServiceOffer(serviceOffer, planEntityType) { } function initializePage() { global.ServiceOffer.registerExtension({ initializeServiceOffer: initializeServiceOffer, onOfferSaving: onOfferSaving, executeCommand: executeCommand }); } $(document).ready(initializePage); })(jQuery, this);