main.ftl 5.7 KB
Newer Older
A
ascrutae 已提交
1 2 3 4
<#import "./common/commons.ftl" as common>
<#import "./common/traceInfo.ftl" as traceInfo>
<#import "./usr/applications/applicationMaintain.ftl" as applicationMaintain>
<#import "./usr/authfile/auth.ftl" as auth>
5 6
<#import "anls-result/analysisSearchResult.ftl" as anlySearchResult>
<#import "anls-result/analysisResult.ftl" as anlyResult>
A
ascrutae 已提交
7 8 9 10 11 12 13 14 15 16 17 18 19 20
<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<@common.importResources />
    <script src="${_base}/bower_components/jquery-ui/jquery-ui.min.js"></script>
    <link rel="stylesheet" href="${_base}/bower_components/jquery-treetable/css/jquery.treetable.theme.default.css"/>
    <script src="${_base}/bower_components/jquery-treetable/jquery.treetable.js"></script>
    <link href="${_base}/bower_components/jquery-treetable/css/jquery.treetable.css" rel="stylesheet"/>
    <link href="${_base}/bower_components/skywalking/css/tracelog.css" rel="stylesheet"/>
    <script src="${_base}/bower_components/skywalking/js/tracelog.js"></script>
    <script src="${_base}/bower_components/skywalking/js/application.js"></script>
21 22 23 24
    <script src="${_base}/bower_components/skywalking/js/analysisSearchResult.js"></script>
    <script src="${_base}/bower_components/skywalking/js/analysisResult.js"></script>
    <script src="${_base}/bower_components/smalot-bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
    <link href="${_base}/bower_components/smalot-bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet">
A
ascrutae 已提交
25 26 27 28
    <link href="${_base}/bower_components/bootstrap-toggle/css/bootstrap-toggle.min.css" rel="stylesheet">
    <script src="${_base}/bower_components/bootstrap-toggle/js/bootstrap-toggle.min.js"></script>
</head>

29
<body style="padding-top:100px">
A
ascrutae 已提交
30 31 32 33 34 35 36 37 38 39 40
<@common.navbar/>
<!--Trace Info -->
<@traceInfo.traceTableTmpl/>
<@traceInfo.traceLogTmpl/>
<@traceInfo.traceTreeAllTmpl/>
<!--Application -->
<@applicationMaintain.applicationList/>
<@applicationMaintain.addApplication/>
<@applicationMaintain.createglobalConfig/>
<@applicationMaintain.modifyApplication/>
<@auth.downloadAuth/>
41 42 43 44 45
<@anlySearchResult.anlyResultTmpl/>
<@anlySearchResult.anlyResultDisplayTmpl/>
<@anlySearchResult.pageInfoTmpl/>
<@anlyResult.analysisResult/>
<@anlyResult.analysisResultTableTmpl/>
A
ascrutae 已提交
46 47 48 49 50 51 52 53 54 55 56 57 58
<p id="baseUrl" style="display: none">${_base}</p>
<div class="container" id="mainPanel">
    <p id="searchType" style="display: none">${searchType!''}</p>
    <p id="loadType" style="display: none;">${loadType!''}</p>
</div>

<script>
    $(document).ready(function () {
        //
        var loadType = $("#loadType").text();
        loadContent(loadType);
        // bind
        $("#searchBtn").click(function () {
59
            var searchKey = $("#searchKey").val();
60 61 62 63 64
            if (searchKey.match(/viewpoint:*/i)) {
                loadContent("showAnlySearchResult")
            } else if (searchKey.match(/analyResult:*/i)){
                loadContent("showAnalysisResult");
            } else{
65 66
                loadContent("showTraceInfo");
            }
A
ascrutae 已提交
67 68 69
        })
    });

70
    function loadContent(loadType, param) {
A
ascrutae 已提交
71

72
        if (loadType == "showTraceInfo") {
A
ascrutae 已提交
73
            loadTraceTreeData("${_base}");
A
ascrutae 已提交
74
            return;
A
ascrutae 已提交
75 76
        }

77
        if (loadType == "showAnlySearchResult") {
78 79 80 81 82 83 84 85 86 87 88 89 90
            var template = $.templates("#anlyResultPanelTmpl");
            var htmlOutput = template.render({});
            $("#mainPanel").empty();
            $("#mainPanel").html(htmlOutput);
            var searchKey = $("#searchKey").val();
            var index = searchKey.indexOf(':');
            if (index != -1) {
                searchKey = searchKey.substr(index + 1);
            }
            toSearchAnlyResult(searchKey);
            return;
        }

91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
        if (loadType == "showAnalysisResult") {
            var searchKey = $("#searchKey").val();
            var index = searchKey.indexOf(':');
            if (index != -1) {
                searchKey = searchKey.substr(index + 1);
            }

            var template = $.templates("#analysisResultPanelTmpl");
            var htmlOutput = template.render({treeId: searchKey});
            $("#mainPanel").empty();
            $("#mainPanel").html(htmlOutput);
            initAnalysisResult()
            return;
        }

A
ascrutae 已提交
106 107 108 109 110
        if (loadType == "applicationList") {
            loadAllApplications();
            return;
        }

111
        if (loadType == "addApplication") {
A
ascrutae 已提交
112 113 114 115 116 117 118 119
            var template = $.templates("#addApplicationTmpl");
            var htmlOutput = template.render({});
            $("#mainPanel").empty();
            $("#mainPanel").html(htmlOutput);
            addApplication();
            return;
        }

120
        if (loadType == "createGlobalApplication") {
A
ascrutae 已提交
121 122 123 124 125 126 127 128
            var template = $.templates("#createGlobalConfigTmpl");
            var htmlOutput = template.render({});
            $("#mainPanel").empty();
            $("#mainPanel").html(htmlOutput);
            createGlobalConfig();
            return;
        }

129
        if (loadType == "modifyApplication") {
A
ascrutae 已提交
130
            var template = $.templates("#modifyApplicationTmpl");
131
            var htmlOutput = template.render({applicationId: param});
A
ascrutae 已提交
132 133 134 135 136 137
            $("#mainPanel").empty();
            $("#mainPanel").html(htmlOutput);
            modifyApplication();
            return;
        }

138
        if (loadType == "downloadAuthFile") {
A
ascrutae 已提交
139
            var template = $.templates("#downloadAuthFileTmpl");
140
            var htmlOutput = template.render({applicationCode: param});
A
ascrutae 已提交
141 142 143 144 145 146
            $("#mainPanel").empty();
            $("#mainPanel").html(htmlOutput);
            toDownloadAuthFile();
            return;
        }

147

A
ascrutae 已提交
148 149 150 151 152
        $("#mainPanel").empty();
    }
</script>
</body>
</html>