diff --git a/plugins/solr/index.html b/plugins/solr/index.html index 66f5f71af..576029102 100755 --- a/plugins/solr/index.html +++ b/plugins/solr/index.html @@ -3,7 +3,7 @@
diff --git a/plugins/solr/index.py b/plugins/solr/index.py index c9b8fc028..5d617383c 100755 --- a/plugins/solr/index.py +++ b/plugins/solr/index.py @@ -172,6 +172,20 @@ def collectionList(): data.append(tmp) return public.returnJson(True, 'OK', data) +def addCollection(): + args = getArgs() + data = checkArgs(args, ['name']) + if not data[0]: + return data[1] + + name = args['name'] + solr_bin = getServerDir() + "/bin/solr" + + retdata = public.execShell(solr_bin + ' create -c ' + name) + if retdata[1] != "": + return public.returnJson(False, '添加失败!:'+retdata[0]) + return public.returnJson(True, '添加成功!:'+retdata[0]) + # rsyncdReceive if __name__ == "__main__": @@ -196,5 +210,7 @@ if __name__ == "__main__": print getLog() elif func == 'collection_list': print collectionList() + elif func == 'add_collection': + print addCollection() else: print 'error' diff --git a/plugins/solr/js/solr.js b/plugins/solr/js/solr.js index f17bd9ef7..cd9cdefb2 100755 --- a/plugins/solr/js/solr.js +++ b/plugins/solr/js/solr.js @@ -37,7 +37,7 @@ function pPost(method,args,callback, title){ } -function collection_management(){ +function collectionManagement(){ pPost('collection_list', '', function(data){ var rdata = $.parseJSON(data.data); if (!rdata.status){ @@ -54,7 +54,7 @@ function collection_management(){ con += ''; con += ''; - + for (var i = 0; i < list.length; i++) { con += '