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


TypeScript IQService.all方法代码示例

本文整理汇总了TypeScript中angular.IQService.all方法的典型用法代码示例。如果您正苦于以下问题:TypeScript IQService.all方法的具体用法?TypeScript IQService.all怎么用?TypeScript IQService.all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在angular.IQService的用法示例。


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

示例1: buildNewServerGroupCommand

  public buildNewServerGroupCommand(app: Application,
                                    selectedProvider = 'appengine',
                                    mode = 'create'): IPromise<IAppengineServerGroupCommand> {
    const dataToFetch = {
      accounts: this.accountService.getAllAccountDetailsForProvider('appengine'),
    };

    const viewState: IViewState = {
      mode: mode,
      submitButtonLabel: this.getSubmitButtonLabel(mode),
      disableStrategySelection: mode === 'create' ? true : false,
    };

    return this.$q.all(dataToFetch)
      .then((backingData: any) => {
        const credentials: string = this.getCredentials(backingData.accounts, app);
        const region: string = this.getRegion(backingData.accounts, credentials);

        return {
          application: app.name,
          backingData,
          viewState,
          credentials,
          region,
          selectedProvider,
          interestingHealthProviderNames: [],
        } as IAppengineServerGroupCommand;
      });
  }
开发者ID:jcwest,项目名称:deck,代码行数:29,代码来源:serverGroupCommandBuilder.service.ts

示例2: getPipelineTemplatesByScopes

 public getPipelineTemplatesByScopes(scopes: string[]): IPromise<IPipelineTemplate[]> {
   return this.$q.all(scopes.map(this.getPipelineTemplatesByScope)).then(flatten)
     .then(templates => {
       templates.forEach(template => template.selfLink = `spinnaker://${template.id}`);
       return templates;
     });
 }
开发者ID:robfletcher,项目名称:deck,代码行数:7,代码来源:pipelineTemplate.service.ts

示例3: search

  search(options: any) {
    const sections: any = {};
    const promises = [];
    const query = _.clone(options);
    const hasFilters =
      options.query ||
      (options.tag && options.tag.length > 0) ||
      options.starred ||
      (options.folderIds && options.folderIds.length > 0);

    if (!options.skipRecent && !hasFilters) {
      promises.push(this.getRecentDashboards(sections));
    }

    if (!options.skipStarred && !hasFilters) {
      promises.push(this.getStarred(sections));
    }

    query.folderIds = query.folderIds || [];
    if (!hasFilters) {
      query.folderIds = [0];
    }

    promises.push(
      this.backendSrv.search(query).then(results => {
        return this.handleSearchResult(sections, results);
      })
    );

    return this.$q.all(promises).then(() => {
      return _.sortBy(_.values(sections), 'score');
    });
  }
开发者ID:grafana,项目名称:grafana,代码行数:33,代码来源:search_srv.ts

示例4: keys

      .then((backingData: Partial<IEcsServerGroupCommandBackingData>) => {
        let loadBalancerReloader = this.$q.when();
        backingData.accounts = keys(backingData.credentialsKeyedByAccount);
        backingData.filtered = {} as IEcsServerGroupCommandBackingDataFiltered;
        cmd.backingData = backingData as IEcsServerGroupCommandBackingData;
        this.configureVpcId(cmd);
        this.configureAvailableIamRoles(cmd);
        this.configureAvailableSubnetTypes(cmd);
        this.configureAvailableSecurityGroups(cmd);
        this.configureAvailableMetricAlarms(cmd);
        this.configureAvailableEcsClusters(cmd);

        if (cmd.loadBalancers && cmd.loadBalancers.length) {
          // verify all load balancers are accounted for; otherwise, try refreshing load balancers cache
          const loadBalancerNames = this.getLoadBalancerNames(cmd);
          if (intersection(loadBalancerNames, cmd.loadBalancers).length < cmd.loadBalancers.length) {
            loadBalancerReloader = this.refreshLoadBalancers(cmd, true);
          }
        }

        return this.$q.all([loadBalancerReloader]).then(() => {
          this.applyOverrides('afterConfiguration', cmd);
          this.attachEventHandlers(cmd);
        });
      });
