mirror of
https://github.com/Ylianst/MeshCentralRouter
synced 2025-12-06 00:13:33 +00:00
wake up support
This commit is contained in:
12
src/MainForm.Designer.cs
generated
12
src/MainForm.Designer.cs
generated
@@ -108,6 +108,7 @@
|
||||
this.rdpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.sshToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.scpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.wolToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.devicesImageList = new System.Windows.Forms.ImageList(this.components);
|
||||
this.noSearchResultsLabel = new System.Windows.Forms.Label();
|
||||
this.noDevicesLabel = new System.Windows.Forms.Label();
|
||||
@@ -677,7 +678,9 @@
|
||||
this.httpsToolStripMenuItem,
|
||||
this.rdpToolStripMenuItem,
|
||||
this.sshToolStripMenuItem,
|
||||
this.scpToolStripMenuItem});
|
||||
this.scpToolStripMenuItem,
|
||||
this.wolToolStripMenuItem,
|
||||
});
|
||||
this.devicesContextMenuStrip.Name = "devicesContextMenuStrip";
|
||||
resources.ApplyResources(this.devicesContextMenuStrip, "devicesContextMenuStrip");
|
||||
this.devicesContextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(this.devicesContextMenuStrip_Opening);
|
||||
@@ -763,6 +766,12 @@
|
||||
resources.ApplyResources(this.scpToolStripMenuItem, "scpToolStripMenuItem");
|
||||
this.scpToolStripMenuItem.Click += new System.EventHandler(this.scpToolStripMenuItem_Click);
|
||||
//
|
||||
// wolToolStripMenuItem
|
||||
//
|
||||
this.wolToolStripMenuItem.Name = "wolToolStripMenuItem";
|
||||
resources.ApplyResources(this.wolToolStripMenuItem, "wolToolStripMenuItem");
|
||||
this.wolToolStripMenuItem.Click += new System.EventHandler(this.wolToolStripMenuItem_Click);
|
||||
//
|
||||
// devicesImageList
|
||||
//
|
||||
this.devicesImageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("devicesImageList.ImageStream")));
|
||||
@@ -1137,6 +1146,7 @@
|
||||
private System.Windows.Forms.ToolStripMenuItem rdpToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem sshToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem scpToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem wolToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem addMapToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem addRelayMapToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem3;
|
||||
|
||||
@@ -2045,24 +2045,42 @@ namespace MeshCentralRouter
|
||||
if (devicesListView.SelectedItems.Count != 1) { e.Cancel = true; return; } // Device not selected
|
||||
ListViewItem selecteditem = devicesListView.SelectedItems[0];
|
||||
NodeClass node = (NodeClass)selecteditem.Tag;
|
||||
if (((node.conn & 1) == 0) && (node.mtype != 3)) { e.Cancel = true; return; } // Agent not connected on this device
|
||||
if (node.agentid < 6)
|
||||
{
|
||||
// Windows OS
|
||||
if (((node.conn & 1) == 0) && (node.mtype != 3))
|
||||
{ // Agent not connected on this device and not local device
|
||||
addMapToolStripMenuItem.Visible = false;
|
||||
addRelayMapToolStripMenuItem.Visible = false;
|
||||
remoteDesktopToolStripMenuItem.Visible = false;
|
||||
remoteFilesToolStripMenuItem.Visible = false;
|
||||
httpToolStripMenuItem.Visible = false;
|
||||
httpsToolStripMenuItem.Visible = false;
|
||||
rdpToolStripMenuItem.Visible = false;
|
||||
sshToolStripMenuItem.Visible = false;
|
||||
scpToolStripMenuItem.Visible = false;
|
||||
rdpToolStripMenuItem.Visible = true;
|
||||
wolToolStripMenuItem.Visible = true; // Wol not allowed for local devices
|
||||
}
|
||||
else
|
||||
{
|
||||
// Other OS
|
||||
sshToolStripMenuItem.Visible = true;
|
||||
scpToolStripMenuItem.Visible = true;
|
||||
rdpToolStripMenuItem.Visible = false;
|
||||
else{ // Agent connected or local device
|
||||
if (node.agentid < 6)
|
||||
{
|
||||
// Windows OS
|
||||
sshToolStripMenuItem.Visible = false;
|
||||
scpToolStripMenuItem.Visible = false;
|
||||
rdpToolStripMenuItem.Visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Other OS
|
||||
sshToolStripMenuItem.Visible = true;
|
||||
scpToolStripMenuItem.Visible = true;
|
||||
rdpToolStripMenuItem.Visible = false;
|
||||
}
|
||||
addMapToolStripMenuItem.Visible = true;
|
||||
httpToolStripMenuItem.Visible = true;
|
||||
httpsToolStripMenuItem.Visible = true;
|
||||
addRelayMapToolStripMenuItem.Visible = (node.mtype != 3); // Relay mappings are not allowed for local devices
|
||||
remoteDesktopToolStripMenuItem.Visible = ((node.agentcaps & 1) != 0); // Only display remote desktop if it's supported by the agent (1 = Desktop)
|
||||
remoteFilesToolStripMenuItem.Visible = ((node.agentcaps & 4) != 0); // Only display remote desktop if it's supported by the agent (4 = Files)
|
||||
}
|
||||
addRelayMapToolStripMenuItem.Visible = (node.mtype != 3); // Relay mappings are not allowed for local devices
|
||||
remoteDesktopToolStripMenuItem.Visible = ((node.agentcaps & 1) != 0); // Only display remote desktop if it's supported by the agent (1 = Desktop)
|
||||
remoteFilesToolStripMenuItem.Visible = ((node.agentcaps & 4) != 0); // Only display remote desktop if it's supported by the agent (4 = Files)
|
||||
|
||||
}
|
||||
|
||||
private void httpToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
@@ -2111,6 +2129,18 @@ namespace MeshCentralRouter
|
||||
if (((node.conn & 1) == 0) && (node.mtype != 3)) { return; } // Agent not connected on this device & not local device
|
||||
QuickMap(1, 22, 5, node); // WinSCP
|
||||
}
|
||||
|
||||
private void wolToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (devicesListView.SelectedItems.Count != 1) { return; }
|
||||
ListViewItem selecteditem = devicesListView.SelectedItems[0];
|
||||
NodeClass node = (NodeClass)selecteditem.Tag;
|
||||
if (((node.conn & 1) == 0) && (node.mtype != 3)) { return; } // Agent not connected on this device & not local device
|
||||
// List of actions : https://github.com/Ylianst/MeshCentral/blob/f5db131693386147731f2ec93b9378bf035b5861/agents/meshcore.js#L1110
|
||||
// https://github.com/Ylianst/MeshCentral/blob/f5db131693386147731f2ec93b9378bf035b5861/amtmanager.js#L347
|
||||
// https://github.com/Ylianst/MeshCentral/blob/f5db131693386147731f2ec93b9378bf035b5861/meshuser.js#L5285
|
||||
meshcentral.sendCommand("{ \"action\": \"wakedevices\", \"nodeids\": [\"" + node.nodeid + "\"]}");
|
||||
}
|
||||
|
||||
private void addMapToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
@@ -1695,6 +1695,12 @@
|
||||
<data name="remoteFilesToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>Remote Files...</value>
|
||||
</data>
|
||||
<data name="wolToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>198, 24</value>
|
||||
</data>
|
||||
<data name="wolToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>Wake Up...</value>
|
||||
</data>
|
||||
<data name="httpToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>198, 24</value>
|
||||
</data>
|
||||
@@ -6243,6 +6249,12 @@ Click "Add" to get started.</value>
|
||||
<data name=">>remoteFilesToolStripMenuItem.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>wolToolStripMenuItem.Name" xml:space="preserve">
|
||||
<value>wolToolStripMenuItem</value>
|
||||
</data>
|
||||
<data name=">>wolToolStripMenuItem.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>httpToolStripMenuItem.Name" xml:space="preserve">
|
||||
<value>httpToolStripMenuItem</value>
|
||||
</data>
|
||||
|
||||
@@ -4086,6 +4086,29 @@ namespace MeshCentralRouter
|
||||
{"ru","Спросите согласия"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"Wake Up...",
|
||||
new Dictionary<string, string>() {
|
||||
{"de","Wach auf..."},
|
||||
{"hi","जगाना..."},
|
||||
{"fr","Reveiller..."},
|
||||
{"zh-chs","醒来..."},
|
||||
{"fi","herätä..."},
|
||||
{"tr","uyanmak..."},
|
||||
{"cs","vzbudit..."},
|
||||
{"ja","起きろ..."},
|
||||
{"es","despertar..."},
|
||||
{"pl","budzić się..."},
|
||||
{"pt","acordar..."},
|
||||
{"nl","word wakker..."},
|
||||
{"pt-br","acordar..."},
|
||||
{"sv","vakna..."},
|
||||
{"da","Vågn op..."},
|
||||
{"ko","깨우다..."},
|
||||
{"it","svegliati..."},
|
||||
{"ru","просыпайся..."}
|
||||
}
|
||||
},
|
||||
{
|
||||
"Remote Desktop...",
|
||||
new Dictionary<string, string>() {
|
||||
|
||||
Reference in New Issue
Block a user