다음을 통해 공유


Windows Azure Pack 관리 포털 확장에서 새 서랍 추가에 항목을 추가하는 방법

 

적용 대상: Windows Azure Pack

새 추가 서랍은 관리 포털 사용자 인터페이스에서 새 항목을 만드는 중앙 위치입니다. 확장은 사용자가 확장을 통해 새 리소스를 만들 수 있도록 이 서랍에 메뉴 항목을 추가할 수 있습니다. 메뉴의 항목은 선언적으로 추가되며 추가된 후에는 변경하거나 제거할 수 없습니다. 관리 포털의 어디에서나 사용할 수 있습니다. 선언에 권장되는 위치는 확장의 초기화 JavaScript에 있습니다. 자세한 내용은 Windows Azure Pack 관리 포털 Client-Side 확장 JavaScript를 참조하세요.

표준 메뉴 항목을 추가하려면

  1. 다음 코드를 사용하여 표준 메뉴 항목을 추가합니다.

    menuItems: [
      {
        // ID of the menu item
        name: "WebDomain",
        // Text of the menu item
        displayName: "Web site domains",
        // ID of a template to show when the user hovers over the item (before they click it)
        preview: "createPreview",
        // Sub-menu (child menu) items take mostly the same parameters as parent menu items
        subMenu: [
          {
            name: "Create",
            displayName: "Create",
            // Function to run when the user clicks the item
            execute: global.DomainTenantExtension.CreateWizard.showCreateWizard,
            preview: "customCreatePreview"
          }
        ]
      }
    ]
    

빠른 만들기 메뉴 항목

빠른 만들기 메뉴 항목(새 추가 서랍에 짧은 폼을 표시하여 항목을 즉시 만드는 항목)의 경우 서랍에 렌더링될 템플릿의 ID와 동작을 정의하는 함수(템플릿이 표시될 때 수행할 작업, 사용자가 확인을 클릭할 때 수행할 작업)를 제공해야 합니다. 등).

빠른 만들기 메뉴 항목을 추가하려면

  1. 위의 코드를 사용하여 menuItems 배열에 다음 코드를 추가하여 빠른 만들기 메뉴 항목을 추가합니다.

    {
      // ID of this menu item
      name: "QuickCreate",
      // Text displaye on top of the Quick Create template as a title
      displayName: "Quick Create a Domain",
      // Description text displayed when the user hovers over the item with their mouse
      description: "Quickly add a new domain by supplying a few details",
      // Template to render for the Quick Create form
      template: "quickcreate",
      // Menu item's text
      label:"Quick Create",
      // Context object for the template
      data: null,
    
      opening: function(object) {
        // Add logic here to run just before the template is rendered
      }
    
      open: function () {
        // Add logic here to run just after the template is rendered
        Shell.UI.Validation.setValidationContainer("#webDomainQuickCreateForm");
      },
    
      ok: function(object) {
        var dialogFields = object.fields;
    
        if (Shell.UI.Validation.validateContainer("#webDomainQuickCreateForm")) {
          createWebDomain(dialogFields);
        }
        return false;
      },
    
      cancel: function (object) {
        // Add logic here to run after the user dismisses the Quick Create form
        // Do nothing in this case
      }
    }
    

참고 항목

Windows Azure Pack 관리 포털 확장에서 일반 작업 수행