cloudron 4.15.0 → 4.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/actions.js +17 -11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudron",
3
- "version": "4.15.0",
3
+ "version": "4.15.1",
4
4
  "license": "MIT",
5
5
  "description": "Cloudron Commandline Tool",
6
6
  "main": "main.js",
package/src/actions.js CHANGED
@@ -449,23 +449,29 @@ async function list(options) {
449
449
  // after quiet
450
450
  if (apps.length === 0) return console.log('No apps installed.');
451
451
 
452
- var t = new Table();
452
+ const t = new Table();
453
453
 
454
- apps.forEach(function (app) {
455
- t.cell('Id', app.id);
456
- t.cell('Location', app.fqdn);
457
- t.cell('Manifest Id', (app.manifest.id || 'customapp') + '@' + app.manifest.version);
454
+ for (const app of apps) {
455
+ const response2 = await createRequest('GET', `/api/v1/apps/${app.id}`, options);
456
+ if (response2.statusCode !== 200) return exit(`Failed to list app: ${requestError(response2)}`);
457
+ response2.body.location = response2.body.location || response2.body.subdomain; // LEGACY support
458
+
459
+ const detailedApp = response2.body;
460
+
461
+ t.cell('Id', detailedApp.id);
462
+ t.cell('Location', detailedApp.fqdn);
463
+ t.cell('Manifest Id', (detailedApp.manifest.id || 'customapp') + '@' + detailedApp.manifest.version);
458
464
  var prettyState;
459
- if (app.installationState === 'installed') {
460
- prettyState = (app.debugMode ? 'debug' : app.runState);
461
- } else if (app.installationState === 'error') {
462
- prettyState = `error (${app.error.installationState})`;
465
+ if (detailedApp.installationState === 'installed') {
466
+ prettyState = (detailedApp.debugMode ? 'debug' : detailedApp.runState);
467
+ } else if (detailedApp.installationState === 'error') {
468
+ prettyState = `error (${detailedApp.error.installationState})`;
463
469
  } else {
464
- prettyState = app.installationState;
470
+ prettyState = detailedApp.installationState;
465
471
  }
466
472
  t.cell('State', prettyState);
467
473
  t.newRow();
468
- });
474
+ }
469
475
 
470
476
  console.log();
471
477
  console.log(t.toString());