How to use the routes.toRoute function in routes

To help you get started, we’ve selected a few routes examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github openpitrix / dashboard / src / pages / Dashboard / Overview / index.jsx View on Github external
handleClickTotalCard = (label, type) => {
    label = `${label}`.toLocaleLowerCase();
    const guessRoute = routes.portal[type][label] || routes.portal[label];
    this.props.history.push(toRoute(guessRoute));
  };
github openpitrix / dashboard / src / components / DetailCard / ClusterCard.jsx View on Github external
<ul>
          <li>
            <span>{t('Status')}</span>
            
          </li>
          <li>
            <span>{t('App')}</span>
            <label>
              <label>
                <img src="{app.icon}">
              </label>
              
                {app.name}
              
            </label>
          </li>
          <li>
            <span>{t('Version')}</span>
            <label>
              
              <span>{version.name}</span>
            </label>
          </li>
          <li>
            <span>{t('Runtime')}</span>
            </li></ul>
github openpitrix / dashboard / src / pages / Login / index.jsx View on Github external
handleSubmit = async (e, params) => {
    const { store, user } = this.props;
    const res = await store.oauth2Check(params);

    if (res && res.user) {
      await store.fetchDetail(res.user.sub, true);
    }

    const defaultUrl = toRoute(routes.portal.apps, user.defaultPortal);

    if (!(res && res.err)) {
      location.href = getUrlParam('redirect_url') || defaultUrl;
    } else {
      this.setState({
        hasError: true,
        showInputError: true
      });
    }
  };
github openpitrix / dashboard / src / pages / Dashboard / Apps / Deploy / index.jsx View on Github external
const res = await create({
      app_id: appId,
      version_id: versionId,
      runtime_id: runtimeId,
      conf: conf.replace(/>>>>>>/g, '.')
    });

    if (res && _.get(res, 'cluster_id')) {
      appDeployStore.success(t('Deploy app successfully'));
      const path = user.isDevPortal || user.isISVPortal
        ? toRoute(routes.portal._dev.sandboxInstances, {
          portal: 'dev',
          appId
        })
        : toRoute(routes.portal.clusters);
      setTimeout(() => history.push(path), 1000);
    }
  };

routes

Minimalist route matching for javascript

Unknown
Latest version published 9 years ago

Package Health Score

48 / 100
Full package analysis