Compare commits

..

4 Commits

Author SHA1 Message Date
ca305dff73 move editor to bottom
All checks were successful
continuous-integration/drone/push Build is passing
2020-08-28 17:42:21 +02:00
9d91740f6e display timestamps in local timezone 2020-08-28 17:40:20 +02:00
1a75f8c242 y axis labelling 2020-08-28 17:40:00 +02:00
ca37e38800 schedule database cleanup 2020-08-28 17:39:47 +02:00
5 changed files with 24 additions and 12 deletions

View File

@ -38,6 +38,9 @@ async function init (use_fake_seed) {
// await db.seed.run ({ specific: 'fake.js' });
await job (db);
setInterval (() => {
job (db);
}, 3600e3);
}
function get_db () {

View File

@ -40,6 +40,8 @@ async function batch_update (knex, ids, data) {
}
module.exports = async (knex) => {
console.log ('-- running database cleanup --');
const apps = await knex ('app')
.select ('id', 'name', 'reduction');

View File

@ -66,7 +66,16 @@ export default {
if (typeof y.max_value === 'number')
range.suggestedMax = y.max_value;
return { id: index, ticks: range };
return {
id: index,
ticks: range,
scaleLabel: {
labelString: y.label,
display: true,
lineHeight: 1,
padding: 0.1
}
};
}
)
}

View File

@ -41,13 +41,11 @@ export default new Vuex.Store ({
.then ((res) => res.json ())
.then ((json) => json.map ((entry) => {
entry.data = JSON.parse (entry.data);
const time
= (/(?<y>[0-9]+-[0-9]+-[0-9]+)T(?<t>[0-9]+:[0-9]+:[0-9]+)/u)
.exec (
new Date (entry.timestamp)
.toISOString ()
);
entry.timestamp = `${time.groups.y} ${time.groups.t}`;
const time = new Date (entry.timestamp);
time.setMinutes (time.getMinutes () - time.getTimezoneOffset ());
entry.timestamp = time.toISOString ()
.replace ('T', ' ')
.substr (0, 19);
return entry;
}));
logs[source.name] = log;

View File

@ -2,16 +2,16 @@
<div
class="grid"
>
<ConfigEditor
v-model="config"
:template="template"
/>
<ViewComponent
v-for="(item,key) of saved_config.displays"
:key="key"
:config="item"
:data="log(item.source)"
/>
<ConfigEditor
v-model="config"
:template="template"
/>
</div>
</template>