當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript model.Application.getDataSource方法代碼示例

本文整理匯總了TypeScript中core/application/application.model.Application.getDataSource方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript model.Application.getDataSource方法的具體用法?TypeScript model.Application.getDataSource怎麽用?TypeScript model.Application.getDataSource使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在core/application/application.model.Application的用法示例。


在下文中一共展示了model.Application.getDataSource方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: it

 it('sets appropriate flags when task load fails', function () {
   spyOn(taskReader, 'getTasks').and.returnValue($q.reject(null));
   configureApplication();
   expect(application.getDataSource('tasks').loaded).toBe(false);
   expect(application.getDataSource('tasks').loading).toBe(false);
   expect(application.getDataSource('tasks').loadFailure).toBe(true);
 });
開發者ID:jcwest,項目名稱:deck,代碼行數:7,代碼來源:task.dataSource.spec.ts

示例2: it

 it('loads tasks and sets appropriate flags', function() {
   spyOn(TaskReader, 'getTasks').and.returnValue($q.when([]));
   configureApplication();
   expect(application.getDataSource('tasks').loaded).toBe(true);
   expect(application.getDataSource('tasks').loading).toBe(false);
   expect(application.getDataSource('tasks').loadFailure).toBe(false);
 });
開發者ID:emjburns,項目名稱:deck,代碼行數:7,代碼來源:task.dataSource.spec.ts

示例3: it

 it('sets appropriate flags when execution load fails', function () {
   spyOn(executionService, 'getExecutions').and.returnValue($q.reject(null));
   configureApplication();
   application.getDataSource('executions').activate();
   $scope.$digest();
   expect(application.getDataSource('executions').loaded).toBe(false);
   expect(application.getDataSource('executions').loading).toBe(false);
   expect(application.getDataSource('executions').loadFailure).toBe(true);
 });
開發者ID:jcwest,項目名稱:deck,代碼行數:9,代碼來源:delivery.dataSource.spec.ts

示例4: handleTaskSuccess

 public handleTaskSuccess(task: ITask): void {
   this.task = task;
   if (this.application && this.application.getDataSource('runningTasks')) {
     this.application.getDataSource('runningTasks').refresh();
   }
   this.taskReader.waitUntilTaskCompletes(task, this.monitorInterval)
     .then(() => this.onTaskComplete ? this.onTaskComplete() : noop)
     .catch(() => this.setError(task));
 }
開發者ID:brujoand,項目名稱:deck,代碼行數:9,代碼來源:taskMonitor.builder.ts

示例5: addTagsToExecutions

 public static addTagsToExecutions(application: Application): void {
   if (!SETTINGS.feature.entityTags) {
     return;
   }
   const allTags = application.getDataSource('entityTags').data;
   const executionTags: IEntityTags[] = allTags.filter(t => t.entityRef.entityType === 'execution');
   application.getDataSource('executions').data.forEach((execution: IExecution) => {
     execution.entityTags = executionTags.find(t => t.entityRef.entityId === execution.id);
   });
 }
開發者ID:emjburns,項目名稱:deck,代碼行數:10,代碼來源:EntityTagsReader.ts

示例6: addTagsToPipelines

 public static addTagsToPipelines(application: Application): void {
   if (!SETTINGS.feature.entityTags) {
     return;
   }
   const allTags = application.getDataSource('entityTags').data;
   const pipelineTags: IEntityTags[] = allTags.filter(t => t.entityRef.entityType === 'pipeline');
   application.getDataSource('pipelineConfigs').data.forEach((pipeline: IPipeline) => {
     pipeline.entityTags = pipelineTags.find(t => t.entityRef.entityId === pipeline.id);
   });
 }
開發者ID:emjburns,項目名稱:deck,代碼行數:10,代碼來源:EntityTagsReader.ts

