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


TypeScript PageConfig.getWsUrl方法代碼示例

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


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

示例1: it

 it('should use default settings', () => {
   let settings = ServerConnection.makeSettings();
   expect(settings.baseUrl).to.be(PageConfig.getBaseUrl());
   expect(settings.wsUrl).to.be(PageConfig.getWsUrl());
   expect(settings.user).to.be('');
   expect(settings.password).to.be('');
   expect(settings.withCredentials).to.be(false);
   expect(settings.timeout).to.be(0);
   expect(settings.token).to.be(PageConfig.getOption('token'));
   expect(Object.keys(settings.requestHeaders).length).to.be(0);
 });
開發者ID:cameronoelsen,項目名稱:jupyterlab,代碼行數:11,代碼來源:serverconnection.spec.ts

示例2: makeSettings

 function makeSettings(options: Partial<ServerConnection.ISettings> = {}): ServerConnection.ISettings {
   let baseUrl = options.baseUrl || PageConfig.getBaseUrl();
   return {
     baseUrl,
     wsUrl: options.wsUrl || PageConfig.getWsUrl(baseUrl),
     user: options.user || '',
     password: options.password || '',
     withCredentials: !!options.withCredentials,
     timeout: options.timeout || 0,
     token: options.token || PageConfig.getOption('token'),
     requestHeaders: { ...options.requestHeaders || {} },
     xhrFactory: options.xhrFactory || xhrFactory,
     wsFactory: options.wsFactory || wsFactory
   };
 }
開發者ID:charnpreetsingh185,項目名稱:jupyterlab,代碼行數:15,代碼來源:serverconnection.ts

示例3: it

 it('should use default settings', () => {
   let settings = ServerConnection.makeSettings();
   expect(settings.baseUrl).to.be(PageConfig.getBaseUrl());
   expect(settings.wsUrl).to.be(PageConfig.getWsUrl());
   expect(settings.token).to.be(PageConfig.getOption('token'));
 });
開發者ID:datadesk,項目名稱:jupyterlab,代碼行數:6,代碼來源:serverconnection.spec.ts

示例4: it

 it('should get the base ws url of the page', () => {
   // The value was passed as a command line arg.
   expect(PageConfig.getWsUrl()).to.contain('ws://localhost');
 });
開發者ID:7125messi,項目名稱:jupyterlab,代碼行數:4,代碼來源:pageconfig.spec.ts

示例5: constructor

    /**
     * Create a new network error.
     */
    constructor(original: TypeError) {
      super(original.message);
      this.stack = original.stack;
    }
  }

  /**
   * The default settings.
   */
  export const defaultSettings: ServerConnection.ISettings = {
    baseUrl: PageConfig.getBaseUrl(),
    pageUrl: PageConfig.getOption('pageUrl'),
    wsUrl: PageConfig.getWsUrl(),
    token: PageConfig.getToken(),
    init: { cache: 'no-store', credentials: 'same-origin' },
    fetch: FETCH,
    Headers: HEADERS,
    Request: REQUEST,
    WebSocket: WEBSOCKET
  };
}

/**
 * The namespace for module private data.
 */
namespace Private {
  /**
   * Handle the server connection settings, returning a new value.
開發者ID:afshin,項目名稱:jupyterlab,代碼行數:31,代碼來源:serverconnection.ts

示例6: it

 it('should be an empty string for a bad base url', () => {
   const url = 'blargh://foo.com';
   expect(PageConfig.getWsUrl(url)).to.equal('');
 });
開發者ID:afshin,項目名稱:jupyterlab,代碼行數:4,代碼來源:pageconfig.spec.ts


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