当前位置: 首页>>代码示例>>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;未经允许,请勿转载。