From 2a066e1a134f202aec66b994098d7801006fb6f5 Mon Sep 17 00:00:00 2001 From: hmiao <739025250@qq.com> Date: Thu, 29 Sep 2022 12:31:00 +0800 Subject: [PATCH 1/6] add param enable verify in UserTask --- server/api/v1/task/find.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/server/api/v1/task/find.go b/server/api/v1/task/find.go index 4f95ce2..cb1669e 100644 --- a/server/api/v1/task/find.go +++ b/server/api/v1/task/find.go @@ -34,13 +34,14 @@ type Task struct { Task_id int64 `json:"task_id"` } type UserTask struct { - ID int64 `json:"id"` - Name string `json:"name"` - Type string `json:"type"` - Creator string `json:"creator"` - Status string `json:"status"` - CreatedAt int64 `json:"created_at"` - CreatorName string `json:"creator_name"` + ID int64 `json:"id"` + Name string `json:"name"` + Type string `json:"type"` + Creator string `json:"creator"` + Status string `json:"status"` + CreatedAt int64 `json:"created_at"` + CreatorName string `json:"creator_name"` + EnableVerify bool `json:"enable_verify"` } type AllTasks struct { From 2a297adcfec9d783b248e44bed529913288034f8 Mon Sep 17 00:00:00 2001 From: hmiao <739025250@qq.com> Date: Thu, 29 Sep 2022 19:46:19 +0800 Subject: [PATCH 2/6] add new task status: CONFIRMED --- web/src/i18n/en/dashboard/tasklist.js | 1 + web/src/i18n/zh/dashboard/tasklist.js | 1 + web/src/main.js | 1 + .../views/dashboard/content/myTasks/index.vue | 5 +- .../dashboard/content/taskdetail/index.vue | 49 +++++++++++++------ 5 files changed, 41 insertions(+), 16 deletions(-) diff --git a/web/src/i18n/en/dashboard/tasklist.js b/web/src/i18n/en/dashboard/tasklist.js index 09c0678..2df0836 100644 --- a/web/src/i18n/en/dashboard/tasklist.js +++ b/web/src/i18n/en/dashboard/tasklist.js @@ -8,5 +8,6 @@ export default { 'dashboard.tasklist.pending':'Pending', 'dashboard.tasklist.running':'Running', 'dashboard.tasklist.finished':'Finished', + 'dashboard.tasklist.confirmed':'Confirmed', 'dashboard.tasklist.error':'Error' } \ No newline at end of file diff --git a/web/src/i18n/zh/dashboard/tasklist.js b/web/src/i18n/zh/dashboard/tasklist.js index b677005..d03e5e5 100644 --- a/web/src/i18n/zh/dashboard/tasklist.js +++ b/web/src/i18n/zh/dashboard/tasklist.js @@ -8,5 +8,6 @@ export default { 'dashboard.tasklist.pending':'等待运行', 'dashboard.tasklist.running':'运行中', 'dashboard.tasklist.finished':'完成', + 'dashboard.tasklist.confirmed':'已确认', 'dashboard.tasklist.error':'异常' } \ No newline at end of file diff --git a/web/src/main.js b/web/src/main.js index 0be9937..a156763 100644 --- a/web/src/main.js +++ b/web/src/main.js @@ -59,6 +59,7 @@ Vue.prototype.$appGlobal = { TASK_STATUS_RUNNING:'RUNNING', TASK_STATUS_FINISHED:'FINISHED', TASK_STATUS_ERROR:'ERROR', + TASK_STATUS_CONFIRMED: 'CONFIRMED', USER_APPROVE_STATUS_REGISTED:1, USER_APPROV_STATUS_APPROVED:2 } diff --git a/web/src/views/dashboard/content/myTasks/index.vue b/web/src/views/dashboard/content/myTasks/index.vue index 7458d0c..b6cd9b7 100644 --- a/web/src/views/dashboard/content/myTasks/index.vue +++ b/web/src/views/dashboard/content/myTasks/index.vue @@ -28,9 +28,12 @@ {{$t('dashboard.tasklist.error')}} - + {{$t('dashboard.tasklist.finished')}} + + {{$t('dashboard.tasklist.confirmed')}} + {{ }} diff --git a/web/src/views/dashboard/content/taskdetail/index.vue b/web/src/views/dashboard/content/taskdetail/index.vue index b81dab5..00c977c 100644 --- a/web/src/views/dashboard/content/taskdetail/index.vue +++ b/web/src/views/dashboard/content/taskdetail/index.vue @@ -11,7 +11,7 @@ {{ (taskLogMetaData.created_at / 1000) || 0 | second2Date }} + >{{ taskLogMetaData.created_at / 1000 || 0 | second2Date }} {{ $t("dashboard.taskdetail.error") }} - + {{ $t("dashboard.taskdetail.finished") }} + + {{ $t("dashboard.taskdetail.confirmed") }} + {{ $t("dashboard.taskdetail.download_result") }} @@ -83,10 +92,11 @@ >
- {{ (itm.created_at / 1000) | second2Date }}    {{ itm.message }} + {{ (itm.created_at / 1000) | second2Date }}    + {{ itm.message }}
-
tx hash: +
+ tx hash: {{ itm.tx_hash }}
@@ -108,6 +118,13 @@ export default { currentTaskId() { return this.$route.params.task_id; }, + resultReady() { + if (this.taskLogMetaData.enableVerify) { + return this.taskLogMetaData.status == this.$appGlobal.constants.TASK_STATUS_CONFIRMED; + } else { + return this.taskLogMetaData.status == this.$appGlobal.constants.TASK_STATUS_FINISHED; + } + }, }, data() { return { @@ -140,14 +157,16 @@ export default { }, loadTaskLog() { console.log(`load task log page ${this.page}`); - V1TaskAPI.getTaskLogs(this.currentTaskId, this.logStart, this.logLimit).then( - (res) => { - this.taskLogData = this.taskLogData.concat(res); - let finalLogData = res[res.length - 1]; - this.logStart = finalLogData.id + 1; - console.log(`load task log complete, page increase to ${this.page}`); - } - ); + V1TaskAPI.getTaskLogs( + this.currentTaskId, + this.logStart, + this.logLimit + ).then((res) => { + this.taskLogData = this.taskLogData.concat(res); + let finalLogData = res[res.length - 1]; + this.logStart = finalLogData.id + 1; + console.log(`load task log complete, page increase to ${this.page}`); + }); }, txUrl(txHash) { return `https://explorer.deltampc.com/tx/${txHash}/internal-transactions`; @@ -230,4 +249,4 @@ export default { .drawer-wrapper { padding: 30px 0px; } - \ No newline at end of file + From dbf7b75fe5a4052f27dc012dc3263dee34bdfb3c Mon Sep 17 00:00:00 2001 From: hmiao <739025250@qq.com> Date: Thu, 29 Sep 2022 19:48:29 +0800 Subject: [PATCH 3/6] update logistic regression task notebook --- jupyter/examples/en-horizontal-logistic-regression-task.ipynb | 2 ++ jupyter/examples/zh-horizontal-logistic-regression-task.ipynb | 2 ++ 2 files changed, 4 insertions(+) diff --git a/jupyter/examples/en-horizontal-logistic-regression-task.ipynb b/jupyter/examples/en-horizontal-logistic-regression-task.ipynb index ba3a3c7..adfafcb 100644 --- a/jupyter/examples/en-horizontal-logistic-regression-task.ipynb +++ b/jupyter/examples/en-horizontal-logistic-regression-task.ipynb @@ -72,6 +72,8 @@ " max_clients=3, # Maximum nodes allowed in each round, must be greater equal than min_clients.\n", " wait_timeout=5, # Timeout for calculation.\n", " connection_timeout=5, # Wait timeout for each step.\n", + " verify_timeout=360, # Timeout for the final zero knownledge verification step\n", + " enable_verify=True # whether to enable final zero knownledge verification step\n", " )\n", "\n", " def dataset(self):\n", diff --git a/jupyter/examples/zh-horizontal-logistic-regression-task.ipynb b/jupyter/examples/zh-horizontal-logistic-regression-task.ipynb index 82360e9..222e44c 100644 --- a/jupyter/examples/zh-horizontal-logistic-regression-task.ipynb +++ b/jupyter/examples/zh-horizontal-logistic-regression-task.ipynb @@ -71,6 +71,8 @@ " max_clients=3, # 算法所支持的最大客户端数,必须大雨等于min_clients\n", " wait_timeout=5, # 等待超时时间,用来控制一轮计算的超时时间\n", " connection_timeout=5, # 连接超时时间,用来控制流程中每个阶段的超时时间\n", + " verify_timeout=360, # 零知识证明步骤的超时时间\n", + " enable_verify=True # 是否开启零知识证明\n", " )\n", "\n", " def dataset(self):\n", From 70e7f221d5777ef922d651e04f0315ea5e06c275 Mon Sep 17 00:00:00 2001 From: hmiao <739025250@qq.com> Date: Fri, 30 Sep 2022 10:12:42 +0800 Subject: [PATCH 4/6] increase verify timeout in hlr example --- jupyter/examples/en-horizontal-logistic-regression-task.ipynb | 2 +- jupyter/examples/zh-horizontal-logistic-regression-task.ipynb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jupyter/examples/en-horizontal-logistic-regression-task.ipynb b/jupyter/examples/en-horizontal-logistic-regression-task.ipynb index adfafcb..1c6dc3b 100644 --- a/jupyter/examples/en-horizontal-logistic-regression-task.ipynb +++ b/jupyter/examples/en-horizontal-logistic-regression-task.ipynb @@ -72,7 +72,7 @@ " max_clients=3, # Maximum nodes allowed in each round, must be greater equal than min_clients.\n", " wait_timeout=5, # Timeout for calculation.\n", " connection_timeout=5, # Wait timeout for each step.\n", - " verify_timeout=360, # Timeout for the final zero knownledge verification step\n", + " verify_timeout=500, # Timeout for the final zero knownledge verification step\n", " enable_verify=True # whether to enable final zero knownledge verification step\n", " )\n", "\n", diff --git a/jupyter/examples/zh-horizontal-logistic-regression-task.ipynb b/jupyter/examples/zh-horizontal-logistic-regression-task.ipynb index 222e44c..a79f802 100644 --- a/jupyter/examples/zh-horizontal-logistic-regression-task.ipynb +++ b/jupyter/examples/zh-horizontal-logistic-regression-task.ipynb @@ -71,7 +71,7 @@ " max_clients=3, # 算法所支持的最大客户端数,必须大雨等于min_clients\n", " wait_timeout=5, # 等待超时时间,用来控制一轮计算的超时时间\n", " connection_timeout=5, # 连接超时时间,用来控制流程中每个阶段的超时时间\n", - " verify_timeout=360, # 零知识证明步骤的超时时间\n", + " verify_timeout=500, # 零知识证明步骤的超时时间\n", " enable_verify=True # 是否开启零知识证明\n", " )\n", "\n", From 6f14b69ca31943758dd05adcdaa42475e705d349 Mon Sep 17 00:00:00 2001 From: hmiao <739025250@qq.com> Date: Fri, 30 Sep 2022 10:12:58 +0800 Subject: [PATCH 5/6] update delta-task version to 0.7.0rc1 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 2ff0284..0f9e664 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ PyYAML==6.0 jupyterlab==3.1.6 notebook==6.4.3 -delta-task==0.6.0 +delta-task==0.7.0rc1 oauthenticator==14.2.0 jupyterhub==1.4.2 From e95d90bd0b9d0727f73634284c3835ddc4f86198 Mon Sep 17 00:00:00 2001 From: hmiao <739025250@qq.com> Date: Fri, 30 Sep 2022 10:13:27 +0800 Subject: [PATCH 6/6] update version to 0.7.0 --- web/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/package.json b/web/package.json index ce67bf6..b617f1e 100644 --- a/web/package.json +++ b/web/package.json @@ -1,6 +1,6 @@ { "name": "deltaboard-web", - "version": "0.1.0", + "version": "0.7.0", "private": true, "scripts": { "serve": "vue-cli-service serve",