volumio / Volumio2-UI

Volumio2 Web Based User Interface
http://volumio.org
166 stars 164 forks source link

Newly installed plugins don't show in installed tab #736

Closed ashthespy closed 4 years ago

ashthespy commented 4 years ago

After installing (and enabling) multiple plugins, navigating back to the "installed plugins" tab doesn't show the right plugin names - instead the first one is repopulated for all the newly installed plugins. However note that the icons represent the actual installed plugins.. image

volumio commented 4 years ago

This is a BE issue. If you could look into it that would be awesome..

ashthespy commented 4 years ago

This is a BE issue.

Are you sure? I patched the BE and it looks like the right data being pushed via the pushInstalledPlugins msg? From the UI, only the prettyName isn't being updated here, with the rest of the parameters being correct.

diff --git a/app/plugins/user_interface/websocket/index.js b/app/plugins/user_interface/websocket/index.js
index 233e761c..47c3618d 100644
--- a/app/plugins/user_interface/websocket/index.js
+++ b/app/plugins/user_interface/websocket/index.js
@@ -1027,7 +1027,9 @@ function InterfaceWebUI (context) {
             var installed = self.commandRouter.getInstalledPlugins();
             if (installed != undefined) {
               installed.then(function (installedPLugins) {
-                self.broadcastMessage('pushInstalledPlugins', installedPLugins);
+                  console.log('[dbg][installPlugin]: length', installedPLugins.length);
+                  console.log('[dbg][installPlugin]: pushInstalledPlugins', installedPLugins);
+                  selfConnWebSocket.emit('pushInstalledPlugins', installedPLugins);                
               });
             }
             var available = self.commandRouter.getAvailablePlugins();
@@ -1054,7 +1056,8 @@ function InterfaceWebUI (context) {
           var installed = self.commandRouter.getInstalledPlugins();
           if (installed != undefined) {
             installed.then(function (installedPLugins) {
-              self.logger.info(JSON.stringify(installedPLugins));
+              console.log('[dbg][updatePlugin]: length', installedPLugins.length);
+              console.log('[dbg][updatePlugin]: pushInstalledPlugins', installedPLugins);
               selfConnWebSocket.emit('pushInstalledPlugins', installedPLugins);
             });
           }
@@ -1079,7 +1082,8 @@ function InterfaceWebUI (context) {
           var installed = self.commandRouter.getInstalledPlugins();
           if (installed != undefined) {
             installed.then(function (installedPLugins) {
-              self.logger.info(JSON.stringify(installedPLugins));
+              console.log('[dbg][unInstallPlugin]: length', installedPLugins.length);
+              console.log('[dbg][unInstallPlugin]: pushInstalledPlugins', installedPLugins);
               selfConnWebSocket.emit('pushInstalledPlugins', installedPLugins);
             });
           }
@@ -1104,7 +1108,8 @@ function InterfaceWebUI (context) {
           var installed = self.commandRouter.getInstalledPlugins();
           if (installed != undefined) {
             installed.then(function (installedPLugins) {
-              self.logger.info(JSON.stringify(installedPLugins));
+              console.log('[dbg][enablePlugin]: length', installedPLugins.length);
+              console.log('[dbg][enablePlugin]: pushInstalledPlugins', installedPLugins);
               selfConnWebSocket.emit('pushInstalledPlugins', installedPLugins);
             });
           }
@@ -1152,11 +1157,13 @@ function InterfaceWebUI (context) {

     connWebSocket.on('getInstalledPlugins', function (pippo) {
       var selfConnWebSocket = this;
-
+      
       var returnedData = self.commandRouter.getInstalledPlugins();

       if (returnedData != undefined) {
         returnedData.then(function (installedPLugins) {
+          console.log('[dbg][getInstalledPlugins]: length', installedPLugins.length);
+          console.log('[dbg][getInstalledPlugins]: pushInstalledPlugins', installedPLugins);
           selfConnWebSocket.emit('pushInstalledPlugins', installedPLugins);
         });
       } else self.logger.error('Error on getting installed plugins');

volPlugins

From my limited knowledge, I would think that changing the one-time binding {{::plugin.prettyName}} to {{plugin.prettyName}} would fix the issue. https://github.com/volumio/Volumio2-UI/blob/e172452f45e535e3eae6b1a0acafce1ff3006451/src/app/plugin-manager/elements/installed-plugin.html#L6-L12

I can't test this as I never managed to get the dev environment for the FE up and running, and the dist3 branch is minified on my device..

volumio commented 4 years ago

I'll try now!

volumio commented 4 years ago

Brilliant! You were right, its now fixed: https://github.com/volumio/Volumio2-UI/commit/f74ff1e18486fe935f4c339cd8011f110e20b918

Thanks so much!