1
0
mirror of https://github.com/donaldzou/WGDashboard.git synced 2024-11-21 23:01:39 +01:00

Added total peers in peers count

This commit is contained in:
Donald Zou 2024-10-05 16:10:36 +08:00
parent 5e1769b81f
commit 2cb06bb4bb
6 changed files with 18 additions and 14 deletions

View File

@ -913,7 +913,8 @@ class WireguardConfiguration:
"Sent": sum(list(map(lambda x: x.cumu_sent + x.total_sent, self.Peers))),
"Receive": sum(list(map(lambda x: x.cumu_receive + x.total_receive, self.Peers)))
},
"ConnectedPeers": len(list(filter(lambda x: x.status == "running", self.Peers)))
"ConnectedPeers": len(list(filter(lambda x: x.status == "running", self.Peers))),
"TotalPeers": len(self.Peers)
}
def updateConfigurationSettings(self, newData: dict) -> tuple[bool, str]:

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"build": "vite build && git commit -a",
"build electron": "vite build && vite build --mode electron && cd ../../../../WGDashboard-Desktop && electron-builder --mac --win",
"preview": "vite preview"
},

View File

@ -495,7 +495,9 @@ export default {
<p class="mb-0 text-muted"><small>
<LocaleText t="Connected Peers"></LocaleText>
</small></p>
<strong class="h4">{{configurationSummary.connectedPeers}}</strong>
<strong class="h4">
{{configurationSummary.connectedPeers}} / {{configurationPeers.length}}
</strong>
</div>
<i class="bi bi-ethernet ms-auto h2 text-muted"></i>
</div>

View File

@ -65,7 +65,8 @@ export default {
<i class="bi bi-arrow-up me-2"></i>{{c.DataUsage.Sent > 0 ? c.DataUsage.Sent.toFixed(4) : 0}} GB
</small>
<small class="text-md-end col-6 col-md-3">
<span class="dot me-2" :class="{active: c.ConnectedPeers > 0}"></span>{{c.ConnectedPeers}}
<span class="dot me-2" :class="{active: c.ConnectedPeers > 0}"></span>
{{c.ConnectedPeers}} / {{c.TotalPeers}}
<LocaleText t="Peers"></LocaleText>
</small>
</div>