2025-09-19 17:02:55 +00:00
|
|
|
module.exports = {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
friendlyName: 'View mdm commands',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
description: 'Display "Mdm commands" page.',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exits: {
|
|
|
|
|
|
|
|
|
|
success: {
|
2026-03-26 20:32:48 +00:00
|
|
|
viewTemplatePath: 'pages/docs/mdm-commands'
|
2025-09-19 17:02:55 +00:00
|
|
|
},
|
|
|
|
|
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,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|