From bc5c50cdfd9cbcb0bcc7a38c9782fa8e24cbb058 Mon Sep 17 00:00:00 2001
From: waynelwz <100347187+waynelwz@users.noreply.github.com>
Date: Mon, 26 Sep 2022 21:30:57 +0800
Subject: [PATCH] optimize: dag/eva layout/table render (#1303)
* optimize: job dag layout
* optimize: action showing when hover
* update: icon of admin setting
* optimize: resize bar
* optimize: evaluation list laytou
* optimize: data table reduce extra render
* fix: type error
* optimize: canvas postion
---
console/package.json | 2 +-
console/pnpm-lock.yaml | 15 +-
console/src/api/WithAuth.tsx | 1 +
console/src/assets/fonts/iconfont.css | 10 +-
console/src/assets/fonts/iconfont.js | 2 +-
console/src/assets/fonts/iconfont.ttf | 4 +-
console/src/assets/fonts/iconfont.woff | 4 +-
console/src/assets/fonts/iconfont.woff2 | 4 +-
console/src/components/DAG/DAG.tsx | 17 +-
console/src/components/Form/form.tsx | 2 +-
.../data-table/data-custom-table.tsx | 57 +++--
.../src/components/data-table/data-table.tsx | 1 -
.../src/components/data-table/header-cell.tsx | 34 +--
.../data-table/measure-column-widths.tsx | 97 +++----
.../data-table/stateful-container.tsx | 16 +-
console/src/pages/Admin/AdminSidebar.tsx | 2 +-
console/src/pages/BaseSubLayout.tsx | 3 +
.../pages/Evaluation/EvaluationListCard.tsx | 236 +++++++++---------
.../Evaluation/EvaluationListCompare.tsx | 27 +-
.../Evaluation/EvaluationOverviewLayout.tsx | 2 +-
.../pages/Evaluation/EvaluationResults.tsx | 5 +
console/src/pages/Job/JobDAG.tsx | 2 +-
console/src/pages/Project/ProjectListCard.tsx | 16 +-
console/src/styles/_global.scss | 25 +-
24 files changed, 309 insertions(+), 275 deletions(-)
diff --git a/console/package.json b/console/package.json
index 37ed5c1d13..9ec64f14d1 100644
--- a/console/package.json
+++ b/console/package.json
@@ -60,7 +60,7 @@
"plyr-react": "^5.1.0",
"pretty-bytes": "^5.6.0",
"qs": "^6.10.1",
- "rc-field-form": "^1.21.1",
+ "rc-field-form": "^1.27.1",
"rc-image": "^5.2.5",
"react": "^17.0.2",
"react-code-blocks": "^0.0.9-0",
diff --git a/console/pnpm-lock.yaml b/console/pnpm-lock.yaml
index c07b06860d..b097a225c5 100644
--- a/console/pnpm-lock.yaml
+++ b/console/pnpm-lock.yaml
@@ -119,7 +119,7 @@ specifiers:
prettier: ^2.3.2
pretty-bytes: ^5.6.0
qs: ^6.10.1
- rc-field-form: ^1.21.1
+ rc-field-form: ^1.27.1
rc-image: ^5.2.5
react: ^17.0.2
react-code-blocks: ^0.0.9-0
@@ -7646,7 +7646,7 @@ packages:
mississippi: 3.0.0
mkdirp: 0.5.6
move-concurrently: 1.0.1
- promise-inflight: 1.0.1_bluebird@3.7.2
+ promise-inflight: 1.0.1
rimraf: 2.7.1
ssri: 6.0.2
unique-filename: 1.1.1
@@ -18322,17 +18322,6 @@ packages:
optional: true
dev: true
- /promise-inflight/1.0.1_bluebird@3.7.2:
- resolution: {integrity: sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==}
- peerDependencies:
- bluebird: '*'
- peerDependenciesMeta:
- bluebird:
- optional: true
- dependencies:
- bluebird: 3.7.2
- dev: true
-
/promise.allsettled/1.0.5:
resolution: {integrity: sha512-tVDqeZPoBC0SlzJHzWGZ2NKAguVq2oiYj7gbggbiTvH2itHohijTp7njOUA0aQ/nl+0lr/r6egmhoYu63UZ/pQ==}
engines: {node: '>= 0.4'}
diff --git a/console/src/api/WithAuth.tsx b/console/src/api/WithAuth.tsx
index a1f6130694..a0a2761e7b 100644
--- a/console/src/api/WithAuth.tsx
+++ b/console/src/api/WithAuth.tsx
@@ -25,6 +25,7 @@ export default function WithAuth({
children: React.ReactElement | any
}) {
let isPrivileged = false
+ // eslint-disable-next-line react-hooks/exhaustive-deps
const { currentUser } = useCurrentUser()
if (!currentUser) return
if (isWrongKey(id)) return
diff --git a/console/src/assets/fonts/iconfont.css b/console/src/assets/fonts/iconfont.css
index f8ad3c987d..69ed456a92 100644
--- a/console/src/assets/fonts/iconfont.css
+++ b/console/src/assets/fonts/iconfont.css
@@ -1,8 +1,8 @@
@font-face {
font-family: "iconfont"; /* Project id 3410006 */
- src: url('iconfont.woff2?t=1663575449431') format('woff2'),
- url('iconfont.woff?t=1663575449431') format('woff'),
- url('iconfont.ttf?t=1663575449431') format('truetype');
+ src: url('iconfont.woff2?t=1664178541024') format('woff2'),
+ url('iconfont.woff?t=1664178541024') format('woff'),
+ url('iconfont.ttf?t=1664178541024') format('truetype');
}
.iconfont {
@@ -13,6 +13,10 @@
-moz-osx-font-smoothing: grayscale;
}
+.icon-setting2:before {
+ content: "\e64e";
+}
+
.icon-token:before {
content: "\e64d";
}
diff --git a/console/src/assets/fonts/iconfont.js b/console/src/assets/fonts/iconfont.js
index 9848f3efb5..7d1cdc138d 100644
--- a/console/src/assets/fonts/iconfont.js
+++ b/console/src/assets/fonts/iconfont.js
@@ -1 +1 @@
-window._iconfont_svg_string_3410006='',function(o){var l=(l=document.getElementsByTagName("script"))[l.length-1],c=l.getAttribute("data-injectcss"),l=l.getAttribute("data-disable-injectsvg");if(!l){var i,h,v,t,m,s=function(l,c){c.parentNode.insertBefore(l,c)};if(c&&!o.__iconfont__svg__cssinject__){o.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(l){console&&console.log(l)}}i=function(){var l,c=document.createElement("div");c.innerHTML=o._iconfont_svg_string_3410006,(c=c.getElementsByTagName("svg")[0])&&(c.setAttribute("aria-hidden","true"),c.style.position="absolute",c.style.width=0,c.style.height=0,c.style.overflow="hidden",c=c,(l=document.body).firstChild?s(c,l.firstChild):l.appendChild(c))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(i,0):(h=function(){document.removeEventListener("DOMContentLoaded",h,!1),i()},document.addEventListener("DOMContentLoaded",h,!1)):document.attachEvent&&(v=i,t=o.document,m=!1,e(),t.onreadystatechange=function(){"complete"==t.readyState&&(t.onreadystatechange=null,a())})}function a(){m||(m=!0,v())}function e(){try{t.documentElement.doScroll("left")}catch(l){return void setTimeout(e,50)}a()}}(window);
\ No newline at end of file
+window._iconfont_svg_string_3410006='',function(i){var l=(l=document.getElementsByTagName("script"))[l.length-1],c=l.getAttribute("data-injectcss"),l=l.getAttribute("data-disable-injectsvg");if(!l){var o,h,v,t,m,s=function(l,c){c.parentNode.insertBefore(l,c)};if(c&&!i.__iconfont__svg__cssinject__){i.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(l){console&&console.log(l)}}o=function(){var l,c=document.createElement("div");c.innerHTML=i._iconfont_svg_string_3410006,(c=c.getElementsByTagName("svg")[0])&&(c.setAttribute("aria-hidden","true"),c.style.position="absolute",c.style.width=0,c.style.height=0,c.style.overflow="hidden",c=c,(l=document.body).firstChild?s(c,l.firstChild):l.appendChild(c))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(o,0):(h=function(){document.removeEventListener("DOMContentLoaded",h,!1),o()},document.addEventListener("DOMContentLoaded",h,!1)):document.attachEvent&&(v=o,t=i.document,m=!1,e(),t.onreadystatechange=function(){"complete"==t.readyState&&(t.onreadystatechange=null,a())})}function a(){m||(m=!0,v())}function e(){try{t.documentElement.doScroll("left")}catch(l){return void setTimeout(e,50)}a()}}(window);
\ No newline at end of file
diff --git a/console/src/assets/fonts/iconfont.ttf b/console/src/assets/fonts/iconfont.ttf
index 3bf53d20ae..1ba10177a1 100644
--- a/console/src/assets/fonts/iconfont.ttf
+++ b/console/src/assets/fonts/iconfont.ttf
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:4161a9c94cdd624463ae229e633b03527a5f45c27ff3d25af1deb72dcf215a28
-size 14520
+oid sha256:26284a0cc6966f438aea0dcd584c34aaa990869ca9e6aa4925f40e56fe61b2d1
+size 14692
diff --git a/console/src/assets/fonts/iconfont.woff b/console/src/assets/fonts/iconfont.woff
index 60503a66de..2c0c8f0259 100644
--- a/console/src/assets/fonts/iconfont.woff
+++ b/console/src/assets/fonts/iconfont.woff
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:910a49efa68736adfccc10a9941a52ee0fe1121eb0fc9b3712f443475867a75b
-size 8584
+oid sha256:a4e1adf4a19844da49ca35298d7ea2c319bf97a960d00fe966263bc4d83d52f7
+size 8672
diff --git a/console/src/assets/fonts/iconfont.woff2 b/console/src/assets/fonts/iconfont.woff2
index 08ad378031..680ac9f8e6 100644
--- a/console/src/assets/fonts/iconfont.woff2
+++ b/console/src/assets/fonts/iconfont.woff2
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:ee823b2095cabf23f59fecc22644b1ab8286b78a85382c00e02f6e7aa3d65e3a
-size 7232
+oid sha256:652240aa701acc28e3066fbbd0a7a942fae0956842904ad97b334230beecc32b
+size 7276
diff --git a/console/src/components/DAG/DAG.tsx b/console/src/components/DAG/DAG.tsx
index f9e3c1c92f..7803d891c8 100644
--- a/console/src/components/DAG/DAG.tsx
+++ b/console/src/components/DAG/DAG.tsx
@@ -126,10 +126,11 @@ export default function DAG({ nodes = [], edges = [] }: any) {
@@ -148,9 +149,9 @@ export default function DAG({ nodes = [], edges = [] }: any) {