Skip to content

Commit

Permalink
Various bug fixes for v5.1
Browse files Browse the repository at this point in the history
- Fix an error that occurs when traffic graph is shrinked down to
  less than 1px high.
- Fix bing IP address option incorrect max length limit.
- Fix jQuery selector typo for check_port plugin.
  • Loading branch information
jevenski committed Dec 15, 2024
1 parent 0ddb6af commit 4964e39
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 24 deletions.
11 changes: 10 additions & 1 deletion css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,16 @@ div#gcont div.row.Header {font-size: 14px; font-weight: bold; background: #FCFCF
div#gcont div.row:not(.Header) {padding: 0 0.3rem; word-break: break-all;}
div#gcont div.row > div {padding-top: 0.25rem; padding-bottom: 0.25rem;}

div.graph_tab {background-color: #FFFFFF; overflow: hidden; display: block; -moz-user-focus: normal; -moz-user-input: enabled; line-height: 11px; color: #545454;}
div.graph_tab {
height: 100%;
background-color: #FFFFFF;
overflow: hidden;
display: block;
-moz-user-focus: normal;
-moz-user-input: enabled;
line-height: 11px;
color: #545454;
}
.graph_tab_grid,.graph_tab_legend {display: none;}
.graph_tab_grid { background-color: transparent; border: 2px solid #545454; }
.graph_tab_legend { background-color: #F0F0F0; border: 0px none transparent; }
Expand Down
2 changes: 1 addition & 1 deletion js/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ function makeContent() {
$("<label>").attr({id:"lbl_ip", for:"ip"}).text(theUILang.Ip_report_track + ": "),
),
$("<div>").addClass("col-md-6").append(
$("<input>").attr({type:"text", id:"ip"}).prop("maxlength", 6),
$("<input>").attr({type:"text", id:"ip"}),
),
),
),
Expand Down
4 changes: 2 additions & 2 deletions plugins/check_port/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ plugin.loadMainCSS();

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

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

Expand Down
39 changes: 19 additions & 20 deletions plugins/trafic/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,15 @@ class rTraficGraph extends rGraph {
this.draw();
}

resize(newWidth, newHeight) {
if (newWidth) newWidth -= 8;
if (this.plot && newHeight)
newHeight -=
iv($$(this.plot.getPlaceholder().attr("id") + "_ctrl").style.height) +
$("#tabbar").outerHeight();
super.resize(newWidth, newHeight);
}
resize(newWidth, newHeight) {
if (!newWidth) {
newWidth = $("#traf").width();
}
if (!newHeight) {
newHeight = $("#traf").height() - $("#traf_graph_ctrl").height();
}
super.resize(newWidth, newHeight);
}
}

if(plugin.canChangeTabs())
Expand All @@ -147,26 +148,24 @@ if(plugin.canChangeTabs())

plugin.resizeLeft = theWebUI.resizeLeft;
theWebUI.resizeLeft = function(w) {
plugin.resizeLeft.call(this, w);
if (plugin.enabled) {
if (plugin.allStuffLoaded) {
const tdcont = $("#tdcont");
this.trafGraph.resize(tdcont.width(), tdcont.height());
this.trafGraph.resize();
} else
setTimeout('theWebUI.resize()', 1000);
}
plugin.resizeLeft.call(this, w);
}

plugin.resizeTop = theWebUI.resizeTop;
theWebUI.resizeTop = function(w, h) {
plugin.resizeTop.call(this, w, h);
if (plugin.enabled) {
if (plugin.allStuffLoaded) {
const tdcont = $("#tdcont");
this.trafGraph.resize(tdcont.width(), tdcont.height());
this.trafGraph.resize();
} else
setTimeout('theWebUI.resize()', 1000);
}
plugin.resizeTop.call(this, w, h);
}

theWebUI.showTrafic = function(d)
Expand Down Expand Up @@ -323,17 +322,17 @@ plugin.onLangLoaded = function()
{
if(id=="traf")
{
if(theWebUI.activeView!="traf" || !theWebUI.trafGraph.xticks.length)
if(theWebUI.activeView!="traf" || !theWebUI.trafGraph.xticks.length) {
theWebUI.reqForTraficGraph();
else
theWebUI.trafGraph.resize();
}
theWebUI.trafGraph.resize();
}
else
plugin.onShow.call(this,id);
};
this.attachPageToTabs(
$('<div>').attr("id","traf").append(
$("<div>").attr({id:"traf_graph_ctrl"}).addClass("graph_tab d-flex flex-row").append(
$('<div>').attr("id","traf").addClass("graph_tab").append(
$("<div>").attr({id:"traf_graph_ctrl"}).addClass("d-flex flex-row").append(
plugin.disableClearButton ? $() : $("<button>").attr({type:"button", onclick: "theWebUI.clearStats();return(false);"}).text(theUILang.ClearButton),
$("<select>").attr({
name:"tracker_mode",
Expand All @@ -352,7 +351,7 @@ plugin.onLangLoaded = function()
$("<option>").val("year").text(theUILang.perYear),
),
),
$("<div>").attr({id:"traf_graph"}).addClass("graph_tab"),
$("<div>").attr({id:"traf_graph"}),
)[0],
theUILang.traf,
"lcont",
Expand Down

0 comments on commit 4964e39

Please sign in to comment.