Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GroupMessage and GroupToast actions in 'meshctrl.js' #5494

Closed
CapriPL opened this issue Nov 1, 2023 · 10 comments · Fixed by #5731
Closed

GroupMessage and GroupToast actions in 'meshctrl.js' #5494

CapriPL opened this issue Nov 1, 2023 · 10 comments · Fixed by #5731
Assignees

Comments

@CapriPL
Copy link

CapriPL commented Nov 1, 2023

Hello,

It would be nice if 'meshctrl.js' offered GroupMessage and GroupToast actions , i.e. equivalent to 'Group Action / Device notification', but with the possibility of using it in your own scripts. There is often a need to notify all users within a device group.

Regards, Grzegorz.

@si458
Copy link
Collaborator

si458 commented Nov 1, 2023

Should be simple enough! If the web ui can do a feature, we just copy what the websocket does and put it into meshctrl.js 👍
Will have a look tomorrow for you!

@CapriPL
Copy link
Author

CapriPL commented Nov 2, 2023

Hello,
Thank you for your quick response and interest in the topic.
If possible, it would be ideal to be able to do it like this:
MeshCtrl GroupMessage --id groupid --msg "message" --title "title"
Thank you once again.

Regards, Grzegorz.

@si458
Copy link
Collaborator

si458 commented Nov 4, 2023

just checking this out
the is already these feature built into meshctrl?

console.log(winRemoveSingleQuotes("  MeshCtrl DeviceMessage --id 'deviceid' --msg \"message\" --title \"title\""));
console.log(winRemoveSingleQuotes("  MeshCtrl DeviceToast --id 'deviceid' --msg \"message\" --title \"title\""));

you can set deviceid to the deviceid you want to send too, and to send to multiple, just use the command multiple commands, each time a different id

@CapriPL
Copy link
Author

CapriPL commented Nov 5, 2023

I know there are 'DeviceMessage' and 'DeviceToast' commands.
From my point of view, if I want to send a notification to an entire group of devices, I have to find the 'id' of each turned on computer within the group, which is difficult from the script level because I have to parse the result of the 'ListDevices' command.
And I also don't want to have a script where all computer 'id' are hardcoded, another PC in the group means a change in the script.
The 'GroupMessage/GroupToast' command should internally find the 'id' of all computers in the group and send a message, which is a very flexible solution, hence my request.

@si458
Copy link
Collaborator

si458 commented Nov 5, 2023

Ahh now I get you!
So you want the command to specify a groupid, and it then get all the device ids then send the message/toast to each machine!
Got it!

@CapriPL
Copy link
Author

CapriPL commented Nov 5, 2023

That's exactly what I mean.

G.

@si458
Copy link
Collaborator

si458 commented Jan 25, 2024

ok all added, is this ok?

simon@testmc:~/meshcentral/MeshCentral$ node meshctrl.js help groupmessage
Open a message box on remote devices in a specific device group, Example usages:

  MeshCtrl GroupMessage --id 'devicegroupid' --msg "message"
  MeshCtrl GroupMessage --id 'devicegroupid' --msg "message" --title "title"
  MeshCtrl GroupMessage --id 'devicegroupid' --msg "message" --title "title" --timeout 120000

Required arguments:

  --id '[devicegroupid]'        - The device identifier.
  --msg [message]          - The message to display.

Optional arguments:

  --title [title]          - Messagebox title, default is "MeshCentral".
  --timeout [miliseconds]  - After timeout messagebox vanishes, 0 keeps messagebox open until closed manually, default is 120000 (2 Minutes).
simon@testmc:~/meshcentral/MeshCentral$ node meshctrl.js help grouptoast
Display a toast notification on remote devices in a specific device group, Example usages:

  MeshCtrl GroupToast --id 'devicegroupid' --msg "message"
  MeshCtrl GroupToast --id 'devicegroupid' --msg "message" --title "title"

Required arguments:

  --id '[devicegroupid]'      - The device identifier.
  --msg [message]        - The message to display.

Optional arguments:

  --title [title]        - Toast title, default is "MeshCentral".

@CapriPL
Copy link
Author

CapriPL commented Jan 25, 2024

Excellent! Thank you very much.

G.

@si458
Copy link
Collaborator

si458 commented Jan 25, 2024

merged so will be available in next release OR in docker master build in about 15mins OR just download the meshctrl.js directly from the master branch 👍

@CapriPL
Copy link
Author

CapriPL commented Jan 25, 2024

Great news, thank you again 😊

Regards, Grzegorz.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants