INNER CODE UNIT · JavaScript

datasetOpLabel

rootSunc/CNEquity · frontend/src/main.js:369

function datasetOpLabel(op, why) {
  const labels = {
    "backfill.run": tr("回填这个数据集", "Backfill this dataset"),
    "daily.stale": tr("补抓落后数据", "Catch up stale data"),
    "derive.run": tr("重算派生", "Recompute derived data"),
  };
  return labels[op] || why;
}

function datasetActionButtons(dataset) {
  const runnable = (dataset.commands || []).filter((command) => command.op).slice(0, 2);
  const buttons = [`<a class="button button-ghost" href="#/datasets">${tr("← 返回数据集", "← Datasets")}</a>`];
  for (const [index, command] of runnable.entries()) {
    const tone = index === 0 ? "button button-primary" : "button button-ghost";
    buttons.push(`<a class="${tone}" href="${opsHref(command.op, command.params)}">${esc(datasetOpLabel(command.op, command.why))}</a>`);
  }
  return buttons.join("");
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…