diff --git a/front/assets/js/app-search.js b/front/assets/js/app-search.js index dfea036..e9db840 100644 --- a/front/assets/js/app-search.js +++ b/front/assets/js/app-search.js @@ -4,15 +4,17 @@ var mapping = []; var fmapping = {}; var filter_operation = ["is", "is_not", "exists", "does_not_exists"] var filters_set = {} -dateS.setMinutes(dateS.getMinutes() - 195) -dateE.setMinutes(dateE.getMinutes() - 180) +//dateS.setMinutes(dateS.getMinutes() - 195) +dateS.setMinutes(dateS.getMinutes() - 15) +//dateE.setMinutes(dateE.getMinutes() - 180) +//dateE.setMinutes(dateE.getMinutes() - 180) $.datetimepicker.setLocale('ru'); -$('#datetimepicker_start').datetimepicker({timepicker: true, format:'Y-m-d H:i:s', step: 15, value:dateS}); +$('#datetimepicker_start').datetimepicker({timepicker: true, format:'Y-m-d H:i:s', step: 15, value:dateS.toISOString()}); $('#datetimepicker_end').datetimepicker({ timepicker: true, format:'Y-m-d H:i:s', step: 15, - value:dateE, + value:dateE.toISOString(), onShow:function( ct ){ this.setOptions({ minDate:$('#datetimepicker_start').val()?$('#datetimepicker_start').val():false @@ -22,6 +24,22 @@ $('#datetimepicker_end').datetimepicker({ //var getnodes = setInterval(NodeStatus, 5000); //var getindices = setInterval(IndexList, 3000); + +function cyrb53(str, seed = 0){ + let h1 = 0xdeadbeef ^ seed, h2 = 0x41c6ce57 ^ seed; + for(let i = 0, ch; i < str.length; i++) { + ch = str.charCodeAt(i); + h1 = Math.imul(h1 ^ ch, 2654435761); + h2 = Math.imul(h2 ^ ch, 1597334677); + } + h1 = Math.imul(h1 ^ (h1 >>> 16), 2246822507); + h1 ^= Math.imul(h2 ^ (h2 >>> 13), 3266489909); + h2 = Math.imul(h2 ^ (h2 >>> 16), 2246822507); + h2 ^= Math.imul(h1 ^ (h1 >>> 13), 3266489909); + + return 4294967296 * (2097151 & h2) + (h1 >>> 0); +} + function bytesToSize(bytes) { var sizes = ['b', 'kb', 'mb', 'gb', 'tb']; if (bytes == 0) return '0 byte'; @@ -103,29 +121,25 @@ $('#igs').on('change', function(e) { $('#mapping_filter').val(''); str += "" $("#fields").html(str); + event.preventDefault(); } }); }); $('#mapping_filter').on('keypress', function(e) { - var str=""; - str += "" - $("#fields").html(str); }); $('#modal_add_filter').on('shown.bs.modal',function(e){ diff --git a/modules/router/methods.go b/modules/router/methods.go index 9210937..9981573 100644 --- a/modules/router/methods.go +++ b/modules/router/methods.go @@ -236,7 +236,6 @@ func (rt *Router) getIndexGroups(cluster string) ([]indexGroup, error) { return nil, err } err = json.Unmarshal(response, &igs) - fmt.Printf("%v\n", igs) if err != nil { return nil, err } @@ -246,7 +245,6 @@ func (rt *Router) getIndexGroups(cluster string) ([]indexGroup, error) { igresp = append(igresp, n) } unique := removeDuplicates(igresp) - fmt.Printf("%v\n", unique) return unique, nil } diff --git a/modules/router/router.go b/modules/router/router.go index bbb5610..f532d92 100644 --- a/modules/router/router.go +++ b/modules/router/router.go @@ -684,8 +684,8 @@ func (rt *Router) ApiHandler(w http.ResponseWriter, r *http.Request) { query = fmt.Sprintf(`"query": { "bool": { "must": [ %s ],"filter": [ %s %s ], "should": [],"must_not": [ %s ] }}`, xql, tf, filters, must_not) full_query = fmt.Sprintf(`{"size": 500, %s, %s, %s, %s }`, sort, use_source, fields, query) - fmt.Println(full_query) if request.Search.Count { + log.Println("action: Count", "\tquery: ", "{"+query+"}") _ = json.Unmarshal([]byte("{"+query+"}"), &req) cresponse, err := rt.doPost(host+request.Search.Index+"/_count", req, "Search") if err != nil { @@ -695,6 +695,7 @@ func (rt *Router) ApiHandler(w http.ResponseWriter, r *http.Request) { } w.Write(cresponse) } else { + log.Println("action: Search", "\tquery: ", full_query) _ = json.Unmarshal([]byte(full_query), &req) sresponse, err := rt.doPost(host+request.Search.Index+"/_search", req, "Search") if err != nil { diff --git a/modules/version/version.go b/modules/version/version.go index a3f675d..e8c7c4a 100644 --- a/modules/version/version.go +++ b/modules/version/version.go @@ -13,4 +13,4 @@ package version -var Version = "extractor/v0.2.15" +var Version = "extractor/v0.2.16"