From 856c7b116648a223680f6185757e201de9b61a95 Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Sun, 13 Dec 2020 22:12:41 +0000 Subject: [PATCH 01/11] Update index.js Added plugin status --- .../dashboard/plugins/installed/index.js | 47 ++++++++++++++++++- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/src/controllers/dashboard/plugins/installed/index.js b/src/controllers/dashboard/plugins/installed/index.js index 33f9b44ea..186aafd1b 100644 --- a/src/controllers/dashboard/plugins/installed/index.js +++ b/src/controllers/dashboard/plugins/installed/index.js @@ -23,6 +23,20 @@ function deletePlugin(page, uniqueid, name) { }); } +function enablePlugin(page, uniqueid, name) { + loading.show(); + ApiClient.enablePlugin(uniqueid).then(function () { + reloadList(page); + }); +} + +function disablePlugin(page, uniqueid, name) { + loading.show(); + ApiClient.disablePlugin(uniqueid).then(function () { + reloadList(page); + }); +} + function showNoConfigurationMessage() { Dashboard.alert({ message: globalize.translate('MessageNoPluginConfiguration') @@ -41,12 +55,18 @@ function getPluginCardHtml(plugin, pluginConfigurationPages) { })[0]; const configPageUrl = configPage ? Dashboard.getPluginUrl(configPage.Name) : null; let html = ''; - html += "
"; + html += "
"; html += '
'; html += ''; html += '
'; @@ -114,6 +134,7 @@ function showPluginMenu(page, elem) { const name = card.getAttribute('data-name'); const removable = card.getAttribute('data-removable'); const configHref = card.querySelector('.cardContent').getAttribute('href'); + const status = card.getAttribute('data-status'); const menuItems = []; if (configHref) { @@ -125,6 +146,22 @@ function showPluginMenu(page, elem) { } if (removable === 'true') { + if (status === 'Disabled') { + menuItems.push({ + name: globalize.translate('EnablePlugin'), + id: 'enable', + icon: 'enable' + }); + } + + if (status === 'Active') { + menuItems.push({ + name: globalize.translate('DisablePlugin'), + id: 'disable', + icon: 'disable' + }); + } + menuItems.push({ name: globalize.translate('ButtonUninstall'), id: 'delete', @@ -144,6 +181,12 @@ function showPluginMenu(page, elem) { case 'delete': deletePlugin(page, id, name); break; + case 'enable': + enablePlugin(page, id.name); + break; + case 'disable': + disablePlugin(page, id, name); + break; } } }); From a2987f4c19d86654557a8e0417458587793ea151 Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Sun, 13 Dec 2020 22:13:50 +0000 Subject: [PATCH 02/11] Update en-gb.json --- src/strings/en-gb.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/strings/en-gb.json b/src/strings/en-gb.json index 22fb21f45..af752f724 100644 --- a/src/strings/en-gb.json +++ b/src/strings/en-gb.json @@ -1455,5 +1455,7 @@ "LabelEnableIP6": "Enable IPv6:", "LabelEnableIP4Help": "Enables IPv4 functionality.", "LabelEnableIP4": "Enable IPv4:", - "HeaderNetworking": "IP Protocols" + "HeaderNetworking": "IP Protocols", + "EnablePlugin": "Enable Plugin", + "DisablePlugin": "Disable Plugin" } From e2ac6db7a1a416641908a19ed3bd12b193c2c626 Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Mon, 14 Dec 2020 22:54:21 +0000 Subject: [PATCH 03/11] Update index.js --- .../dashboard/plugins/installed/index.js | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/controllers/dashboard/plugins/installed/index.js b/src/controllers/dashboard/plugins/installed/index.js index 186aafd1b..d01a0e9fb 100644 --- a/src/controllers/dashboard/plugins/installed/index.js +++ b/src/controllers/dashboard/plugins/installed/index.js @@ -7,7 +7,7 @@ import '../../../../elements/emby-button/emby-button'; import Dashboard, { pageIdOn } from '../../../../scripts/clientUtils'; import confirm from '../../../../components/confirm/confirm'; -function deletePlugin(page, uniqueid, name) { +function deletePlugin(page, uniqueid, version, name) { const msg = globalize.translate('UninstallPluginConfirmation', name); confirm({ @@ -17,22 +17,22 @@ function deletePlugin(page, uniqueid, name) { confirmText: globalize.translate('HeaderUninstallPlugin') }).then(function () { loading.show(); - ApiClient.uninstallPlugin(uniqueid).then(function () { + ApiClient.uninstallPlugin(uniqueid, version).then(function () { reloadList(page); }); }); } -function enablePlugin(page, uniqueid, name) { +function enablePlugin(page, uniqueid, version) { loading.show(); - ApiClient.enablePlugin(uniqueid).then(function () { + ApiClient.enablePlugin(uniqueid, version).then(function () { reloadList(page); }); } -function disablePlugin(page, uniqueid, name) { +function disablePlugin(page, uniqueid, version) { loading.show(); - ApiClient.disablePlugin(uniqueid).then(function () { + ApiClient.disablePlugin(uniqueid, version).then(function () { reloadList(page); }); } @@ -55,14 +55,14 @@ function getPluginCardHtml(plugin, pluginConfigurationPages) { })[0]; const configPageUrl = configPage ? Dashboard.getPluginUrl(configPage.Name) : null; let html = ''; - html += "
"; + html += "
"; html += '
'; html += '
'; html += '
'; html += configPageUrl ? '' : '
'; - html += ''; + html += '">'; } else { html += ' material-icons folder">'; } @@ -135,6 +135,7 @@ function showPluginMenu(page, elem) { const removable = card.getAttribute('data-removable'); const configHref = card.querySelector('.cardContent').getAttribute('href'); const status = card.getAttribute('data-status'); + const version = card.getAttribute('data-version'); const menuItems = []; if (configHref) { @@ -150,7 +151,7 @@ function showPluginMenu(page, elem) { menuItems.push({ name: globalize.translate('EnablePlugin'), id: 'enable', - icon: 'enable' + icon: 'mode_enable' }); } @@ -158,7 +159,7 @@ function showPluginMenu(page, elem) { menuItems.push({ name: globalize.translate('DisablePlugin'), id: 'disable', - icon: 'disable' + icon: 'mode_disable' }); } @@ -179,13 +180,13 @@ function showPluginMenu(page, elem) { Dashboard.navigate(configHref); break; case 'delete': - deletePlugin(page, id, name); + deletePlugin(page, id, version, name); break; case 'enable': - enablePlugin(page, id.name); + enablePlugin(page, id, version); break; case 'disable': - disablePlugin(page, id, name); + disablePlugin(page, id, version); break; } } From 07b9cd53480ac95429f834987ffc2addd0634879 Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Tue, 15 Dec 2020 15:52:43 +0000 Subject: [PATCH 04/11] Update index.js --- src/controllers/dashboard/plugins/installed/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/controllers/dashboard/plugins/installed/index.js b/src/controllers/dashboard/plugins/installed/index.js index d01a0e9fb..00635b042 100644 --- a/src/controllers/dashboard/plugins/installed/index.js +++ b/src/controllers/dashboard/plugins/installed/index.js @@ -17,7 +17,7 @@ function deletePlugin(page, uniqueid, version, name) { confirmText: globalize.translate('HeaderUninstallPlugin') }).then(function () { loading.show(); - ApiClient.uninstallPlugin(uniqueid, version).then(function () { + ApiClient.uninstallPluginByVersion(uniqueid, version).then(function () { reloadList(page); }); }); @@ -60,7 +60,7 @@ function getPluginCardHtml(plugin, pluginConfigurationPages) { html += ''; } - html += "
" + html += "
"; html += configPage && configPage.DisplayName ? configPage.DisplayName : plugin.Name; - html += '
Status: ' + plugin.Status +'
'; + html += '
Status: ' + plugin.Status + '
'; html += "
"; html += plugin.Version; html += '
'; From 1c3f38663d9ce08afc2b017aba3e9de4d7a5c5f7 Mon Sep 17 00:00:00 2001 From: dkanada Date: Mon, 28 Dec 2020 13:49:54 +0900 Subject: [PATCH 06/11] fix json file --- src/strings/en-gb.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/strings/en-gb.json b/src/strings/en-gb.json index 70e310ec7..3bebc3f49 100644 --- a/src/strings/en-gb.json +++ b/src/strings/en-gb.json @@ -1458,7 +1458,7 @@ "LabelEnableIP4": "Enable IPv4:", "HeaderNetworking": "IP Protocols", "EnablePlugin": "Enable Plugin", - "DisablePlugin": "Disable Plugin" + "DisablePlugin": "Disable Plugin", "YoutubeDenied": "Requested video is not allowed to be played in embedded players.", "YoutubeNotFound": "Video not found.", "YoutubePlaybackError": "Requested video cannot be played.", From 908c7b94ad2dc244f28701096762309502d1d25c Mon Sep 17 00:00:00 2001 From: dkanada Date: Mon, 28 Dec 2020 13:51:57 +0900 Subject: [PATCH 07/11] use translations for status string --- 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 98dc2ad71..fedde5b4c 100644 --- a/src/controllers/dashboard/plugins/installed/index.js +++ b/src/controllers/dashboard/plugins/installed/index.js @@ -79,7 +79,7 @@ function getPluginCardHtml(plugin, pluginConfigurationPages) { html += "
"; html += configPage && configPage.DisplayName ? configPage.DisplayName : plugin.Name; - html += '
Status: ' + plugin.Status + '
'; + html += '
' + globalize.translate('LabelStatus') + ' ' + plugin.Status + '
'; html += "
"; html += plugin.Version; html += '
'; From e068668e82673faf5c7cd5ce1de8d70e57ffebd4 Mon Sep 17 00:00:00 2001 From: dkanada Date: Mon, 28 Dec 2020 13:54:33 +0900 Subject: [PATCH 08/11] add a missing space --- 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 fedde5b4c..cb2bd3c06 100644 --- a/src/controllers/dashboard/plugins/installed/index.js +++ b/src/controllers/dashboard/plugins/installed/index.js @@ -55,7 +55,7 @@ function getPluginCardHtml(plugin, pluginConfigurationPages) { })[0]; const configPageUrl = configPage ? Dashboard.getPluginUrl(configPage.Name) : null; let html = ''; - html += "
"; + html += "
"; html += '
'; html += '
'; html += '
'; From 2c00c640055dd36eed392699684ff0ace1f17c61 Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Wed, 30 Dec 2020 15:29:51 +0000 Subject: [PATCH 09/11] Update src/controllers/dashboard/plugins/installed/index.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Fernando Fernández --- 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 cb2bd3c06..9d9b7e86e 100644 --- a/src/controllers/dashboard/plugins/installed/index.js +++ b/src/controllers/dashboard/plugins/installed/index.js @@ -55,7 +55,7 @@ function getPluginCardHtml(plugin, pluginConfigurationPages) { })[0]; const configPageUrl = configPage ? Dashboard.getPluginUrl(configPage.Name) : null; let html = ''; - html += "
"; + html += `
`; html += '
'; html += '
'; html += '
'; From d0552ce7ae6d6fc3c6898f1561ad53ab4a5912ef Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Wed, 30 Dec 2020 15:33:33 +0000 Subject: [PATCH 10/11] Update index.js --- src/controllers/dashboard/plugins/installed/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/controllers/dashboard/plugins/installed/index.js b/src/controllers/dashboard/plugins/installed/index.js index 9d9b7e86e..625a55c15 100644 --- a/src/controllers/dashboard/plugins/installed/index.js +++ b/src/controllers/dashboard/plugins/installed/index.js @@ -59,10 +59,10 @@ function getPluginCardHtml(plugin, pluginConfigurationPages) { html += '
'; html += '
'; html += '
'; - html += configPageUrl ? '' : '
'; + html += configPageUrl ? `` : '
'; html += ''; + html += `">`; } else { html += ' material-icons folder">'; } @@ -79,7 +79,7 @@ function getPluginCardHtml(plugin, pluginConfigurationPages) { html += "
"; html += configPage && configPage.DisplayName ? configPage.DisplayName : plugin.Name; - html += '
' + globalize.translate('LabelStatus') + ' ' + plugin.Status + '
'; + html += '
' + globalize.translate('LabelStatus') + ` ${plugin.Status}
`; html += "
"; html += plugin.Version; html += '
'; From 177d88dd84408ee47f8967434ee78d97b0bed1df Mon Sep 17 00:00:00 2001 From: BaronGreenback Date: Wed, 30 Dec 2020 17:09:24 +0000 Subject: [PATCH 11/11] Update src/controllers/dashboard/plugins/installed/index.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Fernando Fernández --- 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 625a55c15..76249abf6 100644 --- a/src/controllers/dashboard/plugins/installed/index.js +++ b/src/controllers/dashboard/plugins/installed/index.js @@ -79,7 +79,7 @@ function getPluginCardHtml(plugin, pluginConfigurationPages) { html += "
"; html += configPage && configPage.DisplayName ? configPage.DisplayName : plugin.Name; - html += '
' + globalize.translate('LabelStatus') + ` ${plugin.Status}
`; + html += `
${globalize.translate('LabelStatus')} ${plugin.Status}
`; html += "
"; html += plugin.Version; html += '
';