From 2721804ebf233b2eb1a40ac2e1956baa31139bc1 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Wed, 4 Nov 2015 18:39:45 -0800 Subject: make the tabs a little prettier --- windows/WinUI/MainWindow.xaml | 104 +++++++++++++++++++++--------------------- 1 file changed, 53 insertions(+), 51 deletions(-) (limited to 'windows/WinUI/MainWindow.xaml') diff --git a/windows/WinUI/MainWindow.xaml b/windows/WinUI/MainWindow.xaml index 553d44fe..b5365a37 100644 --- a/windows/WinUI/MainWindow.xaml +++ b/windows/WinUI/MainWindow.xaml @@ -7,56 +7,58 @@ mc:Ignorable="d" x:Class="WinUI.MainWindow" Title="ZeroTier One" Height="500" Width="700" Icon="ZeroTierIcon.ico"> - - - - - + + - + + + + + + + + + + + + + + @@ -87,7 +89,7 @@ - + @@ -98,7 +100,7 @@ - + -- cgit v1.2.3 From df74dd6e41007b55ca879967092ab59af4c3a279 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Wed, 4 Nov 2015 20:03:25 -0800 Subject: make the peers page prettier --- windows/WinUI/APIHandler.cs | 2 +- windows/WinUI/MainWindow.xaml | 16 ++++++++++++++++ windows/WinUI/PeersPage.xaml | 11 +++++++++-- windows/WinUI/ZeroTierPeer.cs | 36 ++++++++++++++++++++++++++++++++++-- 4 files changed, 60 insertions(+), 5 deletions(-) (limited to 'windows/WinUI/MainWindow.xaml') diff --git a/windows/WinUI/APIHandler.cs b/windows/WinUI/APIHandler.cs index ada7369a..2968c963 100644 --- a/windows/WinUI/APIHandler.cs +++ b/windows/WinUI/APIHandler.cs @@ -181,7 +181,7 @@ namespace WinUI using (var streamReader = new StreamReader(httpResponse.GetResponseStream())) { var responseText = streamReader.ReadToEnd(); - + //Console.WriteLine(responseText); List peerList = null; try { diff --git a/windows/WinUI/MainWindow.xaml b/windows/WinUI/MainWindow.xaml index b5365a37..660cbd9b 100644 --- a/windows/WinUI/MainWindow.xaml +++ b/windows/WinUI/MainWindow.xaml @@ -19,7 +19,23 @@ + + + + + @@ -13,7 +20,7 @@ - + diff --git a/windows/WinUI/ZeroTierPeer.cs b/windows/WinUI/ZeroTierPeer.cs index 3153f7e2..06a8896b 100644 --- a/windows/WinUI/ZeroTierPeer.cs +++ b/windows/WinUI/ZeroTierPeer.cs @@ -12,11 +12,43 @@ namespace WinUI [JsonProperty("address")] public string Address { get; set; } + private Int64 _lastUnicast; [JsonProperty("lastUnicastFrame")] - public UInt64 LastUnicastFrame { get; set; } + public Int64 LastUnicastFrame + { + get + { + if (_lastUnicast == 0) + return 0; + + TimeSpan t = DateTime.UtcNow - new DateTime(1970, 1, 1); + Int64 millisecondsSinceEpoch = (Int64)t.TotalMilliseconds; + return (millisecondsSinceEpoch - _lastUnicast) / 1000; + } + set + { + _lastUnicast = value; + } + } + private Int64 _lastMulticast; [JsonProperty("lastMulticastFrame")] - public UInt64 LastMulticastFrame { get; set; } + public Int64 LastMulticastFrame + { + get + { + if (_lastMulticast == 0) + return 0; + + TimeSpan t = DateTime.UtcNow - new DateTime(1970, 1, 1); + Int64 millisecondsSinceEpoch = (Int64)t.TotalMilliseconds; + return (millisecondsSinceEpoch - _lastMulticast) / 1000; + } + set + { + _lastMulticast = value; + } + } [JsonProperty("versionMajor")] public int VersionMajor { get; set; } -- cgit v1.2.3 From 4c7bb06894137a4fe5ba03c1bcaecb810ce372d4 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Wed, 4 Nov 2015 20:19:14 -0800 Subject: make the main window width a bit smaller --- windows/WinUI/MainWindow.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'windows/WinUI/MainWindow.xaml') diff --git a/windows/WinUI/MainWindow.xaml b/windows/WinUI/MainWindow.xaml index 660cbd9b..82be7c4b 100644 --- a/windows/WinUI/MainWindow.xaml +++ b/windows/WinUI/MainWindow.xaml @@ -5,7 +5,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:WinUI" mc:Ignorable="d" x:Class="WinUI.MainWindow" - Title="ZeroTier One" Height="500" Width="700" Icon="ZeroTierIcon.ico"> + Title="ZeroTier One" Height="500" Width="600" Icon="ZeroTierIcon.ico"> -- cgit v1.2.3 From 49086e4556bbe0c31abb8d4e640d854859430d49 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Wed, 4 Nov 2015 20:31:41 -0800 Subject: just a little xaml cleanup --- windows/WinUI/MainWindow.xaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'windows/WinUI/MainWindow.xaml') diff --git a/windows/WinUI/MainWindow.xaml b/windows/WinUI/MainWindow.xaml index 82be7c4b..bf068ab7 100644 --- a/windows/WinUI/MainWindow.xaml +++ b/windows/WinUI/MainWindow.xaml @@ -95,16 +95,16 @@ - - + + - +