2017-10-22 09:10:33 +08:00
|
|
|
"use strict";
|
|
|
|
|
2017-10-15 11:31:44 +08:00
|
|
|
const express = require('express');
|
|
|
|
const router = express.Router();
|
2017-10-16 07:47:05 +08:00
|
|
|
const auth = require('../services/auth');
|
2017-12-17 09:48:34 +08:00
|
|
|
const source_id = require('../services/source_id');
|
2017-12-20 12:22:21 +08:00
|
|
|
const sql = require('../services/sql');
|
2017-10-15 11:31:44 +08:00
|
|
|
|
2017-10-23 08:22:09 +08:00
|
|
|
router.get('', auth.checkAuth, async (req, res, next) => {
|
2017-12-17 09:48:34 +08:00
|
|
|
res.render('index', {
|
2017-12-20 12:22:21 +08:00
|
|
|
sourceId: await source_id.generateSourceId(),
|
2017-12-24 00:02:38 +08:00
|
|
|
maxSyncIdAtLoad: await sql.getFirstValue("SELECT MAX(id) FROM sync")
|
2017-12-17 09:48:34 +08:00
|
|
|
});
|
2017-10-15 11:31:44 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = router;
|