mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
Related to: #20296 Changes: - Added `ee/bulk-operations-dashboard`, a Sails.js app that lets users manage configuration profiles and scripts across multiple teams on a Fleet instance. - Added a Github workflow to deploy the app to Heroku - Added a Github workflow to test changes to the bulk operations dashboard.
45 lines
787 B
JavaScript
45 lines
787 B
JavaScript
module.exports = {
|
|
|
|
|
|
friendlyName: 'Broadcast session change',
|
|
|
|
|
|
description: 'Broadcast a socket notification indicating a change in login status.',
|
|
|
|
|
|
inputs: {
|
|
|
|
req: {
|
|
type: 'ref',
|
|
required: true,
|
|
},
|
|
|
|
},
|
|
|
|
|
|
exits: {
|
|
|
|
success: {
|
|
description: 'All done.',
|
|
},
|
|
|
|
},
|
|
|
|
|
|
fn: async function ({ req }) {
|
|
|
|
// If there's no sessionID, we don't need to broadcase a message about the old session.
|
|
if(!req.sessionID) {
|
|
return;
|
|
}
|
|
|
|
let roomName = `session${_.deburr(req.sessionID)}`;
|
|
let messageText = `You have signed out or signed into a different session in another tab or window. Reload the page to refresh your session.`;
|
|
sails.sockets.broadcast(roomName, 'session', { notificationText: messageText }, req);
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|