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


TypeScript mithril.buildQueryString函数代码示例

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


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

示例1: apiCurrentAccessTokensPath

 static apiCurrentAccessTokensPath(filter?: "all" | "revoked" | "active") {
   if (filter) {
     return `/go/api/current_user/access_tokens?${m.buildQueryString({filter})}`;
   } else {
     return `/go/api/current_user/access_tokens`;
   }
 }
开发者ID:GaneshSPatil,项目名称:gocd,代码行数:7,代码来源:spark_routes.ts

示例2: pipelineMaterialSearchPath

 static pipelineMaterialSearchPath(pipelineName: string, fingerprint: string, searchText: string): string {
   const queryString = m.buildQueryString({
                                            fingerprint,
                                            pipeline_name: pipelineName,
                                            search_text: searchText
                                          });
   return `/go/api/internal/material_search?${queryString}`;
 }
开发者ID:GaneshSPatil,项目名称:gocd,代码行数:8,代码来源:spark_routes.ts

示例3: queryConfig

export function queryConfig(pattern = "%"): Promise<any[]> {
  const filter = stringify(["LIKE", ["PARAM", "_id"], pattern]);
  return m.request({
    method: "GET",
    url: `api/config/?${m.buildQueryString({ filter: filter })}`,
    background: true
  });
}
开发者ID:zaidka,项目名称:genieacs,代码行数:8,代码来源:store.ts

示例4: resourceExists

export function resourceExists(resource, id): Promise<number> {
  const param = resource === "devices" ? "DeviceID.ID" : "_id";
  const filter = ["=", ["PARAM", param], id];
  return m.request({
    method: "HEAD",
    url:
      `/api/${resource}/?` +
      m.buildQueryString({
        filter: memoizedStringify(filter)
      }),
    extract: xhr => +xhr.getResponseHeader("x-total-count"),
    background: true
  });
}
开发者ID:zaidka,项目名称:genieacs,代码行数:14,代码来源:store.ts

示例5: Promise

            new Promise((resolve2, reject2) => {
              m.request({
                method: "GET",
                url:
                  `/api/${resourceType}/?` +
                  m.buildQueryString({
                    filter: memoizedStringify(combinedFilterDiff)
                  })
              })
                .then(res => {
                  for (const r of res as {}[]) {
                    const id =
                      resourceType === "devices"
                        ? r["DeviceID.ID"].value[0]
                        : r["_id"];
                    resources[resourceType].objects.set(id, r);
                    deleted.delete(id);
                  }

                  for (const d of deleted) {
                    const obj = resources[resourceType].objects.get(d);
                    if (evaluate(combinedFilterDiff, obj, fulfillTimestamp))
                      resources[resourceType].objects.delete(d);
                  }

                  for (const queryResponse of toFetch) {
                    let filter = queries.filter.get(queryResponse);
                    filter = unpackExpression(filter);
                    const limit = queries.limit.get(queryResponse);
                    const bookmark = queries.bookmark.get(queryResponse);
                    const sort = queries.sort.get(queryResponse);
                    if (bookmark) filter = limitFilter(filter, sort, bookmark);

                    queries.value.set(
                      queryResponse,
                      findMatches(resourceType, filter, sort, limit)
                    );
                    queries.fulfilled.set(queryResponse, fulfillTimestamp);
                    queries.fulfilling.delete(queryResponse);
                  }
                  resolve2();
                })
                .catch(reject2);
            })
开发者ID:zaidka,项目名称:genieacs,代码行数:44,代码来源:store.ts

示例6: m

 view: () => {
   if (window.username) {
     return m(
       "div.user-menu",
       window.username,
       m(
         "button",
         {
           onclick: e => {
             e.target.disabled = true;
             store
               .logOut()
               .then(() => {
                 location.hash = "";
                 location.reload();
               })
               .catch(err => {
                 e.target.disabled = false;
                 notifications.push("error", err.message);
               });
             return false;
           }
         },
         "Log out"
       )
     );
   } else {
     return m(
       "div.user-menu",
       m(
         "a",
         {
           href:
             "#!/login?" + m.buildQueryString({ continue: m.route.get() })
         },
         "Log in"
       )
     );
   }
 }
开发者ID:zaidka,项目名称:genieacs,代码行数:40,代码来源:user-menu.ts

示例7: showDashboardPath

 static showDashboardPath(viewName?: string): string {
   if (viewName) {
     return `/go/api/dashboard?${m.buildQueryString({viewName})}`;
   }
   return "/go/api/dashboard";
 }
开发者ID:GaneshSPatil,项目名称:gocd,代码行数:6,代码来源:spark_routes.ts

示例8: apiUsersSearchPath

 static apiUsersSearchPath(searchText: string) {
   return `/go/api/user_search?${m.buildQueryString({q: searchText})}`;
 }
开发者ID:GaneshSPatil,项目名称:gocd,代码行数:3,代码来源:spark_routes.ts


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