mlflow/server/js/src/utils/Utils.js
/**
   * Renders the source name and entry point into an HTML element. Used for display.
   * @param tags Object containing tag key value pairs.
   * @param queryParams Query params to add to certain source type links.
   */
Renders the source name and entry point into an HTML element. Used for display.
@param tags Object containing tag key value pairs.
@param queryParams Query params to add to certain source type links.
Renders the source name and entry point into an HTML element . Used for display . @param tags Object containing tag key value pairs . @param queryParams Query params to add to certain source type links .
static renderSource(tags, queryParams) {
    const sourceName = Utils.getSourceName(tags);
    const sourceType = Utils.getSourceType(tags);
    let res = Utils.formatSource(tags);
    if (sourceType === "PROJECT") {
      const url = Utils.getGitRepoUrl(sourceName);
      if (url) {
        res = <a target="_top" href={url}>{res}</a>;
      }
      return res;
    } else if (sourceType === "NOTEBOOK") {
      const revisionIdTag = 'mlflow.databricks.notebookRevisionID';
      const notebookIdTag = 'mlflow.databricks.notebookID';
      const revisionId = tags && tags[revisionIdTag] && tags[revisionIdTag].value;
      const notebookId = tags && tags[notebookIdTag] && tags[notebookIdTag].value;
      if (notebookId) {
        let url = Utils.setQueryParams(window.location.origin, queryParams);
        url += `#notebook/${notebookId}`;
        if (revisionId) {
          url += `/revision/${revisionId}`;
        }
        res = (<a title={sourceName} href={url} target='_top'>
          {Utils.baseName(sourceName)}
        </a>);
      }
      return res;
    } else {
      return res;
    }
  }
static renderSource ( tags , queryParams ) { const sourceName = Utils . getSourceName ( tags ) ; const sourceType = Utils . getSourceType ( tags ) ; let res = Utils . formatSource ( tags ) ; if ( sourceType === "PROJECT" ) { const url = Utils . getGitRepoUrl ( sourceName ) ; if ( url ) { res = < a target = "_top" href = { url } > { res } < / a > ; } return res ; } else if ( sourceType === "NOTEBOOK" ) { const revisionIdTag = 'mlflow.databricks.notebookRevisionID' ; const notebookIdTag = 'mlflow.databricks.notebookID' ; const revisionId = tags && tags [ revisionIdTag ] && tags [ revisionIdTag ] . value ; const notebookId = tags && tags [ notebookIdTag ] && tags [ notebookIdTag ] . value ; if ( notebookId ) { let url = Utils . setQueryParams ( window . location . origin , queryParams ) ; url += ` ${ notebookId } ` ; if ( revisionId ) { url += ` ${ revisionId } ` ; } res = ( < a title = { sourceName } href = { url } target = '_top' > { Utils . baseName ( sourceName ) } < / a > ) ; } return res ; } else { return res ; } }
Renders the source name and entry point into an HTML element.
Renders the source name and entry point into an HTML element .