diff --git a/plugins/gogs/index.py b/plugins/gogs/index.py index fd3a5918b..cf5c3bbf6 100755 --- a/plugins/gogs/index.py +++ b/plugins/gogs/index.py @@ -545,10 +545,17 @@ def repoList(): data['root_url'] = getRootUrl() + repo_where1 = '' + repo_where2 = '' + if search != '': + repo_where1 = ' where name like "%' + search + '%"' + repo_where2 = ' where r.name like "%' + search + '%"' + start = (page - 1) * page_size - list_count = pQuery('select count(id) as num from repository') + list_count = pQuery( + 'select count(id) as num from repository' + repo_where1) count = list_count[0]["num"] - sql = 'select r.id,r.owner_id,r.name as repo, u.name from repository r left join user u on r.owner_id=u.id order by r.id desc limit ' + \ + sql = 'select r.id,r.owner_id,r.name as repo, u.name from repository r left join user u on r.owner_id=u.id ' + repo_where2 + ' order by r.id desc limit ' + \ str(start) + ',' + str(page_size) # print(sql) list_data = pQuery(sql) diff --git a/plugins/gogs/js/gogs.js b/plugins/gogs/js/gogs.js index 828b772de..2999ccbc4 100755 --- a/plugins/gogs/js/gogs.js +++ b/plugins/gogs/js/gogs.js @@ -137,7 +137,7 @@ function gogsUserList(page, search) { return; } content = '