1
0
mirror of https://github.com/Ylianst/MeshCentralRouter synced 2025-12-06 00:13:33 +00:00

Fixed individual devices, #46

This commit is contained in:
Ylian Saint-Hilaire
2022-07-01 14:31:49 -07:00
parent 91fad23547
commit a2210cd49a
3 changed files with 55 additions and 45 deletions

View File

@@ -13,7 +13,7 @@
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<StartupObject>MeshCentralRouter.Program</StartupObject>
<ApplicationIcon>src\MeshServer.ico</ApplicationIcon>
<ApplicationIcon>MeshServer.ico</ApplicationIcon>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
@@ -58,6 +58,7 @@
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup />
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
@@ -415,6 +416,7 @@
<None Include="app.config" />
</ItemGroup>
<ItemGroup>
<Content Include="MeshServer.ico" />
<Content Include="src\MeshServer.ico" />
<None Include="readme.md" />
<None Include="Resources\icon-monitor1.png" />

BIN
MeshServer.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

View File

@@ -731,6 +731,7 @@ namespace MeshCentralRouter
{
foreach (NodeClass node in meshcentral.nodes.Values)
{
if (node.agentid == -1) { continue; }
ListViewItem device;
if (node.listitem == null)
@@ -748,9 +749,11 @@ namespace MeshCentralRouter
}
if ((node.meshid != null) && meshcentral.meshes.ContainsKey(node.meshid)) { node.mesh = (MeshClass)meshcentral.meshes[node.meshid]; }
string meshName = (node.mesh != null) ? node.mesh.name : Properties.Resources.IndividualDevices;
if ((showGroupNamesToolStripMenuItem.Checked) && (node.mesh != null))
{
device.SubItems[0].Text = node.mesh.name + " - " + node.name;
device.SubItems[0].Text = meshName + " - " + node.name;
}
else
{
@@ -759,22 +762,22 @@ namespace MeshCentralRouter
// *** Flynn Grouping start
bool bGroupExisting = false;
for(int i = 0; i < devicesListView.Groups.Count; i++)
if(devicesListView.Groups[i].Header == node.mesh.name)
for (int i = 0; i < devicesListView.Groups.Count; i++)
{
if (devicesListView.Groups[i].Header == meshName)
{
bGroupExisting = true;
node.listitem.Group = devicesListView.Groups[i];
break;
}
if(!bGroupExisting)
}
if (!bGroupExisting)
{
ListViewGroup grp = devicesListView.Groups.Add(devicesListView.Groups.Count.ToString(), node.mesh.name);
ListViewGroup grp = devicesListView.Groups.Add(devicesListView.Groups.Count.ToString(), meshName);
node.listitem.Group = grp;
ListViewGroup[] groups = new ListViewGroup[this.devicesListView.Groups.Count];
this.devicesListView.Groups.CopyTo(groups, 0);
Array.Sort(groups, new GroupComparer());
this.devicesListView.BeginUpdate();
@@ -782,15 +785,19 @@ namespace MeshCentralRouter
this.devicesListView.Groups.AddRange(groups);
this.devicesListView.EndUpdate();
foreach(ListViewGroup lvg in devicesListView.Groups)
foreach (ListViewGroup lvg in devicesListView.Groups)
{
if (lvg.Header == "Repos")
{
if(lvg.Header == "Repos")
ListViewExtended.setGrpState(lvg, ListViewGroupState.Collapsible | ListViewGroupState.Normal);
}
else
{
ListViewExtended.setGrpState(lvg, ListViewGroupState.Collapsible | ListViewGroupState.Collapsed);
}
}
// *** Flynn Groupng end
}
// *** Flynn Grouping end
bool connVisible = ((showOfflineDevicesToolStripMenuItem.Checked) || ((node.conn & 1) != 0)) || (node.mtype == 3);
int imageIndex = (node.icon - 1) * 2;
@@ -2226,7 +2233,8 @@ namespace MeshCentralRouter
private void customAppsToolStripMenuItem_Click(object sender, EventArgs e)
{
CustomAppsForm f = new CustomAppsForm(Settings.GetApplications());
if (f.ShowDialog(this) == DialogResult.OK) {
if (f.ShowDialog(this) == DialogResult.OK)
{
Settings.SetApplications(f.getApplications());
}
}