mirror of
https://github.com/fleetdm/fleet
synced 2026-04-26 07:57:29 +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
46 lines
1,004 B
JavaScript
Vendored
46 lines
1,004 B
JavaScript
Vendored
module.exports = {
|
|
|
|
|
|
friendlyName: 'View script library',
|
|
|
|
|
|
description: 'Display "Script library" page.',
|
|
|
|
|
|
exits: {
|
|
|
|
success: {
|
|
viewTemplatePath: 'pages/docs/script-library'
|
|
},
|
|
badConfig: { responseType: 'badConfig' },
|
|
|
|
},
|
|
|
|
|
|
fn: async function () {
|
|
|
|
if (!_.isObject(sails.config.builtStaticContent) || !_.isArray(sails.config.builtStaticContent.scripts)) {
|
|
throw {badConfig: 'builtStaticContent.scripts'};
|
|
}
|
|
let scripts = sails.config.builtStaticContent.scripts;
|
|
let macOsScripts = _.filter(scripts, (script)=>{
|
|
return script.platform === 'macos';
|
|
});
|
|
let windowsScripts = _.filter(scripts, (script)=>{
|
|
return script.platform === 'windows';
|
|
});
|
|
let linuxScripts = _.filter(scripts, (script)=>{
|
|
return script.platform === 'linux';
|
|
});
|
|
// Respond with view.
|
|
return {
|
|
macOsScripts,
|
|
windowsScripts,
|
|
linuxScripts,
|
|
algoliaPublicKey: sails.config.custom.algoliaPublicKey,
|
|
};
|
|
|
|
}
|
|
|
|
|
|
};
|