Skip to content

Commit

Permalink
Fix schedules count. Fix missing closing bracket. Clear schedules.json
Browse files Browse the repository at this point in the history
  • Loading branch information
versx committed Apr 23, 2020
1 parent 8f35ed8 commit 111f701
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 16 deletions.
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,13 @@ app.get(['/', '/index'], async function(req, res) {
var username = req.session.username;
var devices = await Device.getAll();
var configs = await Config.getAll();
var schedules = ScheduleManager.getAll();
var metadata = await Migrator.getEntries();
var data = defaultData;
data.metadata = metadata;
data.devices = devices.length;
data.configs = configs.length;
data.schedules = Object.keys(schedules).length;
data.username = username;
res.render('index', data);
}
Expand Down
2 changes: 1 addition & 1 deletion src/migrator.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class Migrator {
.then(x => x)
.catch(err => {
console.error('[DBController] Migration failed:', err);
process.exit(
process.exit(-1);
});
console.log('[DBController] Migration successful');
if (newVersion === toVersion) {
Expand Down
15 changes: 0 additions & 15 deletions src/schedules.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,2 @@
{
"Leveling schedule": {
"name": "Leveling schedule",
"config": "Leveling",
"uuids": [
"iPhone10SE",
"iPhone11SE",
"iPhone12SE",
"iPhone13SE"
],
"start_time": "23:00:00",
"end_time": "02:00:00",
"timezone": -8,
"next_config": "Main",
"enabled": 1
}
}

0 comments on commit 111f701

Please sign in to comment.