mirror of
https://github.com/fleetdm/fleet
synced 2026-05-04 13:59:01 +00:00
Changes: - Moved documentation pages into the docs/ folder - Updated routes, poicies, and importer.less - Renamed the "scripts" page to "script-library" to be consistent with the other landing pages for YAML documentation - removed a stray console.log() in the new-licence page script
47 lines
1 KiB
JavaScript
Vendored
47 lines
1 KiB
JavaScript
Vendored
module.exports = {
|
|
|
|
|
|
friendlyName: 'View mdm commands',
|
|
|
|
|
|
description: 'Display "Mdm commands" page.',
|
|
|
|
|
|
exits: {
|
|
|
|
success: {
|
|
viewTemplatePath: 'pages/docs/mdm-commands'
|
|
},
|
|
badConfig: { responseType: 'badConfig' },
|
|
|
|
},
|
|
|
|
|
|
fn: async function () {
|
|
|
|
if (!_.isObject(sails.config.builtStaticContent) || !_.isArray(sails.config.builtStaticContent.mdmCommands)) {
|
|
throw {badConfig: 'builtStaticContent.scripts'};
|
|
}
|
|
let commands = sails.config.builtStaticContent.mdmCommands;
|
|
let appleCommands = _.filter(commands, (command)=>{
|
|
return command.platform === 'apple';
|
|
});
|
|
let windowsCommands = _.filter(commands, (command)=>{
|
|
return command.platform === 'windows';
|
|
});
|
|
|
|
let windowsCategories = _.groupBy(windowsCommands, 'category');
|
|
let appleCategories = _.groupBy(appleCommands, 'category');
|
|
// respond with view.
|
|
return {
|
|
windowsCategories,
|
|
windowsCommands,
|
|
appleCategories,
|
|
appleCommands,
|
|
algoliaPublicKey: sails.config.custom.algoliaPublicKey,
|
|
};
|
|
|
|
}
|
|
|
|
|
|
};
|