Viz: uber, report, dash, adhoc

jQueryUI, css reset, embedding report to iframe, loading reports list from server

by Pavel Savushchyk

HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/jquery-ui.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore.js"></script>
<script type="text/javascript">
    window.addEventListener("load", onLoad);
</script>
<div style="width:327px;float: left;border-right:1px solid #333;margin-right:2px">
     <h4>Settings</h4>
    
    <div>
        <div id="containerLoadV">
            <div id="serverUrlsDiv"></div>
            <label for="confLocale">Locale: </label>
            <input id="confLocale" value="en" />
            <!-- options -->
            <br/>
            <input id="confOptimized" type="checkbox" />
            <label for="confOptimized" >optimized</label>
            <br/>
            <input id="logEnabled" type="checkbox" />
            <label for="logEnabled" >enable log</label>
            <select id="logLevel">
                <option value="debug">debug</option>
                <option value="info">info</option>
                <option value="warn">warn</option>
                <option value="error" selected="selected">error</option>
            </select>
            <br/>
            <button id="loadV">Load visualize</button>
            <br/>
            
        </div>
        <div id="loadResources" style="display:none;">
            <div>Add report:</div>
            <input id="defaultJiveUi" type="checkbox" checked="checked" />
            <label for="defaultJiveUi" >- default JIVE UI </label>
            <br/>
            <input id="isolateDOM" type="checkbox" />
            <label for="isolateDOM" >- isolate DOM </label>
            <br/>

            <select id="selected_resource" name="report" style="width:195px"></select>
            <button id="addReport">Add</button>
        </div>
        <p>Loaded resourses list:</p>
        <ul id="resourcesList" style="overflow-wrap:...

CSS

/*.qwe {
    height: 100%;
}
#reportContainer {
    height: 100%;
}
body, html {
    height: 100%;
}
.visualizejs table {
    font-size: 1%;
}
*/

#containerLoadV.disabled {
    color: #666;
}
#selected_resource option.dashboard {
  color: blue;
}
#selected_resource option.dashboard {
  color: green;
}

JavaScript

// ************ SETTINGS **********
var serverUrls = [
    "http://localhost:8080/jasperserver-pro",
    "http://localhost:8080/jrs1",
    "http://localhost:8080/jrs2",
    "http://localhost:8080/jrs3",
    "http://localhost:8080/trunk",
    "http://localhost:8080/bugfix",
    "http://build-master.jaspersoft.com:5980/jrs-pro-trunk",
    "http://build-master.jaspersoft.com:7980/jrs-pro-bugfix",
    "http://build-master.jaspersoft.com:8180/jrs-pro-feature-embedded-ic",
    "http://build-master.jaspersoft.com:7480/jrs-pro-feature-adhoc-rest-api2",
    "http://build-master.jaspersoft.com:8980/jrs-pro-feature-embeddable-ahv2",
    "http://build-master.jaspersoft.com:7480/jrs-pro-feature-jive-refactoring",
    "http://build-master.jaspersoft.com:4380/jrs-pro-hotfix-6.0.0",
    "http://build-master.jaspersoft.com:4780/jrs-pro-hotfix-6.0.1",
    "http://build-master.jaspersoft.com:6180/jrs-pro-hotfix-6.1.0",
    "http://build-master.jaspersoft.com:7080/jrs-pro-hotfix-6.1.1",
    "http://build-master.jaspersoft.com:7580/jrs-pro-hotfix-6.2.0",
    "http://build-master.jaspersoft.com:4280/jrs-pro-hotfix-6.2.1",
    "http://build-master.jaspersoft.com:4480/jrs-pro-hotfix-6.3.0"
];
var settings = JSON.parse(getCookie("settings"));

settings = _.defaults(settings || {}, {
    	locale: "en",
      urlUsed: 0,
      useOptimize: false,
      logEnabled: false,
      logLevel: "error"
    });
    
    
var resourcesList = {};
// ********************************
function setupLoaderV() {
    var html,
        radioTpl = '<input id="#id" type="radio" value="#value" name="confServer" /><label for="#id" title="#title" >#label</label><br/>';
    for (var i = 0, l = serverUrls.length; i < l; i++) {
        html = radioTpl.replace(/#id/g, "serverUrl_" + i)
            .replace(/#value/g, i)
            .replace(/#title/g, serverUrls[i])
            .replace("#label", serverUrls[i].replace(/(.+)jrs-/, "CI jrs-"));

        $("#serverUrlsDiv").append(html);
        $("#serverUrl_" +...