Example #1
0
        success: function(data) {
            $(".setting-search").text("查询日志")
            var ret = data.ret;
            if (ret === 0) {
                var param = {
                    encodeHtml: encodeHtml,
                    set: Delegator.set,
                    startIndex: currentIndex * MAX_LIMIT
                };

                if (isAdd) {
                    $('#log-table').append(logTable({
                        it: data.data,
                        opt: param
                    }));
                } else {
                    $('#log-table').html(logTable({
                        it: data.data,
                        opt: param
                    }));
                }

                currentIndex++;
                if (data.data.length === 0) {
                    noData = true;
                }
            }else {
                dialog({
                    header: '查询失败',
                    body: JSON.stringify(data.msg)
                });
            }
            loading = false;
        },
Example #2
0
function isTimeRight(begin, end) {
    if (begin > end) {
        dialog({
            header: '时间范围错误',
            body: '结束时间必须在开始时间之后!'
        });
        return false;
    } else if (end - maxDate > begin) {
        dialog({
            header: '时间范围错误',
            body: '结束时间和开始时间间隔需在三天之内!'
        });
        return false;
    }
    return true;

}
Example #3
0
            $('#showLogs').bind("click" , function(e){
                var projectId = $("#select-business").val();

                if(isNaN(projectId) || projectId<0){
                    Dialog({
                        header: '警告',
                        body: '请选择一个项目'
                    })
                    return ;
                }

                $.getJSON("/controller/statisticsAction/queryById.do" , {projectId : projectId , startDate : new Date($('#startTime').val() + " 00:00:00") - 0} , function (data){
                        $('#table-content').html(statisticsTpl({it : data,  opt : {encodeHtml : encodeHtml }}));
                    if(  data && data.data[0] ){
                        $('#error-count').html(data.data[0].total || 0 );
                    }
                });
            });
Example #4
0
        }).on('click', 'showLogs', function() {
            logConfig.id = $('#select-business').val() >> 0; // jshint ignore:line
            if (logConfig.id <= 0 || loading) {
                !loading && dialog({
                    header: '警告',
                    body: '请选择一个项目'
                });
                return;
            }

            if (!$(this).data("stop")) {
                $(this).data("stop", true);
                $('#log-table').html('');
                startMonitor(logConfig.id);
                $(this).addClass("stop").text('停止监听');
            } else {
                $(this).data("stop", false);
                websocket.close();
                $(this).removeClass("stop").text('开始监听');
            }

        })
Example #5
0
function showLogs(opts, isAdd) {
    opts.id = $('#select-business').val() >> 0; // jshint ignore:line
    if (opts.id <= 0 || loading) {
        !loading && dialog({
            header: '警告',
            body: '请选择一个项目'
        });
        return;
    }

    loading = true;

    $(".setting-search").text("正在加载...")


    if (!isAdd) {
        currentIndex = 0;
        noData = false;
    }

    var url = '/controller/logAction/queryLogList.do';
    $.ajax({
        url: url,
        data: {
            id: opts.id,
            startDate: opts.startDate,
            endDate: opts.endDate,
            include: opts.include,
            exclude: opts.exclude,
            index: currentIndex,
            _t: new Date() - 0,
            level: opts.level
        },
        success: function(data) {
            $(".setting-search").text("查询日志")
            var ret = data.ret;
            if (ret === 0) {
                var param = {
                    encodeHtml: encodeHtml,
                    set: Delegator.set,
                    startIndex: currentIndex * MAX_LIMIT
                };

                if (isAdd) {
                    $('#log-table').append(logTable({
                        it: data.data,
                        opt: param
                    }));
                } else {
                    $('#log-table').html(logTable({
                        it: data.data,
                        opt: param
                    }));
                }

                currentIndex++;
                if (data.data.length === 0) {
                    noData = true;
                }
            }else {
                dialog({
                    header: '查询失败',
                    body: JSON.stringify(data.msg)
                });
            }
            loading = false;
        },
        error: function() {
            $(".setting-search").text("查询日志")
            loading = false;
        }
    });
}