Commit dcdb36d5 authored by Rafael Monnerat's avatar Rafael Monnerat

Monitoring UI was moved into ERP5 code base and it is not part of OfficeJS.

parent 65dfb326
...@@ -19,7 +19,6 @@ slapos_crm ...@@ -19,7 +19,6 @@ slapos_crm
slapos_pdm slapos_pdm
slapos_web slapos_web
slapos_jio slapos_jio
slapos_monitoring
slapos_payzen slapos_payzen
slapos_hypermedia slapos_hypermedia
slapos_upgrader slapos_upgrader
......
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<title>ERP5 Graph</title>
<!-- custom css -->
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<!-- custom script -->
<script src="dygraph.js" type="text/javascript"></script>
<script src="gadget_erp5_graph.js" type="text/javascript"></script>
</head>
<body>
<div class="custom-grid-wrap">
<div class="custom-grid ui-corner-all ui-body-inherit ui-shadow ui-corner-all"></div>
</div>
</body>
</html>
\ No newline at end of file
/*global window, rJS, console, RSVP, Dygraph */
/*jslint indent: 2, maxerr: 3 */
(function(rJS) {
"use strict";
// Custom Interaction Model for synchronised graphs
var customInteractionModel = Dygraph.Interaction.defaultModel;
customInteractionModel.touchend = function(event, g, context) {
Dygraph.Interaction.endTouch(event, g, context);
var viewWindow = g.xAxisRange();
g.getFunctionOption("zoomCallback").call(g, viewWindow[0], viewWindow[1], g.yAxisRanges());
};
/*customInteractionModel.touchmove = function(event, g, context) {
Dygraph.Interaction.moveTouch(event, g, context);
var viewWindow = g.xAxisRange();
g.getFunctionOption("zoomCallback").call(g, viewWindow[0], viewWindow[1], g.yAxisRanges());
};
customInteractionModel.mousemove = function(event, g, context) {
if (context.isPanning) {
var viewWindow = g.xAxisRange();
g.getFunctionOption("zoomCallback").call(g, viewWindow[0], viewWindow[1], g.yAxisRanges());
}
}*/
customInteractionModel.mouseup = function(event, g, context) {
if (context.isPanning) {
var viewWindow = g.xAxisRange();
g.getFunctionOption("zoomCallback").call(g, viewWindow[0], viewWindow[1], g.yAxisRanges());
}
};
rJS(window)
/////////////////////////////////////////////////////////////////
// ready
/////////////////////////////////////////////////////////////////
.ready(function(gadget) {
gadget.property_dict = {};
return gadget.getElement()
.push(function(element) {
gadget.property_dict.element = element;
});
})
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.declareMethod('getColors', function() {
var gadget = this;
return new RSVP.Queue()
.push(function () {
return gadget.property_dict.graph.getColors();
});
})
.declareMethod('setVisibility', function(num, value) {
var gadget = this;
return new RSVP.Queue()
.push(function () {
return gadget.property_dict.graph.setVisibility(num, value);
});
})
.declareMethod('updateOptions', function(options, ndarray) {
var gadget = this;
return new RSVP.Queue()
.push(function () {
gadget.property_dict.graph.ndarray = ndarray;
return gadget.property_dict.graph.updateOptions(options);
});
})
.declareMethod('resize', function(width, height) {
var gadget = this;
return new RSVP.Queue()
.push(function () {
return gadget.property_dict.graph.resize(width, height);
});
})
// render gadget
.declareMethod('render', function(data, option_dict, interactionModel) {
var gadget = this;
if (interactionModel === "customInteractionModel") {
option_dict.interactionModel = customInteractionModel;
}
return new RSVP.Queue()
.push(function () {
gadget.property_dict.graph = new Dygraph(
gadget.property_dict.element,
data,
option_dict
);
return gadget;
});
});
}(rJS));
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<title>Monitoring Panel Gadget</title>
<link rel="stylesheet" href="magnific-popup.css">
<link rel="stylesheet" href="gadget_monitoring_tooltipster.css">
<link href="gadget_monitoring_custom.css" rel="stylesheet" type="text/css"/>
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<script src="handlebars.js" type="text/javascript"></script>
<script src="gadget_global.js" type="text/javascript"></script>
<script src="jquery.js" type="text/javascript"></script>
<script src="jquerymobile.js" type="text/javascript"></script>
<!-- magnific-popup -->
<script src="jquery.magnific-popup.min.js" type="text/javascript"></script>
<script src="gadget_monitoring_tooltipster.min.js" type="text/javascript"></script>
<script id="panel-template-header" type="text/x-handlebars-template">
<div data-role="header" class="ui-bar-inherit">
<div class="ui-controlgroup ui-controlgroup-horizontal ui-btn-left">
<div class="ui-controlgroup-controls">
<form action="#" method="post">
<input type="submit" data-i18n="[value]Close" data-icon="delete" data-iconpos="notext" value="Close" />
</form>
</div>
</div>
<img class="ui-title" alt="SlapOS Monitoring" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAB2klEQVRIS62V8TkDURDEZyughKhAVEAqQAXoICoQFaACOkAFkgpEB1EBKhjf7+zL90SORG7/SXLZN7M7s/su1BK2tyUdSupVKTNJk4jgc6WIxSzbAF5JOvoF4UHSZURM/2L5RmD7VNJtHvqQtAWQpAtJj9lReU7aWUTc/UYyJ7A9zMpfJEH0JOkmIka2LWkgqZ9kfAd4NzsZtZE0BLaR414S4AeSIDuNiJ5tQJ9LtbbR/y6Jx5L2JR1HBLL9iELAIUwFjANUVJu7eJB8ciaS8OEtInaWElS6kwgoRATaU+F7dnCeYBTBEBD8BxnPlvoRttHyRBLmIQ0HniKi9geiYZka283vBMYvYoxsi11AUCrvM9+2SWr0/2sEV/kfAiaEVstMA8xIXqc0RbJV8EoOeHsUXAiQpyagbaaJ+ceLdYICkZxFHEGA5ixUw5gSoXFDUHuxCottzrFDc4JiMm1h3GsCdUZQlgxg9KYbNrUbgtzkspEAoyG/8WFziZKgXAcYzcJM04tuCJKk3KTNiHXaQZmOnAAuLXzpzoN6/PJNxiMmij2AaJ1Abpb0a0zbTlbzvA54nTuIiHErQWX+f66KWXlvLyWwTYu8rTaNSRsBF2An0UbAFGHWpjH9BL0Y7d/fY0bVAAAAAElFTkSuQmCC"/>
<div class="ui-controlgroup ui-controlgroup-horizontal ui-btn-right">
<div class="ui-controlgroup-controls">
<a href="#" class="ui-btn ui-btn-icon-notext ui-icon-home" data-i18n="Home">Home</a>
</div>
</div>
</div>
</script>
<script id="panel-template-body" type="text/x-handlebars-template">
<div class="ui-content">
<ul data-role="listview" class="ui-listview">
<li><a href="#page=status_list"><i class="fa fa-th-list"></i><span data-i18n="Promises Status">Promises Status</span></a></li>
<li><a href="#page=software_instance_list"><i class="fa fa-cube"></i><span data-i18n="Software Instances">Software Instances</span></a></li>
<li><a href="#page=hosting_subscription_list"><i class="fa fa-globe"></i><span data-i18n="Hosting Subscriptions">Hosting Subscriptions</span></a></li>
<li><a href="#page=message_log"><i class="fa fa-newspaper-o" aria-hidden="true"></i><span data-i18n="Log Messages">Log Messages</span></a></li>
<li><a href="#page=settings_configurator"><i class="fa fa-cog"></i><span data-i18n="Monitoring Configuration">Monitoring Configuration</span></a></li>
<li><a href="#page=import_export"><i class="fa fa-exchange"></i><span data-i18n="Import / Export">Import / Export</span></a></li>
</ul>
</div>
</script>
<!-- custom script -->
<script src="gadget_monitoring_application_panel.js" type="text/javascript"></script>
</head>
<body>
<div class="jqm-navmenu-panel"></div>
</body>
</html>
\ No newline at end of file
/*jslint nomen: true, indent: 2, maxerr: 3 */
/*global window, rJS, Handlebars, jQuery, RSVP, loopEventListener */
(function (window, rJS, Handlebars, $, RSVP, loopEventListener) {
"use strict";
var gadget_klass = rJS(window),
source_header = gadget_klass.__template_element
.getElementById("panel-template-header")
.innerHTML,
panel_template_header = Handlebars.compile(source_header),
source_body = gadget_klass.__template_element
.getElementById("panel-template-body")
.innerHTML,
panel_template_body = Handlebars.compile(source_body);
gadget_klass
.declareAcquiredMethod("translateHtml", "translateHtml")
// Assign the element to a variable
// Init local properties
.ready(function (g) {
g.props = {};
})
.ready(function (g) {
return g.getElement()
.push(function (element) {
g.props.element = element;
g.props.jelement = $(element.querySelector("div"));
});
})
.ready(function (g) {
g.props.jelement.panel({
display: "overlay",
position: "left",
theme: "b"
// animate: false
});
})
.ready(function (g) {
return g.translateHtml(panel_template_header() + panel_template_body())
.push(function (my_translated_or_plain_html) {
g.props.jelement.html(my_translated_or_plain_html);
g.props.jelement.trigger("create");
});
})
.declareMethod('toggle', function () {
this.props.jelement.panel("toggle");
})
.declareMethod('close', function () {
this.props.jelement.panel("close");
})
.declareMethod('render', function () {
return;
})
/////////////////////////////////////////////////////////////////
// declared services
/////////////////////////////////////////////////////////////////
.declareService(function () {
var panel_gadget,
form_list,
event_list,
i,
len;
function formSubmit() {
panel_gadget.toggle();
}
panel_gadget = this;
form_list = panel_gadget.props.element.querySelectorAll('form');
event_list = [];
// XXX: not robust - Will break when search field is active
for (i = 0, len = form_list.length; i < len; i += 1) {
event_list[i] = loopEventListener(
form_list[i],
'submit',
false,
formSubmit
);
}
return new RSVP.Queue()
.push(function () {
return RSVP.all(event_list);
});
});
}(window, rJS, Handlebars, jQuery, RSVP, loopEventListener));
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<title>Chart Gadget</title>
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<script src="Chart.min.js"></script>
<!-- custom script -->
<script src="gadget_monitoring_chart.js" type="text/javascript"></script>
</head>
<body>
<canvas height="450" width="600"></canvas>
<div class='legend'></div>
</body>
</html>
\ No newline at end of file
/*global window, rJS, Chart, RSVP */
/*jslint nomen: true, indent: 2, maxerr: 3*/
(function (window, rJS, RSVP, Chart) {
"use strict";
rJS(window)
.ready(function (gadget) {
return gadget.getElement()
.push(function (element) {
gadget.property_dict = {
element: element,
render_deferred: RSVP.defer()
};
});
})
.ready(function (gadget) {
// Initialize the gadget local parameters
gadget.property_dict.ctx = gadget.property_dict.element.querySelector('canvas').getContext("2d");
Chart.defaults.global = {
// Boolean - Whether to animate the chart
animation: true,
// Number - Number of animation steps
animationSteps: 60,
// String - Animation easing effect
// Possible effects are:
// [easeInOutQuart, linear, easeOutBounce, easeInBack, easeInOutQuad,
// easeOutQuart, easeOutQuad, easeInOutBounce, easeOutSine, easeInOutCubic,
// easeInExpo, easeInOutBack, easeInCirc, easeInOutElastic, easeOutBack,
// easeInQuad, easeInOutExpo, easeInQuart, easeOutQuint, easeInOutCirc,
// easeInSine, easeOutExpo, easeOutCirc, easeOutCubic, easeInQuint,
// easeInElastic, easeInOutSine, easeInOutQuint, easeInBounce,
// easeOutElastic, easeInCubic]
animationEasing: "easeOutQuart",
// Boolean - If we should show the scale at all
showScale: true,
// Boolean - If we want to override with a hard coded scale
scaleOverride: false,
// ** Required if scaleOverride is true **
// Number - The number of steps in a hard coded scale
scaleSteps: null,
// Number - The value jump in the hard coded scale
scaleStepWidth: null,
// Number - The scale starting value
scaleStartValue: null,
// String - Colour of the scale line
scaleLineColor: "rgba(0,0,0,.1)",
// Number - Pixel width of the scale line
scaleLineWidth: 1,
// Boolean - Whether to show labels on the scale
scaleShowLabels: true,
// Interpolated JS string - can access value
scaleLabel: "<%=value%>",
// Boolean - Whether the scale should stick to integers, not floats even if drawing space is there
scaleIntegersOnly: true,
// Boolean - Whether the scale should start at zero, or an order of magnitude down from the lowest value
scaleBeginAtZero: false,
// String - Scale label font declaration for the scale label
scaleFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
// Number - Scale label font size in pixels
scaleFontSize: 12,
// String - Scale label font weight style
scaleFontStyle: "normal",
// String - Scale label font colour
scaleFontColor: "#666",
// Boolean - whether or not the chart should be responsive and resize when the browser does.
responsive: true,
// Boolean - whether to maintain the starting aspect ratio or not when responsive, if set to false, will take up entire container
maintainAspectRatio: true,
// Boolean - Determines whether to draw tooltips on the canvas or not
showTooltips: true,
// Function - Determines whether to execute the customTooltips function instead of drawing the built in tooltips (See [Advanced - External Tooltips](#advanced-usage-custom-tooltips))
customTooltips: false,
// Array - Array of string names to attach tooltip events
tooltipEvents: ["mousemove", "touchstart", "touchmove"],
// String - Tooltip background colour
tooltipFillColor: "rgba(0,0,0,0.8)",
// String - Tooltip label font declaration for the scale label
tooltipFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
// Number - Tooltip label font size in pixels
tooltipFontSize: 14,
// String - Tooltip font weight style
tooltipFontStyle: "normal",
// String - Tooltip label font colour
tooltipFontColor: "#fff",
// String - Tooltip title font declaration for the scale label
tooltipTitleFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
// Number - Tooltip title font size in pixels
tooltipTitleFontSize: 14,
// String - Tooltip title font weight style
tooltipTitleFontStyle: "bold",
// String - Tooltip title font colour
tooltipTitleFontColor: "#fff",
// Number - pixel width of padding around tooltip text
tooltipYPadding: 6,
// Number - pixel width of padding around tooltip text
tooltipXPadding: 6,
// Number - Size of the caret on the tooltip
tooltipCaretSize: 8,
// Number - Pixel radius of the tooltip border
tooltipCornerRadius: 6,
// Number - Pixel offset from point x to tooltip edge
tooltipXOffset: 10,
// String - Template string for single tooltips
tooltipTemplate: "<%if (label){%><%=label%>: <%}%><%= value %>",
// String - Template string for multiple tooltips
multiTooltipTemplate: "<%= value %>",
// Function - Will fire on animation progression.
onAnimationProgress: function(){},
// Function - Will fire on animation completion.
onAnimationComplete: function(){}
};
})
.declareMethod('render', function (options) {
var gadget = this;
gadget.property_dict.options = options;
})
.declareMethod('addData', function (valuesArray, label) {
return gadget.property_dict.chart.addData(valuesArray, label);
})
.declareMethod('removeData', function () {
return gadget.property_dict.chart.removeData();
})
.declareMethod('addDataIndex', function (segmentData, index) {
return gadget.property_dict.chart.addData(segmentData, index);
})
.declareMethod('removeDataIndex', function (index) {
return gadget.property_dict.chart.removeData(index);
})
.declareMethod('update', function () {
return gadget.property_dict.chart.update();
})
.declareMethod('clear', function () {
return gadget.property_dict.chart.clear();
})
.declareMethod('stop', function () {
return gadget.property_dict.chart.stop();
})
.declareMethod('redraw', function () {
return gadget.property_dict.chart.render();
})
.declareMethod('resize', function () {
return gadget.property_dict.chart.resize();
})
.declareMethod('toBase64Image', function () {
return gadget.property_dict.chart.toBase64Image();
})
.declareMethod('destroy', function () {
return gadget.property_dict.chart.destroy();
})
.declareMethod('generateLegend', function () {
return gadget.property_dict.chart.generateLegend();
})
.declareService(function () {
var gadget = this;
return new RSVP.Queue()
.push(function () {
var options = gadget.property_dict.options,
promise_list = [];
switch (options.type) {
case "line": promise_list.push(
new Chart(gadget.property_dict.ctx).Line(options.data, options.config)
);
break;
case "bar": promise_list.push(
new Chart(gadget.property_dict.ctx).Bar(options.data, options.config)
);
break;
case "pie": promise_list.push(
new Chart(gadget.property_dict.ctx).Pie(options.data, options.config)
);
break;
case "doughnut": promise_list.push(
new Chart(gadget.property_dict.ctx).Doughnut(options.data, options.config)
);
break;
default: return [];
}
return new RSVP.Queue()
.push(function () {
return RSVP.all(promise_list);
})
.push(function (result_list) {
gadget.property_dict.chart = result_list[0];
gadget.property_dict.element.querySelector('.legend')
.innerHTML += gadget.property_dict.chart.generateLegend();
return gadget.property_dict.chart.render();
});
})
.push(function () {
var promise_list = [];
promise_list.push(window.addEventListener("load", function () {
console.log(gadget.property_dict.chart.generateLegend());
return gadget.property_dict.chart.render();
}));
return RSVP.all(promise_list);
});
});
}(window, rJS, RSVP, Chart));
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<title>Monitoring Document Edit Page</title>
<link rel="stylesheet" href="magnific-popup.css">
<link href="gadget_monitoring_custom.css" rel="stylesheet" type="text/css"/>
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<script id="login-toltip-template" type="text/x-handlebars-template">
</script>
<!-- magnific-popup -->
<script src="jquery.magnific-popup.min.js" type="text/javascript"></script>
<!-- custom script -->
<script src="gadget_monitoring_document_edit.js" type="text/javascript"></script>
</head>
<body>
<div data-gadget-url="gadget_monitoring_jio.html" data-gadget-scope="jio_gadget" data-gadget-sandbox="public"></div>
<div data-gadget-url="gadget_monitoring_login_widget.html" data-gadget-scope="login_gadget" data-gadget-sandbox="public"></div>
<div class="white-popup mfp-hide">
<div class="ui-promise-title"><h2 style="font-size: 1.1em;"></h2></div>
<form>
<div data-role="content">
<div class="form-controlgroup">
</div>
</div>
<div class="padding-5">
<span class="ui-text-error"></span>
</div>
<div>
<button type="button" class="ui-btn ui-corner-all ui-btn-inline cancel"><i class="fa fa-times"></i> Cancel</button>
<button type="submit" class="ui-btn ui-corner-all ui-btn-inline save"><i class="fa fa-floppy-o"></i> Save</button>
<div class="ui-content-hidden spinner">
<i class="fa fa-spinner fa-spin"></i>
</div>
</div>
</form>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<title>Monitoring Document Edit Page</title>
<link rel="stylesheet" href="magnific-popup.css">
<link href="gadget_monitoring_custom.css" rel="stylesheet" type="text/css"/>
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<script id="login-toltip-template" type="text/x-handlebars-template">
</script>
<!-- magnific-popup -->
<script src="jquery.magnific-popup.min.js" type="text/javascript"></script>
<!-- custom script -->
<script src="gadget_monitoring_document_edit.js" type="text/javascript"></script>
</head>
<body>
<div data-gadget-url="gadget_monitoring_jio.html" data-gadget-scope="jio_gadget" data-gadget-sandbox="public"></div>
<div data-gadget-url="gadget_monitoring_login_widget.html" data-gadget-scope="login_gadget" data-gadget-sandbox="public"></div>
<div class="white-popup mfp-hide">
<div class="ui-promise-title"><h2 style="font-size: 1.1em;"></h2></div>
<form>
<div data-role="content">
<div class="form-controlgroup">
</div>
</div>
<div class="padding-5">
<span class="ui-text-error"></span>
</div>
<div>
<button type="button" class="ui-btn ui-corner-all ui-btn-inline cancel"><i class="fa fa-times"></i> Cancel</button>
<button type="submit" class="ui-btn ui-corner-all ui-btn-inline save"><i class="fa fa-floppy-o"></i> Save</button>
<div class="ui-content-hidden spinner">
<i class="fa fa-spinner fa-spin"></i>
</div>
</div>
</form>
</div>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment