ENiGMA 1/2 WILL USE SPACES FROM THIS POINT ON VS TABS

* Really just to make GitHub formatting happy. Arg.
This commit is contained in:
Bryan Ashby 2018-06-21 23:15:04 -06:00
parent 5ddf04c882
commit e9787cee3e
135 changed files with 27397 additions and 27397 deletions

View file

@ -10,78 +10,78 @@ const StatLog = require('./stat_log.js');
const async = require('async');
exports.moduleInfo = {
name : 'File Area Selector',
desc : 'Select from available file areas',
author : 'NuSkooler',
name : 'File Area Selector',
desc : 'Select from available file areas',
author : 'NuSkooler',
};
const MciViewIds = {
areaList : 1,
areaList : 1,
};
exports.getModule = class FileAreaSelectModule extends MenuModule {
constructor(options) {
super(options);
constructor(options) {
super(options);
this.menuMethods = {
selectArea : (formData, extraArgs, cb) => {
const filterCriteria = {
areaTag : formData.value.areaTag,
};
this.menuMethods = {
selectArea : (formData, extraArgs, cb) => {
const filterCriteria = {
areaTag : formData.value.areaTag,
};
const menuOpts = {
extraArgs : {
filterCriteria : filterCriteria,
},
menuFlags : [ 'popParent', 'mergeFlags' ],
};
const menuOpts = {
extraArgs : {
filterCriteria : filterCriteria,
},
menuFlags : [ 'popParent', 'mergeFlags' ],
};
return this.gotoMenu(this.menuConfig.config.fileBaseListEntriesMenu || 'fileBaseListEntries', menuOpts, cb);
}
};
}
return this.gotoMenu(this.menuConfig.config.fileBaseListEntriesMenu || 'fileBaseListEntries', menuOpts, cb);
}
};
}
mciReady(mciData, cb) {
super.mciReady(mciData, err => {
if(err) {
return cb(err);
}
mciReady(mciData, cb) {
super.mciReady(mciData, err => {
if(err) {
return cb(err);
}
const self = this;
const self = this;
async.waterfall(
[
function mergeAreaStats(callback) {
const areaStats = StatLog.getSystemStat('file_base_area_stats') || { areas : {} };
async.waterfall(
[
function mergeAreaStats(callback) {
const areaStats = StatLog.getSystemStat('file_base_area_stats') || { areas : {} };
// we could use 'sort' alone, but area/conf sorting has some special properties; user can still override
const availAreas = getSortedAvailableFileAreas(self.client);
availAreas.forEach(area => {
const stats = areaStats.areas[area.areaTag];
area.totalFiles = stats ? stats.files : 0;
area.totalBytes = stats ? stats.bytes : 0;
});
// we could use 'sort' alone, but area/conf sorting has some special properties; user can still override
const availAreas = getSortedAvailableFileAreas(self.client);
availAreas.forEach(area => {
const stats = areaStats.areas[area.areaTag];
area.totalFiles = stats ? stats.files : 0;
area.totalBytes = stats ? stats.bytes : 0;
});
return callback(null, availAreas);
},
function prepView(availAreas, callback) {
self.prepViewController('allViews', 0, mciData.menu, (err, vc) => {
if(err) {
return callback(err);
}
return callback(null, availAreas);
},
function prepView(availAreas, callback) {
self.prepViewController('allViews', 0, mciData.menu, (err, vc) => {
if(err) {
return callback(err);
}
const areaListView = vc.getView(MciViewIds.areaList);
areaListView.setItems(availAreas.map(area => Object.assign(area, { text : area.name, data : area.areaTag } )));
areaListView.redraw();
const areaListView = vc.getView(MciViewIds.areaList);
areaListView.setItems(availAreas.map(area => Object.assign(area, { text : area.name, data : area.areaTag } )));
areaListView.redraw();
return callback(null);
});
}
],
err => {
return cb(err);
}
);
});
}
return callback(null);
});
}
],
err => {
return cb(err);
}
);
});
}
};