volumio/Volumio2-UI

Newly installed plugins don't show in installed tab

ashthespy opened this issue · 4 comments

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

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

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.

<div class="col-xs-8 col-sm-8 col-md-8">
<i ng-if="plugin.icon" class="fa {{plugin.icon}} fa-lg"></i>
<i ng-if="!plugin.icon" class="fa fa-cube fa-lg"></i>
{{::plugin.prettyName}}
<small ng-if="plugin.version" class="text-muted"> {{plugin.version}}</small>
</div>

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..

I'll try now!

Brilliant! You were right, its now fixed: f74ff1e

Thanks so much!