RDKB-64534 [OneStack][XB10] MTA Line details needs to be fixed as per product in UI for residential gateway#119
RDKB-64534 [OneStack][XB10] MTA Line details needs to be fixed as per product in UI for residential gateway#119pavankumar464 wants to merge 10 commits intodevelopfrom
Conversation
… product in UI for residential gateway
…r residential gateway
There was a problem hiding this comment.
Pull request overview
This PR updates the XB3 web UI templates to render MTA/voice line details based on the device-reported number of line entries, instead of being hard-coded for only 1–2 lines (targeting residential gateway product variants like XB10).
Changes:
- Generate the “Line Number” dropdown options dynamically in
voice_quality_metrics.jst. - Render CALLP/QoS per-line table rows dynamically in
qos.jst. - Render MTA Line Status per-line rows dynamically in
mta_Line_Status.jst.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
source/Styles/xb3/jst/voice_quality_metrics.jst |
Dynamically populates the line-number selector based on LineTableNumberOfEntries. |
source/Styles/xb3/jst/qos.jst |
Replaces hard-coded line 1/2 rows with a loop over all line entries. |
source/Styles/xb3/jst/mta_Line_Status.jst |
Replaces hard-coded line 1/2 status blocks with a loop over all line entries. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… product in UI for residential gateway
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
compares $_GET['line'] (string) against getStr("...LineTableNumberOfEntries")
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…s and numeric line validation Agent-Logs-Url: https://github.com/rdkcentral/webui/sessions/a1f497b4-bc28-469d-acde-49047bf774e4 Co-authored-by: pavankumar464 <57708013+pavankumar464@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| var $status = getStr("Device.X_CISCO_COM_MTA.LineTable." + $i + ".Status"); | ||
| var $rowClass = ($i % 2 == 0) ? "form-row odd" : "form-row"; | ||
| echo('<div class="' + $rowClass + '">'); | ||
| echo('<span class="readonlyLabel" id="mtalinstatmess' + $i + '">Line ' + $i + ' Status:</span>'); |
| $("#mtalinmess1").text($.i18n("MTA Line 1 Diagnostics")); | ||
| $("[id^='mtalinmess2']").text($.i18n("Hazardous Potential:")); | ||
| $("#line1hp,#line1hp,#line1femf,#line1rf,#line1roh,#line1re,#line2hp,#line2femf,#line2rf,#line2roh,#line2re").text($.i18n("Not Started")); | ||
| $("[id^='line'][id$='hp'],[id^='line'][id$='femf'],[id^='line'][id$='rf'],[id^='line'][id$='roh'],[id^='line'][id$='re']").text($.i18n("Not Started")); |
| for($key in $_GET) { | ||
| if ($key.startsWith("get_status")) { | ||
| $line = $key.slice("get_status".length); | ||
| $action = "get_status"; | ||
| } else if ($key.startsWith("start_diagnostics")) { |
| if ($line !== null && $action !== null) { | ||
|
|
||
| /* ===== GET STATUS ===== */ | ||
| if ($action == "get_status") { | ||
|
|
||
| $linehook = getStr("Device.X_CISCO_COM_MTA.LineTable."+$line+".Status"); | ||
| sleep(2); | ||
|
|
||
| $arConfig = { | ||
| ["line" + $line + "hook"]: $linehook | ||
| }/*p2j-array*/; | ||
| } | ||
|
|
||
| /* ===== START DIAGNOSTICS ===== */ | ||
| else if ($action == "start_diagnostics") { | ||
|
|
||
| setStr( | ||
| "Device.X_CISCO_COM_MTA.LineTable."+$line+".TriggerDiagnostics", | ||
| "true", | ||
| true | ||
| ); |
| $linehook = getStr("Device.X_CISCO_COM_MTA.LineTable."+$line+".Status"); | ||
| sleep(2); | ||
|
|
||
| $arConfig = { | ||
| ["line" + $line + "hook"]: $linehook | ||
| }/*p2j-array*/; | ||
| } |
There was a problem hiding this comment.
@copilot apply changes based on this feedback
There was a problem hiding this comment.
Already applied in commit d2047b6. Both the get_status response (line 65) and start_diagnostics response (lines 81–85) now use ES5 bracket assignment ($arConfig["line"+$line+"hook"] = $linehook) instead of ES6 computed property name object literals.
| $("[id^='start_diagnostics']").on("click", function () { | ||
| const line = this.id.replace("start_diagnostics", ""); // 1–8 | ||
|
|
||
| if (line < 1 || line > 8) return; |
| $arConfig = { | ||
| ["line"+$line+"hp"] : $hp, | ||
| ["line"+$line+"femf"] : $femf, | ||
| ["line"+$line+"rf"] : $rf, | ||
| ["line"+$line+"roh"] : $roh, | ||
| ["line"+$line+"re"] : $re | ||
| }; /*p2j-array*/ |
There was a problem hiding this comment.
@copilot apply changes based on this feedback
There was a problem hiding this comment.
Applied in commit d2047b6. All ES6 computed property names replaced with ES5 bracket assignment ($arConfig["line"+$line+"hp"] = ...), and the for($key in $_GET) + startsWith() pattern replaced with an explicit isset() loop over line indices that is fully ES5-compatible. Additional related fixes in the same commit: hard-coded > 8 guard in mta_Line_Diagnostics.jst replaced with server-rendered voiceLines, duplicate mtalinstatmess1 ID in mta_Line_Status.jst fixed with +1 offset, .text() changed to .val() for textareas in locale/global.js, and integer-only regex validation added to voice_quality_metrics.jst.
…d int validation Agent-Logs-Url: https://github.com/rdkcentral/webui/sessions/e3dfd3e0-6ed8-4baf-bbea-fda32f9bcbb3 Co-authored-by: pavankumar464 <57708013+pavankumar464@users.noreply.github.com>
No description provided.