Move towards selectable time ranges in the dashboard

- Add the installation date to frontend and backend
- Add an error page to help with the upgrade from the previous version
- Avoid querying history if installation date is not set
- Make the fillMissing function work for periods of different lenght than than 8 days
This commit is contained in:
MassiveBox 2022-12-04 12:50:11 +01:00
parent 66e2a2de1a
commit 6dc8fa3750
8 changed files with 61 additions and 21 deletions

View file

@ -17,6 +17,7 @@
<h3>HomeAssistant</h3>
<label>HomeAssistant's base URL <input type="text" name="base_url" value="{{.Config.HomeAssistant.BaseURL}}" required></label>
<label>HomeAssistant's API Key <input type="text" name="api_key" value="{{.Config.HomeAssistant.ApiKey}}" required></label>
<lablel>Installation date<input type="date" name="installation_date" value="{{HTMLDateFormat .Config.HomeAssistant.InstallationDate}}" required></lablel>
<h3>Sensors</h3>
<label>Polled Smart Energy Summation entity ID <input type="text" name="polled_smart_energy_summation" value="{{.Config.Sensors.PolledSmartEnergySummation}}" required></label>

View file

@ -0,0 +1,7 @@
<h1>Configuration error</h1>
<p>We've detected an issue with your configuration that prevents EcoDash from working. Please check it below, and <a href="https://gitea.massivebox.net/massivebox/ecodash/issues" target="_blank" rel="noopener noreferrer">open an issue</a> if this problem persists.</p>
<pre><code>{{.Error}}</code></pre>
<a href="/admin" class="button">Admin panel</a>