mirror of
https://github.com/fleetdm/fleet
synced 2026-05-14 12:38:41 +00:00
Related to: https://github.com/fleetdm/confidential/issues/10737 Changes: - Added `docs/scripts.yml`, a YAML file that contains a list of scripts - Added `docs/mdm-commands.yml`, a YAML file that contains Windows and Apple MDM commands - Added `/mdm-commands`, a page that contains a list of MDM commands for Windows and Apple commands - Added `/scripts`, a page that contains a list of scripts - Updated the `<docs-nav-and-search>` component to have a link to the controls library, and reordered the lists. - Updated the build static content script to add the scripts and mdm commands from scripts.yml and mdm-commands.yml to the website's `builtStaticContent` configuration. - Updated the layout of the os-settings page to match the latest wireframes
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/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) {
|
|
return '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,
|
|
};
|
|
|
|
}
|
|
|
|
|
|
};
|