mirror of
https://github.com/openziti/desktop-edge-win.git
synced 2026-10-13 16:21:25 +00:00
Merge remote-tracking branch 'origin/clint' into jun5
This commit is contained in:
@@ -17,12 +17,14 @@ using ZitiTunneler.Models;
|
||||
namespace ZitiTunneler {
|
||||
/// <summary>
|
||||
/// Interaction logic for IdentityDetails.xaml
|
||||
/// </summary>
|
||||
/// </summary>
|
||||
public partial class IdentityDetails:UserControl {
|
||||
|
||||
private bool _isAttached = true;
|
||||
public delegate void Forgot(ZitiIdentity forgotten);
|
||||
public event Forgot OnForgot;
|
||||
public delegate void ErrorOccurred(string message);
|
||||
public event ErrorOccurred OnError;
|
||||
|
||||
private List<ZitiIdentity> identities {
|
||||
get {
|
||||
@@ -112,9 +114,9 @@ namespace ZitiTunneler {
|
||||
OnForgot(forgotten);
|
||||
}
|
||||
} catch (ServiceClient.ServiceException se) {
|
||||
MessageBox.Show(se.AdditionalInfo, se.Message);
|
||||
OnError(se.Message);
|
||||
} catch (Exception ex) {
|
||||
MessageBox.Show("Unexpected error 1", ex.Message);
|
||||
OnError(ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
<Label Name="IdName" MouseDown="OpenDetails" MaxWidth="200" Grid.Column="1" Margin="0,6,0,0" FontFamily="pack://application:,,,/Assets/Fonts/#Open Sans" FontSize="18" Foreground="White" HorizontalAlignment="Left">
|
||||
<TextBlock TextTrimming="CharacterEllipsis">Identity Name</TextBlock>
|
||||
</Label>
|
||||
<Label Name="IdUrl" MouseDown="OpenDetails" Grid.Column="1" Grid.Row="1" FontSize="11" Margin="0,-5,0,0" Typography.Capitals="AllSmallCaps" FontFamily="pack://application:,,,/Assets/Fonts/#Open Sans" Foreground="White" HorizontalAlignment="Left">
|
||||
<TextBlock TextTrimming="CharacterEllipsis">https://serverUrl:8080</TextBlock>
|
||||
<Label Name="IdUrl" MouseDown="OpenDetails" MaxWidth="200" Grid.Column="1" Grid.Row="1" FontSize="11" Margin="0,-5,0,0" Typography.Capitals="AllSmallCaps" FontFamily="pack://application:,,,/Assets/Fonts/#Open Sans" Foreground="White" HorizontalAlignment="Left">
|
||||
<TextBlock TextTrimming="CharacterEllipsis">https://serverUrlThisShouldTrimIfItsLong:8080</TextBlock>
|
||||
</Label>
|
||||
<Canvas Grid.Column="2" Grid.Row="0" Width="50" Height="40" MouseDown="OpenDetails">
|
||||
<Border Width="44" Height="26" Background="#0068F9" CornerRadius="12" Canvas.Top="10" Canvas.Left="3"></Border>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
xmlns:local="clr-namespace:ZitiTunneler"
|
||||
mc:Ignorable="d"
|
||||
x:Name="MainMenuArea"
|
||||
d:DesignHeight="400" d:DesignWidth="350">
|
||||
d:DesignHeight="400" d:DesignWidth="350" Margin="1,1,1,1">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
@@ -39,20 +39,7 @@
|
||||
<Label FontSize="12" FontWeight="SemiBold" Content="Back" FontFamily="pack://application:,,,/Assets/Fonts/#Open Sans"></Label>
|
||||
</StackPanel>
|
||||
<Label Name="MenuTitle" Grid.Column="1" Content="Main Menu" HorizontalAlignment="Center" FontSize="14" FontWeight="SemiBold" FontFamily="pack://application:,,,/Assets/Fonts/#Open Sans" Foreground="#0F0F23"></Label>
|
||||
<Image Grid.Column="2" Cursor="Hand" Source="/Assets/Images/x.png" Height="20" Margin="50,4,0,5" MouseDown="HideMenu">
|
||||
<Image.Triggers>
|
||||
<EventTrigger RoutedEvent="Image.MouseDown" >
|
||||
<BeginStoryboard>
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="MainMenuArea" From="1.0" To="0" Duration="0:0:0.5"></DoubleAnimation>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="MainMenuArea" Storyboard.TargetProperty="Visibility">
|
||||
<DiscreteObjectKeyFrame KeyTime="0:0:0.5" Value="{x:Static Visibility.Collapsed}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</EventTrigger>
|
||||
</Image.Triggers>
|
||||
</Image>
|
||||
<Image Grid.Column="2" Cursor="Hand" Source="/Assets/Images/x.png" Height="20" Margin="50,4,0,5" MouseDown="HideMenu"></Image>
|
||||
</Grid>
|
||||
<Rectangle HorizontalAlignment="Stretch" Height="1" Fill="#7d8faf" Opacity="0.2"></Rectangle>
|
||||
<StackPanel Name="MainItems" Orientation="Vertical" HorizontalAlignment="Stretch">
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace ZitiTunneler
|
||||
private void HideMenu(object sender, MouseButtonEventArgs e) {
|
||||
menuState = "Menu";
|
||||
UpdateState();
|
||||
this.Visibility = Visibility.Collapsed;
|
||||
MainMenuArea.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
private void CloseApp(object sender, MouseButtonEventArgs e) {
|
||||
@@ -133,6 +133,7 @@ namespace ZitiTunneler
|
||||
if (OnAttachmentChange != null) {
|
||||
OnAttachmentChange(false);
|
||||
}
|
||||
MainMenuArea.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
private void RetachWindow(object sender, MouseButtonEventArgs e) {
|
||||
Application.Current.MainWindow.ShowInTaskbar = false;
|
||||
|
||||
@@ -62,19 +62,6 @@
|
||||
<ColumnDefinition Width="100"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Grid.Column="0" Cursor="Hand" Orientation="Vertical" Margin="14,16,14,14" MouseLeftButtonDown="ShowMenu">
|
||||
<StackPanel.Triggers>
|
||||
<EventTrigger RoutedEvent="StackPanel.MouseLeftButtonDown" >
|
||||
<BeginStoryboard>
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="MainMenu" From="0" To="1.0" Duration="0:0:.5"></DoubleAnimation>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="MainMenu" Storyboard.TargetProperty="Visibility">
|
||||
<DiscreteObjectKeyFrame KeyTime="0:0:.5" Value="{x:Static Visibility.Visible}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="MainMenu" From="0" To="1.0" Duration="0:0:.5"></DoubleAnimation>
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</EventTrigger>
|
||||
</StackPanel.Triggers>
|
||||
<Image Source="/Assets/Images/hamburger.png" Margin="5,0,0,-4" Width="26" Height="26" HorizontalAlignment="Left"></Image>
|
||||
<Label Content="MAIN" FontFamily="pack://application:,,,/Assets/Fonts/#Open Sans" Foreground="White" Height="25" FontSize="10"></Label>
|
||||
<Label Content="MENU" FontFamily="pack://application:,,,/Assets/Fonts/#Open Sans" Foreground="White" Height="25" Margin="0,-14,0,0" FontSize="10"></Label>
|
||||
@@ -120,7 +107,7 @@
|
||||
<Image Grid.Column="1" Source="/Assets/Images/down.png" Width="20" HorizontalAlignment="Left" Height="20"></Image>
|
||||
</Grid>
|
||||
<Label Name="DownloadSpeed" Margin="0,-16,0,0" Foreground="#0069FF" Content="0" FontSize="40" HorizontalAlignment="Center" FontFamily="pack://application:,,,/Assets/Fonts/#Open Sans" />
|
||||
<Label Foreground="White" Margin="0,-20,0,30" Content="KBps" FontSize="11" HorizontalAlignment="Center" FontFamily="pack://application:,,,/Assets/Fonts/#Open Sans" />
|
||||
<Label Name="DownloadSpeedLabel" Foreground="White" Margin="0,-20,0,30" Content="KBps" FontSize="11" HorizontalAlignment="Center" FontFamily="pack://application:,,,/Assets/Fonts/#Open Sans" />
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="1" Orientation="Vertical">
|
||||
<Grid HorizontalAlignment="Stretch" Width="Auto">
|
||||
@@ -132,7 +119,7 @@
|
||||
<Image Grid.Column="1" Source="/Assets/Images/up.png" Width="20" HorizontalAlignment="Left" Height="20"></Image>
|
||||
</Grid>
|
||||
<Label Name="UploadSpeed" Margin="0,-16,0,0" Foreground="#FF0047" Content="0" FontSize="40" HorizontalAlignment="Center" FontFamily="pack://application:,,,/Assets/Fonts/#Open Sans" />
|
||||
<Label Foreground="White" Margin="0,-20,0,30" Content="KBps" FontSize="11" HorizontalAlignment="Center" FontFamily="pack://application:,,,/Assets/Fonts/#Open Sans" />
|
||||
<Label Name="UploadSpeedLabel" Foreground="White" Margin="0,-20,0,30" Content="KBps" FontSize="11" HorizontalAlignment="Center" FontFamily="pack://application:,,,/Assets/Fonts/#Open Sans" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<ScrollViewer ScrollViewer.HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Auto" CanContentScroll="True">
|
||||
|
||||
@@ -13,6 +13,7 @@ using System.Runtime.Remoting.Messaging;
|
||||
using System.Diagnostics;
|
||||
using System.Security.Principal;
|
||||
using System.Net;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace ZitiTunneler {
|
||||
|
||||
@@ -29,6 +30,7 @@ namespace ZitiTunneler {
|
||||
private int _right = 75;
|
||||
private int _bottom = 0;
|
||||
private double _maxHeight = 800d;
|
||||
private string[] suffixes = { "bps", "kbps", "mbps", "gbps", "tbps", "pbps" };
|
||||
|
||||
private List<ZitiIdentity> identities {
|
||||
get {
|
||||
@@ -67,21 +69,18 @@ namespace ZitiTunneler {
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
private void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) {
|
||||
notifyIcon.Visible = false;
|
||||
notifyIcon.Icon.Dispose();
|
||||
notifyIcon.Dispose();
|
||||
}
|
||||
|
||||
private void SetCantDisplay()
|
||||
{
|
||||
private void SetCantDisplay() {
|
||||
NoServiceView.Visibility = Visibility.Visible;
|
||||
SetNotifyIcon("red");
|
||||
}
|
||||
|
||||
private void SetCanDisplay()
|
||||
{
|
||||
private void SetCanDisplay() {
|
||||
NoServiceView.Visibility = Visibility.Collapsed;
|
||||
SetNotifyIcon("green");
|
||||
}
|
||||
@@ -115,6 +114,7 @@ namespace ZitiTunneler {
|
||||
Application.Current.Properties.Add("ServiceClient", serviceClient);
|
||||
Application.Current.Properties.Add("Identities", new List<ZitiIdentity>());
|
||||
MainMenu.OnAttachmentChange += AttachmentChanged;
|
||||
IdentityMenu.OnError += IdentityMenu_OnError;
|
||||
|
||||
try {
|
||||
serviceClient.Connect();
|
||||
@@ -127,6 +127,10 @@ namespace ZitiTunneler {
|
||||
IdentityMenu.OnForgot += IdentityForgotten;
|
||||
}
|
||||
|
||||
private void IdentityMenu_OnError(string message) {
|
||||
ShowError("Identity Error", message);
|
||||
}
|
||||
|
||||
private void ServiceClient_OnClientConnected(object sender, object e) {
|
||||
this.Dispatcher.Invoke(() => {
|
||||
//e is _ALWAYS_ null at this time use this to display something if you want
|
||||
@@ -173,12 +177,22 @@ namespace ZitiTunneler {
|
||||
}
|
||||
}
|
||||
this.Dispatcher.Invoke(() => {
|
||||
DownloadSpeed.Content = (totalDown / 1000).ToString();
|
||||
UploadSpeed.Content = (totalUp / 1000).ToString();
|
||||
SetSpeed(totalUp, UploadSpeed, UploadSpeedLabel);
|
||||
SetSpeed(totalDown, DownloadSpeed, DownloadSpeedLabel);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public void SetSpeed(decimal bytes, Label speed, Label speedLabel) {
|
||||
int counter = 0;
|
||||
while (Math.Round(bytes / 1024) >= 1) {
|
||||
bytes = bytes / 1024;
|
||||
counter++;
|
||||
}
|
||||
speed.Content = speed.ToString();
|
||||
speedLabel.Content = suffixes[counter];
|
||||
}
|
||||
|
||||
private void ServiceClient_OnServiceEvent(object sender, ServiceEvent e) {
|
||||
if (e == null) return;
|
||||
|
||||
|
||||
+60
-4
@@ -11,11 +11,67 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ZitiTunneler", "ZitiTunneler\ZitiTunneler.csproj", "{FA4291EA-A97E-4854-959F-91EE7B330B37}"
|
||||
EndProject
|
||||
Project("{C7167F0D-BC9F-4E6E-AFE1-012C56B48DB5}") = "ZitiInstaller", "ZitiInstaller\ZitiInstaller.wapproj", "{520E523A-1E9B-4983-ABA9-0EB3B27B6420}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ZitiUpdateService", "ZitiUpdateService\ZitiUpdateService.csproj", "{9AB81609-F5DD-40A6-87B5-F3279D48514D}"
|
||||
EndProject
|
||||
Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "ZitiTunnelerSetup", "ZitiTunnelerSetup\ZitiTunnelerSetup.vdproj", "{6ABD9DF3-3298-4038-ABED-B16FFD5FF66D}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|ARM = Debug|ARM
|
||||
Debug|ARM64 = Debug|ARM64
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|ARM = Release|ARM
|
||||
Release|ARM64 = Release|ARM64
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{FA4291EA-A97E-4854-959F-91EE7B330B37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{FA4291EA-A97E-4854-959F-91EE7B330B37}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{FA4291EA-A97E-4854-959F-91EE7B330B37}.Debug|ARM.ActiveCfg = Debug|Any CPU
|
||||
{FA4291EA-A97E-4854-959F-91EE7B330B37}.Debug|ARM.Build.0 = Debug|Any CPU
|
||||
{FA4291EA-A97E-4854-959F-91EE7B330B37}.Debug|ARM64.ActiveCfg = Debug|Any CPU
|
||||
{FA4291EA-A97E-4854-959F-91EE7B330B37}.Debug|ARM64.Build.0 = Debug|Any CPU
|
||||
{FA4291EA-A97E-4854-959F-91EE7B330B37}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{FA4291EA-A97E-4854-959F-91EE7B330B37}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{FA4291EA-A97E-4854-959F-91EE7B330B37}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{FA4291EA-A97E-4854-959F-91EE7B330B37}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{FA4291EA-A97E-4854-959F-91EE7B330B37}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{FA4291EA-A97E-4854-959F-91EE7B330B37}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{FA4291EA-A97E-4854-959F-91EE7B330B37}.Release|ARM.ActiveCfg = Release|Any CPU
|
||||
{FA4291EA-A97E-4854-959F-91EE7B330B37}.Release|ARM.Build.0 = Release|Any CPU
|
||||
{FA4291EA-A97E-4854-959F-91EE7B330B37}.Release|ARM64.ActiveCfg = Release|Any CPU
|
||||
{FA4291EA-A97E-4854-959F-91EE7B330B37}.Release|ARM64.Build.0 = Release|Any CPU
|
||||
{FA4291EA-A97E-4854-959F-91EE7B330B37}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{FA4291EA-A97E-4854-959F-91EE7B330B37}.Release|x64.Build.0 = Release|Any CPU
|
||||
{FA4291EA-A97E-4854-959F-91EE7B330B37}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{FA4291EA-A97E-4854-959F-91EE7B330B37}.Release|x86.Build.0 = Release|Any CPU
|
||||
{9AB81609-F5DD-40A6-87B5-F3279D48514D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9AB81609-F5DD-40A6-87B5-F3279D48514D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9AB81609-F5DD-40A6-87B5-F3279D48514D}.Debug|ARM.ActiveCfg = Debug|Any CPU
|
||||
{9AB81609-F5DD-40A6-87B5-F3279D48514D}.Debug|ARM.Build.0 = Debug|Any CPU
|
||||
{9AB81609-F5DD-40A6-87B5-F3279D48514D}.Debug|ARM64.ActiveCfg = Debug|Any CPU
|
||||
{9AB81609-F5DD-40A6-87B5-F3279D48514D}.Debug|ARM64.Build.0 = Debug|Any CPU
|
||||
{9AB81609-F5DD-40A6-87B5-F3279D48514D}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{9AB81609-F5DD-40A6-87B5-F3279D48514D}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{9AB81609-F5DD-40A6-87B5-F3279D48514D}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{9AB81609-F5DD-40A6-87B5-F3279D48514D}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{9AB81609-F5DD-40A6-87B5-F3279D48514D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9AB81609-F5DD-40A6-87B5-F3279D48514D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{9AB81609-F5DD-40A6-87B5-F3279D48514D}.Release|ARM.ActiveCfg = Release|Any CPU
|
||||
{9AB81609-F5DD-40A6-87B5-F3279D48514D}.Release|ARM.Build.0 = Release|Any CPU
|
||||
{9AB81609-F5DD-40A6-87B5-F3279D48514D}.Release|ARM64.ActiveCfg = Release|Any CPU
|
||||
{9AB81609-F5DD-40A6-87B5-F3279D48514D}.Release|ARM64.Build.0 = Release|Any CPU
|
||||
{9AB81609-F5DD-40A6-87B5-F3279D48514D}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{9AB81609-F5DD-40A6-87B5-F3279D48514D}.Release|x64.Build.0 = Release|Any CPU
|
||||
{9AB81609-F5DD-40A6-87B5-F3279D48514D}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{9AB81609-F5DD-40A6-87B5-F3279D48514D}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {3E499EAC-C1BA-41A0-8076-D660F8ACC977}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
Reference in New Issue
Block a user