Use proper Object methods

Signed-off-by: XhmikosR <xhmikosr@gmail.com>
This commit is contained in:
XhmikosR
2025-04-02 18:37:28 +03:00
parent 04760b55c8
commit ba3b76421b
5 changed files with 23 additions and 33 deletions

View File

@@ -265,8 +265,7 @@ function valueDetails(key, value) {
function generateRow(topic, key, value) {
// If the value is an object, we need to recurse
if (!("description" in value)) {
for (const subkey of Object.keys(value)) {
const subvalue = value[subkey];
for (const [subkey, subvalue] of Object.entries(value)) {
generateRow(topic, key + "." + subkey, subvalue);
}
@@ -304,9 +303,7 @@ function createDynamicConfigTabs() {
})
.done(data => {
// Create the tabs for the advanced dynamic config topics
for (const n of Object.keys(data.topics)) {
const topic = data.topics[n];
for (const topic of Object.values(data.topics)) {
$("#advanced-settings-tabs").append(`
<div id="advanced-content-${topic.name}" role="tabpanel" class="tab-pane fade">
<h3 class="page-header">${topic.description} (<code>${topic.name}</code>)</h3>
@@ -325,8 +322,7 @@ function createDynamicConfigTabs() {
}
// Dynamically fill the tabs with config topics
for (const topic of Object.keys(data.config)) {
const value = data.config[topic];
for (const [topic, value] of Object.entries(data.config)) {
generateRow(topic, topic, value);
}