From fc54a4281e76cbf99e9f91aeb0be57f65b2c500e Mon Sep 17 00:00:00 2001 From: zouap Date: Tue, 14 Sep 2021 16:32:29 +0800 Subject: [PATCH 01/39] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=A0=87=E6=B3=A8?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- public/self/js/Director/detection.js | 27 ++++++++++++++++++--------- public/self/labelTaskPage.js | 2 +- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/public/self/js/Director/detection.js b/public/self/js/Director/detection.js index 5f40e73c3..8b63ef854 100644 --- a/public/self/js/Director/detection.js +++ b/public/self/js/Director/detection.js @@ -1640,22 +1640,31 @@ function showfilelist(){ var htmlstr=""; for (var i=0;i 70){ + var tmpIndex = labeltastresult[i].pic_image_field.indexOf("/",70); + console.log(tmpIndex) + if(tmpIndex != -1){ + fname = labeltastresult[i].pic_image_field.substring(tmpIndex + 1); + fname = fname.substring(fname.indexOf('/')+1); + } + } + var isfinished = labeltastresult[i].label_status; - if(isVerified()){ - isfinished = labeltastresult[i].verify_status - 1; - } + if(isVerified()){ + isfinished = labeltastresult[i].verify_status - 1; + } var lablebg=" style=\"cursor:pointer\""; var classStr = "style=\"color:#FF6200;background: transparent;border: 0;\""; var finish="未完成"; if (isfinished=="0"){finish="已完成";classStr = "style=\"color:#27c24c;background: transparent;border: 0;\"";} if (i==fileindex){lablebg=" style=\"color:#fff;cursor:pointer;\"";classStr = "style=\"color:#04B3E5;background: transparent;border: 0;\"";finish="标注中"} - if(isVerified()){ - htmlstr = htmlstr+" "+""+finish +""+""+ fname+ ""; - }else{ - htmlstr = htmlstr+""+fname+""+""+""; - } + if(isVerified()){ + htmlstr = htmlstr+" "+""+finish +""+""+ fname+ ""; + }else{ + htmlstr = htmlstr+""+fname+""+""+""; + } - }; + } document.getElementById("filelist").innerHTML=htmlstr; } diff --git a/public/self/labelTaskPage.js b/public/self/labelTaskPage.js index 98813dd08..4ce48407a 100644 --- a/public/self/labelTaskPage.js +++ b/public/self/labelTaskPage.js @@ -318,7 +318,7 @@ function label_task_create(task_name, relate_task_id, taskType,assign_user_id,la success:function(res){ console.log(res); if(res.code == 0){ - alert("人工校验任务创建成功!"); + alert("人工标注任务创建成功!"); createsucced = true; } else{ From 5c0e4ed465c17fd1310e79192251502c92cb3591 Mon Sep 17 00:00:00 2001 From: zouap Date: Wed, 15 Sep 2021 09:38:34 +0800 Subject: [PATCH 02/39] =?UTF-8?q?=E6=94=AF=E6=8C=81.tar.gz=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E6=96=87=E4=BB=B6=E8=A7=A3=E5=8E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- models/attachment.go | 2 +- modules/worker/task.go | 4 ++-- routers/repo/attachment.go | 13 ++++++++++--- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/models/attachment.go b/models/attachment.go index 4f2c8d09a..2a3bbf9c8 100755 --- a/models/attachment.go +++ b/models/attachment.go @@ -378,7 +378,7 @@ func GetUnDecompressAttachments() ([]*Attachment, error) { func getUnDecompressAttachments(e Engine) ([]*Attachment, error) { attachments := make([]*Attachment, 0, 10) - return attachments, e.Where("decompress_state = ? and dataset_id != 0 and attachment.type = ? and name like '%.zip'", DecompressStateInit, TypeCloudBrainOne).Find(&attachments) + return attachments, e.Where("decompress_state = ? and dataset_id != 0 and attachment.type = ? and (name like '%.zip' or name like '%.tar.gz')", DecompressStateInit, TypeCloudBrainOne).Find(&attachments) } func GetAllPublicAttachments() ([]*AttachmentUsername, error) { diff --git a/modules/worker/task.go b/modules/worker/task.go index 073b16b92..c2d9467dc 100755 --- a/modules/worker/task.go +++ b/modules/worker/task.go @@ -13,8 +13,8 @@ const ( DecompressTaskName = "Decompress" ) -func SendDecompressTask(ctx context.Context, uuid string) error { - args := []tasks.Arg{{Name: "uuid", Type: "string", Value: uuid}} +func SendDecompressTask(ctx context.Context, uuid string, name string) error { + args := []tasks.Arg{{Name: "uuid", Type: "string", Value: uuid}, {Name: "name", Type: "string", Value: name}} task, err := tasks.NewSignature(DecompressTaskName, args) if err != nil { log.Error("NewSignature failed:", err.Error()) diff --git a/routers/repo/attachment.go b/routers/repo/attachment.go index cfbbc73a4..1ac496c2f 100755 --- a/routers/repo/attachment.go +++ b/routers/repo/attachment.go @@ -386,7 +386,7 @@ func AddAttachment(ctx *context.Context) { if attachment.DatasetID != 0 { if strings.HasSuffix(attachment.Name, ".zip") { if typeCloudBrain == models.TypeCloudBrainOne { - err = worker.SendDecompressTask(contexExt.Background(), uuid) + err = worker.SendDecompressTask(contexExt.Background(), uuid, attachment.Name) if err != nil { log.Error("SendDecompressTask(%s) failed:%s", uuid, err.Error()) } else { @@ -406,6 +406,13 @@ func AddAttachment(ctx *context.Context) { }) } +func isCanDecompress(name string) bool { + if strings.HasSuffix(name, ".zip") || strings.HasSuffix(name, ".tar.gz") { + return true + } + return false +} + func UpdateAttachmentDecompressState(ctx *context.Context) { uuid := ctx.Query("uuid") result := ctx.Query("result") @@ -768,7 +775,7 @@ func CompleteMultipart(ctx *context.Context) { if attachment.DatasetID != 0 { if strings.HasSuffix(attachment.Name, ".zip") { if typeCloudBrain == models.TypeCloudBrainOne { - err = worker.SendDecompressTask(contexExt.Background(), uuid) + err = worker.SendDecompressTask(contexExt.Background(), uuid, attachment.Name) if err != nil { log.Error("SendDecompressTask(%s) failed:%s", uuid, err.Error()) } else { @@ -838,7 +845,7 @@ func HandleUnDecompressAttachment() { } for _, attach := range attachs { - err = worker.SendDecompressTask(contexExt.Background(), attach.UUID) + err = worker.SendDecompressTask(contexExt.Background(), attach.UUID, attach.Name) if err != nil { log.Error("SendDecompressTask(%s) failed:%s", attach.UUID, err.Error()) } else { From 20ab6324169409567e14f435ba2c5fc975e2039f Mon Sep 17 00:00:00 2001 From: zouap Date: Wed, 15 Sep 2021 09:40:48 +0800 Subject: [PATCH 03/39] =?UTF-8?q?=E6=94=AF=E6=8C=81.tar.gz=E8=A7=A3?= =?UTF-8?q?=E5=8E=8B=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- routers/repo/attachment.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routers/repo/attachment.go b/routers/repo/attachment.go index 1ac496c2f..a20ed9a7d 100755 --- a/routers/repo/attachment.go +++ b/routers/repo/attachment.go @@ -384,7 +384,7 @@ func AddAttachment(ctx *context.Context) { } if attachment.DatasetID != 0 { - if strings.HasSuffix(attachment.Name, ".zip") { + if isCanDecompress(attachment.Name) { if typeCloudBrain == models.TypeCloudBrainOne { err = worker.SendDecompressTask(contexExt.Background(), uuid, attachment.Name) if err != nil { @@ -773,7 +773,7 @@ func CompleteMultipart(ctx *context.Context) { } if attachment.DatasetID != 0 { - if strings.HasSuffix(attachment.Name, ".zip") { + if isCanDecompress(attachment.Name) { if typeCloudBrain == models.TypeCloudBrainOne { err = worker.SendDecompressTask(contexExt.Background(), uuid, attachment.Name) if err != nil { From 4e3e88c8ff4d9b532f392a138ce86db9fa1ea5dc Mon Sep 17 00:00:00 2001 From: OpenIhu Date: Wed, 15 Sep 2021 11:28:16 +0800 Subject: [PATCH 04/39] =?UTF-8?q?=E5=9C=A8=E7=94=A8=E6=88=B7=E4=B8=AA?= =?UTF-8?q?=E4=BA=BA=E4=B8=AD=E5=BF=83=E9=9A=90=E8=97=8F=E7=83=AD=E9=97=A8?= =?UTF-8?q?=E5=8F=8A=E6=B4=BB=E8=B7=83Tab?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/explore/repo_list.tmpl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/explore/repo_list.tmpl b/templates/explore/repo_list.tmpl index decce4fbe..79c301ef7 100755 --- a/templates/explore/repo_list.tmpl +++ b/templates/explore/repo_list.tmpl @@ -39,6 +39,7 @@