示例7: addTagsToLoadBalancers

 public addTagsToLoadBalancers(application: Application): void {
   if (!SETTINGS.feature.entityTags) {
     return;
   }
   const allTags = application.getDataSource('entityTags').data;
   const serverGroupTags: IEntityTags[] = allTags.filter(t => t.entityRef.entityType === 'loadbalancer');
   application.getDataSource('loadBalancers').data.forEach((loadBalancer: ILoadBalancer) => {
     loadBalancer.entityTags = serverGroupTags.find(t => t.entityRef.entityId === loadBalancer.name &&
       t.entityRef.account === loadBalancer.account &&
       t.entityRef.region === loadBalancer.region);
   });
 }
開發者ID:robfletcher,項目名稱:deck,代碼行數:12,代碼來源:entityTags.read.service.ts

示例8: addTagsToSecurityGroups

 public addTagsToSecurityGroups(application: Application): void {
   if (!SETTINGS.feature.entityTags) {
     return;
   }
   const allTags = application.getDataSource('entityTags').data;
   const securityGroupTags: IEntityTags[] = allTags.filter(t => t.entityRef.entityType === 'securitygroup');
   application.getDataSource('securityGroups').data.forEach((securityGroup: ISecurityGroup) => {
     securityGroup.entityTags = securityGroupTags.find(t => t.entityRef.entityId === securityGroup.name &&
       t.entityRef.account === securityGroup.account &&
       t.entityRef.region === securityGroup.region);
   });
 }
開發者ID:robfletcher,項目名稱:deck,代碼行數:12,代碼來源:entityTags.read.service.ts

示例9: attachSecurityGroups

  private attachSecurityGroups(
    application: Application,
    nameBasedSecurityGroups: ISecurityGroup[],
    retryIfNotFound: boolean,
  ): IPromise<any[]> {
    let data: ISecurityGroup[] = [];
    let notFoundCaught = false;
    if (nameBasedSecurityGroups) {
      // reset everything
      application.getDataSource('securityGroups').data = [];
      const nameBasedGroups: ISecurityGroupProcessorResult = this.addNameBasedSecurityGroups(
        application,
        nameBasedSecurityGroups,
      );
      notFoundCaught = nameBasedGroups.notFoundCaught;
      if (!nameBasedGroups.notFoundCaught) {
        data = nameBasedGroups.securityGroups;
      }
    } else {
      // filter down to empty (name-based only) firewalls - we will repopulate usages
      data = application
        .getDataSource('securityGroups')
        .data.filter(
          (group: ISecurityGroup) => !group.usages.serverGroups.length && !group.usages.loadBalancers.length,
        );
    }

    if (!notFoundCaught) {
      const loadBalancerSecurityGroups: ISecurityGroupProcessorResult = this.addLoadBalancerSecurityGroups(application);
      notFoundCaught = loadBalancerSecurityGroups.notFoundCaught;
      if (!notFoundCaught) {
        data = data.concat(loadBalancerSecurityGroups.securityGroups.filter((sg: any) => !data.includes(sg)));
        const serverGroupSecurityGroups: ISecurityGroupProcessorResult = this.addServerGroupSecurityGroups(application);
        notFoundCaught = serverGroupSecurityGroups.notFoundCaught;
        if (!notFoundCaught) {
          data = data.concat(serverGroupSecurityGroups.securityGroups.filter((sg: any) => !data.includes(sg)));
        }
      }
    }

    data = uniq(data);
    if (notFoundCaught && retryIfNotFound) {
      this.$log.warn('Clearing firewall cache and trying again...');
      return this.clearCacheAndRetryAttachingSecurityGroups(application, nameBasedSecurityGroups);
    } else {
      data.forEach((sg: ISecurityGroup) => this.addNamePartsToSecurityGroup(sg));
      return this.$q
        .all(data.map((sg: ISecurityGroup) => this.securityGroupTransformer.normalizeSecurityGroup(sg)))
        .then(() => data);
    }
  }
開發者ID:mizzy,項目名稱:deck,代碼行數:51,代碼來源:securityGroupReader.service.ts


注:本文中的core/application/application.model.Application.getDataSource方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。