当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript application.model.Application类代码示例

本文整理汇总了TypeScript中core/application/application.model.Application的典型用法代码示例。如果您正苦于以下问题:TypeScript model.Application类的具体用法?TypeScript model.Application怎么用?TypeScript model.Application使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了model.Application类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: addTagsToSecurityGroups

 public static 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:mizzy,项目名称:deck,代码行数:15,代码来源:EntityTagsReader.ts

示例2: addTagsToServerGroupManagers

 public static addTagsToServerGroupManagers(application: Application): void {
   if (!SETTINGS.feature.entityTags) {
     return;
   }
   const allTags = application.getDataSource('entityTags').data;
   const serverGroupManagerTags: IEntityTags[] = allTags.filter(t => t.entityRef.entityType === 'servergroupmanager');
   application.getDataSource('serverGroupManagers').data.forEach((serverGroupManager: IServerGroupManager) => {
     serverGroupManager.entityTags = serverGroupManagerTags.find(
       t =>
         t.entityRef.entityId === serverGroupManager.name &&
         t.entityRef.account === serverGroupManager.account &&
         t.entityRef.region === serverGroupManager.region,
     );
   });
 }
开发者ID:emjburns,项目名称:deck,代码行数:15,代码来源:EntityTagsReader.ts

示例3: addTagsToLoadBalancers

 public static addTagsToLoadBalancers(application: Application): void {
   if (!SETTINGS.feature.entityTags) {
     return;
   }
   const allTags = application.getDataSource('entityTags').data;
   const loadBalancerTags: IEntityTags[] = allTags.filter(t => t.entityRef.entityType === 'loadbalancer');
   application.getDataSource('loadBalancers').data.forEach((loadBalancer: ILoadBalancer) => {
     loadBalancer.entityTags = loadBalancerTags.find(
       t =>
         t.entityRef.entityId === loadBalancer.name &&
         t.entityRef.account === loadBalancer.account &&
         t.entityRef.region === loadBalancer.region,
     );
   });
 }
开发者ID:emjburns,项目名称:deck,代码行数:15,代码来源:EntityTagsReader.ts

示例4: it

  it('attaches load balancer to firewall usages', function() {
    let data: any[] = null;

    const application: Application = ApplicationModelBuilder.createApplicationForTests(
      'app',
      {
        key: 'securityGroups',
        loader: () => $q.resolve([]),
        onLoad: (_app, _data) => $q.resolve(_data),
      },
      {
        key: 'serverGroups',
        loader: () => $q.resolve([]),
        onLoad: (_app, _data) => $q.resolve(_data),
      },
      {
        key: 'loadBalancers',
        loader: () =>
          $q.resolve([
            {
              name: 'my-elb',
              account: 'test',
              region: 'us-east-1',
              securityGroups: ['not-cached'],
            },
          ]),
        onLoad: (_app, _data) => $q.resolve(_data),
      },
    );

    application.serverGroups.refresh();
    application.loadBalancers.refresh();
    $scope.$digest();

    $http.expectGET(`${API.baseUrl}/securityGroups`).respond(200, {
      test: {
        aws: {
          'us-east-1': [{ name: 'not-cached' }],
        },
      },
    });
    reader.getApplicationSecurityGroups(application, null).then((results: any[]) => (data = results));
    $http.flush();
    $scope.$digest();
    const group: ISecurityGroup = data[0];
    expect(group.name).toBe('not-cached');
    expect(group.usages.loadBalancers[0]).toEqual({ name: application.getDataSource('loadBalancers').data[0].name });
  });
开发者ID:emjburns,项目名称:deck,代码行数:48,代码来源:securityGroupReader.service.spec.ts

示例5: it

  it('should clear cache, then reload security groups and try again if a security group is not found', function () {
    let data: ISecurityGroup[] = null;
    const application: Application = applicationModelBuilder.createApplication(
      {
        key: 'securityGroups',
      },
      {
        key: 'serverGroups',
        ready: () => $q.when(null),
        loaded: true
      },
      {
        securityGroupsIndex: {}
      },
      {
        key: 'loadBalancers',
        ready: () => $q.when(null),
        loaded: true
      });
    application.getDataSource('securityGroups').data = [];
    application.getDataSource('serverGroups').data = [];
    application.getDataSource('loadBalancers').data = [
      {
        name: 'my-elb',
        account: 'test',
        region: 'us-east-1',
        securityGroups: [
          'not-cached',
        ]
      }
    ];

    $http.expectGET(API.baseUrl + '/securityGroups').respond(200, {
      test: {
        aws: {
          'us-east-1': [
            {name: 'not-cached', id: 'not-cached-id', vpcId: null}
          ]
        }
      }
    });

    reader.getApplicationSecurityGroups(application, []).then(results => data = results);
    $http.flush();
    const group: ISecurityGroup = data[0];
    expect(group.name).toBe('not-cached');
    expect(group.usages.loadBalancers[0]).toEqual({name: application.getDataSource('loadBalancers').data[0].name});
  });
