Browse Source

Merge branch 'zouap' into fix-1653

tags/v1.22.4.1^2
wangjr 3 years ago
parent
commit
fb93ec36bd
5 changed files with 70 additions and 17 deletions
  1. +13
    -0
      models/dbsql/dataset_foreigntable_for_es.sql
  2. +11
    -0
      models/dbsql/issue_foreigntable_for_es.sql
  3. +13
    -0
      models/dbsql/repo_foreigntable_for_es.sql
  4. +9
    -0
      models/dbsql/user_foreigntable_for_es.sql
  5. +24
    -17
      public/home/search.js

+ 13
- 0
models/dbsql/dataset_foreigntable_for_es.sql View File

@@ -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,


+ 11
- 0
models/dbsql/issue_foreigntable_for_es.sql View File

@@ -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,


+ 13
- 0
models/dbsql/repo_foreigntable_for_es.sql View File

@@ -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,


+ 9
- 0
models/dbsql/user_foreigntable_for_es.sql View File

@@ -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 ,


+ 24
- 17
public/home/search.js View File

@@ -108,8 +108,9 @@ function searchItem(type,sortType){
currentSearchSortBy = sortBy[sortType];
currentSearchAscending = sortAscending[sortType];
OnlySearchLabel =false;
page(currentPage);
}else{
emptySearch();
}
}

@@ -121,27 +122,31 @@ function search(){
if(!isEmpty(currentSearchKeyword)){
currentSearchKeyword = currentSearchKeyword.trim();
}
$('#searchForm').addClass("hiddenSearch");
initPageInfo();
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);
initPageInfo();
$('#searchForm').addClass("hiddenSearch");
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";
@@ -152,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";
@@ -167,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();
@@ -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....");


Loading…
Cancel
Save