다음을 통해 공유


Windows Azure Pack 관리 포털 확장에서 작업 진행률을 표시하는 방법

 

적용 대상: Windows Azure Pack

사용자가 시작한 작업을 처리하는 데 시간이 오래 걸리는 경우 관리 포털 사용자 인터페이스를 차단하지 않고 사용자가 작업이 진행 중임을 확인할 수 있도록 ProgressOperation을 사용하는 것이 좋습니다. ProgressOperation에는 사용자에게 작업에 대한 정보를 유지할 수 있는 몇 가지 옵션이 있습니다. 이러한 각 옵션은 서로 독립적으로 사용할 수 있습니다.

진행률 작업을 확인할 수 있습니다. 작업이 얼마나 완료되었는지 알 수 있습니다. 예를 들어 작업이 완료율 값을 보고할 수 있습니다. 또는 확정되지 않을 수 있습니다. 작업이 완료되었거나 완료되지 않았지만 어느 한 상태에 얼마나 가까운지는 알 수 없습니다.

ProgressOperation에는 완료를 향해 진행률이 보고될 예정이거나 보고되지 않음을 사용자에게 암시하는 확정되지 않은 속성이 있습니다.

작업은 각각 성공 또는 실패할 수 있는 개별 단계의 시퀀스로 구성될 수 있습니다. 오류가 발생하면 작업의 추가 진행이 중지됩니다. 작업에 단계가 있는 경우 세부 정보 단추가 나타납니다.

Windows Azure Pack Portal Step Details Selection

이를 클릭하면 성공, 실패 또는 경고와 같은 개별 상태와 함께 개별 단계가 표시됩니다. 자세한 내용은 ProgressOperation의 addStep/removeStep 메서드를 참조하세요.

Windows Azure Pack Portal Operataion Steps

진행률 작업의 예는 마법사 샘플 표시에 포함되어 있습니다. 마법사의 onComplete 함수는 서버 작업이 완료되는 시기를 표시하는 진행률 작업을 설정합니다.

마법사 내에서 작업의 진행률을 표시하려면

  1. 마법사 내에서 진행률을 표시하려면 다음 코드를 사용합니다.

    cdm.stepWizard({
        extension: "DomainTenantExtension",
        steps: [{
          template: "createStep1",
          data: data,
          // Called when the step is first created
          onStepCreated: function () {
            wizard = this;
          },
          // Called each time the step is displayed
          onStepActivate: step1Activate,
          // Called before the wizard moves to the next step
          onNextStep: function () {
            return Shell.UI.Validation.validateContainer("#dm-create-step1");
          }
        }],
        // Called when the user clicks the "Finish" button on the last step
        onComplete: function () {
          var newPassword, newResellerPortalUrl;
          newPassword = $("#dm-password").val();
          newResellerPortalUrl = registerReseller ? $("#dm-portalUrl").val() : null;
          // Call whatever backend function we need to. In our example, it returns a promise
          promise = callback(newPassword, newResellerPortalUrl);
    
          // Create a new Progress Operation object
          var progressOperation = new Shell.UI.ProgressOperation(
            // Title of operation
            "Registering endpoint...",
            // Initial status. null = default
            null,
            // Is indeterministic? (Does it NOT provide a % complete)
            true);
    
          // This adds the progress operation we set up earlier to the visible list of PrOp's
          Shell.UI.ProgressOperations.add(progressOperation);
    
          promise
            .done(function() {
               // When the operation succeeds, complete the progress operation
               progressOperation.complete(
                 "Successfully registered the endpoint.",
                 Shell.UI.InteractionSeverity.information);
               })
            .fail(function() {
               // When the operation fails, complete the progress operation
               progressOperation.complete(
                 "Failed to register the endpoint.",
                 Shell.UI.InteractionSeverity.error,
                 Shell.UI.InteractionBehavior.ok);
            });
        }
      },
      {
        // Other supported sized include large, medium & small
        size: "mediumplus" 
      });
    

참고 항목

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