}
};
+ // Get selectors' current state
+ function getSelector(id) {
+ var e = document.getElementById(id);
+ return e.options[e.selectedIndex].value;
+ }
+
function initGraph() {
- // Get selectors' current state
- function getSelector(id) {
- var e = document.getElementById(id);
- return e.options[e.selectedIndex].value;
- }
var graph = new D3Evolution("graph", $.extend({}, graph_options, {
type: getSelector("selType"),
interpolate: getSelector("selInterpolate"),
});
}
- // Handling mouse events on overlapping elements
- $("#rrd-pie").mouseover(function () {
- $("#rrd-pie").css("z-index", "200");
- $("#rrd-table_toggle").css("z-index", "300");
- });
- $("#rrd-table_toggle").mouseover(function () {
- $("#rrd-pie").css("z-index", "0");
- $("#rrd-table_toggle").css("z-index", "0");
- });
-
var interface = {};
interface.draw = function(rspamd, graphs, neighbours, checked_server, type) {
graphs.graph = initGraph();
}
- if (type === undefined) {
- function getSelector(id) {
- var e = document.getElementById(id);
- return e.options[e.selectedIndex].value;
- }
- type = getSelector("selData");
- }
-
if (checked_server === "All SERVERS") {
rspamd.queryNeighbours("graph", function (req_data) {
var neighbours_data = req_data
});
};
+ interface.setup = function() {
+ // Handling mouse events on overlapping elements
+ $("#rrd-pie").mouseover(function () {
+ $("#rrd-pie").css("z-index", "200");
+ $("#rrd-table_toggle").css("z-index", "300");
+ });
+ $("#rrd-table_toggle").mouseover(function () {
+ $("#rrd-pie").css("z-index", "0");
+ $("#rrd-table_toggle").css("z-index", "0");
+ });
+
+ return getSelector("selData");
+ };
+
return interface;
});
// Public functions
interface.alertMessage = alertMessage;
interface.setup = function() {
- // Bind event handlers to selectors
$("#selData").change(function () {
selData = this.value;
tabClick("#throughput_nav");
tab_config.setup(interface);
tab_symbols.setup(interface, tables);
tab_history.setup(interface, tables);
- tab_upload.setup(interface)
+ tab_upload.setup(interface);
+ selData = tab_graph.setup();
};
interface.connect = function() {