feat: show github-only spider md links
This commit is contained in:
@@ -180,25 +180,23 @@ const formatDateTime = (value?: string) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const remoteConfigured = computed(() => {
|
const remoteConfigured = computed(() => {
|
||||||
return Boolean(summary.value.gitee?.configured || summary.value.github?.configured);
|
return Boolean(summary.value.github?.configured);
|
||||||
});
|
});
|
||||||
|
|
||||||
const remoteTitle = computed(() => {
|
const remoteTitle = computed(() => {
|
||||||
if (summary.value.gitee?.configured || summary.value.github?.configured) {
|
if (summary.value.github?.configured) {
|
||||||
return "当前已配置远端自动推送,生成后会自动返回可复制链接";
|
return "当前已配置 GitHub 自动推送,生成后会自动返回可复制链接";
|
||||||
}
|
}
|
||||||
if (summary.value.gitee?.enabled || summary.value.github?.enabled) {
|
if (summary.value.github?.enabled) {
|
||||||
return "远端推送已启用但未配完整,当前只能保留本地文件";
|
return "GitHub 推送已启用但未配完整,当前只能保留本地文件";
|
||||||
}
|
}
|
||||||
return "当前未启用远端推送,生成后仅保留本地文件";
|
return "当前未启用 GitHub 推送,生成后仅保留本地文件";
|
||||||
});
|
});
|
||||||
|
|
||||||
const remoteDescription = computed(() => {
|
const remoteDescription = computed(() => {
|
||||||
const gitee = summary.value.gitee || {};
|
|
||||||
const github = summary.value.github || {};
|
const github = summary.value.github || {};
|
||||||
const giteeRepo = gitee.owner && gitee.repo ? `${gitee.owner}/${gitee.repo}` : "未配置";
|
|
||||||
const githubRepo = github.owner && github.repo ? `${github.owner}/${github.repo}` : "未配置";
|
const githubRepo = github.owner && github.repo ? `${github.owner}/${github.repo}` : "未配置";
|
||||||
return `Gitee:${giteeRepo} / ${gitee.branch || "-"} / ${gitee.root || "-"};GitHub:${githubRepo} / ${github.branch || "-"} / ${github.root || "-"}`;
|
return `GitHub:${githubRepo} / ${github.branch || "-"} / ${github.root || "-"}`;
|
||||||
});
|
});
|
||||||
|
|
||||||
const latestRunTitle = computed(() => {
|
const latestRunTitle = computed(() => {
|
||||||
@@ -216,34 +214,20 @@ const latestRunDescription = computed(() => {
|
|||||||
const runRoot = String(row.run_root || "").trim() || "-";
|
const runRoot = String(row.run_root || "").trim() || "-";
|
||||||
const githubStatus = String(row.github_push_status || "").trim();
|
const githubStatus = String(row.github_push_status || "").trim();
|
||||||
const githubError = String(row.github_push_error || "").trim();
|
const githubError = String(row.github_push_error || "").trim();
|
||||||
const giteeStatus = String(row.gitee_push_status || "").trim();
|
|
||||||
const giteeError = String(row.gitee_push_error || "").trim();
|
|
||||||
let pushed = "当前仅保留本地";
|
let pushed = "当前仅保留本地";
|
||||||
let pushError = "";
|
const pushError = githubError;
|
||||||
|
|
||||||
if (githubStatus === "success" && giteeStatus === "success") {
|
if (githubStatus === "success") {
|
||||||
pushed = "已推送到 GitHub 和 Gitee";
|
|
||||||
} else if (githubStatus === "success") {
|
|
||||||
pushed = "已推送到 GitHub";
|
pushed = "已推送到 GitHub";
|
||||||
pushError = giteeError;
|
|
||||||
} else if (giteeStatus === "success") {
|
|
||||||
pushed = "已推送到 Gitee";
|
|
||||||
pushError = githubError;
|
|
||||||
} else if (githubStatus === "failed" || githubStatus === "partial_failed") {
|
} else if (githubStatus === "failed" || githubStatus === "partial_failed") {
|
||||||
pushed = githubStatus === "partial_failed" ? "本地生成成功,GitHub 部分推送后失败" : "本地生成成功,GitHub 推送失败";
|
pushed = githubStatus === "partial_failed" ? "本地生成成功,GitHub 部分推送后失败" : "本地生成成功,GitHub 推送失败";
|
||||||
pushError = githubError;
|
|
||||||
} else if (giteeStatus === "failed" || giteeStatus === "partial_failed") {
|
|
||||||
pushed = giteeStatus === "partial_failed" ? "本地生成成功,Gitee 部分推送后失败" : "本地生成成功,Gitee 推送失败";
|
|
||||||
pushError = giteeError;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return `目录:${runRoot};文件数:${fileCount};链接数:${totalLinks};状态:${pushed}${pushError ? `;错误:${pushError}` : ""}`;
|
return `目录:${runRoot};文件数:${fileCount};链接数:${totalLinks};状态:${pushed}${pushError ? `;错误:${pushError}` : ""}`;
|
||||||
});
|
});
|
||||||
|
|
||||||
const remoteFiles = (row: SiteList.DomainSpiderMdRunSummaryItem) => {
|
const remoteFiles = (row: SiteList.DomainSpiderMdRunSummaryItem) => {
|
||||||
const githubFiles = row.github_files || [];
|
return row.github_files || [];
|
||||||
if (githubFiles.length) return githubFiles;
|
|
||||||
return row.gitee_files || [];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const remoteMdFiles = (row: SiteList.DomainSpiderMdRunSummaryItem) => {
|
const remoteMdFiles = (row: SiteList.DomainSpiderMdRunSummaryItem) => {
|
||||||
@@ -251,21 +235,16 @@ const remoteMdFiles = (row: SiteList.DomainSpiderMdRunSummaryItem) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const remoteStatus = (row: SiteList.DomainSpiderMdRunSummaryItem) => {
|
const remoteStatus = (row: SiteList.DomainSpiderMdRunSummaryItem) => {
|
||||||
return String(row.github_push_status || row.gitee_push_status || "").trim();
|
return String(row.github_push_status || "").trim();
|
||||||
};
|
};
|
||||||
|
|
||||||
const emptyRemoteDescription = (row: SiteList.DomainSpiderMdRunSummaryItem) => {
|
const emptyRemoteDescription = (row: SiteList.DomainSpiderMdRunSummaryItem) => {
|
||||||
const githubStatus = String(row.github_push_status || "").trim();
|
const githubStatus = String(row.github_push_status || "").trim();
|
||||||
const githubError = String(row.github_push_error || "").trim();
|
const githubError = String(row.github_push_error || "").trim();
|
||||||
const giteeStatus = String(row.gitee_push_status || "").trim();
|
|
||||||
const giteeError = String(row.gitee_push_error || "").trim();
|
|
||||||
if (githubStatus === "failed" || githubStatus === "partial_failed") {
|
if (githubStatus === "failed" || githubStatus === "partial_failed") {
|
||||||
return `GitHub 推送失败:${githubError || "请查看任务日志"}`;
|
return `GitHub 推送失败:${githubError || "请查看任务日志"}`;
|
||||||
}
|
}
|
||||||
if (giteeStatus === "failed" || giteeStatus === "partial_failed") {
|
return "当前这轮还没有可复制的 GitHub 链接";
|
||||||
return `Gitee 推送失败:${giteeError || "请查看任务日志"}`;
|
|
||||||
}
|
|
||||||
return "当前这轮还没有可复制的远端链接";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const loadData = async () => {
|
const loadData = async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user