From 7f02d022880438315399d556fa537ad1b4fed51e Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Thu, 19 May 2022 10:58:09 +0800 Subject: [PATCH] fix issue --- templates/repo/cloudbrain/benchmark/show.tmpl | 2 +- web_src/js/features/contexmenu.js | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/templates/repo/cloudbrain/benchmark/show.tmpl b/templates/repo/cloudbrain/benchmark/show.tmpl index 4ad5c44c4..c79f6f268 100755 --- a/templates/repo/cloudbrain/benchmark/show.tmpl +++ b/templates/repo/cloudbrain/benchmark/show.tmpl @@ -485,7 +485,7 @@
- {{if .User.Name}} + {{if .User}} {{.User.Name}} {{else}} -- diff --git a/web_src/js/features/contexmenu.js b/web_src/js/features/contexmenu.js index ff827060b..23494d480 100644 --- a/web_src/js/features/contexmenu.js +++ b/web_src/js/features/contexmenu.js @@ -40,7 +40,8 @@ export default async function initContextMenu() { if (a.currentTarget.parentNode.nextElementSibling) { a.currentTarget.parentNode.style.setProperty('display', 'none', 'important') a.currentTarget.parentNode.nextElementSibling.style.display = 'table-row' - a.currentTarget.parentNode.nextElementSibling.getElementsByTagName("input")[0].setAttribute("value", a.currentTarget.getElementsByTagName("a")[0].getAttribute('title')) + let renameFile = a.currentTarget.getElementsByTagName("a")[0].getAttribute('title') + a.currentTarget.parentNode.nextElementSibling.getElementsByTagName("input")[0].setAttribute("value", renameFile.substr(0, renameFile.indexOf('/'))) } let btn = a.currentTarget.parentNode.nextElementSibling.getElementsByTagName("button")[0] @@ -55,9 +56,6 @@ export default async function initContextMenu() { contentType: "application/x-www-form-urlencoded", data: { last_commit: last_commit, tree_path: tree_path, _csrf: csrf }, success: function (res) { - console.log("--------------") - console.log(res.Code) - console.log(res.Message) if (res.Code === 0) { document.getElementById("mask").style.display = "block" location.reload()