mirror of
https://github.com/fleetdm/fleet
synced 2026-04-21 21:47:20 +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
44 lines
1.1 KiB
JavaScript
Vendored
44 lines
1.1 KiB
JavaScript
Vendored
module.exports = {
|
|
|
|
|
|
friendlyName: 'View command details',
|
|
|
|
|
|
description: 'Display "Command details" page.',
|
|
|
|
|
|
inputs: {
|
|
slug: { type: 'string', required: true, description: 'A slug uniquely identifying this script in the library.', example: 'macos-uninstall-fleetd' },
|
|
},
|
|
|
|
exits: {
|
|
|
|
success: { viewTemplatePath: 'pages/docs/command-details' },
|
|
notFound: { responseType: 'notFound' },
|
|
badConfig: { responseType: 'badConfig' },
|
|
|
|
},
|
|
|
|
|
|
fn: async function ({slug}) {
|
|
if (!_.isObject(sails.config.builtStaticContent) || !_.isArray(sails.config.builtStaticContent.mdmCommands)) {
|
|
throw {badConfig: 'builtStaticContent.mdmCommands'};
|
|
}
|
|
let thisCommand = _.find(sails.config.builtStaticContent.mdmCommands, { slug: slug });
|
|
if(!thisCommand) {
|
|
throw 'notFound';
|
|
}
|
|
let pageTitleForMeta = ` ${thisCommand.name} command | Fleet controls library`;
|
|
let pageDescriptionForMeta = `${thisCommand.description}`;
|
|
// Respond with view.
|
|
return {
|
|
thisCommand,
|
|
pageTitleForMeta,
|
|
pageDescriptionForMeta,
|
|
algoliaPublicKey: sails.config.custom.algoliaPublicKey,
|
|
};
|
|
|
|
}
|
|
|
|
|
|
};
|