pull/109/head
midoks 3 years ago
parent e1d8225c93
commit ce5aa5ff86
  1. 2
      plugins/gogs/class/mysqlDb.py
  2. 10
      plugins/gogs/index.py

@ -83,7 +83,7 @@ class mysqlDb:
self.__Close()
return result
except Exception as ex:
return ex
return "error: " + str(ex)
# 关闭连接
def __Close(self):

@ -628,16 +628,20 @@ def getRsaPublic():
def getTotalStatistics():
st = status()
data = {}
if st == 'start':
if st.strip() == 'start':
pm = pMysqlDb()
list_count = pm.query('select count(id) as num from repository')
count = list_count[0][0]
if list_count.find("error") > -1:
data['status'] = False
data['count'] = 0
return mw.returnJson(False, 'fail', data)
data['status'] = True
data['count'] = count
data['ver'] = mw.readFile(getServerDir() + '/version.pl').strip()
return mw.returnJson(True, 'ok', data)
else:
data['status'] = False
data['count'] = 0
return mw.returnJson(False, 'fail', data)

Loading…
Cancel
Save