From 471be23ced6e9bf6afe771449646e40946847d5c Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 22 Jan 2019 15:00:30 +0800 Subject: [PATCH] update --- plugins/sphinx/tpl/simdht.conf | 37 ++++++++++++++++- plugins/sphinx/tpl/simdht_delta.conf | 59 ++++++++++++++++++++++++++++ route/static/app/public.js | 10 ++++- 3 files changed, 103 insertions(+), 3 deletions(-) create mode 100755 plugins/sphinx/tpl/simdht_delta.conf diff --git a/plugins/sphinx/tpl/simdht.conf b/plugins/sphinx/tpl/simdht.conf index 96a83a137..4032b82d1 100755 --- a/plugins/sphinx/tpl/simdht.conf +++ b/plugins/sphinx/tpl/simdht.conf @@ -4,7 +4,7 @@ indexer { - mem_limit = 218M + mem_limit = 32M } searchd @@ -22,3 +22,38 @@ searchd #workers = threads # for RT to work binlog_path = {$SERVER_APP}/index/binlog } + +source search_hash +{ + type = mysql + + sql_host = 127.0.0.1 + sql_user = ssbc + sql_pass = ssbc + sql_db = ssbc + sql_port = 3306 # optional, default is 3306 + + sql_query_range = SELECT min(id), max(id) FROM search_hash + sql_range_step = 1000 + + sql_query_pre = SET NAMES utf8 + sql_query = \ + SELECT id, name, CRC32(category) AS category, length, UNIX_TIMESTAMP(create_time) AS create_time, UNIX_TIMESTAMP(last_seen) AS last_seen\ + FROM search_hash where id >= $start AND id <= $end + + sql_attr_bigint = length + sql_attr_timestamp = create_time + sql_attr_timestamp = last_seen + sql_attr_uint = category + +} + + +index search_hash +{ + source = search_hash + path = {$SERVER_APP}/index/db/search_hash + + ngram_len = 1 + ngram_chars = U+3000..U+2FA1F +} diff --git a/plugins/sphinx/tpl/simdht_delta.conf b/plugins/sphinx/tpl/simdht_delta.conf new file mode 100755 index 000000000..4032b82d1 --- /dev/null +++ b/plugins/sphinx/tpl/simdht_delta.conf @@ -0,0 +1,59 @@ +# +# Minimal Sphinx configuration sample (clean, simple, functional) +# + +indexer +{ + mem_limit = 32M +} + +searchd +{ + listen = 9312 + listen = 9306:mysql41 + log = {$SERVER_APP}/index/searchd.log + query_log = {$SERVER_APP}/index/query.log + read_timeout = 5 + max_children = 0 + pid_file = {$SERVER_APP}/index/searchd.pid + seamless_rotate = 1 + preopen_indexes = 1 + unlink_old = 1 + #workers = threads # for RT to work + binlog_path = {$SERVER_APP}/index/binlog +} + +source search_hash +{ + type = mysql + + sql_host = 127.0.0.1 + sql_user = ssbc + sql_pass = ssbc + sql_db = ssbc + sql_port = 3306 # optional, default is 3306 + + sql_query_range = SELECT min(id), max(id) FROM search_hash + sql_range_step = 1000 + + sql_query_pre = SET NAMES utf8 + sql_query = \ + SELECT id, name, CRC32(category) AS category, length, UNIX_TIMESTAMP(create_time) AS create_time, UNIX_TIMESTAMP(last_seen) AS last_seen\ + FROM search_hash where id >= $start AND id <= $end + + sql_attr_bigint = length + sql_attr_timestamp = create_time + sql_attr_timestamp = last_seen + sql_attr_uint = category + +} + + +index search_hash +{ + source = search_hash + path = {$SERVER_APP}/index/db/search_hash + + ngram_len = 1 + ngram_chars = U+3000..U+2FA1F +} diff --git a/route/static/app/public.js b/route/static/app/public.js index 520396d81..44e478b89 100755 --- a/route/static/app/public.js +++ b/route/static/app/public.js @@ -1391,6 +1391,7 @@ function pluginConfigTpl(_name, version, func, config_tpl_func, read_config_tpl_ return f } + var fileName = ''; $.post('/plugins/run',{name:_name, func:_config_tpl_func,version:version}, function(data){ var rdata = $.parseJSON(data.data); for (var i = 0; i < rdata.length; i++) { @@ -1410,7 +1411,7 @@ function pluginConfigTpl(_name, version, func, config_tpl_func, read_config_tpl_ layer.msg(rdata.msg,{icon:0,time:2000,shade: [0.3, '#000']}); return; } - + $("#textBody").empty().text(rdata.data); $(".CodeMirror").remove(); var editor = CodeMirror.fromTextArea(document.getElementById("textBody"), { @@ -1428,6 +1429,11 @@ function pluginConfigTpl(_name, version, func, config_tpl_func, read_config_tpl_ }); editor.focus(); $(".CodeMirror-scroll").css({"height":"300px","margin":0,"padding":0}); + $("#onlineEditFileBtn").unbind('click'); + $("#onlineEditFileBtn").click(function(){ + $("#textBody").text(editor.getValue()); + pluginConfigSave(fileName); + }); },'json'); } }); @@ -1439,7 +1445,7 @@ function pluginConfigTpl(_name, version, func, config_tpl_func, read_config_tpl_ layer.close(loadT); var loadT2 = layer.msg('文件内容获取中...',{icon:16,time:0,shade: [0.3, '#000']}); - var fileName = data.data; + fileName = data.data; $.post('/files/get_body', 'path=' + fileName, function(rdata) { layer.close(loadT2); if (!rdata.status){