client+server: implement code autoformatting using prettier and black

This commit is contained in:
Shyam Sunder
2020-06-05 18:03:37 -04:00
parent c06aaa63af
commit 57193b5715
312 changed files with 15512 additions and 12825 deletions

View File

@ -1,26 +1,26 @@
'use strict';
"use strict";
const api = require('../api.js');
const config = require('../config.js');
const Info = require('../models/info.js');
const topNavigation = require('../models/top_navigation.js');
const HomeView = require('../views/home_view.js');
const api = require("../api.js");
const config = require("../config.js");
const Info = require("../models/info.js");
const topNavigation = require("../models/top_navigation.js");
const HomeView = require("../views/home_view.js");
class HomeController {
constructor() {
topNavigation.activate('home');
topNavigation.setTitle('Home');
topNavigation.activate("home");
topNavigation.setTitle("Home");
this._homeView = new HomeView({
name: api.getName(),
version: config.meta.version,
buildDate: config.meta.buildDate,
canListSnapshots: api.hasPrivilege('snapshots:list'),
canListPosts: api.hasPrivilege('posts:list'),
canListSnapshots: api.hasPrivilege("snapshots:list"),
canListPosts: api.hasPrivilege("posts:list"),
});
Info.get()
.then(info => {
Info.get().then(
(info) => {
this._homeView.setStats({
diskUsage: info.diskUsage,
postCount: info.postCount,
@ -31,7 +31,8 @@ class HomeController {
featuringTime: info.featuringTime,
});
},
error => this._homeView.showError(error.message));
(error) => this._homeView.showError(error.message)
);
}
showSuccess(message) {
@ -43,8 +44,8 @@ class HomeController {
}
}
module.exports = router => {
module.exports = (router) => {
router.enter([], (ctx, next) => {
ctx.controller = new HomeController();
});
}
};