开发者ID:mizzy,项目名称:deck,代码行数:25,代码来源:serverGroupConfiguration.service.ts

示例5: getAllEntityTags

  public getAllEntityTags(entityType: string, entityIds: string[]): IPromise<IEntityTags[]> {
    if (!entityIds || !entityIds.length) {
      return this.$q.when([]);
    }
    const idGroups: string[] = this.collateEntityIds(entityType, uniq(entityIds));
    const succeeded = (val: IEntityTags[]) => val !== null;
    const sources = idGroups.map(idGroup => this.retryService.buildRetrySequence<IEntityTags[]>(
      () => this.API.one('tags')
        .withParams({
          entityType: entityType.toLowerCase(),
          entityId: idGroup
        }).getList(),
      succeeded, 1, 0)
    );

    const result: IDeferred<IEntityTags[]> = this.$q.defer();

    this.$q.all(sources).then(
      (entityTagGroups: IEntityTags[][]) => {
        const allTags: IEntityTags[] = this.flattenTagsAndAddMetadata(entityTagGroups);
        result.resolve(allTags);
      })
      .catch(() => {
        this.$exceptionHandler(new Error(`Failed to load ${entityType} entity tags; groups: \n${idGroups.join('\n')}`));
        result.resolve([]);
      });

    return result.promise;
  }
开发者ID:brujoand,项目名称:deck,代码行数:29,代码来源:entityTags.read.service.ts

示例6: getAllEntityTags

  public getAllEntityTags(entityType: string, entityIds: string[]): IPromise<IEntityTags[]> {
    if (!entityIds || !entityIds.length) {
      return this.$q.when([]);
    }
    const idGroups: ICollatedIdGroup[] = this.collateEntityIds(entityType, entityIds);
    const succeeded = (val: IEntityTags[]) => val !== null;
    const sources = idGroups.map(idGroup => this.retryService.buildRetrySequence<IEntityTags[]>(
      () => this.API.one('tags')
        .withParams({
          entityType: entityType.toLowerCase(),
          entityId: idGroup.entityId,
          maxResults: idGroup.maxResults,
        }).getList(),
      succeeded, 1, 0)
    );

    const result: IDeferred<IEntityTags[]> = this.$q.defer();

    this.$q.all(sources).then(
      (entityTagGroups: IEntityTags[][]) => {
        const allTags: IEntityTags[] = this.flattenTagsAndAddMetadata(entityTagGroups);
        result.resolve(allTags);
      })
      .catch(() => {
        result.resolve([]);
      });

    return result.promise;
  }
开发者ID:jcwest,项目名称:deck,代码行数:29,代码来源:entityTags.read.service.ts

示例7: applicationAccounts

 public applicationAccounts(application: Application = null): IPromise<IAccountDetails[]> {
   return this.$q.all([this.listProviders(application), this.listAccounts()]).then(([providers, accounts]) => {
     return providers.reduce((memo, p) => {
       return memo.concat(accounts.filter(acc => acc.cloudProvider === p));
     }, [] as IAccountDetails[]);
   });
 }
开发者ID:robfletcher,项目名称:deck,代码行数:7,代码来源:account.service.ts

示例8: placeOrders

  // todo: add return type
  placeOrders(orders: IOrder[]): IPromise<IOrder[]> {
    const url = this.lConfig.apiUrl + '/orders';
    const allOrdersPlacedPromise = map(orders, order => {
      return this.$http.post(url, this.prepareOrderForApi(order));
    });

    return this.$q.all(allOrdersPlacedPromise);
  }
开发者ID:lunches-platform,项目名称:fe,代码行数:9,代码来源:order.ts

