From 3f8470708e94f2dc80a6206da7afc41b71ca2db6 Mon Sep 17 00:00:00 2001 From: zouap Date: Fri, 1 Apr 2022 14:37:05 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- public/home/search.js | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/public/home/search.js b/public/home/search.js index 71af07bc3..33c2279f4 100644 --- a/public/home/search.js +++ b/public/home/search.js @@ -108,8 +108,9 @@ function searchItem(type,sortType){ currentSearchSortBy = sortBy[sortType]; currentSearchAscending = sortAscending[sortType]; OnlySearchLabel =false; - page(currentPage); + }else{ + emptySearch(); } } @@ -126,22 +127,26 @@ function search(){ if(!isEmpty(currentSearchKeyword)){ doSpcifySearch(currentSearchTableName,currentSearchKeyword,sortBy[10],"false"); }else{ - initDiv(false); - document.getElementById("find_id").innerHTML=getLabel(isZh,"search_empty"); - $('#find_title').html(""); - document.getElementById("sort_type").innerHTML=""; - document.getElementById("child_search_item").innerHTML=""; - document.getElementById("page_menu").innerHTML=""; - $('#repo_total').text(""); - $('#pr_total').text(""); - $('#issue_total').text(""); - $('#dataset_total').text(""); - $('#user_total').text(""); - $('#org_total').text(""); - setActivate(null); + emptySearch(); } } +function emptySearch(){ + initDiv(false); + document.getElementById("find_id").innerHTML=getLabel(isZh,"search_empty"); + $('#find_title').html(""); + document.getElementById("sort_type").innerHTML=""; + document.getElementById("child_search_item").innerHTML=""; + document.getElementById("page_menu").innerHTML=""; + $('#repo_total').text(""); + $('#pr_total').text(""); + $('#issue_total').text(""); + $('#dataset_total').text(""); + $('#user_total').text(""); + $('#org_total').text(""); + setActivate(null); +} + function initDiv(isSearchLabel=false){ if(isSearchLabel){ document.getElementById("search_div").style.display="none"; @@ -1285,6 +1290,8 @@ var zhCN={ var specifySearch = sessionStorage.getItem("specifySearch"); if(specifySearch){ sessionStorage.removeItem("specifySearch"); + console.log("search sepcial keyword=...." + sessionStorage.getItem("keyword")); + document.getElementById("keyword_input").value = sessionStorage.getItem("keyword"); doSpcifySearch(sessionStorage.getItem("tableName"),sessionStorage.getItem("keyword"),sessionStorage.getItem("sortBy"),sessionStorage.getItem("ascending")); }else{ console.log("normal search...."); From fa5534f85eb87d6a215128d9d50acdfd9c08b30f Mon Sep 17 00:00:00 2001 From: zouap Date: Fri, 1 Apr 2022 15:56:58 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- models/dbsql/dataset_foreigntable_for_es.sql | 13 +++++++++++++ models/dbsql/issue_foreigntable_for_es.sql | 11 +++++++++++ models/dbsql/repo_foreigntable_for_es.sql | 13 +++++++++++++ models/dbsql/user_foreigntable_for_es.sql | 9 +++++++++ 4 files changed, 46 insertions(+) diff --git a/models/dbsql/dataset_foreigntable_for_es.sql b/models/dbsql/dataset_foreigntable_for_es.sql index 815b89d02..02e5f0ddf 100644 --- a/models/dbsql/dataset_foreigntable_for_es.sql +++ b/models/dbsql/dataset_foreigntable_for_es.sql @@ -1,4 +1,17 @@ +DELETE FROM public.dataset_es; DROP FOREIGN TABLE public.dataset_es; +DROP TRIGGER IF EXISTS es_insert_dataset on public.dataset; +DROP FUNCTION public.insert_dataset_data(); +DROP TRIGGER IF EXISTS es_udpate_dataset_file_name on public.attachment; +DROP FUNCTION public.udpate_dataset_file_name; + +DROP TRIGGER IF EXISTS es_update_dataset on public.dataset; +DROP FUNCTION public.update_dataset; + +DROP TRIGGER IF EXISTS es_delete_dataset on public.dataset; +DROP FUNCTION public.delete_dataset; + + CREATE FOREIGN TABLE public.dataset_es ( id bigint NOT NULL, diff --git a/models/dbsql/issue_foreigntable_for_es.sql b/models/dbsql/issue_foreigntable_for_es.sql index bb5c1634e..30fa01550 100644 --- a/models/dbsql/issue_foreigntable_for_es.sql +++ b/models/dbsql/issue_foreigntable_for_es.sql @@ -1,4 +1,15 @@ +delete from public.issue_es; DROP FOREIGN TABLE public.issue_es; +DROP TRIGGER IF EXISTS es_insert_issue on public.issue; +DROP FUNCTION public.insert_issue_data; +DROP TRIGGER IF EXISTS es_udpate_issue_comment on public.comment; +DROP FUNCTION udpate_issue_comment; +DROP TRIGGER IF EXISTS es_update_issue on public.issue; +DROP FUNCTION public.update_issue; +DROP TRIGGER IF EXISTS es_delete_issue on public.issue; +DROP FUNCTION public.delete_issue; + + CREATE FOREIGN TABLE public.issue_es ( id bigint NOT NULL, diff --git a/models/dbsql/repo_foreigntable_for_es.sql b/models/dbsql/repo_foreigntable_for_es.sql index f51155ccf..7e06fd99e 100644 --- a/models/dbsql/repo_foreigntable_for_es.sql +++ b/models/dbsql/repo_foreigntable_for_es.sql @@ -1,5 +1,18 @@ -- 要处理项目从私有变为公有,并且从公有变成私有的情况 +DELETE FROM public.repository_es; DROP FOREIGN table if exists public.repository_es; +DROP TRIGGER IF EXISTS es_insert_repository on public.repository; +DROP FUNCTION public.insert_repository_data; +DROP TRIGGER IF EXISTS es_update_repository on public.repository; +DROP FUNCTION public.update_repository; + +DROP TRIGGER IF EXISTS es_delete_repository on public.repository; +DROP FUNCTION public.delete_repository; + +DROP TRIGGER IF EXISTS es_udpate_repository_lang on public.language_stat; +DROP FUNCTION public.udpate_repository_lang; + + CREATE FOREIGN TABLE public.repository_es ( id bigint NOT NULL, owner_id bigint, diff --git a/models/dbsql/user_foreigntable_for_es.sql b/models/dbsql/user_foreigntable_for_es.sql index c3d21b92a..5d77757f0 100644 --- a/models/dbsql/user_foreigntable_for_es.sql +++ b/models/dbsql/user_foreigntable_for_es.sql @@ -1,4 +1,13 @@ +DELETE FROM public.user_es; DROP FOREIGN table if exists public.user_es; +DROP TRIGGER IF EXISTS es_insert_user on public.user; +DROP FUNCTION public.insert_user_data; +DROP TRIGGER IF EXISTS es_update_user on public.user; +DROP FUNCTION public.update_user; + +DROP TRIGGER IF EXISTS es_delete_user on public.user; +DROP FUNCTION public.delete_user; + CREATE FOREIGN TABLE public.user_es ( id bigint NOT NULL , From 9040c72e703000b26ea89c93296f3e9e0cbc4337 Mon Sep 17 00:00:00 2001 From: zouap Date: Fri, 1 Apr 2022 16:06:06 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- public/home/search.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/home/search.js b/public/home/search.js index 33c2279f4..e23d27549 100644 --- a/public/home/search.js +++ b/public/home/search.js @@ -122,8 +122,6 @@ function search(){ if(!isEmpty(currentSearchKeyword)){ currentSearchKeyword = currentSearchKeyword.trim(); } - $('#searchForm').addClass("hiddenSearch"); - initPageInfo(); if(!isEmpty(currentSearchKeyword)){ doSpcifySearch(currentSearchTableName,currentSearchKeyword,sortBy[10],"false"); }else{ @@ -133,6 +131,8 @@ function search(){ function emptySearch(){ initDiv(false); + initPageInfo(); + $('#searchForm').addClass("hiddenSearch"); document.getElementById("find_id").innerHTML=getLabel(isZh,"search_empty"); $('#find_title').html(""); document.getElementById("sort_type").innerHTML=""; @@ -157,7 +157,6 @@ function initDiv(isSearchLabel=false){ document.getElementById("user_item").style.display="none"; document.getElementById("org_item").style.display="none"; document.getElementById("find_id").innerHTML=""; - }else{ document.getElementById("search_div").style.display="block"; document.getElementById("search_label_div").style.display="none"; @@ -172,6 +171,7 @@ function initDiv(isSearchLabel=false){ function doSpcifySearch(tableName,keyword,sortBy="",ascending="false"){ initDiv(false); + $('#searchForm').addClass("hiddenSearch"); document.getElementById("find_id").innerHTML=getLabel(isZh,"search_finded"); currentSearchKeyword = keyword; initPageInfo();