2016-12-23 10:16:12 +00:00
|
|
|
var express = require('express');
|
2018-01-29 07:29:19 +00:00
|
|
|
var Promise = require('bluebird');
|
2016-12-23 10:16:12 +00:00
|
|
|
var router = express.Router();
|
2018-01-29 07:29:19 +00:00
|
|
|
var models_eco_v1 = require('../model/sjy_eco_v1.js');
|
|
|
|
|
|
|
|
|
2016-12-23 10:16:12 +00:00
|
|
|
|
|
|
|
router.get('/', function (req, res, next) {
|
2018-01-29 07:29:19 +00:00
|
|
|
Promise.all([
|
|
|
|
models_eco_v1.getTop10Metadata(),
|
|
|
|
models_eco_v1.getLast10Metadata()
|
|
|
|
]).then(function(results) {
|
|
|
|
res.render('data', {
|
|
|
|
metadatas: results[0],
|
|
|
|
latestMetadatas: results[1],
|
2018-01-30 07:01:13 +00:00
|
|
|
page_title: '数据管理'
|
2018-01-29 07:29:19 +00:00
|
|
|
});
|
|
|
|
}).catch(function(err) {
|
|
|
|
console.error(err);
|
|
|
|
});
|
2016-12-23 10:16:12 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = router;
|