dshoreman / servidor

A modern web application for managing servers
GNU Lesser General Public License v2.1
9 stars 11 forks source link

Project logs don't always load #498

Closed dshoreman closed 3 years ago

dshoreman commented 3 years ago

Steps to Reproduce:

  1. Open the projects list in a new tab
  2. Click on any project that will have logs

Expected Behaviour

The first log's content should be loaded automatically.

Actual Behaviour

Log content does not autoload: image

To load the first log, it must be triggered manually by clicking its tab.

Notes

Autoload can be triggered by refreshing the page, or opening the project in a new tab so that it starts with a clean slate.

This happens because the logs are initialised only when projects/all is empty (i.e. when loading the /projects page): https://github.com/dshoreman/servidor/blob/550fed12e94e2489fd8c0e2593b30cd70192d1d0/resources/js/pages/Projects/ProjectViewer.vue#L201-L207

If it doesn't break Vue it can probably be fixed by awaiting the projects/load action, and moving this.initLog() below the if statement.