Compare commits
4 Commits
f57444a3d1
...
ca305dff73
Author | SHA1 | Date | |
---|---|---|---|
ca305dff73 | |||
9d91740f6e | |||
1a75f8c242 | |||
ca37e38800 |
@ -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 () {
|
||||
|
@ -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');
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
};
|
||||
}
|
||||
)
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user