示例9: configureCommand

  // TODO (Bruno Carrier): Why do we need to inject an Application into this constructor so that the app works?  This is strange, and needs investigating
  public configureCommand(command: IEcsServerGroupCommand): IPromise<void> {
    this.applyOverrides('beforeConfiguration', command);
    command.toggleSuspendedProcess = (process: string): void => {
      command.suspendedProcesses = command.suspendedProcesses || [];
      const processIndex = command.suspendedProcesses.indexOf(process);
      if (processIndex === -1) {
        command.suspendedProcesses.push(process);
      } else {
        command.suspendedProcesses.splice(processIndex, 1);
      }
    };

    command.processIsSuspended = (process: string): boolean => command.suspendedProcesses.includes(process);

    command.onStrategyChange = (strategy: IDeploymentStrategy): void => {
      // Any strategy other than None or Custom should force traffic to be enabled
      if (strategy.key !== '' && strategy.key !== 'custom') {
        command.suspendedProcesses = (command.suspendedProcesses || []).filter(p => p !== 'AddToLoadBalancer');
      }
    };

    command.regionIsDeprecated = (): boolean => {
      return has(command, 'backingData.filtered.regions') &&
        command.backingData.filtered.regions.some((region) => region.name === command.region && region.deprecated);
    };

    return this.$q.all({
      credentialsKeyedByAccount: this.accountService.getCredentialsKeyedByAccount('ecs'),
      loadBalancers: this.loadBalancerReader.listLoadBalancers('ecs'),
      subnets: this.subnetReader.listSubnets(),
      iamRoles: this.iamRoleReader.listRoles('ecs'),
      ecsClusters: this.ecsClusterReader.listClusters(),
      metricAlarms: this.metricAlarmReader.listMetricAlarms(),
    }).then((backingData: Partial<IEcsServerGroupCommandBackingData>) => {
      let loadBalancerReloader = this.$q.when(null);
      backingData.accounts = keys(backingData.credentialsKeyedByAccount);
      backingData.filtered = {} as IEcsServerGroupCommandBackingDataFiltered;
      command.backingData = backingData as IEcsServerGroupCommandBackingData;
      this.configureVpcId(command);
      this.configureAvailableIamRoles(command);
      this.configureAvailableMetricAlarms(command);
      this.configureAvailableEcsClusters(command);

      if (command.loadBalancers && command.loadBalancers.length) {
        // verify all load balancers are accounted for; otherwise, try refreshing load balancers cache
        const loadBalancerNames = this.getLoadBalancerNames(command);
        if (intersection(loadBalancerNames, command.loadBalancers).length < command.loadBalancers.length) {
          loadBalancerReloader = this.refreshLoadBalancers(command, true);
        }
      }

      return this.$q.all([loadBalancerReloader]).then(() => {
        this.applyOverrides('afterConfiguration', command);
        this.attachEventHandlers(command);
      });
    });
  }
开发者ID:robfletcher,项目名称:deck,代码行数:58,代码来源:serverGroupConfiguration.service.ts

示例10: buildNewManifestCommand

  public buildNewManifestCommand(app: Application, sourceManifest?: any, sourceMoniker?: IMoniker): IPromise<IKubernetesManifestCommandData> {
    const dataToFetch = {
      accounts: this.accountService.getAllAccountDetailsForProvider('kubernetes', 'v2'),
      artifactAccounts: this.accountService.getArtifactAccounts(),
    };

    return this.$q.all(dataToFetch)
      .then((backingData: any) => {
        const accountData = backingData.accounts[0];
        let account: string = null;
        if (accountData) {
          account = accountData.name;
        }

        let manifestArtifactAccount: string = null;
        const artifactAccountData = backingData.artifactAccounts[0];
        if (artifactAccountData) {
          manifestArtifactAccount = artifactAccountData.name;
        }

        const manifest: any = null;
        const manifests: any = null;
        const manifestText = !sourceManifest ? '' : dump(sourceManifest);
        const cloudProvider = 'kubernetes';
        const moniker = sourceMoniker || {
          app: app.name,
        };

        const relationships = {
          loadBalancers: [] as string[],
          securityGroups: [] as string[],
        };

        const versioned: any = null;

        return {
          command: {
            cloudProvider,
            manifest,
            manifests,
            relationships,
            moniker,
            account,
            versioned,
            manifestArtifactAccount,
          },
          metadata: {
            backingData,
            manifestText,
          }
        } as IKubernetesManifestCommandData;
      });
  }
开发者ID:robfletcher,项目名称:deck,代码行数:53,代码来源:manifestCommandBuilder.service.ts


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