diff --git a/plugins/mongodb/index.html b/plugins/mongodb/index.html
index 5adf23d95..ebe9c50cf 100755
--- a/plugins/mongodb/index.html
+++ b/plugins/mongodb/index.html
@@ -37,7 +37,29 @@ function redisStatus() {
connections | ' + rdata.connections + ' | 当前链接数 |
\
collections | ' + rdata.collections + ' | 文档数 |
\
\
- '
+
';
+
+ var t = '';
+ for(var i=0; i';
+ t += ''+rdata.dbs[i]["db"]+' | ';
+ t += ''+toSize(rdata.dbs[i]["totalSize"])+' | ';
+ t += ''+toSize(rdata.dbs[i]["storageSize"])+' | ';
+ t += ''+toSize(rdata.dbs[i]["dataSize"])+' | ';
+ t += ''+toSize(rdata.dbs[i]["indexSize"])+' | ';
+ t += ''+rdata.dbs[i]["indexes"]+' | ';
+ t += ''+rdata.dbs[i]["objects"]+' | ';
+ t += '';
+ }
+ // console.log(t);
+
+ Con += '\
+
\
+ 库名 | 大小 | 存储大小 | 数据 | 索引 | 文档数据 | 对象 | \
+ '+t+'\
+
';
+ // console.log(rdata.dbs);
+
$(".soft-man-con").html(Con);
},'json');
}
diff --git a/plugins/mongodb/index.py b/plugins/mongodb/index.py
index be3cb5c69..ea6bfd534 100755
--- a/plugins/mongodb/index.py
+++ b/plugins/mongodb/index.py
@@ -148,9 +148,18 @@ def runInfo():
client = pymongo.MongoClient(host='127.0.0.1', port=27017)
db = client.admin
serverStatus = db.command('serverStatus')
+
+ listDbs = client.list_database_names()
+
+ showDbList = []
+ for x in range(len(listDbs)):
+ mongd = client[listDbs[x]]
+ stats = mongd.command({"dbstats": 1})
+ showDbList.append(stats)
+ # print(showDbList)
# print(serverStatus)
# for key, value in serverStatus.items():
- # print(key, value)
+ # print(key, value)
result = {}
result["version"] = serverStatus['version']
result["uptime"] = serverStatus['uptime']
@@ -162,6 +171,7 @@ def runInfo():
result["connections"] = serverStatus['connections']['current']
result["collections"] = serverStatus['catalogStats']['collections']
+ result["dbs"] = showDbList
return mw.getJson(result)