Skip to content

Commit

Permalink
Merge pull request #6723 from knarrff/channel_analysis__base-channel
Browse files Browse the repository at this point in the history
luci-mod-status: highlight primary 20 MHz channel
  • Loading branch information
systemcrash authored Dec 17, 2023
2 parents 8be149c + 008c1cf commit 8b65199
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 9 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,6 @@ return view.extend({
scanCache[res.bssid].graph = [];

channels.forEach(function(channel) {
var chan_offset = offset_tbl[channel],
points = [
(chan_offset-(step*channel_width))+','+height,
(chan_offset-(step*(channel_width-1)))+','+height_diff,
(chan_offset+(step*(channel_width-1)))+','+height_diff,
(chan_offset+(step*(channel_width)))+','+height
];

if (scanCache[res.bssid].graph[i] == null) {
var group = document.createElementNS('http://www.w3.org/2000/svg', 'g'),
line = document.createElementNS('http://www.w3.org/2000/svg', 'polyline'),
Expand All @@ -88,8 +80,33 @@ return view.extend({
chan_analysis.graph.firstElementChild.appendChild(group);
scanCache[res.bssid].graph[i] = { group : group, line : line, text : text };
}
if (channel_width > 2) {
if (!("main" in scanCache[res.bssid].graph[i])) {
var main = document.createElementNS('http://www.w3.org/2000/svg', 'polyline');
main.setAttribute('style', 'fill:url(#GradientVerticalCenteredBlack)');
scanCache[res.bssid].graph[i].group.appendChild(main)
chan_analysis.graph.firstElementChild.lastElementChild.appendChild(main);
scanCache[res.bssid].graph[i]["main"] = main;
}
var main_offset = offset_tbl[res.channel],
points = [
(main_offset-(step*(2 )))+','+height,
(main_offset-(step*(2-1)))+','+height_diff,
(main_offset+(step*(2-1)))+','+height_diff,
(main_offset+(step*(2 )))+','+height
];
scanCache[res.bssid].graph[i].main.setAttribute('points', points);
}

var chan_offset = offset_tbl[channel],
points = [
(chan_offset-(step*(channel_width )))+','+height,
(chan_offset-(step*(channel_width-1)))+','+height_diff,
(chan_offset+(step*(channel_width-1)))+','+height_diff,
(chan_offset+(step*(channel_width )))+','+height
];

scanCache[res.bssid].graph[i].text.setAttribute('x', chan_offset-step);
scanCache[res.bssid].graph[i].text.setAttribute('x', offset_tbl[res.channel]-step);
scanCache[res.bssid].graph[i].text.setAttribute('y', height_diff - 2);
scanCache[res.bssid].graph[i].line.setAttribute('points', points);
scanCache[res.bssid].graph[i].group.style.zIndex = res.signal*-1;
Expand Down

0 comments on commit 8b65199

Please sign in to comment.