From 13eeabf2674d5d2a84bcca98925178cc6be885cc Mon Sep 17 00:00:00 2001 From: dkanada Date: Wed, 24 Feb 2021 00:06:53 +0900 Subject: [PATCH 1/5] minor improvements to plugin pages --- src/controllers/dashboard/plugins/add/index.js | 2 +- .../dashboard/plugins/installed/index.js | 14 ++++++-------- src/scripts/clientUtils.js | 2 +- src/strings/en-gb.json | 4 ++-- src/strings/en-us.json | 4 ++-- 5 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/controllers/dashboard/plugins/add/index.js b/src/controllers/dashboard/plugins/add/index.js index 89bd499f49..787b193861 100644 --- a/src/controllers/dashboard/plugins/add/index.js +++ b/src/controllers/dashboard/plugins/add/index.js @@ -33,7 +33,7 @@ function populateVersions(packageInfo, page, installedPlugin) { $('#pCurrentVersion', page).hide().html(''); } - const packageVersion = packageInfo.versions[0]; + const packageVersion = packageInfo.versions.sort().pop(); if (packageVersion) { selectmenu.val(packageVersion.version); } diff --git a/src/controllers/dashboard/plugins/installed/index.js b/src/controllers/dashboard/plugins/installed/index.js index 654ae4c29e..04deb2e85a 100644 --- a/src/controllers/dashboard/plugins/installed/index.js +++ b/src/controllers/dashboard/plugins/installed/index.js @@ -66,7 +66,7 @@ function getPluginCardHtml(plugin, pluginConfigurationPages) { if (configPageUrl) { html += ``; } else { - html += '
'; + html += '
'; } if (plugin.HasImage) { @@ -87,12 +87,10 @@ function getPluginCardHtml(plugin, pluginConfigurationPages) { html += '
'; } - html += "
"; - html += configPage && configPage.DisplayName ? configPage.DisplayName : plugin.Name; - html += `
${globalize.translate('LabelStatus')} ${plugin.Status}
`; - html += "
"; - html += plugin.Version; + html += '
' + html += `${plugin.Name}${plugin.Version}`; html += '
'; + html += `
${globalize.translate('LabelStatus')} ${plugin.Status}
`; html += '
'; html += '
'; html += ''; @@ -161,7 +159,7 @@ function showPluginMenu(page, elem) { menuItems.push({ name: globalize.translate('EnablePlugin'), id: 'enable', - icon: 'mode_enable' + icon: 'check_circle_outline' }); } @@ -169,7 +167,7 @@ function showPluginMenu(page, elem) { menuItems.push({ name: globalize.translate('DisablePlugin'), id: 'disable', - icon: 'mode_disable' + icon: 'do_not_disturb' }); } diff --git a/src/scripts/clientUtils.js b/src/scripts/clientUtils.js index 291202b2e0..a7941d88c6 100644 --- a/src/scripts/clientUtils.js +++ b/src/scripts/clientUtils.js @@ -65,7 +65,7 @@ export async function serverAddress() { })); }).then(configs => { const selection = configs.find(obj => !obj.config.StartupWizardCompleted) || configs[0]; - return Promise.resolve(selection.url); + return Promise.resolve(selection?.url); }).catch(error => { console.log(error); return Promise.resolve(); diff --git a/src/strings/en-gb.json b/src/strings/en-gb.json index a863660bc1..6118921df3 100644 --- a/src/strings/en-gb.json +++ b/src/strings/en-gb.json @@ -1457,8 +1457,8 @@ "LabelEnableIP4Help": "Enables IPv4 functionality.", "LabelEnableIP4": "Enable IPv4:", "HeaderNetworking": "IP Protocols", - "EnablePlugin": "Enable Plugin", - "DisablePlugin": "Disable Plugin", + "EnablePlugin": "Enable", + "DisablePlugin": "Disable", "YoutubeDenied": "Requested video is not allowed to be played in embedded players.", "YoutubeNotFound": "Video not found.", "YoutubePlaybackError": "Requested video cannot be played.", diff --git a/src/strings/en-us.json b/src/strings/en-us.json index 3941622491..b23b261c14 100644 --- a/src/strings/en-us.json +++ b/src/strings/en-us.json @@ -179,8 +179,8 @@ "DirectStreamHelp1": "The video stream is compatible with the device, but has an incompatible audio format (DTS, TRUEHD, etc) or number of audio channels. The video stream will be repackaged losslessly on the fly before being sent to the device. Only the audio stream will be transcoded.", "DirectStreamHelp2": "Power consumed by direct streaming usually depends on the audio profile. Only the video stream is lossless.", "DirectStreaming": "Direct streaming", - "EnablePlugin": "Enable Plugin", - "DisablePlugin": "Disable Plugin", + "EnablePlugin": "Enable", + "DisablePlugin": "Disable", "Disc": "Disc", "Disconnect": "Disconnect", "Display": "Display", From 4f4fff717f64c353f40afaab4ff778a0c70251bf Mon Sep 17 00:00:00 2001 From: dkanada Date: Wed, 24 Feb 2021 00:11:53 +0900 Subject: [PATCH 2/5] add semicolon to fix linting --- src/controllers/dashboard/plugins/installed/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/dashboard/plugins/installed/index.js b/src/controllers/dashboard/plugins/installed/index.js index 04deb2e85a..77229f3ac9 100644 --- a/src/controllers/dashboard/plugins/installed/index.js +++ b/src/controllers/dashboard/plugins/installed/index.js @@ -87,7 +87,7 @@ function getPluginCardHtml(plugin, pluginConfigurationPages) { html += ''; } - html += '
' + html += '
'; html += `${plugin.Name}${plugin.Version}`; html += '
'; html += `
${globalize.translate('LabelStatus')} ${plugin.Status}
`; From 3489d716b234e7034dc04678332fa2b66552992b Mon Sep 17 00:00:00 2001 From: dkanada Date: Thu, 25 Feb 2021 19:59:57 +0900 Subject: [PATCH 3/5] fix issue with version sort --- src/controllers/dashboard/plugins/add/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/controllers/dashboard/plugins/add/index.js b/src/controllers/dashboard/plugins/add/index.js index 787b193861..506e0a0c00 100644 --- a/src/controllers/dashboard/plugins/add/index.js +++ b/src/controllers/dashboard/plugins/add/index.js @@ -22,6 +22,10 @@ function populateHistory(packageInfo, page) { function populateVersions(packageInfo, page, installedPlugin) { let html = ''; + packageInfo.versions.sort((a, b) => { + return b.timestamp < a.timestamp ? 1 : -1; + }); + for (let i = 0; i < packageInfo.versions.length; i++) { const version = packageInfo.versions[i]; html += ''; @@ -33,7 +37,7 @@ function populateVersions(packageInfo, page, installedPlugin) { $('#pCurrentVersion', page).hide().html(''); } - const packageVersion = packageInfo.versions.sort().pop(); + const packageVersion = packageInfo.versions.pop(); if (packageVersion) { selectmenu.val(packageVersion.version); } From c86306e6a7f525fb4a379a475bfb83631fb5dc47 Mon Sep 17 00:00:00 2001 From: dkanada Date: Sat, 6 Mar 2021 13:41:23 +0900 Subject: [PATCH 4/5] invert version sorting for plugins Co-authored-by: Dmitry Lyzo <56478732+dmitrylyzo@users.noreply.github.com> --- src/controllers/dashboard/plugins/add/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/dashboard/plugins/add/index.js b/src/controllers/dashboard/plugins/add/index.js index 506e0a0c00..124a4d8b9e 100644 --- a/src/controllers/dashboard/plugins/add/index.js +++ b/src/controllers/dashboard/plugins/add/index.js @@ -23,7 +23,7 @@ function populateVersions(packageInfo, page, installedPlugin) { let html = ''; packageInfo.versions.sort((a, b) => { - return b.timestamp < a.timestamp ? 1 : -1; + return b.timestamp < a.timestamp ? -1 : 1; }); for (let i = 0; i < packageInfo.versions.length; i++) { From 90d48d840da48aea9e47277fbfd634a047452909 Mon Sep 17 00:00:00 2001 From: dkanada Date: Sat, 6 Mar 2021 13:41:43 +0900 Subject: [PATCH 5/5] select the version at the front of the list instead Co-authored-by: Dmitry Lyzo <56478732+dmitrylyzo@users.noreply.github.com> --- src/controllers/dashboard/plugins/add/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/dashboard/plugins/add/index.js b/src/controllers/dashboard/plugins/add/index.js index 124a4d8b9e..007a2d8410 100644 --- a/src/controllers/dashboard/plugins/add/index.js +++ b/src/controllers/dashboard/plugins/add/index.js @@ -37,7 +37,7 @@ function populateVersions(packageInfo, page, installedPlugin) { $('#pCurrentVersion', page).hide().html(''); } - const packageVersion = packageInfo.versions.pop(); + const packageVersion = packageInfo.versions[0]; if (packageVersion) { selectmenu.val(packageVersion.version); }