From 2866af55b448a5ad21a6d72f79caa9e2b87e9098 Mon Sep 17 00:00:00 2001 From: Meekdai Date: Tue, 2 Apr 2024 18:34:57 +0800 Subject: [PATCH] Update tag.html --- templates/tag.html | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/templates/tag.html b/templates/tag.html index 7746df9..98e80ce 100644 --- a/templates/tag.html +++ b/templates/tag.html @@ -91,7 +91,16 @@ function showList(){ tagLable.appendChild(showLabels); } - for(label in jsonData['labelColorDict']){ + let labelsSet = new Set(); + for(let key in jsonData) { + if (key !== 'labelColorDict' && Array.isArray(jsonData[key]['labels'])) { + for (let label of jsonData[key]['labels']) { + labelsSet.add(label); + } + } + } + let labelsList = Array.from(labelsSet); + for(label in labelsList){ tagList.push(label); let showLabels=document.createElement("button"); showLabels.setAttribute("class","Label");