Bug Fix: Context Handling

master
Steve L. Nyemba 8 years ago
parent 2e4c8cf9f3
commit fd4c01f804

@ -3,7 +3,7 @@ var monitor = {}
monitor.processes = {}
monitor.processes.fetch = function(){
var httpclient = HttpClient.instance()
httpclient.get('/get/processes',monitor.processes.init);
httpclient.get(HTTP_CONTEXT+'/get/processes',monitor.processes.init);
}
@ -105,7 +105,7 @@ monitor.processes.render = function(label,data) {
monitor.processes.trend = {}
monitor.processes.trend.init = function (label,app) {
var httpclient = HttpClient.instance()
var uri = '/trends?id='+label+'&app='+encodeURIComponent(app)
var uri = HTTP_CONTEXT+'/trends?id='+label+'&app='+encodeURIComponent(app)
httpclient.get(uri, function (x) {
var logs = JSON.parse(x.responseText)
var dom = jx.dom.get.instance('trend_info');
@ -282,7 +282,7 @@ monitor.sandbox = {}
monitor.sandbox.init = function () {
jx.dom.hide('inspect_sandbox')
var httpclient = HttpClient.instance()
httpclient.get('/sandbox', function (x) {
httpclient.get(HTTP_CONTEXT+'/sandbox', function (x) {
var r = JSON.parse(x.responseText)
@ -335,7 +335,7 @@ monitor.sandbox.render = function (logs) {
dom.name = 'missing'
dom.value = JSON.stringify(item.missing)
form.action = '/download'
form.action = HTTP_CONTEXT+'/download'
form.method = 'POST'
form.appendChild(dom)
form.submit()
@ -358,7 +358,7 @@ monitor.sandbox.render = function (logs) {
monitor.folders = {}
monitor.folders.init = function () {
var httpclient = HttpClient.instance()
httpclient.get('/folders', function (x) {
httpclient.get(HTTP_CONTEXT+'/folders', function (x) {
var r = JSON.parse(x.responseText)
var data = []
for (var id in r) {

@ -5,6 +5,7 @@
<link type="text/css" rel="stylesheet" href="{{ context }}/static/js/jsgrid/jsgrid-theme.min.css" >
<link href="{{context}}/static/css/default.css" rel="stylesheet" type="text/css">
<link href="{{context}}/static/css/fa/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link rel="icon" href="data:;base64,iVBORw0KGgo=">
<script src="{{ context }}/static/js/jquery/jquery.min.js"></script>
<script src="{{context}}/static/js/chart.js/chart.bundle.js"></script>
@ -18,6 +19,7 @@
<script src="{{context}}/static/js/dashboard.js"></script>
<title>iMonitor</title>
<script>
var HTTP_CONTEXT="{{context}}"
$(document).ready(function(){
monitor.folders.init()
monitor.processes.fetch()
@ -91,9 +93,9 @@
<div class="small">Powered By Machine Learning</div>
</div>
<div class=" border" style="margin-top:4px; padding:2px; height:34px">
<i class="fa fa-search left" style="margin:4px; padding:4px; position:absolute; color:gray"></i>
<i class="fa fa-search left" style="margin:4px; padding:4px; ; color:gray;"></i>
<input id="folder_search" type="text" class="small left" placeholder="hostname" style="width:92%; padding-left:22px" onkeyup="monitor.folders.search.init()"/>
<i class="fa fa-trash right action" style="margin:4px; padding:4px; color:maroon" onclick="monitor.folders.search.reset()"></i>
<i class="fa fa-trash right action right" style="margin:4px; padding:4px; color:maroon" onclick="monitor.folders.search.reset()"></i>
</div>
<div style="margin-top:10px; height:150px">
<div id="gridfolders"></div>

@ -12,6 +12,8 @@ if len(sys.argv) > 1:
value = sys.argv[i + 1] = sys.argv[i+1].strip()
if key and value:
PARAMS[key] = value
if key == 'context':
PARAMS[key] = ('/'+value).replace('//','/')
i += 2

Loading…
Cancel
Save