开发者ID:brujoand,项目名称:deck,代码行数:48,代码来源:securityGroupReader.service.spec.ts

示例6: beforeEach

 beforeEach(() => {
   application = ApplicationModelBuilder.createApplicationForTests(
     'app',
     {
       key: 'optionalSource',
       optional: true,
       visible: true,
     },
     {
       key: 'invisibleSource',
       visible: false,
     },
     {
       key: 'requiredSource',
       visible: true,
     },
     {
       key: 'optInSource',
       optional: true,
       visible: true,
       optIn: true,
     },
   );
   application.getDataSource('optInSource').disabled = true;
   application.attributes = { accounts: ['test'] };
 });
开发者ID:emjburns,项目名称:deck,代码行数:26,代码来源:applicationDataSourceEditor.component.spec.ts

示例7: addServerGroupSecurityGroups

  private addServerGroupSecurityGroups(application: Application): ISecurityGroupProcessorResult {
    let notFoundCaught = false;
    const securityGroups: ISecurityGroup[] = [];
    application.getDataSource('serverGroups').data.forEach((serverGroup: IServerGroup) => {
      if (serverGroup.securityGroups) {
        serverGroup.securityGroups.forEach((securityGroupId: string) => {
          try {
            const securityGroup: ISecurityGroup = this.resolve(application['securityGroupsIndex'], serverGroup, securityGroupId);
            SecurityGroupReader.attachUsageFields(securityGroup);
            if (!securityGroup.usages.serverGroups.some((sg: IServerGroupUsage) => sg.name === serverGroup.name)) {
              securityGroup.usages.serverGroups.push({
                name: serverGroup.name,
                isDisabled: serverGroup.isDisabled,
                region: serverGroup.region,
              });
            }
            securityGroups.push(securityGroup);
          } catch (e) {
            this.$log.warn('could not attach security group to server group:', serverGroup.name, securityGroupId);
            notFoundCaught = true;
          }
        });
      }
    });

    return {notFoundCaught, securityGroups};
  }
开发者ID:jcwest,项目名称:deck,代码行数:27,代码来源:securityGroupReader.service.ts

示例8: addTagsToServerGroups

 public addTagsToServerGroups(application: Application): void {
   if (!SETTINGS.feature.entityTags) {
     return;
   }
   const allTags = application.getDataSource('entityTags').data;
   const serverGroupTags: IEntityTags[] = allTags.filter(t => t.entityRef.entityType === 'servergroup');
   const clusterTags: IEntityTags[] = allTags.filter(t => t.entityRef.entityType === 'cluster');
   application.getDataSource('serverGroups').data.forEach((serverGroup: IServerGroup) => {
     serverGroup.entityTags = serverGroupTags.find(t => t.entityRef.entityId === serverGroup.name &&
       t.entityRef.account === serverGroup.account &&
       t.entityRef.region === serverGroup.region);
     serverGroup.clusterEntityTags = clusterTags.filter(t => t.entityRef.entityId === serverGroup.cluster &&
       (t.entityRef.account === '*' || t.entityRef.account === serverGroup.account) &&
       (t.entityRef.region === '*' || t.entityRef.region === serverGroup.region));
   });
 }
开发者ID:robfletcher,项目名称:deck,代码行数:16,代码来源:entityTags.read.service.ts

示例9: it

 it('adds a server group when new one provided in same sub-sub-group', function(done) {
   application = this.buildApplication({
     serverGroups: {
       data: [
         this.serverGroup000,
         this.serverGroup001,
         {
           cluster: 'cluster-a',
           name: 'cluster-a-v003',
           account: 'prod',
           region: 'us-east-1',
           stringVal: 'new',
           category: 'serverGroup',
           instances: [],
         },
       ],
     },
   });
   application.clusters = clusterService.createServerGroupClusters(application.getDataSource('serverGroups').data);
   ClusterState.filterService.updateClusterGroups(application);
   setTimeout(() => {
     expect(ClusterState.filterModel.asFilterModel.groups.length).toBe(1);
     expect(ClusterState.filterModel.asFilterModel.groups[0].subgroups.length).toBe(1);
     expect(ClusterState.filterModel.asFilterModel.groups[0].subgroups[0].subgroups.length).toBe(1);
     expect(ClusterState.filterModel.asFilterModel.groups[0].subgroups[0].subgroups[0].serverGroups.length).toBe(3);
     expect(ClusterState.filterModel.asFilterModel.groups[0].subgroups[0].subgroups[0].serverGroups[2].name).toBe(
       'cluster-a-v003',
     );
     done();
   }, debounceTimeout);
 });
开发者ID:mizzy,项目名称:deck,代码行数:31,代码来源:ClusterFilterService.spec.ts


注:本文中的core/application/application.model.Application类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。