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 db.seed.run ({ specific: 'fake.js' });
|
||||||
await job (db);
|
await job (db);
|
||||||
|
setInterval (() => {
|
||||||
|
job (db);
|
||||||
|
}, 3600e3);
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_db () {
|
function get_db () {
|
||||||
|
@ -40,6 +40,8 @@ async function batch_update (knex, ids, data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
module.exports = async (knex) => {
|
module.exports = async (knex) => {
|
||||||
|
console.log ('-- running database cleanup --');
|
||||||
|
|
||||||
const apps = await knex ('app')
|
const apps = await knex ('app')
|
||||||
.select ('id', 'name', 'reduction');
|
.select ('id', 'name', 'reduction');
|
||||||
|
|
||||||
|
@ -66,7 +66,16 @@ export default {
|
|||||||
if (typeof y.max_value === 'number')
|
if (typeof y.max_value === 'number')
|
||||||
range.suggestedMax = y.max_value;
|
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 ((res) => res.json ())
|
||||||
.then ((json) => json.map ((entry) => {
|
.then ((json) => json.map ((entry) => {
|
||||||
entry.data = JSON.parse (entry.data);
|
entry.data = JSON.parse (entry.data);
|
||||||
const time
|
const time = new Date (entry.timestamp);
|
||||||
= (/(?<y>[0-9]+-[0-9]+-[0-9]+)T(?<t>[0-9]+:[0-9]+:[0-9]+)/u)
|
time.setMinutes (time.getMinutes () - time.getTimezoneOffset ());
|
||||||
.exec (
|
entry.timestamp = time.toISOString ()
|
||||||
new Date (entry.timestamp)
|
.replace ('T', ' ')
|
||||||
.toISOString ()
|
.substr (0, 19);
|
||||||
);
|
|
||||||
entry.timestamp = `${time.groups.y} ${time.groups.t}`;
|
|
||||||
return entry;
|
return entry;
|
||||||
}));
|
}));
|
||||||
logs[source.name] = log;
|
logs[source.name] = log;
|
||||||
|
@ -2,16 +2,16 @@
|
|||||||
<div
|
<div
|
||||||
class="grid"
|
class="grid"
|
||||||
>
|
>
|
||||||
<ConfigEditor
|
|
||||||
v-model="config"
|
|
||||||
:template="template"
|
|
||||||
/>
|
|
||||||
<ViewComponent
|
<ViewComponent
|
||||||
v-for="(item,key) of saved_config.displays"
|
v-for="(item,key) of saved_config.displays"
|
||||||
:key="key"
|
:key="key"
|
||||||
:config="item"
|
:config="item"
|
||||||
:data="log(item.source)"
|
:data="log(item.source)"
|
||||||
/>
|
/>
|
||||||
|
<ConfigEditor
|
||||||
|
v-model="config"
|
||||||
|
:template="template"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user