Skip to content

Commit dd281af

Browse files
authored
Various bug fixes for v5.1 (#2827)
- Fix an error that occurs when traffic graph is shrunk down to less than 1px high. - Fix bind IP address option incorrect max length limit. - Fix jQuery selector typo for check_port plugin.
1 parent 0ddb6af commit dd281af

4 files changed

Lines changed: 32 additions & 24 deletions

File tree

css/style.css

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,16 @@ div#gcont div.row.Header {font-size: 14px; font-weight: bold; background: #FCFCF
499499
div#gcont div.row:not(.Header) {padding: 0 0.3rem; word-break: break-all;}
500500
div#gcont div.row > div {padding-top: 0.25rem; padding-bottom: 0.25rem;}
501501

502-
div.graph_tab {background-color: #FFFFFF; overflow: hidden; display: block; -moz-user-focus: normal; -moz-user-input: enabled; line-height: 11px; color: #545454;}
502+
div.graph_tab {
503+
height: 100%;
504+
background-color: #FFFFFF;
505+
overflow: hidden;
506+
display: block;
507+
-moz-user-focus: normal;
508+
-moz-user-input: enabled;
509+
line-height: 11px;
510+
color: #545454;
511+
}
503512
.graph_tab_grid,.graph_tab_legend {display: none;}
504513
.graph_tab_grid { background-color: transparent; border: 2px solid #545454; }
505514
.graph_tab_legend { background-color: #F0F0F0; border: 0px none transparent; }

js/content.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ function makeContent() {
616616
$("<label>").attr({id:"lbl_ip", for:"ip"}).text(theUILang.Ip_report_track + ": "),
617617
),
618618
$("<div>").addClass("col-md-6").append(
619-
$("<input>").attr({type:"text", id:"ip"}).prop("maxlength", 6),
619+
$("<input>").attr({type:"text", id:"ip"}),
620620
),
621621
),
622622
),

plugins/check_port/init.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ plugin.loadMainCSS();
33

44
plugin.init = function()
55
{
6-
$("port-pane .icon").addClass("pstatus0");
6+
$("#port-pane .icon").removeClass().addClass("icon pstatus0");
77
theWebUI.request("?action=initportcheck", [plugin.getPortStatus, plugin]);
88
}
99

1010
plugin.update = function()
1111
{
12-
$("port-pane .icon").addClass("pstatus0");
12+
$("#port-pane .icon").removeClass().addClass("icon pstatus0");
1313
theWebUI.request("?action=updateportcheck", [plugin.getPortStatus, plugin]);
1414
}
1515

plugins/trafic/init.js

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,15 @@ class rTraficGraph extends rGraph {
115115
this.draw();
116116
}
117117

118-
resize(newWidth, newHeight) {
119-
if (newWidth) newWidth -= 8;
120-
if (this.plot && newHeight)
121-
newHeight -=
122-
iv($$(this.plot.getPlaceholder().attr("id") + "_ctrl").style.height) +
123-
$("#tabbar").outerHeight();
124-
super.resize(newWidth, newHeight);
125-
}
118+
resize(newWidth, newHeight) {
119+
if (!newWidth) {
120+
newWidth = $("#traf").width();
121+
}
122+
if (!newHeight) {
123+
newHeight = $("#traf").height() - $("#traf_graph_ctrl").height();
124+
}
125+
super.resize(newWidth, newHeight);
126+
}
126127
}
127128

128129
if(plugin.canChangeTabs())
@@ -147,26 +148,24 @@ if(plugin.canChangeTabs())
147148

148149
plugin.resizeLeft = theWebUI.resizeLeft;
149150
theWebUI.resizeLeft = function(w) {
151+
plugin.resizeLeft.call(this, w);
150152
if (plugin.enabled) {
151153
if (plugin.allStuffLoaded) {
152-
const tdcont = $("#tdcont");
153-
this.trafGraph.resize(tdcont.width(), tdcont.height());
154+
this.trafGraph.resize();
154155
} else
155156
setTimeout('theWebUI.resize()', 1000);
156157
}
157-
plugin.resizeLeft.call(this, w);
158158
}
159159

160160
plugin.resizeTop = theWebUI.resizeTop;
161161
theWebUI.resizeTop = function(w, h) {
162+
plugin.resizeTop.call(this, w, h);
162163
if (plugin.enabled) {
163164
if (plugin.allStuffLoaded) {
164-
const tdcont = $("#tdcont");
165-
this.trafGraph.resize(tdcont.width(), tdcont.height());
165+
this.trafGraph.resize();
166166
} else
167167
setTimeout('theWebUI.resize()', 1000);
168168
}
169-
plugin.resizeTop.call(this, w, h);
170169
}
171170

172171
theWebUI.showTrafic = function(d)
@@ -323,17 +322,17 @@ plugin.onLangLoaded = function()
323322
{
324323
if(id=="traf")
325324
{
326-
if(theWebUI.activeView!="traf" || !theWebUI.trafGraph.xticks.length)
325+
if(theWebUI.activeView!="traf" || !theWebUI.trafGraph.xticks.length) {
327326
theWebUI.reqForTraficGraph();
328-
else
329-
theWebUI.trafGraph.resize();
327+
}
328+
theWebUI.trafGraph.resize();
330329
}
331330
else
332331
plugin.onShow.call(this,id);
333332
};
334333
this.attachPageToTabs(
335-
$('<div>').attr("id","traf").append(
336-
$("<div>").attr({id:"traf_graph_ctrl"}).addClass("graph_tab d-flex flex-row").append(
334+
$('<div>').attr("id","traf").addClass("graph_tab").append(
335+
$("<div>").attr({id:"traf_graph_ctrl"}).addClass("d-flex flex-row").append(
337336
plugin.disableClearButton ? $() : $("<button>").attr({type:"button", onclick: "theWebUI.clearStats();return(false);"}).text(theUILang.ClearButton),
338337
$("<select>").attr({
339338
name:"tracker_mode",
@@ -352,7 +351,7 @@ plugin.onLangLoaded = function()
352351
$("<option>").val("year").text(theUILang.perYear),
353352
),
354353
),
355-
$("<div>").attr({id:"traf_graph"}).addClass("graph_tab"),
354+
$("<div>").attr({id:"traf_graph"}),
356355
)[0],
357356
theUILang.traf,
358357
"lcont",

0 commit comments

Comments
 (0)