2017-07-13 20:09:47 +02:00
|
|
|
import { BaseCommand } from './base-command.js';
|
2017-07-16 18:06:05 +02:00
|
|
|
import { Database } from 'lib/database.js';
|
|
|
|
import { Setting } from 'lib/models/setting.js';
|
2017-07-13 20:09:47 +02:00
|
|
|
import { _ } from 'lib/locale.js';
|
|
|
|
import { ReportService } from 'lib/services/report.js';
|
|
|
|
|
|
|
|
class Command extends BaseCommand {
|
|
|
|
|
|
|
|
usage() {
|
|
|
|
return 'status';
|
|
|
|
}
|
|
|
|
|
|
|
|
description() {
|
2017-07-18 20:21:03 +02:00
|
|
|
return _('Displays summary about the notes and notebooks.');
|
2017-07-13 20:09:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
async action(args) {
|
|
|
|
let service = new ReportService();
|
2017-07-24 20:58:11 +02:00
|
|
|
let report = await service.status(Setting.value('sync.target'));
|
2017-07-13 20:09:47 +02:00
|
|
|
|
|
|
|
for (let i = 0; i < report.length; i++) {
|
|
|
|
let section = report[i];
|
|
|
|
|
|
|
|
if (i > 0) this.log('');
|
|
|
|
|
|
|
|
this.log('# ' + section.title);
|
|
|
|
this.log('');
|
|
|
|
|
|
|
|
for (let n in section.body) {
|
|
|
|
if (!section.body.hasOwnProperty(n)) continue;
|
|
|
|
let line = section.body[n];
|
|
|
|
this.log(line);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = Command;
|