Merge pull request #15 from Crylia/feature/cleanup-code_document-code

Issue #5
This commit is contained in:
Kievits Rene
2021-08-06 12:39:12 +02:00
committed by GitHub
59 changed files with 476 additions and 829 deletions

Binary file not shown.

View File

@@ -4,6 +4,9 @@ using System.Net.Sockets;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Server_Dashboard_Socket { namespace Server_Dashboard_Socket {
/// <summary>
/// Basic echo server to test the socket connection
/// </summary>
public class EchoServer { public class EchoServer {
public void Start(int port = 9565) { public void Start(int port = 9565) {
IPEndPoint endPoint = new IPEndPoint(IPAddress.Loopback, port); IPEndPoint endPoint = new IPEndPoint(IPAddress.Loopback, port);

View File

@@ -356,6 +356,5 @@
</Setter.Value> </Setter.Value>
</Setter> </Setter>
</Style> </Style>
</Application.Resources> </Application.Resources>
</Application> </Application>

View File

@@ -4,6 +4,11 @@ using System.Text;
using System.Windows; using System.Windows;
namespace Server_Dashboard { namespace Server_Dashboard {
/// <summary>
/// Attached property base class
/// </summary>
/// <typeparam name="Parent"></typeparam>
/// <typeparam name="Property"></typeparam>
public abstract class BaseAttachedProperty<Parent, Property> public abstract class BaseAttachedProperty<Parent, Property>
where Parent : BaseAttachedProperty<Parent, Property>, new() { where Parent : BaseAttachedProperty<Parent, Property>, new() {
public event Action<DependencyObject, DependencyPropertyChangedEventArgs> ValueChanged = (sender, e) => { }; public event Action<DependencyObject, DependencyPropertyChangedEventArgs> ValueChanged = (sender, e) => { };

View File

@@ -5,8 +5,7 @@ using System.Text;
using System.Windows; using System.Windows;
using System.Windows.Documents; using System.Windows.Documents;
namespace Server_Dashboard namespace Server_Dashboard {
{
public static class HyperlinkExtensions { public static class HyperlinkExtensions {
public static bool GetIsExternal(DependencyObject obj) { public static bool GetIsExternal(DependencyObject obj) {
return (bool)obj.GetValue(IsExternalProperty); return (bool)obj.GetValue(IsExternalProperty);

View File

@@ -6,19 +6,12 @@
xmlns:local="clr-namespace:Server_Dashboard.Views.DashboardPages.ModuleCRUD" xmlns:local="clr-namespace:Server_Dashboard.Views.DashboardPages.ModuleCRUD"
xmlns:root="clr-namespace:Server_Dashboard" xmlns:i="http://schemas.microsoft.com/xaml/behaviors" xmlns:root="clr-namespace:Server_Dashboard" xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
d:DataContext="{d:DesignInstance Type=root:DashboardModuleViewModel}" d:DataContext="{d:DesignInstance Type=root:DashboardModuleViewModel}"
mc:Ignorable="d" mc:Ignorable="d" ResizeMode="NoResize" Height="700" Width="500" d:WindowStyle="None">
ResizeMode="NoResize"
Height="700"
Width="500"
d:WindowStyle="None"
>
<WindowChrome.WindowChrome> <WindowChrome.WindowChrome>
<WindowChrome CaptionHeight="0" ResizeBorderThickness="0"/> <WindowChrome CaptionHeight="0" ResizeBorderThickness="0"/>
</WindowChrome.WindowChrome> </WindowChrome.WindowChrome>
<Border <!--Create new Server Form-->
Width="500" <Border Width="500" Height="700">
Height="700"
>
<Border.Background> <Border.Background>
<SolidColorBrush Color="#2D2D2D" Opacity="1"/> <SolidColorBrush Color="#2D2D2D" Opacity="1"/>
</Border.Background> </Border.Background>
@@ -27,10 +20,8 @@
<RowDefinition Height="30"/> <RowDefinition Height="30"/>
<RowDefinition Height="*"/> <RowDefinition Height="*"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid <!--Title Bar-->
Background="{StaticResource BackgroundSurface_04dp}" <Grid Background="{StaticResource BackgroundSurface_04dp}" Grid.Row="0">
Grid.Row="0"
>
<i:Interaction.Triggers> <i:Interaction.Triggers>
<i:EventTrigger EventName="MouseDown"> <i:EventTrigger EventName="MouseDown">
<i:CallMethodAction MethodName="DragMove" TargetObject="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"/> <i:CallMethodAction MethodName="DragMove" TargetObject="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"/>
@@ -40,19 +31,8 @@
<ColumnDefinition/> <ColumnDefinition/>
<ColumnDefinition Width="40"/> <ColumnDefinition Width="40"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock <TextBlock Grid.Column="0" Text="Create a new Server" Margin="5 0 0 0" Foreground="{StaticResource DeepPurple_A100}" VerticalAlignment="Center"/>
Grid.Column="0" <Button Style="{StaticResource CloseButton}" Grid.Column="2" Content="✕" Cursor="Hand">
Text="Create a new Server"
Margin="5 0 0 0"
Foreground="{StaticResource DeepPurple_A100}"
VerticalAlignment="Center"
/>
<Button
Style="{StaticResource CloseButton}"
Grid.Column="2"
Content="✕"
Cursor="Hand"
>
<i:Interaction.Triggers> <i:Interaction.Triggers>
<i:EventTrigger EventName="Click"> <i:EventTrigger EventName="Click">
<i:CallMethodAction MethodName="Close" TargetObject="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"/> <i:CallMethodAction MethodName="Close" TargetObject="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"/>
@@ -60,11 +40,7 @@
</i:Interaction.Triggers> </i:Interaction.Triggers>
</Button> </Button>
</Grid> </Grid>
<Grid <Grid Background="{StaticResource BackgroundSurface_04dp}" Grid.Row="1" Margin="20">
Background="{StaticResource BackgroundSurface_04dp}"
Grid.Row="1"
Margin="20"
>
<Grid.Effect> <Grid.Effect>
<DropShadowEffect Direction="0" BlurRadius="5" ShadowDepth="0"/> <DropShadowEffect Direction="0" BlurRadius="5" ShadowDepth="0"/>
</Grid.Effect> </Grid.Effect>
@@ -76,192 +52,98 @@
<RowDefinition/> <RowDefinition/>
<RowDefinition/> <RowDefinition/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<!--Server Name-->
<StackPanel VerticalAlignment="Center" Grid.Row="0" Margin="20 0 20 0"> <StackPanel VerticalAlignment="Center" Grid.Row="0" Margin="20 0 20 0">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock <TextBlock Text="Server Name" FontSize="24" Margin="0 0 0 5">
Text="Server Name"
FontSize="24"
Margin="0 0 0 5"
>
<TextBlock.Foreground> <TextBlock.Foreground>
<SolidColorBrush Color="White" Opacity="0.87"/> <SolidColorBrush Color="White" Opacity="0.87"/>
</TextBlock.Foreground> </TextBlock.Foreground>
</TextBlock> </TextBlock>
<TextBlock <TextBlock Text="*" Foreground="{StaticResource ErrorRed}" FontSize="20"/>
Text="*"
Foreground="{StaticResource ErrorRed}"
FontSize="20"
/>
</StackPanel> </StackPanel>
<Grid> <Grid>
<Grid.Effect> <Grid.Effect>
<DropShadowEffect Direction="0" BlurRadius="5" ShadowDepth="0"/> <DropShadowEffect Direction="0" BlurRadius="5" ShadowDepth="0"/>
</Grid.Effect> </Grid.Effect>
<TextBox <TextBox Text="{Binding ServerName}" Grid.Column="1" Height="40" FontSize="20" x:Name="ServerName"/>
Text="{Binding ServerName}" <TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Text="My Awesome Server" FontSize="20" Visibility="{Binding ElementName=ServerName, Path=Text.IsEmpty, Converter={StaticResource UserNameVisibillity}}" Grid.Column="1" IsHitTestVisible="False" Margin="5 0 0 0">
Grid.Column="1"
Height="40"
FontSize="20"
x:Name="ServerName"
/>
<TextBlock
VerticalAlignment="Center"
HorizontalAlignment="Left"
Text="My Awesome Server"
FontSize="20"
Visibility="{Binding ElementName=ServerName, Path=Text.IsEmpty, Converter={StaticResource UserNameVisibillity}}"
Grid.Column="1"
IsHitTestVisible="False"
Margin="5 0 0 0"
>
<TextBlock.Foreground> <TextBlock.Foreground>
<SolidColorBrush Color="White" Opacity="0.12"/> <SolidColorBrush Color="White" Opacity="0.12"/>
</TextBlock.Foreground> </TextBlock.Foreground>
</TextBlock> </TextBlock>
</Grid> </Grid>
</StackPanel> </StackPanel>
<!--Password-->
<StackPanel VerticalAlignment="Center" Grid.Row="1" Margin="20 0 20 0"> <StackPanel VerticalAlignment="Center" Grid.Row="1" Margin="20 0 20 0">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock <TextBlock Text="Password" FontSize="24" Margin="0 0 0 5">
Text="Password"
FontSize="24"
Margin="0 0 0 5"
>
<TextBlock.Foreground> <TextBlock.Foreground>
<SolidColorBrush Color="White" Opacity="0.87"/> <SolidColorBrush Color="White" Opacity="0.87"/>
</TextBlock.Foreground> </TextBlock.Foreground>
</TextBlock> </TextBlock>
<TextBlock <TextBlock Text="*" Foreground="{StaticResource ErrorRed}" FontSize="20"/>
Text="*"
Foreground="{StaticResource ErrorRed}"
FontSize="20"
/>
</StackPanel> </StackPanel>
<Grid> <Grid>
<Grid.Effect> <Grid.Effect>
<DropShadowEffect Direction="0" BlurRadius="5" ShadowDepth="0"/> <DropShadowEffect Direction="0" BlurRadius="5" ShadowDepth="0"/>
</Grid.Effect> </Grid.Effect>
<PasswordBox <PasswordBox Width="420" VerticalAlignment="Center" HorizontalAlignment="Left" root:MonitorPasswordProperty.Value="True" Grid.Column="1" FontSize="20" x:Name="Password" Height="40">
Width="420"
VerticalAlignment="Center"
HorizontalAlignment="Left"
root:MonitorPasswordProperty.Value="True"
Grid.Column="1"
FontSize="20"
x:Name="Password"
Height="40"
>
</PasswordBox> </PasswordBox>
<TextBlock <TextBlock Visibility="{Binding ElementName=Password, Path=(root:HasTextProperty.Value), Converter={StaticResource UserNameVisibillity}}" x:Name="PasswordHint" Text="********" Grid.Column="1" IsHitTestVisible="False" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5 0 0 0" FontSize="20">
Visibility="{Binding ElementName=Password, Path=(root:HasTextProperty.Value), Converter={StaticResource UserNameVisibillity}}" x:Name="PasswordHint"
Text="********"
Grid.Column="1"
IsHitTestVisible="False"
VerticalAlignment="Center"
HorizontalAlignment="Left"
Margin="5 0 0 0"
FontSize="20"
>
<TextBlock.Foreground> <TextBlock.Foreground>
<SolidColorBrush Color="White" Opacity="0.12"/> <SolidColorBrush Color="White" Opacity="0.12"/>
</TextBlock.Foreground> </TextBlock.Foreground>
</TextBlock> </TextBlock>
</Grid> </Grid>
</StackPanel> </StackPanel>
<!--Username-->
<StackPanel VerticalAlignment="Center" Grid.Row="2" Margin="20 0 20 0"> <StackPanel VerticalAlignment="Center" Grid.Row="2" Margin="20 0 20 0">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock <TextBlock Text="Username" FontSize="24" Margin="0 0 0 5">
Text="Username"
FontSize="24"
Margin="0 0 0 5"
>
<TextBlock.Foreground> <TextBlock.Foreground>
<SolidColorBrush Color="White" Opacity="0.87"/> <SolidColorBrush Color="White" Opacity="0.87"/>
</TextBlock.Foreground> </TextBlock.Foreground>
</TextBlock> </TextBlock>
<TextBlock <TextBlock Text="*" Foreground="{StaticResource ErrorRed}" FontSize="16"/>
Text="*"
Foreground="{StaticResource ErrorRed}"
FontSize="16"
/>
</StackPanel> </StackPanel>
<Grid> <Grid>
<Grid.Effect> <Grid.Effect>
<DropShadowEffect Direction="0" BlurRadius="5" ShadowDepth="0"/> <DropShadowEffect Direction="0" BlurRadius="5" ShadowDepth="0"/>
</Grid.Effect> </Grid.Effect>
<TextBox <TextBox Text="{Binding Username}" Grid.Column="1" Height="40" FontSize="20" x:Name="UserName"/>
Text="{Binding Username}" <TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Text="Name" FontSize="20" Visibility="{Binding ElementName=UserName, Path=Text.IsEmpty, Converter={StaticResource UserNameVisibillity}}" Grid.Column="1" IsHitTestVisible="False" Margin="5 0 0 0">
Grid.Column="1"
Height="40"
FontSize="20"
x:Name="UserName"
/>
<TextBlock
VerticalAlignment="Center"
HorizontalAlignment="Left"
Text="Name"
FontSize="20"
Visibility="{Binding ElementName=UserName, Path=Text.IsEmpty, Converter={StaticResource UserNameVisibillity}}"
Grid.Column="1"
IsHitTestVisible="False"
Margin="5 0 0 0"
>
<TextBlock.Foreground> <TextBlock.Foreground>
<SolidColorBrush Color="White" Opacity="0.12"/> <SolidColorBrush Color="White" Opacity="0.12"/>
</TextBlock.Foreground> </TextBlock.Foreground>
</TextBlock> </TextBlock>
</Grid> </Grid>
</StackPanel> </StackPanel>
<!--IP Adress-->
<StackPanel VerticalAlignment="Center" Grid.Row="3" Margin="20 0 20 0"> <StackPanel VerticalAlignment="Center" Grid.Row="3" Margin="20 0 20 0">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock <TextBlock Text="IP Adress" FontSize="24" Margin="0 0 0 5">
Text="IP Adress"
FontSize="24"
Margin="0 0 0 5"
>
<TextBlock.Foreground> <TextBlock.Foreground>
<SolidColorBrush Color="White" Opacity="0.87"/> <SolidColorBrush Color="White" Opacity="0.87"/>
</TextBlock.Foreground> </TextBlock.Foreground>
</TextBlock> </TextBlock>
<TextBlock <TextBlock Text="*" Foreground="{StaticResource ErrorRed}" FontSize="16"/>
Text="*"
Foreground="{StaticResource ErrorRed}"
FontSize="16"
/>
</StackPanel> </StackPanel>
<Grid> <Grid>
<Grid.Effect> <Grid.Effect>
<DropShadowEffect Direction="0" BlurRadius="5" ShadowDepth="0"/> <DropShadowEffect Direction="0" BlurRadius="5" ShadowDepth="0"/>
</Grid.Effect> </Grid.Effect>
<TextBox <TextBox Text="{Binding IPAdress}" Grid.Column="1" Height="40" FontSize="20" x:Name="IPAdress"/>
Text="{Binding IPAdress}" <TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Text="sample.ssh.com" FontSize="20" Visibility="{Binding ElementName=IPAdress, Path=Text.IsEmpty, Converter={StaticResource UserNameVisibillity}}" Grid.Column="1" IsHitTestVisible="False" Margin="5 0 0 0">
Grid.Column="1"
Height="40"
FontSize="20"
x:Name="IPAdress"
/>
<TextBlock
VerticalAlignment="Center"
HorizontalAlignment="Left"
Text="sample.ssh.com"
FontSize="20"
Visibility="{Binding ElementName=IPAdress, Path=Text.IsEmpty, Converter={StaticResource UserNameVisibillity}}"
Grid.Column="1"
IsHitTestVisible="False"
Margin="5 0 0 0"
>
<TextBlock.Foreground> <TextBlock.Foreground>
<SolidColorBrush Color="White" Opacity="0.12"/> <SolidColorBrush Color="White" Opacity="0.12"/>
</TextBlock.Foreground> </TextBlock.Foreground>
</TextBlock> </TextBlock>
</Grid> </Grid>
</StackPanel> </StackPanel>
<!--Port-->
<StackPanel VerticalAlignment="Center" Grid.Row="4" Margin="20 0 20 0"> <StackPanel VerticalAlignment="Center" Grid.Row="4" Margin="20 0 20 0">
<TextBlock <TextBlock Text="Port" FontSize="24" Margin="0 0 0 5">
Text="Port"
FontSize="24"
Margin="0 0 0 5"
>
<TextBlock.Foreground> <TextBlock.Foreground>
<SolidColorBrush Color="White" Opacity="0.87"/> <SolidColorBrush Color="White" Opacity="0.87"/>
</TextBlock.Foreground> </TextBlock.Foreground>
@@ -270,38 +152,16 @@
<Grid.Effect> <Grid.Effect>
<DropShadowEffect Direction="0" BlurRadius="5" ShadowDepth="0"/> <DropShadowEffect Direction="0" BlurRadius="5" ShadowDepth="0"/>
</Grid.Effect> </Grid.Effect>
<TextBox <TextBox Text="{Binding Port}" Grid.Column="1" Height="40" FontSize="20" x:Name="Port"/>
Text="{Binding Port}" <TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Text="22" FontSize="20" Visibility="{Binding ElementName=Port, Path=Text.IsEmpty, Converter={StaticResource UserNameVisibillity}}" Grid.Column="1" IsHitTestVisible="False" Margin="5 0 0 0">
Grid.Column="1"
Height="40"
FontSize="20"
x:Name="Port"
/>
<TextBlock
VerticalAlignment="Center"
HorizontalAlignment="Left"
Text="22"
FontSize="20"
Visibility="{Binding ElementName=Port, Path=Text.IsEmpty, Converter={StaticResource UserNameVisibillity}}"
Grid.Column="1"
IsHitTestVisible="False"
Margin="5 0 0 0"
>
<TextBlock.Foreground> <TextBlock.Foreground>
<SolidColorBrush Color="White" Opacity="0.12"/> <SolidColorBrush Color="White" Opacity="0.12"/>
</TextBlock.Foreground> </TextBlock.Foreground>
</TextBlock> </TextBlock>
</Grid> </Grid>
</StackPanel> </StackPanel>
<Button <!--Create Module button-->
Height="60" <Button Height="60" Width="350" Command="{Binding CreateModuleCommand}" CommandParameter="{Binding ElementName=CREATE_MODULE}" Grid.Row="5" Content="CREATE MODULE" Grid.ColumnSpan="2"/>
Width="350"
Command="{Binding CreateModuleCommand}"
CommandParameter="{Binding ElementName=CREATE_MODULE}"
Grid.Row="5"
Content="CREATE MODULE"
Grid.ColumnSpan="2"
/>
</Grid> </Grid>
</Grid> </Grid>
</Border> </Border>

View File

@@ -12,83 +12,13 @@
<UserControl.Resources> <UserControl.Resources>
<root:ValueToAngleConverter x:Key="valueToAngle"/> <root:ValueToAngleConverter x:Key="valueToAngle"/>
</UserControl.Resources> </UserControl.Resources>
<!--Circular Prograss bar-->
<Grid> <Grid>
<Ellipse <Ellipse x:Name="Background" Fill="{Binding ElementName=_this, Path=BackgroundBrush}" Margin="0" Stroke="{Binding ElementName=_this, Path=BackgroundBrush}"/>
x:Name="Background" <ed:Arc ArcThickness="8" ArcThicknessUnit="Pixel" EndAngle="{Binding Converter={StaticResource valueToAngle}, ElementName=_this, Path=ValueRead}" Fill="{Binding ElementName=_this, Path=ReadIndicatorBrush}" Stretch="None" StartAngle="0"/>
<Ellipse x:Name="Seperator" Fill="Transparent" Margin="7" Stroke="{Binding ElementName=_this, Path=ProgressBorderBrush}" Panel.ZIndex="1"/>
Fill="{Binding <Ellipse x:Name="Seperator2" Fill="Transparent" Margin="8" Stroke="{Binding ElementName=_this, Path=ProgressBorderBrush}" Panel.ZIndex="1"/>
ElementName=_this, <ed:Arc Margin="8" ArcThickness="8" ArcThicknessUnit="Pixel" EndAngle="{Binding Converter={StaticResource valueToAngle}, ElementName=_this, Path=ValueWrite}" Fill="{Binding ElementName=_this, Path=WriteIndicatorBrush}" Stretch="None" StartAngle="0"/>
Path=BackgroundBrush <Ellipse x:Name="Border" Fill="{Binding ElementName=_this, Path=ProgressBorderBrush}" Margin="16" Stroke="{Binding ElementName=_this, Path=ProgressBorderBrush}"/>
}"
Margin="0"
Stroke="{Binding
ElementName=_this,
Path=BackgroundBrush
}"
/>
<ed:Arc
ArcThickness="8"
ArcThicknessUnit="Pixel"
EndAngle="{Binding
Converter={StaticResource valueToAngle},
ElementName=_this,
Path=ValueRead
}"
Fill="{Binding
ElementName=_this,
Path=ReadIndicatorBrush
}"
Stretch="None"
StartAngle="0"
/>
<Ellipse
x:Name="Seperator"
Fill="Transparent"
Margin="7"
Stroke="{Binding
ElementName=_this,
Path=ProgressBorderBrush
}"
Panel.ZIndex="1"
/>
<Ellipse
x:Name="Seperator2"
Fill="Transparent"
Margin="8"
Stroke="{Binding
ElementName=_this,
Path=ProgressBorderBrush
}"
Panel.ZIndex="1"
/>
<ed:Arc
Margin="8"
ArcThickness="8"
ArcThicknessUnit="Pixel"
EndAngle="{Binding
Converter={StaticResource valueToAngle},
ElementName=_this,
Path=ValueWrite
}"
Fill="{Binding
ElementName=_this,
Path=WriteIndicatorBrush
}"
Stretch="None"
StartAngle="0"
/>
<Ellipse
x:Name="Border"
Fill="{Binding
ElementName=_this,
Path=ProgressBorderBrush
}"
Margin="16"
Stroke="{Binding
ElementName=_this,
Path=ProgressBorderBrush
}"
/>
</Grid> </Grid>
</UserControl> </UserControl>

View File

@@ -13,37 +13,47 @@ using System.Windows.Navigation;
using System.Windows.Shapes; using System.Windows.Shapes;
namespace Server_Dashboard.Controls.DoubleRoundProgressBar { namespace Server_Dashboard.Controls.DoubleRoundProgressBar {
/// <summary>
/// DependencyProperties
/// </summary>
public partial class DoubleRoundProgressBar : UserControl { public partial class DoubleRoundProgressBar : UserControl {
//Property for the ReadIndicatorBrush
public static DependencyProperty ReadIndicatorBrushProperty = DependencyProperty.Register("ReadIndicatorBrush", typeof(Brush), typeof(DoubleRoundProgressBar)); public static DependencyProperty ReadIndicatorBrushProperty = DependencyProperty.Register("ReadIndicatorBrush", typeof(Brush), typeof(DoubleRoundProgressBar));
public Brush ReadIndicatorBrush { public Brush ReadIndicatorBrush {
get { return (Brush)GetValue(ReadIndicatorBrushProperty); } get { return (Brush)GetValue(ReadIndicatorBrushProperty); }
set { SetValue(ReadIndicatorBrushProperty, value); } set { SetValue(ReadIndicatorBrushProperty, value); }
} }
//Property for the WriteIndicatorBrush
public static DependencyProperty WriteIndicatorBrushProperty = DependencyProperty.Register("WriteIndicatorBrush", typeof(Brush), typeof(DoubleRoundProgressBar)); public static DependencyProperty WriteIndicatorBrushProperty = DependencyProperty.Register("WriteIndicatorBrush", typeof(Brush), typeof(DoubleRoundProgressBar));
public Brush WriteIndicatorBrush { public Brush WriteIndicatorBrush {
get { return (Brush)GetValue(WriteIndicatorBrushProperty); } get { return (Brush)GetValue(WriteIndicatorBrushProperty); }
set { SetValue(WriteIndicatorBrushProperty, value); } set { SetValue(WriteIndicatorBrushProperty, value); }
} }
//Property for the BackgroundBrush
public static DependencyProperty BackgroundBrushProperty = DependencyProperty.Register("BackgroundBrush", typeof(Brush), typeof(DoubleRoundProgressBar)); public static DependencyProperty BackgroundBrushProperty = DependencyProperty.Register("BackgroundBrush", typeof(Brush), typeof(DoubleRoundProgressBar));
public Brush BackgroundBrush { public Brush BackgroundBrush {
get { return (Brush)GetValue(BackgroundBrushProperty); } get { return (Brush)GetValue(BackgroundBrushProperty); }
set { SetValue(BackgroundBrushProperty, value); } set { SetValue(BackgroundBrushProperty, value); }
} }
//Property for the ProgressBorderBrush
public static DependencyProperty ProgressBorderBrushProperty = DependencyProperty.Register("ProgressBorderBrush", typeof(Brush), typeof(DoubleRoundProgressBar)); public static DependencyProperty ProgressBorderBrushProperty = DependencyProperty.Register("ProgressBorderBrush", typeof(Brush), typeof(DoubleRoundProgressBar));
public Brush ProgressBorderBrush { public Brush ProgressBorderBrush {
get { return (Brush)GetValue(ProgressBorderBrushProperty); } get { return (Brush)GetValue(ProgressBorderBrushProperty); }
set { SetValue(ProgressBorderBrushProperty, value); } set { SetValue(ProgressBorderBrushProperty, value); }
} }
//Property for the Value Write
public static DependencyProperty ValueWriteProperty = DependencyProperty.Register("ValueWrite", typeof(int), typeof(DoubleRoundProgressBar)); public static DependencyProperty ValueWriteProperty = DependencyProperty.Register("ValueWrite", typeof(int), typeof(DoubleRoundProgressBar));
public int ValueWrite { public int ValueWrite {
get { return (int)GetValue(ValueWriteProperty); } get { return (int)GetValue(ValueWriteProperty); }
set { SetValue(ValueWriteProperty, value); } set { SetValue(ValueWriteProperty, value); }
} }
//Property for the Value Read
public static DependencyProperty ValueReadProperty = DependencyProperty.Register("ValueRead", typeof(int), typeof(DoubleRoundProgressBar)); public static DependencyProperty ValueReadProperty = DependencyProperty.Register("ValueRead", typeof(int), typeof(DoubleRoundProgressBar));
public int ValueRead { public int ValueRead {
get { return (int)GetValue(ValueReadProperty); } get { return (int)GetValue(ValueReadProperty); }

View File

@@ -6,52 +6,14 @@
xmlns:local="clr-namespace:Server_Dashboard.Controls.HalfRoundProgressBar" xmlns:local="clr-namespace:Server_Dashboard.Controls.HalfRoundProgressBar"
xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing" xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing"
xmlns:root="clr-namespace:Server_Dashboard" xmlns:root="clr-namespace:Server_Dashboard"
mc:Ignorable="d" mc:Ignorable="d" x:Name="_this" d:DesignHeight="50" d:DesignWidth="50">
x:Name="_this"
d:DesignHeight="50" d:DesignWidth="50">
<UserControl.Resources> <UserControl.Resources>
<root:ValueToAngleConverter x:Key="valueToAngle"/> <root:ValueToAngleConverter x:Key="valueToAngle"/>
</UserControl.Resources> </UserControl.Resources>
<!--Progress bar but just half round-->
<Grid> <Grid>
<Ellipse <Ellipse x:Name="Background" Fill="{Binding ElementName=_this, Path=BackgroundBrush}" Margin="0" Stroke="{Binding ElementName=_this, Path=BackgroundBrush}"/>
x:Name="Background" <ed:Arc ArcThickness="8" ArcThicknessUnit="Pixel" EndAngle="{Binding Converter={StaticResource valueToAngle}, ElementName=_this, Path=Value}" Fill="{Binding ElementName=_this, Path=IndicatorBrush}" Stretch="None" StartAngle="0"/>
Fill="{Binding <Ellipse x:Name="Border" Fill="{Binding ElementName=_this, Path=ProgressBorderBrush}" Margin="8" Stroke="{Binding ElementName=_this, Path=ProgressBorderBrush}"/>
ElementName=_this,
Path=BackgroundBrush
}"
Margin="0"
Stroke="{Binding
ElementName=_this,
Path=BackgroundBrush
}"
/>
<ed:Arc
ArcThickness="8"
ArcThicknessUnit="Pixel"
EndAngle="{Binding
Converter={StaticResource valueToAngle},
ElementName=_this,
Path=Value
}"
Fill="{Binding
ElementName=_this,
Path=IndicatorBrush
}"
Stretch="None"
StartAngle="0"
/>
<Ellipse
x:Name="Border"
Fill="{Binding
ElementName=_this,
Path=ProgressBorderBrush
}"
Margin="8"
Stroke="{Binding
ElementName=_this,
Path=ProgressBorderBrush
}"
/>
</Grid> </Grid>
</UserControl> </UserControl>

View File

@@ -13,26 +13,33 @@ using System.Windows.Navigation;
using System.Windows.Shapes; using System.Windows.Shapes;
namespace Server_Dashboard.Controls.HalfRoundProgressBar { namespace Server_Dashboard.Controls.HalfRoundProgressBar {
/// <summary>
/// Dependency Properties
/// </summary>
public partial class HalfRoundProgressBar : UserControl { public partial class HalfRoundProgressBar : UserControl {
//Indicator Brush Property
public static DependencyProperty IndicatorBrushProperty = DependencyProperty.Register("IndicatorBrush", typeof(Brush), typeof(HalfRoundProgressBar)); public static DependencyProperty IndicatorBrushProperty = DependencyProperty.Register("IndicatorBrush", typeof(Brush), typeof(HalfRoundProgressBar));
public Brush IndicatorBrush { public Brush IndicatorBrush {
get { return (Brush)GetValue(IndicatorBrushProperty); } get { return (Brush)GetValue(IndicatorBrushProperty); }
set { SetValue(IndicatorBrushProperty, value); } set { SetValue(IndicatorBrushProperty, value); }
} }
//Background Brush Property
public static DependencyProperty BackgroundBrushProperty = DependencyProperty.Register("BackgroundBrush", typeof(Brush), typeof(HalfRoundProgressBar)); public static DependencyProperty BackgroundBrushProperty = DependencyProperty.Register("BackgroundBrush", typeof(Brush), typeof(HalfRoundProgressBar));
public Brush BackgroundBrush { public Brush BackgroundBrush {
get { return (Brush)GetValue(BackgroundBrushProperty); } get { return (Brush)GetValue(BackgroundBrushProperty); }
set { SetValue(BackgroundBrushProperty, value); } set { SetValue(BackgroundBrushProperty, value); }
} }
//ProgressBorder Property
public static DependencyProperty ProgressBorderBrushProperty = DependencyProperty.Register("ProgressBorderBrush", typeof(Brush), typeof(HalfRoundProgressBar)); public static DependencyProperty ProgressBorderBrushProperty = DependencyProperty.Register("ProgressBorderBrush", typeof(Brush), typeof(HalfRoundProgressBar));
public Brush ProgressBorderBrush { public Brush ProgressBorderBrush {
get { return (Brush)GetValue(ProgressBorderBrushProperty); } get { return (Brush)GetValue(ProgressBorderBrushProperty); }
set { SetValue(ProgressBorderBrushProperty, value); } set { SetValue(ProgressBorderBrushProperty, value); }
} }
//Value
public static DependencyProperty ValueProperty = DependencyProperty.Register("Value", typeof(int), typeof(HalfRoundProgressBar)); public static DependencyProperty ValueProperty = DependencyProperty.Register("Value", typeof(int), typeof(HalfRoundProgressBar));
public int Value { public int Value {
get { return (int)GetValue(ValueProperty); } get { return (int)GetValue(ValueProperty); }

View File

@@ -5,50 +5,27 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Server_Dashboard.Controls" xmlns:local="clr-namespace:Server_Dashboard.Controls"
mc:Ignorable="d" mc:Ignorable="d">
> <!--The Loading indicator circle-->
<Grid DataContext="{Binding RelativeSource={RelativeSource Self}}"> <Grid DataContext="{Binding RelativeSource={RelativeSource Self}}">
<Path <Path Stroke="Transparent" StrokeThickness=".5" RenderTransformOrigin=".5,.5" Width="60" Height="60">
Stroke="Transparent"
StrokeThickness=".5"
RenderTransformOrigin=".5,.5"
Width="60"
Height="60"
>
<Path.Effect> <Path.Effect>
<DropShadowEffect BlurRadius="5" ShadowDepth="0" Opacity="1" Color="#B388FF"/> <DropShadowEffect BlurRadius="5" ShadowDepth="0" Opacity="1" Color="#B388FF"/>
</Path.Effect> </Path.Effect>
<Path.Data> <Path.Data>
<CombinedGeometry <CombinedGeometry GeometryCombineMode="Xor">
GeometryCombineMode="Xor"
>
<CombinedGeometry.Geometry1> <CombinedGeometry.Geometry1>
<EllipseGeometry <EllipseGeometry RadiusX="30" RadiusY="30" Center="30,30"/>
RadiusX="30"
RadiusY="30"
Center="30,30"
/>
</CombinedGeometry.Geometry1> </CombinedGeometry.Geometry1>
<CombinedGeometry.Geometry2> <CombinedGeometry.Geometry2>
<EllipseGeometry <EllipseGeometry RadiusX="24" RadiusY="24" Center="30,30"/>
RadiusX="24"
RadiusY="24"
Center="30,30"
/>
</CombinedGeometry.Geometry2> </CombinedGeometry.Geometry2>
</CombinedGeometry> </CombinedGeometry>
</Path.Data> </Path.Data>
<Path.Fill> <Path.Fill>
<LinearGradientBrush <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
StartPoint="0,0" <GradientStop Color="#B388FF" Offset="0"/>
EndPoint="1,1" <GradientStop Color="#A7FFEB" Offset="1"/>
>
<GradientStop
Color="#B388FF" Offset="0"
/>
<GradientStop
Color="#A7FFEB" Offset="1"
/>
</LinearGradientBrush> </LinearGradientBrush>
</Path.Fill> </Path.Fill>
<Path.RenderTransform> <Path.RenderTransform>
@@ -56,17 +33,10 @@
<!--This is necessary for the animation not to stop--> <!--This is necessary for the animation not to stop-->
</Path.RenderTransform> </Path.RenderTransform>
<Path.Triggers> <Path.Triggers>
<EventTrigger <EventTrigger RoutedEvent="Loaded">
RoutedEvent="Loaded"
>
<BeginStoryboard> <BeginStoryboard>
<Storyboard> <Storyboard>
<DoubleAnimation <DoubleAnimation Storyboard.TargetProperty="(Rectangle.RenderTransform).(RotateTransform.Angle)" To="360" Duration="0:0:.8" RepeatBehavior="Forever"/>
Storyboard.TargetProperty="(Rectangle.RenderTransform).(RotateTransform.Angle)"
To="360"
Duration="0:0:.8"
RepeatBehavior="Forever"
/>
</Storyboard> </Storyboard>
</BeginStoryboard> </BeginStoryboard>
</EventTrigger> </EventTrigger>

View File

@@ -5,8 +5,8 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Server_Dashboard.Controls.ServerModules" xmlns:local="clr-namespace:Server_Dashboard.Controls.ServerModules"
xmlns:halfroundprogressbar="clr-namespace:Server_Dashboard.Controls.HalfRoundProgressBar" xmlns:halfroundprogressbar="clr-namespace:Server_Dashboard.Controls.HalfRoundProgressBar"
xmlns:doubleroundprogressbar="clr-namespace:Server_Dashboard.Controls.DoubleRoundProgressBar" xmlns:doubleroundprogressbar="clr-namespace:Server_Dashboard.Controls.DoubleRoundProgressBar" mc:Ignorable="d">
mc:Ignorable="d"> <!--Module-->
<Border Background="{StaticResource BackgroundSurface_02dp}" MinHeight="100" MinWidth="300" Width="Auto" Height="Auto" Margin="10" CornerRadius="5"> <Border Background="{StaticResource BackgroundSurface_02dp}" MinHeight="100" MinWidth="300" Width="Auto" Height="Auto" Margin="10" CornerRadius="5">
<Border.Effect> <Border.Effect>
<DropShadowEffect BlurRadius="5" ShadowDepth="0"/> <DropShadowEffect BlurRadius="5" ShadowDepth="0"/>
@@ -16,11 +16,8 @@
<RowDefinition Height="40"/> <RowDefinition Height="40"/>
<RowDefinition Height="*"/> <RowDefinition Height="*"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Border <!--Top Bar-->
CornerRadius="5 5 0 0" <Border CornerRadius="5 5 0 0" Grid.Row="0" Background="{StaticResource BackgroundSurface_08dp}" >
Grid.Row="0"
Background="{StaticResource BackgroundSurface_08dp}"
>
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
@@ -48,11 +45,13 @@
</Border> </Border>
</Grid> </Grid>
</Border> </Border>
<!--Main Content-->
<Grid Grid.Row="2" Margin="20" Width="Auto"> <Grid Grid.Row="2" Margin="20" Width="Auto">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="1.5*"/> <ColumnDefinition Width="1.5*"/>
<ColumnDefinition/> <ColumnDefinition/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<!--Information pannel, left-->
<Grid Grid.Row="1" Margin="0 0 25 0"> <Grid Grid.Row="1" Margin="0 0 25 0">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
@@ -133,6 +132,7 @@
</TextBlock> </TextBlock>
</StackPanel> </StackPanel>
</Grid> </Grid>
<!--Graphical Indicators Right-->
<Grid Grid.Row="1" Grid.Column="1"> <Grid Grid.Row="1" Grid.Column="1">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition/> <ColumnDefinition/>
@@ -143,117 +143,25 @@
<RowDefinition/> <RowDefinition/>
<RowDefinition/> <RowDefinition/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<halfroundprogressbar:HalfRoundProgressBar <halfroundprogressbar:HalfRoundProgressBar Margin="5" Grid.Row="0" ProgressBorderBrush="{StaticResource BackgroundSurface_02dp}" BackgroundBrush="{StaticResource BackgroundSurface_08dp}" Height="100" Width="100" Value="{Binding ServerInfo.CpuUsage}" IndicatorBrush="{StaticResource Teal_A100}"/>
Margin="5" <TextBlock Foreground="{StaticResource Teal_A100}" Grid.Row="0" Text="CPU" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18"/>
Grid.Row="0" <halfroundprogressbar:HalfRoundProgressBar Margin="5" Grid.Row="1" ProgressBorderBrush="{StaticResource BackgroundSurface_02dp}" BackgroundBrush="{StaticResource BackgroundSurface_08dp}" Height="100" Width="100" Value="{Binding ServerInfo.GpuUsage}" IndicatorBrush="{StaticResource Teal_A100}"/>
ProgressBorderBrush="{StaticResource BackgroundSurface_02dp}" <TextBlock Foreground="{StaticResource Teal_A100}" Grid.Row="1" Text="GPU" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18"/>
BackgroundBrush="{StaticResource BackgroundSurface_08dp}"
Height="100"
Width="100"
Value="{Binding ServerInfo.CpuUsage}"
IndicatorBrush="{StaticResource Teal_A100}"
/>
<TextBlock
Foreground="{StaticResource Teal_A100}"
Grid.Row="0"
Text="CPU"
VerticalAlignment="Center"
HorizontalAlignment="Center"
FontSize="18"
/>
<halfroundprogressbar:HalfRoundProgressBar
Margin="5"
Grid.Row="1"
ProgressBorderBrush="{StaticResource BackgroundSurface_02dp}"
BackgroundBrush="{StaticResource BackgroundSurface_08dp}"
Height="100"
Width="100"
Value="{Binding ServerInfo.GpuUsage}"
IndicatorBrush="{StaticResource Teal_A100}"
/>
<TextBlock
Foreground="{StaticResource Teal_A100}"
Grid.Row="1"
Text="GPU"
VerticalAlignment="Center"
HorizontalAlignment="Center"
FontSize="18"
/>
</Grid> </Grid>
<Grid Grid.Column="1"> <Grid Grid.Column="1">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition/> <RowDefinition/>
<RowDefinition/> <RowDefinition/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<doubleroundprogressbar:DoubleRoundProgressBar <doubleroundprogressbar:DoubleRoundProgressBar ValueRead="70" ValueWrite="60" ReadIndicatorBrush="{StaticResource DeepPurple_A100}" WriteIndicatorBrush="{StaticResource Teal_A100}" Margin="5" Grid.Row="0" ProgressBorderBrush="{StaticResource BackgroundSurface_02dp}" BackgroundBrush="{StaticResource BackgroundSurface_08dp}" Height="100" Width="100"/>
ValueRead="70" <StackPanel Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center">
ValueWrite="60" <TextBlock Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18" TextAlignment="Center" Text="Read" Foreground="{StaticResource DeepPurple_A100}"/>
ReadIndicatorBrush="{StaticResource DeepPurple_A100}" <TextBlock Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18" TextAlignment="Center" Text="Write" Foreground="{StaticResource Teal_A100}"/>
WriteIndicatorBrush="{StaticResource Teal_A100}"
Margin="5"
Grid.Row="0"
ProgressBorderBrush="{StaticResource BackgroundSurface_02dp}"
BackgroundBrush="{StaticResource BackgroundSurface_08dp}"
Height="100"
Width="100"
/>
<StackPanel
Grid.Row="0"
VerticalAlignment="Center"
HorizontalAlignment="Center">
<TextBlock
Grid.Row="0"
VerticalAlignment="Center"
HorizontalAlignment="Center"
FontSize="18"
TextAlignment="Center"
Text="Read"
Foreground="{StaticResource DeepPurple_A100}"
/>
<TextBlock
Grid.Row="0"
VerticalAlignment="Center"
HorizontalAlignment="Center"
FontSize="18"
TextAlignment="Center"
Text="Write"
Foreground="{StaticResource Teal_A100}"
/>
</StackPanel> </StackPanel>
<doubleroundprogressbar:DoubleRoundProgressBar <doubleroundprogressbar:DoubleRoundProgressBar ValueRead="70" ValueWrite="60" ReadIndicatorBrush="{StaticResource DeepPurple_A100}" WriteIndicatorBrush="{StaticResource Teal_A100}" Margin="5" Grid.Row="1" ProgressBorderBrush="{StaticResource BackgroundSurface_02dp}" BackgroundBrush="{StaticResource BackgroundSurface_08dp}" Height="100" Width="100"/>
ValueRead="70" <StackPanel Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center">
ValueWrite="60" <TextBlock Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18" TextAlignment="Center" Text="UP" Foreground="{StaticResource DeepPurple_A100}"/>
ReadIndicatorBrush="{StaticResource DeepPurple_A100}" <TextBlock Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18" TextAlignment="Center" Text="DOWN" Foreground="{StaticResource Teal_A100}"/>
WriteIndicatorBrush="{StaticResource Teal_A100}"
Margin="5"
Grid.Row="1"
ProgressBorderBrush="{StaticResource BackgroundSurface_02dp}"
BackgroundBrush="{StaticResource BackgroundSurface_08dp}"
Height="100"
Width="100"
/>
<StackPanel
Grid.Row="1"
VerticalAlignment="Center"
HorizontalAlignment="Center">
<TextBlock
Grid.Row="0"
VerticalAlignment="Center"
HorizontalAlignment="Center"
FontSize="18"
TextAlignment="Center"
Text="UP"
Foreground="{StaticResource DeepPurple_A100}"
/>
<TextBlock
Grid.Row="0"
VerticalAlignment="Center"
HorizontalAlignment="Center"
FontSize="18"
TextAlignment="Center"
Text="DOWN"
Foreground="{StaticResource Teal_A100}"
/>
</StackPanel> </StackPanel>
</Grid> </Grid>
</Grid> </Grid>

View File

@@ -3,16 +3,31 @@ using System.Collections.Generic;
using System.Text; using System.Text;
namespace Server_Dashboard { namespace Server_Dashboard {
/// <summary>
/// Dashboard Module class that holds all the information that gets displayed
/// </summary>
class DashboardModule { class DashboardModule {
//The name the user gives the module
public string ModuleName { get; set; } public string ModuleName { get; set; }
//The user who created it
public string Creator { get; set; } public string Creator { get; set; }
//All the information that the server had
public ServerInformation ServerInfo { get; set; } public ServerInformation ServerInfo { get; set; }
//The status indicator
public string StatusIndicator { get; set; } public string StatusIndicator { get; set; }
//The background color of the status indicator
public string StatusIndicatorBG { get; set; } public string StatusIndicatorBG { get; set; }
//If the server is avaibale or not
public bool ServerAvailable { get; set; } public bool ServerAvailable { get; set; }
//The Module icon the user give the server, defaults to a generic server symbol
public string ModuleIcon { get; set; } public string ModuleIcon { get; set; }
//Creation date with System.DateTime.Now
public string CreationDate { get; set; } public string CreationDate { get; set; }
/// <summary>
/// This will set the Module status indicator red or green if the server is available or not
/// </summary>
/// <param name="serverAvailable"></param>
public DashboardModule(bool serverAvailable) { public DashboardModule(bool serverAvailable) {
ServerAvailable = serverAvailable; ServerAvailable = serverAvailable;
StatusIndicator = ServerAvailable ? "#20c657" : "#e53935"; StatusIndicator = ServerAvailable ? "#20c657" : "#e53935";

View File

@@ -3,10 +3,19 @@ using System.Collections.Generic;
using System.Text; using System.Text;
namespace Server_Dashboard.DashboardModules { namespace Server_Dashboard.DashboardModules {
/// <summary>
/// The Information the user puts into the CreateNewModule form
/// </summary>
class NewModuleInformation { class NewModuleInformation {
//The Name of the Module
public string ModuleName { get; set; }
//The Name of the Server
public string ServerName { get; set; } public string ServerName { get; set; }
//The Username
public string Username { get; set; } public string Username { get; set; }
//IPv4 Adress
public string IPAdress { get; set; } public string IPAdress { get; set; }
//Port, defaults to 22
public int Port { get; set; } public int Port { get; set; }
} }
} }

View File

@@ -4,16 +4,30 @@ using System.Collections.ObjectModel;
using System.Text; using System.Text;
namespace Server_Dashboard { namespace Server_Dashboard {
/// <summary>
/// Server information class, this will probably scale pretty big later on
/// This will hold all the information the socket will gather
/// </summary>
class ServerInformation { class ServerInformation {
//The ServerName
public string ServerName { get; set; } public string ServerName { get; set; }
//The unix or windows username
public string OSUserName { get; set; } public string OSUserName { get; set; }
//Cpu Temp in C
public string CpuTemp { get; set; } public string CpuTemp { get; set; }
//Gpu Temp in C
public string GpuTemp { get; set; } public string GpuTemp { get; set; }
//Server uptime
public string Uptime { get; set; } public string Uptime { get; set; }
//When the server was first deployed
public string DeployDate { get; set; } public string DeployDate { get; set; }
//Public IPv4 Adress
public string PublicIpAdress { get; set; } public string PublicIpAdress { get; set; }
//Private IP adress from the servers network
public string PrivateIpAdress { get; set; } public string PrivateIpAdress { get; set; }
//GPU usage in %
public string GpuUsage { get; set; } public string GpuUsage { get; set; }
//CPU usage in %
public string CpuUsage { get; set; } public string CpuUsage { get; set; }
} }
} }

View File

@@ -7,92 +7,149 @@ using System.Data.SqlClient;
using System.Reflection; using System.Reflection;
namespace Server_Dashboard { namespace Server_Dashboard {
/// <summary>
/// Database class to access the database
/// </summary>
public static class DatabaseHandler { public static class DatabaseHandler {
#region Public Methods
public static DataTable GetServerInformation() { /// <summary>
/// Checks the user credentials
return null; /// </summary>
} /// <param name="uname">The username</param>
/// <param name="passwd">The plain text password</param>
/// <returns>[0] is false, [1] is true, [2] connection error</returns>
public static int CheckLogin(string uname, string passwd) { public static int CheckLogin(string uname, string passwd) {
//Creates the database connection
using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ServerDashboardDB"].ConnectionString)) { using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ServerDashboardDB"].ConnectionString)) {
try { try {
//Open the connection
con.Open(); con.Open();
//SQL Query
string query = "EXEC ValidateUserLogin @Username = @uname, @Password = @passwd, @Valid = @valid OUTPUT"; string query = "EXEC ValidateUserLogin @Username = @uname, @Password = @passwd, @Valid = @valid OUTPUT";
//Creates a new command
using (SqlCommand com = new SqlCommand(query, con)) { using (SqlCommand com = new SqlCommand(query, con)) {
//For security reasons the values are added with this function
//this will avoid SQL Injections
com.Parameters.AddWithValue("@uname", uname); com.Parameters.AddWithValue("@uname", uname);
com.Parameters.AddWithValue("@passwd", passwd); com.Parameters.AddWithValue("@passwd", passwd);
com.Parameters.Add("@valid", SqlDbType.NVarChar, 250); com.Parameters.Add("@valid", SqlDbType.NVarChar, 250);
com.Parameters["@valid"].Direction = ParameterDirection.Output; com.Parameters["@valid"].Direction = ParameterDirection.Output;
//Execute without a return value
com.ExecuteNonQuery(); com.ExecuteNonQuery();
//The Return value from the SQL Stored Procedure will have the answer to life
return Convert.ToInt32(com.Parameters["@Valid"].Value); return Convert.ToInt32(com.Parameters["@Valid"].Value);
} }
//Catch any error
} catch (SqlException ex) { } catch (SqlException ex) {
return ex.Number; return ex.Number;
} finally { } finally {
//Always close the connection
con.Close(); con.Close();
} }
} }
} }
/// <summary>
/// Currently obscolete, would check the Username and Cookie
/// </summary>
/// <param name="cookie">Locally stored user cookie</param>
/// <param name="username">Locally stored username</param>
/// <returns>[0] is false, [1] is true, [2] connection error</returns>
public static int CheckCookie(string cookie, string username) { public static int CheckCookie(string cookie, string username) {
//Creates the database connection
using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ServerDashboardDB"].ConnectionString)) { using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ServerDashboardDB"].ConnectionString)) {
try { try {
//Open the connection
con.Open(); con.Open();
//SQL Query
string query = "EXEC CheckUserCookie @Cookie = @cookie, @UserName = @username, @Valid = @valid OUTPUT"; string query = "EXEC CheckUserCookie @Cookie = @cookie, @UserName = @username, @Valid = @valid OUTPUT";
//Creates a new command
using (SqlCommand com = new SqlCommand(query, con)) { using (SqlCommand com = new SqlCommand(query, con)) {
//For security reasons the values are added with this function
//this will avoid SQL Injections
com.Parameters.AddWithValue("@cookie", cookie); com.Parameters.AddWithValue("@cookie", cookie);
com.Parameters.AddWithValue("@username", username); com.Parameters.AddWithValue("@username", username);
com.Parameters.Add("@valid", SqlDbType.Bit); com.Parameters.Add("@valid", SqlDbType.Bit);
com.Parameters["@valid"].Direction = ParameterDirection.Output; com.Parameters["@valid"].Direction = ParameterDirection.Output;
//Execute without a return value
com.ExecuteNonQuery(); com.ExecuteNonQuery();
//The Return value from the SQL Stored Procedure will have the answer to life
return Convert.ToInt32(com.Parameters["@Valid"].Value); return Convert.ToInt32(com.Parameters["@Valid"].Value);
} }
//Catch any error
} catch (SqlException ex) { } catch (SqlException ex) {
return ex.Number; return ex.Number;
} finally { } finally {
//Always close the connection
con.Close(); con.Close();
} }
} }
} }
/// <summary>
/// Deletes a the cookie from the given user
/// </summary>
/// <param name="username">User who doesnt deserve any delicious cookies :3</param>
public static void DeleteCookie(string username) { public static void DeleteCookie(string username) {
//Creates the database connection
using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ServerDashboardDB"].ConnectionString)) { using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ServerDashboardDB"].ConnectionString)) {
try { try {
//Open the connection
con.Open(); con.Open();
//SQL Query
string query = "EXEC DeleteUserCookie @Username = @username, @ResponseMessage = @response OUTPUT"; string query = "EXEC DeleteUserCookie @Username = @username, @ResponseMessage = @response OUTPUT";
//Creates a new command
using (SqlCommand com = new SqlCommand(query, con)) { using (SqlCommand com = new SqlCommand(query, con)) {
//For security reasons the values are added with this function
//this will avoid SQL Injections
com.Parameters.AddWithValue("@username", username); com.Parameters.AddWithValue("@username", username);
com.Parameters.Add("@response", SqlDbType.NVarChar, 250); com.Parameters.Add("@response", SqlDbType.NVarChar, 250);
com.Parameters["@response"].Direction = ParameterDirection.Output; com.Parameters["@response"].Direction = ParameterDirection.Output;
//Execute without a return value
com.ExecuteNonQuery(); com.ExecuteNonQuery();
} }
} catch (SqlException ex) { //Catch any error, dont return them, why would you?
} catch {
} finally { } finally {
//Always close the connection
con.Close(); con.Close();
} }
} }
} }
/// <summary>
/// Adds a new Cookie to a user
/// </summary>
/// <param name="cookie">The delicious locally stored cookie</param>
/// <param name="username">The User who deserves a cookie :3</param>
/// <returns>[0] is false, [1] is true, [2] connection error</returns>
public static int AddCookie(string cookie, string username) { public static int AddCookie(string cookie, string username) {
//Creates the database connection
using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ServerDashboardDB"].ConnectionString)) { using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ServerDashboardDB"].ConnectionString)) {
try { try {
//Open the connection
con.Open(); con.Open();
//SQL Query
string query = "EXEC AddCookieToUser @Cookie = @cookie, @UserName = @username, @ResponseMessage = @response OUTPUT"; string query = "EXEC AddCookieToUser @Cookie = @cookie, @UserName = @username, @ResponseMessage = @response OUTPUT";
//Creates a new command
using (SqlCommand com = new SqlCommand(query, con)) { using (SqlCommand com = new SqlCommand(query, con)) {
//For security reasons the values are added with this function
//this will avoid SQL Injections
com.Parameters.AddWithValue("@cookie", cookie); com.Parameters.AddWithValue("@cookie", cookie);
com.Parameters.AddWithValue("@username", username); com.Parameters.AddWithValue("@username", username);
com.Parameters.Add("@response", SqlDbType.NVarChar, 250); com.Parameters.Add("@response", SqlDbType.NVarChar, 250);
com.Parameters["@response"].Direction = ParameterDirection.Output; com.Parameters["@response"].Direction = ParameterDirection.Output;
//Execute without a return value
com.ExecuteNonQuery(); com.ExecuteNonQuery();
//The Return value from the SQL Stored Procedure will have the answer to life
return Convert.ToInt32(com.Parameters["@ResponseMessage"].Value); return Convert.ToInt32(com.Parameters["@ResponseMessage"].Value);
} }
//Catch any error
} catch (SqlException ex) { } catch (SqlException ex) {
return ex.Number; return ex.Number;
} finally { } finally {
//Always close connection
con.Close(); con.Close();
} }
} }
} }
#endregion
} }
} }

View File

@@ -4,6 +4,9 @@ using System.Security;
using System.Text; using System.Text;
namespace Server_Dashboard { namespace Server_Dashboard {
/// <summary>
/// Interface that makes a SecurePassword go one way
/// </summary>
public interface IHavePassword { public interface IHavePassword {
SecureString SecurePassword { get; } SecureString SecurePassword { get; }
} }

View File

@@ -3,6 +3,9 @@ using System.Collections.Generic;
using System.Text; using System.Text;
namespace Server_Dashboard { namespace Server_Dashboard {
/// <summary>
/// Interface to help close a window with a button
/// </summary>
interface IWindowHelper { interface IWindowHelper {
Action Close { get; set; } Action Close { get; set; }
} }

View File

@@ -8,14 +8,14 @@
xmlns:loading="clr-namespace:Server_Dashboard.Controls" xmlns:loading="clr-namespace:Server_Dashboard.Controls"
x:Name="Login" x:Name="Login"
mc:Ignorable="d" mc:Ignorable="d"
Title="Server Dashboard" Height="700" Width="500" WindowStyle="None" Background="Transparent" ResizeMode="CanResize" local:CloseProperty.Value="True"> Title="Server Dashboard"
Height="700" Width="500" WindowStyle="None" Background="Transparent" ResizeMode="CanResize" local:CloseProperty.Value="True">
<WindowChrome.WindowChrome> <WindowChrome.WindowChrome>
<WindowChrome CaptionHeight="0" ResizeBorderThickness="0"/> <WindowChrome CaptionHeight="0" ResizeBorderThickness="0"/>
</WindowChrome.WindowChrome> </WindowChrome.WindowChrome>
<Window.DataContext> <Window.DataContext>
<local:LoginViewModel/> <local:LoginViewModel/>
</Window.DataContext> </Window.DataContext>
<!--#region Login forms main container--> <!--#region Login forms main container-->
<Border Background="{StaticResource BackgroundSurface_00dp}"> <Border Background="{StaticResource BackgroundSurface_00dp}">
<Grid Grid.Row="0"> <Grid Grid.Row="0">
@@ -36,7 +36,6 @@
<i:CallMethodAction MethodName="DragMove" TargetObject="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"/> <i:CallMethodAction MethodName="DragMove" TargetObject="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"/>
</i:EventTrigger> </i:EventTrigger>
</i:Interaction.Triggers> </i:Interaction.Triggers>
<!--#region Custom title bar--> <!--#region Custom title bar-->
<Grid Background="{StaticResource BackgroundSurface_04dp}" Grid.Row="0" Grid.ColumnSpan="2"> <Grid Background="{StaticResource BackgroundSurface_04dp}" Grid.Row="0" Grid.ColumnSpan="2">
<Grid.Effect> <Grid.Effect>
@@ -56,37 +55,15 @@
</Button> </Button>
</Grid> </Grid>
<!--#endregion--> <!--#endregion-->
<!--#region Greeting text--> <!--#region Greeting text-->
<Border <Border Height="100" BorderBrush="{StaticResource DeepPurple_400}" BorderThickness="0 2 0 2" Background="{StaticResource BackgroundSurface_00dp}" Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Bottom" Grid.ColumnSpan="2" Margin="0 0 0 10">
Height="100" <StackPanel VerticalAlignment="Center" Margin="0 0 0 5" >
BorderBrush="{StaticResource DeepPurple_400}" <TextBlock Text="Server Dashboard" FontSize="30" HorizontalAlignment="Center">
BorderThickness="0 2 0 2"
Background="{StaticResource BackgroundSurface_00dp}"
Grid.Row="1"
HorizontalAlignment="Center"
VerticalAlignment="Bottom"
Grid.ColumnSpan="2"
Margin="0 0 0 10"
>
<StackPanel
VerticalAlignment="Center"
Margin="0 0 0 5"
>
<TextBlock
Text="Server Dashboard"
FontSize="30"
HorizontalAlignment="Center"
>
<TextBlock.Foreground> <TextBlock.Foreground>
<SolidColorBrush Color="White" Opacity="0.64"/> <SolidColorBrush Color="White" Opacity="0.64"/>
</TextBlock.Foreground> </TextBlock.Foreground>
</TextBlock> </TextBlock>
<TextBlock <TextBlock Text="Login" FontSize="30" HorizontalAlignment="Center">
Text="Login"
FontSize="30"
HorizontalAlignment="Center"
>
<TextBlock.Foreground> <TextBlock.Foreground>
<SolidColorBrush Color="White" Opacity="0.64"/> <SolidColorBrush Color="White" Opacity="0.64"/>
</TextBlock.Foreground> </TextBlock.Foreground>
@@ -97,48 +74,19 @@
<loading:LoadingIndicator/> <loading:LoadingIndicator/>
</UserControl> </UserControl>
<!--#endregion--> <!--#endregion-->
<!--#region Username form--> <!--#region Username form-->
<Border <Border CornerRadius="4" Margin="0 10 0 10" Width="350" Height="60" Background="{StaticResource BackgroundSurface_01dp}" Grid.Row="3" Grid.ColumnSpan="2">
CornerRadius="4"
Margin="0 10 0 10"
Width="350"
Height="60"
Background="{StaticResource BackgroundSurface_01dp}"
Grid.Row="3"
Grid.ColumnSpan="2"
>
<Border.Effect> <Border.Effect>
<DropShadowEffect <DropShadowEffect Direction="0" ShadowDepth="0" BlurRadius="5"/>
Direction="0"
ShadowDepth="0"
BlurRadius="5"
/>
</Border.Effect> </Border.Effect>
<Grid Grid.Column="1"> <Grid Grid.Column="1">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="60"/> <ColumnDefinition Width="60"/>
<ColumnDefinition/> <ColumnDefinition/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Image <Image Grid.Column="0" Height="30" Source="Assets/Images/userlogin.png"/>
Grid.Column="0" <TextBox Text="{Binding Username}" x:Name="UserName" Grid.Column="1" Margin="0 0 5 0"/>
Height="30" <TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Text="Username" Visibility="{Binding ElementName=UserName, Path=Text.IsEmpty, Converter={StaticResource UserNameVisibillity}}" Grid.Column="1" IsHitTestVisible="False">
Source="Assets/Images/userlogin.png"
/>
<TextBox
Text="{Binding Username}"
x:Name="UserName"
Grid.Column="1"
Margin="0 0 5 0"
/>
<TextBlock
VerticalAlignment="Center"
HorizontalAlignment="Left"
Text="Username"
Visibility="{Binding ElementName=UserName, Path=Text.IsEmpty, Converter={StaticResource UserNameVisibillity}}"
Grid.Column="1"
IsHitTestVisible="False"
>
<TextBlock.Foreground> <TextBlock.Foreground>
<SolidColorBrush Color="White" Opacity="0.12"/> <SolidColorBrush Color="White" Opacity="0.12"/>
</TextBlock.Foreground> </TextBlock.Foreground>
@@ -146,17 +94,8 @@
</Grid> </Grid>
</Border> </Border>
<!--#endregion--> <!--#endregion-->
<!--#region Password form--> <!--#region Password form-->
<Border <Border Margin="0 10 0 10" Background="{StaticResource BackgroundSurface_01dp}" Grid.Row="4" Grid.ColumnSpan="2" Width="350" CornerRadius="4" Padding="0 0 5 0">
Margin="0 10 0 10"
Background="{StaticResource BackgroundSurface_01dp}"
Grid.Row="4"
Grid.ColumnSpan="2"
Width="350"
CornerRadius="4"
Padding="0 0 5 0"
>
<Border.Effect> <Border.Effect>
<DropShadowEffect Direction="0" ShadowDepth="0" BlurRadius="5"/> <DropShadowEffect Direction="0" ShadowDepth="0" BlurRadius="5"/>
</Border.Effect> </Border.Effect>
@@ -166,35 +105,14 @@
<ColumnDefinition/> <ColumnDefinition/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Image Grid.Column="0" Height="30" Source="Assets/Images/userpasswd.png"/> <Image Grid.Column="0" Height="30" Source="Assets/Images/userpasswd.png"/>
<PasswordBox <PasswordBox Width="290" Height="60" local:MonitorPasswordProperty.Value="True" Grid.Column="1" x:Name="Password">
Width="290"
Height="60"
local:MonitorPasswordProperty.Value="True"
Grid.Column="1"
x:Name="Password"
>
<PasswordBox.InputBindings> <PasswordBox.InputBindings>
<KeyBinding <KeyBinding Key="Return" Command="{Binding LoginCommand}" CommandParameter="{Binding ElementName=Login}"/>
Key="Return"
Command="{Binding LoginCommand}"
CommandParameter="{Binding ElementName=Login}"
/>
</PasswordBox.InputBindings> </PasswordBox.InputBindings>
</PasswordBox> </PasswordBox>
<TextBlock <TextBlock Visibility="{Binding ElementName=Password, Path=(local:HasTextProperty.Value), Converter={StaticResource UserNameVisibillity}}" x:Name="PasswordHint" Text="Password" Grid.Column="1" IsHitTestVisible="False" VerticalAlignment="Center" HorizontalAlignment="Left">
Visibility="{Binding ElementName=Password, Path=(local:HasTextProperty.Value), Converter={StaticResource UserNameVisibillity}}" x:Name="PasswordHint"
Text="Password"
Grid.Column="1"
IsHitTestVisible="False"
VerticalAlignment="Center"
HorizontalAlignment="Left"
>
<TextBlock.InputBindings> <TextBlock.InputBindings>
<KeyBinding <KeyBinding Key="Return" Command="{Binding LoginCommand}" CommandParameter="{Binding ElementName=Login}"/>
Key="Return"
Command="{Binding LoginCommand}"
CommandParameter="{Binding ElementName=Login}"
/>
</TextBlock.InputBindings> </TextBlock.InputBindings>
<TextBlock.Foreground> <TextBlock.Foreground>
<SolidColorBrush Color="White" Opacity="0.12"/> <SolidColorBrush Color="White" Opacity="0.12"/>
@@ -203,29 +121,11 @@
</Grid> </Grid>
</Border> </Border>
<!--#endregion--> <!--#endregion-->
<!--#region Login button--> <!--#region Login button-->
<Button <Button Height="60" Width="350" Command="{Binding LoginCommand}" CommandParameter="{Binding ElementName=Login}" Grid.Row="5" Content="LOGIN" Grid.ColumnSpan="2"/>
Height="60"
Width="350"
Command="{Binding LoginCommand}"
CommandParameter="{Binding ElementName=Login}"
Grid.Row="5"
Content="LOGIN"
Grid.ColumnSpan="2"
/>
<!--#endregion--> <!--#endregion-->
<!--#region Error text--> <!--#region Error text-->
<TextBlock <TextBlock Text="{Binding ErrorText}" VerticalAlignment="Center" HorizontalAlignment="Center" Grid.Row="6" Grid.Column="1" Foreground="{StaticResource ErrorRed}" FontSize="14"/>
Text="{Binding ErrorText}"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Grid.Row="6"
Grid.Column="1"
Foreground="{StaticResource ErrorRed}"
FontSize="14"
/>
<!--#endregion--> <!--#endregion-->
<!--#region Remember me and Password forgotten link--> <!--#region Remember me and Password forgotten link-->
@@ -236,37 +136,15 @@
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<CheckBox <CheckBox IsChecked="{Binding RememberUser}" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="75 0 0 0"/>
IsChecked="{Binding RememberUser}" <TextBlock Grid.Column="1" Text="Remember me?" FontSize="14" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10 0 0 0">
Grid.Column="0"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Margin="75 0 0 0"
/>
<TextBlock
Grid.Column="1"
Text="Remember me?"
FontSize="14"
VerticalAlignment="Center"
HorizontalAlignment="Left"
Margin="10 0 0 0"
>
<TextBlock.Foreground> <TextBlock.Foreground>
<SolidColorBrush Color="White" Opacity="0.64"/> <SolidColorBrush Color="White" Opacity="0.64"/>
</TextBlock.Foreground> </TextBlock.Foreground>
</TextBlock> </TextBlock>
<TextBlock <TextBlock Grid.Column="3" FontSize="14" Margin="0 0 75 0" VerticalAlignment="Center" HorizontalAlignment="Right">
Grid.Column="3"
FontSize="14"
Margin="0 0 75 0"
VerticalAlignment="Center"
HorizontalAlignment="Right"
>
<!--Send recovery Email to user, probably replace with a button--> <!--Send recovery Email to user, probably replace with a button-->
<Hyperlink <Hyperlink NavigateUri="https://example.com" local:HyperlinkExtensions.IsExternal="True">
NavigateUri="https://example.com"
local:HyperlinkExtensions.IsExternal="True"
>
Forgot password Forgot password
</Hyperlink> </Hyperlink>
<TextBlock.Foreground> <TextBlock.Foreground>
@@ -275,39 +153,19 @@
</TextBlock> </TextBlock>
</Grid> </Grid>
<!--#endregion--> <!--#endregion-->
<!--#region Link to register form--> <!--#region Link to register form-->
<Grid Grid.Row="8"> <Grid Grid.Row="8">
<StackPanel <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
Orientation="Horizontal" <TextBlock Text="Don't have an account?" FontSize="16" VerticalAlignment="Center" HorizontalAlignment="Right">
HorizontalAlignment="Center"
>
<TextBlock
Text="Don't have an account?"
FontSize="16"
VerticalAlignment="Center"
HorizontalAlignment="Right"
>
<TextBlock.Foreground> <TextBlock.Foreground>
<SolidColorBrush Color="White" Opacity="0.64"/> <SolidColorBrush Color="White" Opacity="0.64"/>
</TextBlock.Foreground> </TextBlock.Foreground>
</TextBlock> </TextBlock>
<Button <Button Command="{Binding RegisterCommand}" Content="REGISTER" VerticalAlignment="Center" HorizontalAlignment="Left" FontSize="12" Height="30" Width="80" Margin="10 0 0 0"/>
Command="{Binding RegisterCommand}"
Content="REGISTER"
VerticalAlignment="Center"
HorizontalAlignment="Left"
FontSize="12"
Height="30"
Width="80"
Margin="10 0 0 0"
/>
</StackPanel> </StackPanel>
</Grid> </Grid>
<!--#endregion--> <!--#endregion-->
</Grid> </Grid>
</Border> </Border>
<!--#endregion--> <!--#endregion-->
</Window> </Window>

View File

@@ -5,12 +5,19 @@ using System.Security;
using System.Text; using System.Text;
namespace Server_Dashboard { namespace Server_Dashboard {
/// <summary>
/// Secure string helper class to unsecure the Password b4 it goes to the database
/// </summary>
public static class SecureStringHelpers { public static class SecureStringHelpers {
//Unsecures a given password
public static string Unsecure(this SecureString secureString) { public static string Unsecure(this SecureString secureString) {
//If empty return nothing
if (secureString == null) if (secureString == null)
return string.Empty; return string.Empty;
//New zero pointer
var unmanagedString = IntPtr.Zero; var unmanagedString = IntPtr.Zero;
//Try to unsecure the string
try { try {
unmanagedString = Marshal.SecureStringToGlobalAllocUnicode(secureString); unmanagedString = Marshal.SecureStringToGlobalAllocUnicode(secureString);
return Marshal.PtrToStringUni(unmanagedString); return Marshal.PtrToStringUni(unmanagedString);

View File

@@ -5,6 +5,9 @@ using System.Text;
using System.Windows.Data; using System.Windows.Data;
namespace Server_Dashboard { namespace Server_Dashboard {
/// <summary>
/// Value to angle converter
/// </summary>
[ValueConversion(typeof(int), typeof(double))] [ValueConversion(typeof(int), typeof(double))]
public class ValueToAngleConverter : IValueConverter { public class ValueToAngleConverter : IValueConverter {
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) => (int)value * 0.01 * 360; public object Convert(object value, Type targetType, object parameter, CultureInfo culture) => (int)value * 0.01 * 360;

View File

@@ -4,6 +4,10 @@ using System.ComponentModel;
using System.Text; using System.Text;
namespace Server_Dashboard { namespace Server_Dashboard {
/// <summary>
/// Base View Model all the other view models inherit from
/// Makes me write the INotifyPropertyChanged only once
/// </summary>
class BaseViewModel : INotifyPropertyChanged { class BaseViewModel : INotifyPropertyChanged {
public event PropertyChangedEventHandler PropertyChanged = (sender, e) => { }; public event PropertyChangedEventHandler PropertyChanged = (sender, e) => { };

View File

@@ -4,19 +4,14 @@ using System.Collections.ObjectModel;
using System.Text; using System.Text;
namespace Server_Dashboard { namespace Server_Dashboard {
/// <summary>
/// View Model for the modules
/// </summary>
class DashboardModuleViewModel : BaseViewModel { class DashboardModuleViewModel : BaseViewModel {
//List with all Modules inside
public ObservableCollection<DashboardModule> Modules { get; set; } public ObservableCollection<DashboardModule> Modules { get; set; }
private int gpuUsage;
public int GPUUsage {
get { return gpuUsage; }
set {
if(value != gpuUsage)
gpuUsage = value;
OnPropertyChanged(nameof(gpuUsage));
}
}
//Creates Default Modules, remove before release and when implementing the actual data comming from the socket
public DashboardModuleViewModel() { public DashboardModuleViewModel() {
Modules = new ObservableCollection<DashboardModule>(); Modules = new ObservableCollection<DashboardModule>();
for (int i = 0; i < 10; i++) { for (int i = 0; i < 10; i++) {

View File

@@ -6,10 +6,17 @@ using System.Windows.Input;
using Server_Dashboard_Socket; using Server_Dashboard_Socket;
namespace Server_Dashboard { namespace Server_Dashboard {
/// <summary>
/// View Model for the Dashboard
/// </summary>
class DashboardViewModel : BaseViewModel { class DashboardViewModel : BaseViewModel {
private string userName = "Username"; #region Private Values
private DashboardModuleViewModel dmvm = new DashboardModuleViewModel(); private readonly DashboardModuleViewModel dmvm = new DashboardModuleViewModel();
#endregion
#region Properties
//The Username displayed defaults to Username
private string userName = "Username";
public string UserName { public string UserName {
get { return userName; } get { return userName; }
set { set {
@@ -19,8 +26,8 @@ namespace Server_Dashboard {
} }
} }
//List that contains every Module
private ObservableCollection<DashboardModule> modules; private ObservableCollection<DashboardModule> modules;
public ObservableCollection<DashboardModule> Modules { public ObservableCollection<DashboardModule> Modules {
get { return modules; } get { return modules; }
set { set {
@@ -29,32 +36,59 @@ namespace Server_Dashboard {
OnPropertyChanged(nameof(modules)); OnPropertyChanged(nameof(modules));
} }
} }
#endregion
#region Constructor
public DashboardViewModel() { public DashboardViewModel() {
//Creates a new echo server, remove b4 release
EchoServer echoServer = new EchoServer(); EchoServer echoServer = new EchoServer();
echoServer.Start(); echoServer.Start();
//Command inits
OpenLinkCommand = new RelayCommand(OpenLink); OpenLinkCommand = new RelayCommand(OpenLink);
OpenNewModuleWindowCommand = new RelayCommand(OpenNewModuleWindow); OpenNewModuleWindowCommand = new RelayCommand(OpenNewModuleWindow);
CreateModuleCommand = new RelayCommand(CreateModule); CreateModuleCommand = new RelayCommand(CreateModule);
//Sets the local module to the dashboardviewmodule modules
Modules = dmvm.Modules; Modules = dmvm.Modules;
} }
#endregion
#region ICommands
public ICommand OpenLinkCommand { get; set; } public ICommand OpenLinkCommand { get; set; }
public ICommand OpenNewModuleWindowCommand { get; set; } public ICommand OpenNewModuleWindowCommand { get; set; }
public ICommand CreateModuleCommand { get; set; } public ICommand CreateModuleCommand { get; set; }
#endregion
#region Commands
/// <summary>
/// Opens a given link in the default browser
/// </summary>
/// <param name="param">The Link to be opened e.g. https://github.com/Crylia/Server-Dashboard </param>
private void OpenLink(object param) { private void OpenLink(object param) {
Process.Start(new ProcessStartInfo((string)param) { UseShellExecute = true }); Process.Start(new ProcessStartInfo((string)param) { UseShellExecute = true });
} }
/// <summary>
/// Creates a new window to create a new Module
/// </summary>
/// <param name="param">Nothing</param>
private void OpenNewModuleWindow(object param) { private void OpenNewModuleWindow(object param) {
//Creates a new CreateModulePopup and sets this view model as datacontext
CreateModulePopup cmp = new CreateModulePopup { CreateModulePopup cmp = new CreateModulePopup {
DataContext = this DataContext = this
}; };
//Opens it in the middle of the screen, setting the parent window as owner causes the
//application to crash when NOT in debug mode(???)
cmp.WindowStartupLocation = WindowStartupLocation.CenterScreen; cmp.WindowStartupLocation = WindowStartupLocation.CenterScreen;
cmp.ShowDialog(); cmp.ShowDialog();
} }
/// <summary>
/// No function yes
/// </summary>
/// <param name="param">Nothing</param>
private void CreateModule(object param) { private void CreateModule(object param) {
} }
#endregion
} }
} }

View File

@@ -5,10 +5,13 @@ using System.Windows.Input;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Server_Dashboard { namespace Server_Dashboard {
/// <summary>
/// View Model for the Login Window
/// </summary>
class LoginViewModel : BaseViewModel, IWindowHelper { class LoginViewModel : BaseViewModel, IWindowHelper {
#region Properties
//Username Property
private string username; private string username;
public string Username { public string Username {
get { return username; } get { return username; }
set { set {
@@ -17,9 +20,8 @@ namespace Server_Dashboard {
OnPropertyChanged(nameof(username)); OnPropertyChanged(nameof(username));
} }
} }
//Error Text displays an error to help the user to fill the form
private string errorText; private string errorText;
public string ErrorText { public string ErrorText {
get { return errorText; } get { return errorText; }
set { set {
@@ -28,9 +30,8 @@ namespace Server_Dashboard {
OnPropertyChanged(nameof(errorText)); OnPropertyChanged(nameof(errorText));
} }
} }
//Remember me button
private bool rememberUser; private bool rememberUser;
public bool RememberUser { public bool RememberUser {
get { return rememberUser; } get { return rememberUser; }
set { set {
@@ -39,9 +40,8 @@ namespace Server_Dashboard {
OnPropertyChanged(nameof(rememberUser)); OnPropertyChanged(nameof(rememberUser));
} }
} }
//Loading circle, gets hidden and shown when logging in
private string loading; private string loading;
public string Loading { public string Loading {
get { return loading; } get { return loading; }
set { set {
@@ -50,76 +50,126 @@ namespace Server_Dashboard {
OnPropertyChanged(nameof(loading)); OnPropertyChanged(nameof(loading));
} }
} }
#endregion
#region Public Values
//Close action for the Window to close properly
public Action Close { get ; set; } public Action Close { get ; set; }
#endregion
#region Constructor
public LoginViewModel() { public LoginViewModel() {
//Loading circle is hidden on startup
Loading = "Hidden"; Loading = "Hidden";
//Command inits
LoginCommand = new RelayCommand(LoginAsync); LoginCommand = new RelayCommand(LoginAsync);
if (!String.IsNullOrEmpty(Settings.Default.Username)) { //Checks if the Username and Cookie is saved in the Settings.settings
if (!String.IsNullOrEmpty(Settings.Default.Username) && !String.IsNullOrEmpty(Settings.Default.Cookies)) {
//Takes the saved Username and Remember me button status and prefills the username and checks the Remember me button
Username = Settings.Default.Username; Username = Settings.Default.Username;
RememberUser = Settings.Default.RememberMe; RememberUser = Settings.Default.RememberMe;
} }
AutoLoginAsync(); //TODO: Autologin
//AutoLoginAsync();
} }
#endregion
#region ICommands
public ICommand LoginCommand { get; set; } public ICommand LoginCommand { get; set; }
#endregion
#region Commands
/// <summary>
/// Async login
/// </summary>
/// <param name="parameter">Secure password string</param>
private async void LoginAsync(object parameter) { private async void LoginAsync(object parameter) {
//Checks if the Username and Password field has content
if (!String.IsNullOrWhiteSpace(Username) && !String.IsNullOrWhiteSpace((parameter as IHavePassword).SecurePassword.Unsecure())) { if (!String.IsNullOrWhiteSpace(Username) && !String.IsNullOrWhiteSpace((parameter as IHavePassword).SecurePassword.Unsecure())) {
//Sets loading to true to show the loading icon
Loading = "Visible"; Loading = "Visible";
//Sends the Username and Password to the database and saved the result, 1 successfull, 0 wrong username or password
int result = await Task.Run(() => DatabaseHandler.CheckLogin(Username, (parameter as IHavePassword).SecurePassword.Unsecure())); int result = await Task.Run(() => DatabaseHandler.CheckLogin(Username, (parameter as IHavePassword).SecurePassword.Unsecure()));
//hides the loading again
Loading = "Hidden"; Loading = "Hidden";
/*result can be:
0 for Wrong username or password
1 for true username or password
2 for network or database unreachable
default error for everything else
*/
switch (result) { switch (result) {
case 0: case 0:
//Sets the error text and exits function
ErrorText = "Username or password is wrong."; ErrorText = "Username or password is wrong.";
return; return;
case 1: case 1:
/*No idea why this is here, gonna let it be till the remember me and autologin is 100% done
if (RememberUser && !String.IsNullOrEmpty(Settings.Default.Cookies)) { if (RememberUser && !String.IsNullOrEmpty(Settings.Default.Cookies)) {
DatabaseHandler.CheckCookie(Settings.Default.Cookies, Username); DatabaseHandler.CheckCookie(Settings.Default.Cookies, Username);
} }*/
//If the remember me is not checked and a cookie exists the local storage gets cleared
if (!RememberUser && !String.IsNullOrEmpty(Settings.Default.Cookies)) { if (!RememberUser && !String.IsNullOrEmpty(Settings.Default.Cookies)) {
Settings.Default.Cookies = null; Settings.Default.Cookies = null;
Settings.Default.Username = ""; Settings.Default.Username = "";
Settings.Default.RememberMe = false; Settings.Default.RememberMe = false;
Settings.Default.Password = ""; Settings.Default.Password = "";
Settings.Default.Save(); Settings.Default.Save();
//Also deletes the cookie from the database
DatabaseHandler.DeleteCookie(Username); DatabaseHandler.DeleteCookie(Username);
} }
//If the remember user option is checked and the cookie is not set save everything locally
if (RememberUser && String.IsNullOrEmpty(Settings.Default.Cookies)) { if (RememberUser && String.IsNullOrEmpty(Settings.Default.Cookies)) {
var guid = new Guid().ToString() + Username; //Creates a new GUID with the username at the end, this is the cookie
Settings.Default.Cookies = guid; var cookie = new Guid().ToString() + Username;
//Saves cookie, Username Remember me option to the local storage (Settings.settings)
Settings.Default.Cookies = cookie;
Settings.Default.Username = Username; Settings.Default.Username = Username;
Settings.Default.RememberMe = true; Settings.Default.RememberMe = true;
Settings.Default.Password = "*****";
Settings.Default.Save(); Settings.Default.Save();
DatabaseHandler.AddCookie(Username, guid); //Saves the cookie in the database
DatabaseHandler.AddCookie(Username, cookie);
} }
//Creates a new Dashboard window and shows it
DashboardWindow window = new DashboardWindow(); DashboardWindow window = new DashboardWindow();
window.Show(); window.Show();
//When closed, close it correctly
Close?.Invoke(); Close?.Invoke();
return; return;
case 2: case 2:
//Sets the error text
ErrorText = "Server unreachable, connection timeout."; ErrorText = "Server unreachable, connection timeout.";
return; return;
default: default:
//Sets the error text
ErrorText = "An unknown error has occured"; ErrorText = "An unknown error has occured";
return; return;
} }
//If the Username and password is blank
//All these IF's could be one but i made multiple for the different errors so the user knows whats wrong
} else if (String.IsNullOrWhiteSpace(Username) && String.IsNullOrWhiteSpace((parameter as IHavePassword).SecurePassword.Unsecure())) { } else if (String.IsNullOrWhiteSpace(Username) && String.IsNullOrWhiteSpace((parameter as IHavePassword).SecurePassword.Unsecure())) {
//Sets the error text
ErrorText = "Please provide a username and password"; ErrorText = "Please provide a username and password";
return; return;
} }
//Only if the Username is empty
if (String.IsNullOrWhiteSpace(Username)) { if (String.IsNullOrWhiteSpace(Username)) {
//Sets the error text
ErrorText = "Username cannot be empty."; ErrorText = "Username cannot be empty.";
return; return;
} }
//Only if the password is empty
if (String.IsNullOrWhiteSpace((parameter as IHavePassword).SecurePassword.Unsecure())) { if (String.IsNullOrWhiteSpace((parameter as IHavePassword).SecurePassword.Unsecure())) {
//Sets the error text
ErrorText = "Password cannot be empty."; ErrorText = "Password cannot be empty.";
return; return;
} }
//If there is no error, clear the error text
ErrorText = ""; ErrorText = "";
} }
#endregion
#region private functions
//TODO: Add autologin function that locks the UI untill the user hits the abort button or the login completes //TODO: Add autologin function that locks the UI untill the user hits the abort button or the login completes
/*private async void AutoLoginAsync() { /*private async void AutoLoginAsync() {
if (Settings.Default.RememberMe && !String.IsNullOrEmpty(Settings.Default.Username) && !String.IsNullOrEmpty(Settings.Default.Cookies)) { if (Settings.Default.RememberMe && !String.IsNullOrEmpty(Settings.Default.Username) && !String.IsNullOrEmpty(Settings.Default.Cookies)) {
@@ -134,5 +184,6 @@ namespace Server_Dashboard {
} }
} }
}*/ }*/
#endregion
} }
} }

View File

@@ -7,7 +7,7 @@ namespace Server_Dashboard {
class RelayCommand : ICommand { class RelayCommand : ICommand {
//New Action //New Action
private Action<object> execAction; private readonly Action<object> execAction;
//Never gets fires, but needs to be implemented //Never gets fires, but needs to be implemented
public event EventHandler CanExecuteChanged = (sender, e) => { }; public event EventHandler CanExecuteChanged = (sender, e) => { };

View File

@@ -9,15 +9,11 @@
xmlns:root="clr-namespace:Server_Dashboard" xmlns:root="clr-namespace:Server_Dashboard"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors" xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:controls="clr-namespace:Server_Dashboard.Controls.ServerModules" xmlns:controls="clr-namespace:Server_Dashboard.Controls.ServerModules"
mc:Ignorable="d" mc:Ignorable="d" d:DesignHeight="920" d:DesignWidth="1600">
d:DesignHeight="920"
d:DesignWidth="1600"
>
<Grid Background="{StaticResource BackgroundSurface_00dp}"> <Grid Background="{StaticResource BackgroundSurface_00dp}">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="*"/> <RowDefinition Height="*"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<!--Dashboard and Options--> <!--Dashboard and Options-->
<Grid Grid.Row="2"> <Grid Grid.Row="2">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
@@ -31,29 +27,11 @@
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
<RowDefinition Height="*"/> <RowDefinition Height="*"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Button <Button Grid.Row="0" Command="{Binding OpenNewModuleWindowCommand}" Content="New Module" Height="50" Margin="5 10 5 0" Cursor="Hand" x:Name="CreateModule"/>
Grid.Row="0" <Button Grid.Row="1" Command="{Binding OpenDeleteModuleWindowCommand}" Content="Remove Module" Height="50" Margin="5 10 5 0" Cursor="Hand" x:Name="RemoveModule"/>
Command="{Binding OpenNewModuleWindowCommand}" <Button Grid.Row="2" Command="{Binding OpenUpdateModuleWindowCommand}" Content="Change Module" Height="50" Margin="5 10 5 0" Cursor="Hand" x:Name="ChangeModule"/>
Content="New Module"
Height="50"
Margin="5 10 5 0" Cursor="Hand"
x:Name="CreateModule"
/>
<Button
Grid.Row="1"
Command="{Binding OpenDeleteModuleWindowCommand}"
Content="Remove Module"
Height="50"
Margin="5 10 5 0"
/>
<Button
Grid.Row="2"
Command="{Binding OpenUpdateModuleWindowCommand}"
Content="Change Module"
Height="50"
Margin="5 10 5 0" Cursor="Hand"
/>
</Grid> </Grid>
<!--ItemsControl list for the Dashboardmodules-->
<Grid Grid.Column="1"> <Grid Grid.Column="1">
<ScrollViewer VerticalScrollBarVisibility="Hidden"> <ScrollViewer VerticalScrollBarVisibility="Hidden">
<ItemsControl ItemsSource="{Binding Modules}"> <ItemsControl ItemsSource="{Binding Modules}">

View File

@@ -8,20 +8,14 @@
xmlns:views="clr-namespace:Server_Dashboard.Views.DashboardPages" xmlns:views="clr-namespace:Server_Dashboard.Views.DashboardPages"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors" xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:svgc="http://sharpvectors.codeplex.com/svgc/" xmlns:svgc="http://sharpvectors.codeplex.com/svgc/"
Height="1000" Height="1000" Width="Auto" WindowStyle="None" Background="Transparent" ResizeMode="CanResize" mc:Ignorable="d" d:Height="1000" d:Width="1900">
Width="Auto"
WindowStyle="None"
Background="Transparent"
ResizeMode="CanResize"
mc:Ignorable="d"
d:Height="1000" d:Width="1900"
>
<WindowChrome.WindowChrome> <WindowChrome.WindowChrome>
<WindowChrome CaptionHeight="0"/> <WindowChrome CaptionHeight="0"/>
</WindowChrome.WindowChrome> </WindowChrome.WindowChrome>
<Window.DataContext> <Window.DataContext>
<root:DashboardViewModel/> <root:DashboardViewModel/>
</Window.DataContext> </Window.DataContext>
<!--Dashboard Window and Container for the Dashboards-->
<Grid Background="{StaticResource BackgroundSurface_00dp}"> <Grid Background="{StaticResource BackgroundSurface_00dp}">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="30"/> <RowDefinition Height="30"/>
@@ -63,20 +57,8 @@
<Button Grid.Column="0" > <Button Grid.Column="0" >
<Button.Template> <Button.Template>
<ControlTemplate TargetType="{x:Type Button}"> <ControlTemplate TargetType="{x:Type Button}">
<Border <Border x:Name="Border" CornerRadius="4" Padding="2" Background="Transparent" BorderBrush="Transparent" BorderThickness="0" >
x:Name="Border" <svgc:SvgViewbox Source="../Assets/Images/Settings.svg" Margin="5" IsHitTestVisible="False" Opacity="0.87"/>
CornerRadius="4"
Padding="2"
Background="Transparent"
BorderBrush="Transparent"
BorderThickness="0"
>
<svgc:SvgViewbox
Source="../Assets/Images/Settings.svg"
Margin="5"
IsHitTestVisible="False"
Opacity="0.87"
/>
</Border> </Border>
<ControlTemplate.Triggers> <ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True"> <Trigger Property="IsMouseOver" Value="True">
@@ -87,13 +69,7 @@
</ControlTemplate> </ControlTemplate>
</Button.Template> </Button.Template>
</Button> </Button>
<Button <Button Grid.Column="4" Command="{Binding OpenLinkCommand}" Content="{Binding UserName}" Margin="10 0 10 0" Height="40" Cursor="Hand">
Grid.Column="4"
Command="{Binding OpenLinkCommand}"
Content="{Binding UserName}"
Margin="10 0 10 0"
Height="40" Cursor="Hand"
>
<Button.Template> <Button.Template>
<ControlTemplate TargetType="{x:Type Button}"> <ControlTemplate TargetType="{x:Type Button}">
<Border x:Name="Border" CornerRadius="5" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0"> <Border x:Name="Border" CornerRadius="5" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0">
@@ -105,23 +81,8 @@
<SolidColorBrush Color="White" Opacity="0.12"/> <SolidColorBrush Color="White" Opacity="0.12"/>
</Border.BorderBrush> </Border.BorderBrush>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<svgc:SvgViewbox <svgc:SvgViewbox Source="../Assets/Images/User.svg" Margin="5" IsHitTestVisible="False" Opacity="0.87"/>
Source="../Assets/Images/User.svg" <TextBlock FontSize="{TemplateBinding FontSize}" TextAlignment="Center" Padding="0" TextWrapping="Wrap" Text="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="5 0 10 0"/>
Margin="5"
IsHitTestVisible="False"
Opacity="0.87"
/>
<TextBlock
FontSize="{TemplateBinding FontSize}"
TextAlignment="Center"
Padding="0"
TextWrapping="Wrap"
Text="{TemplateBinding Content}"
Foreground="{TemplateBinding Foreground}"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Margin="5 0 10 0"
/>
</StackPanel> </StackPanel>
</Border> </Border>
</Border> </Border>
@@ -151,14 +112,7 @@
</ControlTemplate> </ControlTemplate>
</Button.Template> </Button.Template>
</Button> </Button>
<Button <Button Grid.Column="3" Command="{Binding OpenLinkCommand}" CommandParameter="https://github.com/Crylia/Server-Dashboard/wiki" Content="Docs" Margin="10 0 10 0" Height="40">
Grid.Column="3"
Command="{Binding OpenLinkCommand}"
CommandParameter="https://github.com/Crylia/Server-Dashboard/wiki"
Content="Docs"
Margin="10 0 10 0"
Height="40"
>
<Button.Template> <Button.Template>
<ControlTemplate TargetType="{x:Type Button}"> <ControlTemplate TargetType="{x:Type Button}">
<Border x:Name="Border" CornerRadius="5" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0"> <Border x:Name="Border" CornerRadius="5" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0">
@@ -170,23 +124,8 @@
<SolidColorBrush Color="White" Opacity="0.12"/> <SolidColorBrush Color="White" Opacity="0.12"/>
</Border.BorderBrush> </Border.BorderBrush>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<svgc:SvgViewbox <svgc:SvgViewbox Source="../Assets/Images/Docs.svg" Margin="5" IsHitTestVisible="False" Opacity="0.87"/>
Source="../Assets/Images/Docs.svg" <TextBlock FontSize="{TemplateBinding FontSize}" TextAlignment="Center" Padding="0" TextWrapping="Wrap" Text="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="5 0 10 0"/>
Margin="5"
IsHitTestVisible="False"
Opacity="0.87"
/>
<TextBlock
FontSize="{TemplateBinding FontSize}"
TextAlignment="Center"
Padding="0"
TextWrapping="Wrap"
Text="{TemplateBinding Content}"
Foreground="{TemplateBinding Foreground}"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Margin="5 0 10 0"
/>
</StackPanel> </StackPanel>
</Border> </Border>
</Border> </Border>
@@ -216,15 +155,7 @@
</ControlTemplate> </ControlTemplate>
</Button.Template> </Button.Template>
</Button> </Button>
<Button <Button Grid.Column="2" Command="{Binding OpenLinkCommand}" CommandParameter="https://github.com/Crylia/Server-Dashboard" Content="GitHub" Margin="10 0 10 0" Height="40" Opacity="0.87" Cursor="Hand">
Grid.Column="2"
Command="{Binding OpenLinkCommand}"
CommandParameter="https://github.com/Crylia/Server-Dashboard"
Content="GitHub"
Margin="10 0 10 0"
Height="40"
Opacity="0.87" Cursor="Hand"
>
<Button.Template> <Button.Template>
<ControlTemplate TargetType="{x:Type Button}"> <ControlTemplate TargetType="{x:Type Button}">
<Border x:Name="Border" CornerRadius="5" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0"> <Border x:Name="Border" CornerRadius="5" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0">
@@ -236,21 +167,8 @@
<SolidColorBrush Color="White" Opacity="0.12"/> <SolidColorBrush Color="White" Opacity="0.12"/>
</Border.BorderBrush> </Border.BorderBrush>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<Image <Image Source="../Assets/Images/GitHubLight.png" Margin="5"/>
Source="../Assets/Images/GitHubLight.png" <TextBlock FontSize="{TemplateBinding FontSize}" TextAlignment="Center" Padding="0" TextWrapping="Wrap" Text="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="5 0 10 0"/>
Margin="5"
/>
<TextBlock
FontSize="{TemplateBinding FontSize}"
TextAlignment="Center"
Padding="0"
TextWrapping="Wrap"
Text="{TemplateBinding Content}"
Foreground="{TemplateBinding Foreground}"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Margin="5 0 10 0"
/>
</StackPanel> </StackPanel>
</Border> </Border>
</Border> </Border>
@@ -281,6 +199,7 @@
</Button.Template> </Button.Template>
</Button> </Button>
</Grid> </Grid>
<!--UserControl Container for the Dashboard pages-->
<UserControl Grid.Row="3"> <UserControl Grid.Row="3">
<views:MainDashboardPage/> <views:MainDashboardPage/>
</UserControl> </UserControl>

View File

@@ -1,4 +1,4 @@
#pragma checksum "..\..\..\App.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "8B13C63F73D8B03B1CC973E996B230B95776E3E8" #pragma checksum "..\..\..\App.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "FA6871C28C6B96CD3932405F6C88CE357B9CAC41"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.

View File

@@ -1,4 +1,4 @@
#pragma checksum "..\..\..\App.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "8B13C63F73D8B03B1CC973E996B230B95776E3E8" #pragma checksum "..\..\..\App.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "FA6871C28C6B96CD3932405F6C88CE357B9CAC41"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.

View File

@@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\..\..\Controls\Dashboard\CRUD Popup\CreateModulePopup.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "0EFE1CD6D3BEC2F7CABDA72A79271A24F45A2CA8" #pragma checksum "..\..\..\..\..\..\Controls\Dashboard\CRUD Popup\CreateModulePopup.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "F45F1E4243C66B9FD96C035A50A8EE4E1CBFCB34"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.
@@ -48,7 +48,7 @@ namespace Server_Dashboard.Views.DashboardPages.ModuleCRUD {
public partial class CreateModulePopup : System.Windows.Window, System.Windows.Markup.IComponentConnector { public partial class CreateModulePopup : System.Windows.Window, System.Windows.Markup.IComponentConnector {
#line 105 "..\..\..\..\..\..\Controls\Dashboard\CRUD Popup\CreateModulePopup.xaml" #line 69 "..\..\..\..\..\..\Controls\Dashboard\CRUD Popup\CreateModulePopup.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox ServerName; internal System.Windows.Controls.TextBox ServerName;
@@ -56,7 +56,7 @@ namespace Server_Dashboard.Views.DashboardPages.ModuleCRUD {
#line hidden #line hidden
#line 151 "..\..\..\..\..\..\Controls\Dashboard\CRUD Popup\CreateModulePopup.xaml" #line 91 "..\..\..\..\..\..\Controls\Dashboard\CRUD Popup\CreateModulePopup.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.PasswordBox Password; internal System.Windows.Controls.PasswordBox Password;
@@ -64,7 +64,7 @@ namespace Server_Dashboard.Views.DashboardPages.ModuleCRUD {
#line hidden #line hidden
#line 156 "..\..\..\..\..\..\Controls\Dashboard\CRUD Popup\CreateModulePopup.xaml" #line 93 "..\..\..\..\..\..\Controls\Dashboard\CRUD Popup\CreateModulePopup.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock PasswordHint; internal System.Windows.Controls.TextBlock PasswordHint;
@@ -72,7 +72,7 @@ namespace Server_Dashboard.Views.DashboardPages.ModuleCRUD {
#line hidden #line hidden
#line 197 "..\..\..\..\..\..\Controls\Dashboard\CRUD Popup\CreateModulePopup.xaml" #line 114 "..\..\..\..\..\..\Controls\Dashboard\CRUD Popup\CreateModulePopup.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox UserName; internal System.Windows.Controls.TextBox UserName;
@@ -80,7 +80,7 @@ namespace Server_Dashboard.Views.DashboardPages.ModuleCRUD {
#line hidden #line hidden
#line 241 "..\..\..\..\..\..\Controls\Dashboard\CRUD Popup\CreateModulePopup.xaml" #line 136 "..\..\..\..\..\..\Controls\Dashboard\CRUD Popup\CreateModulePopup.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox IPAdress; internal System.Windows.Controls.TextBox IPAdress;
@@ -88,7 +88,7 @@ namespace Server_Dashboard.Views.DashboardPages.ModuleCRUD {
#line hidden #line hidden
#line 278 "..\..\..\..\..\..\Controls\Dashboard\CRUD Popup\CreateModulePopup.xaml" #line 155 "..\..\..\..\..\..\Controls\Dashboard\CRUD Popup\CreateModulePopup.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox Port; internal System.Windows.Controls.TextBox Port;

View File

@@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\..\..\Controls\Dashboard\CRUD Popup\CreateModulePopup.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "0EFE1CD6D3BEC2F7CABDA72A79271A24F45A2CA8" #pragma checksum "..\..\..\..\..\..\Controls\Dashboard\CRUD Popup\CreateModulePopup.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "F45F1E4243C66B9FD96C035A50A8EE4E1CBFCB34"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.
@@ -48,7 +48,7 @@ namespace Server_Dashboard.Views.DashboardPages.ModuleCRUD {
public partial class CreateModulePopup : System.Windows.Window, System.Windows.Markup.IComponentConnector { public partial class CreateModulePopup : System.Windows.Window, System.Windows.Markup.IComponentConnector {
#line 105 "..\..\..\..\..\..\Controls\Dashboard\CRUD Popup\CreateModulePopup.xaml" #line 69 "..\..\..\..\..\..\Controls\Dashboard\CRUD Popup\CreateModulePopup.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox ServerName; internal System.Windows.Controls.TextBox ServerName;
@@ -56,7 +56,7 @@ namespace Server_Dashboard.Views.DashboardPages.ModuleCRUD {
#line hidden #line hidden
#line 151 "..\..\..\..\..\..\Controls\Dashboard\CRUD Popup\CreateModulePopup.xaml" #line 91 "..\..\..\..\..\..\Controls\Dashboard\CRUD Popup\CreateModulePopup.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.PasswordBox Password; internal System.Windows.Controls.PasswordBox Password;
@@ -64,7 +64,7 @@ namespace Server_Dashboard.Views.DashboardPages.ModuleCRUD {
#line hidden #line hidden
#line 156 "..\..\..\..\..\..\Controls\Dashboard\CRUD Popup\CreateModulePopup.xaml" #line 93 "..\..\..\..\..\..\Controls\Dashboard\CRUD Popup\CreateModulePopup.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock PasswordHint; internal System.Windows.Controls.TextBlock PasswordHint;
@@ -72,7 +72,7 @@ namespace Server_Dashboard.Views.DashboardPages.ModuleCRUD {
#line hidden #line hidden
#line 197 "..\..\..\..\..\..\Controls\Dashboard\CRUD Popup\CreateModulePopup.xaml" #line 114 "..\..\..\..\..\..\Controls\Dashboard\CRUD Popup\CreateModulePopup.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox UserName; internal System.Windows.Controls.TextBox UserName;
@@ -80,7 +80,7 @@ namespace Server_Dashboard.Views.DashboardPages.ModuleCRUD {
#line hidden #line hidden
#line 241 "..\..\..\..\..\..\Controls\Dashboard\CRUD Popup\CreateModulePopup.xaml" #line 136 "..\..\..\..\..\..\Controls\Dashboard\CRUD Popup\CreateModulePopup.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox IPAdress; internal System.Windows.Controls.TextBox IPAdress;
@@ -88,7 +88,7 @@ namespace Server_Dashboard.Views.DashboardPages.ModuleCRUD {
#line hidden #line hidden
#line 278 "..\..\..\..\..\..\Controls\Dashboard\CRUD Popup\CreateModulePopup.xaml" #line 155 "..\..\..\..\..\..\Controls\Dashboard\CRUD Popup\CreateModulePopup.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox Port; internal System.Windows.Controls.TextBox Port;

View File

@@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\..\Controls\DoubleRoundProgressBar\DoubleRoundProgressBar.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "E96EB8CBB00924E817B4F6983981D68244368A22" #pragma checksum "..\..\..\..\..\Controls\DoubleRoundProgressBar\DoubleRoundProgressBar.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "74B46BE3BAB1BA752DF3E2239D67C2C6B44ED2A3"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.
@@ -62,7 +62,7 @@ namespace Server_Dashboard.Controls.DoubleRoundProgressBar {
#line hidden #line hidden
#line 45 "..\..\..\..\..\Controls\DoubleRoundProgressBar\DoubleRoundProgressBar.xaml" #line 19 "..\..\..\..\..\Controls\DoubleRoundProgressBar\DoubleRoundProgressBar.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Shapes.Ellipse Seperator; internal System.Windows.Shapes.Ellipse Seperator;
@@ -70,7 +70,7 @@ namespace Server_Dashboard.Controls.DoubleRoundProgressBar {
#line hidden #line hidden
#line 55 "..\..\..\..\..\Controls\DoubleRoundProgressBar\DoubleRoundProgressBar.xaml" #line 20 "..\..\..\..\..\Controls\DoubleRoundProgressBar\DoubleRoundProgressBar.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Shapes.Ellipse Seperator2; internal System.Windows.Shapes.Ellipse Seperator2;
@@ -78,7 +78,7 @@ namespace Server_Dashboard.Controls.DoubleRoundProgressBar {
#line hidden #line hidden
#line 81 "..\..\..\..\..\Controls\DoubleRoundProgressBar\DoubleRoundProgressBar.xaml" #line 22 "..\..\..\..\..\Controls\DoubleRoundProgressBar\DoubleRoundProgressBar.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Shapes.Ellipse Border; internal System.Windows.Shapes.Ellipse Border;

View File

@@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\..\Controls\DoubleRoundProgressBar\DoubleRoundProgressBar.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "E96EB8CBB00924E817B4F6983981D68244368A22" #pragma checksum "..\..\..\..\..\Controls\DoubleRoundProgressBar\DoubleRoundProgressBar.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "74B46BE3BAB1BA752DF3E2239D67C2C6B44ED2A3"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.
@@ -62,7 +62,7 @@ namespace Server_Dashboard.Controls.DoubleRoundProgressBar {
#line hidden #line hidden
#line 45 "..\..\..\..\..\Controls\DoubleRoundProgressBar\DoubleRoundProgressBar.xaml" #line 19 "..\..\..\..\..\Controls\DoubleRoundProgressBar\DoubleRoundProgressBar.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Shapes.Ellipse Seperator; internal System.Windows.Shapes.Ellipse Seperator;
@@ -70,7 +70,7 @@ namespace Server_Dashboard.Controls.DoubleRoundProgressBar {
#line hidden #line hidden
#line 55 "..\..\..\..\..\Controls\DoubleRoundProgressBar\DoubleRoundProgressBar.xaml" #line 20 "..\..\..\..\..\Controls\DoubleRoundProgressBar\DoubleRoundProgressBar.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Shapes.Ellipse Seperator2; internal System.Windows.Shapes.Ellipse Seperator2;
@@ -78,7 +78,7 @@ namespace Server_Dashboard.Controls.DoubleRoundProgressBar {
#line hidden #line hidden
#line 81 "..\..\..\..\..\Controls\DoubleRoundProgressBar\DoubleRoundProgressBar.xaml" #line 22 "..\..\..\..\..\Controls\DoubleRoundProgressBar\DoubleRoundProgressBar.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Shapes.Ellipse Border; internal System.Windows.Shapes.Ellipse Border;

View File

@@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\..\Controls\HalfRoundProgressBar\HalfRoundProgressBar.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "088662625301BAB0ABA31EF9E2688BA689BC4C48" #pragma checksum "..\..\..\..\..\Controls\HalfRoundProgressBar\HalfRoundProgressBar.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "F8123F9E313CFC197FD21BBF3619385A6FC8FC20"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.
@@ -46,7 +46,7 @@ namespace Server_Dashboard.Controls.HalfRoundProgressBar {
public partial class HalfRoundProgressBar : System.Windows.Controls.UserControl, System.Windows.Markup.IComponentConnector { public partial class HalfRoundProgressBar : System.Windows.Controls.UserControl, System.Windows.Markup.IComponentConnector {
#line 10 "..\..\..\..\..\Controls\HalfRoundProgressBar\HalfRoundProgressBar.xaml" #line 9 "..\..\..\..\..\Controls\HalfRoundProgressBar\HalfRoundProgressBar.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal Server_Dashboard.Controls.HalfRoundProgressBar.HalfRoundProgressBar _this; internal Server_Dashboard.Controls.HalfRoundProgressBar.HalfRoundProgressBar _this;
@@ -54,7 +54,7 @@ namespace Server_Dashboard.Controls.HalfRoundProgressBar {
#line hidden #line hidden
#line 17 "..\..\..\..\..\Controls\HalfRoundProgressBar\HalfRoundProgressBar.xaml" #line 15 "..\..\..\..\..\Controls\HalfRoundProgressBar\HalfRoundProgressBar.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Shapes.Ellipse Background; internal System.Windows.Shapes.Ellipse Background;
@@ -62,7 +62,7 @@ namespace Server_Dashboard.Controls.HalfRoundProgressBar {
#line hidden #line hidden
#line 44 "..\..\..\..\..\Controls\HalfRoundProgressBar\HalfRoundProgressBar.xaml" #line 17 "..\..\..\..\..\Controls\HalfRoundProgressBar\HalfRoundProgressBar.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Shapes.Ellipse Border; internal System.Windows.Shapes.Ellipse Border;

View File

@@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\..\Controls\HalfRoundProgressBar\HalfRoundProgressBar.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "088662625301BAB0ABA31EF9E2688BA689BC4C48" #pragma checksum "..\..\..\..\..\Controls\HalfRoundProgressBar\HalfRoundProgressBar.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "F8123F9E313CFC197FD21BBF3619385A6FC8FC20"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.
@@ -46,7 +46,7 @@ namespace Server_Dashboard.Controls.HalfRoundProgressBar {
public partial class HalfRoundProgressBar : System.Windows.Controls.UserControl, System.Windows.Markup.IComponentConnector { public partial class HalfRoundProgressBar : System.Windows.Controls.UserControl, System.Windows.Markup.IComponentConnector {
#line 10 "..\..\..\..\..\Controls\HalfRoundProgressBar\HalfRoundProgressBar.xaml" #line 9 "..\..\..\..\..\Controls\HalfRoundProgressBar\HalfRoundProgressBar.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal Server_Dashboard.Controls.HalfRoundProgressBar.HalfRoundProgressBar _this; internal Server_Dashboard.Controls.HalfRoundProgressBar.HalfRoundProgressBar _this;
@@ -54,7 +54,7 @@ namespace Server_Dashboard.Controls.HalfRoundProgressBar {
#line hidden #line hidden
#line 17 "..\..\..\..\..\Controls\HalfRoundProgressBar\HalfRoundProgressBar.xaml" #line 15 "..\..\..\..\..\Controls\HalfRoundProgressBar\HalfRoundProgressBar.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Shapes.Ellipse Background; internal System.Windows.Shapes.Ellipse Background;
@@ -62,7 +62,7 @@ namespace Server_Dashboard.Controls.HalfRoundProgressBar {
#line hidden #line hidden
#line 44 "..\..\..\..\..\Controls\HalfRoundProgressBar\HalfRoundProgressBar.xaml" #line 17 "..\..\..\..\..\Controls\HalfRoundProgressBar\HalfRoundProgressBar.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Shapes.Ellipse Border; internal System.Windows.Shapes.Ellipse Border;

View File

@@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\..\Controls\LoadingIndicator\LoadingIndicator.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "B712BFC0DDE46A0CEA17B00250D69DC46AB75992" #pragma checksum "..\..\..\..\..\Controls\LoadingIndicator\LoadingIndicator.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "77F7BA13CD156FFDEBCF337792520673841E87F9"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.

View File

@@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\..\Controls\LoadingIndicator\LoadingIndicator.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "B712BFC0DDE46A0CEA17B00250D69DC46AB75992" #pragma checksum "..\..\..\..\..\Controls\LoadingIndicator\LoadingIndicator.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "77F7BA13CD156FFDEBCF337792520673841E87F9"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.

View File

@@ -1,4 +1,4 @@
#pragma checksum "..\..\..\LoginWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "BC333A5F7B9E8D68E824FFFBFE4539E4AA85365F" #pragma checksum "..\..\..\LoginWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "506FBD9D5FE875E406F1D55625DC6B00926FECF9"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.
@@ -56,7 +56,7 @@ namespace Server_Dashboard {
#line hidden #line hidden
#line 130 "..\..\..\LoginWindow.xaml" #line 88 "..\..\..\LoginWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox UserName; internal System.Windows.Controls.TextBox UserName;
@@ -64,7 +64,7 @@ namespace Server_Dashboard {
#line hidden #line hidden
#line 174 "..\..\..\LoginWindow.xaml" #line 108 "..\..\..\LoginWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.PasswordBox Password; internal System.Windows.Controls.PasswordBox Password;
@@ -72,7 +72,7 @@ namespace Server_Dashboard {
#line hidden #line hidden
#line 185 "..\..\..\LoginWindow.xaml" #line 113 "..\..\..\LoginWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock PasswordHint; internal System.Windows.Controls.TextBlock PasswordHint;

View File

@@ -1,4 +1,4 @@
#pragma checksum "..\..\..\LoginWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "BC333A5F7B9E8D68E824FFFBFE4539E4AA85365F" #pragma checksum "..\..\..\LoginWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "506FBD9D5FE875E406F1D55625DC6B00926FECF9"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.
@@ -56,7 +56,7 @@ namespace Server_Dashboard {
#line hidden #line hidden
#line 130 "..\..\..\LoginWindow.xaml" #line 88 "..\..\..\LoginWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox UserName; internal System.Windows.Controls.TextBox UserName;
@@ -64,7 +64,7 @@ namespace Server_Dashboard {
#line hidden #line hidden
#line 174 "..\..\..\LoginWindow.xaml" #line 108 "..\..\..\LoginWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.PasswordBox Password; internal System.Windows.Controls.PasswordBox Password;
@@ -72,7 +72,7 @@ namespace Server_Dashboard {
#line hidden #line hidden
#line 185 "..\..\..\LoginWindow.xaml" #line 113 "..\..\..\LoginWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock PasswordHint; internal System.Windows.Controls.TextBlock PasswordHint;

View File

@@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\..\Views\DashboardPages\MainDashboardPage.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "7F9B87538E0489397D1B928CEE51EE7AE4712B3B" #pragma checksum "..\..\..\..\..\Views\DashboardPages\MainDashboardPage.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "47F667437FD33C591010E2D8FB596082CE45DAC4"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.
@@ -50,13 +50,29 @@ namespace Server_Dashboard.Views.DashboardPages {
public partial class MainDashboardPage : System.Windows.Controls.UserControl, System.Windows.Markup.IComponentConnector { public partial class MainDashboardPage : System.Windows.Controls.UserControl, System.Windows.Markup.IComponentConnector {
#line 40 "..\..\..\..\..\Views\DashboardPages\MainDashboardPage.xaml" #line 30 "..\..\..\..\..\Views\DashboardPages\MainDashboardPage.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button CreateModule; internal System.Windows.Controls.Button CreateModule;
#line default #line default
#line hidden #line hidden
#line 31 "..\..\..\..\..\Views\DashboardPages\MainDashboardPage.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button RemoveModule;
#line default
#line hidden
#line 32 "..\..\..\..\..\Views\DashboardPages\MainDashboardPage.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button ChangeModule;
#line default
#line hidden
private bool _contentLoaded; private bool _contentLoaded;
/// <summary> /// <summary>
@@ -90,6 +106,12 @@ namespace Server_Dashboard.Views.DashboardPages {
case 1: case 1:
this.CreateModule = ((System.Windows.Controls.Button)(target)); this.CreateModule = ((System.Windows.Controls.Button)(target));
return; return;
case 2:
this.RemoveModule = ((System.Windows.Controls.Button)(target));
return;
case 3:
this.ChangeModule = ((System.Windows.Controls.Button)(target));
return;
} }
this._contentLoaded = true; this._contentLoaded = true;
} }

View File

@@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\..\Views\DashboardPages\MainDashboardPage.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "7F9B87538E0489397D1B928CEE51EE7AE4712B3B" #pragma checksum "..\..\..\..\..\Views\DashboardPages\MainDashboardPage.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "47F667437FD33C591010E2D8FB596082CE45DAC4"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.
@@ -50,13 +50,29 @@ namespace Server_Dashboard.Views.DashboardPages {
public partial class MainDashboardPage : System.Windows.Controls.UserControl, System.Windows.Markup.IComponentConnector { public partial class MainDashboardPage : System.Windows.Controls.UserControl, System.Windows.Markup.IComponentConnector {
#line 40 "..\..\..\..\..\Views\DashboardPages\MainDashboardPage.xaml" #line 30 "..\..\..\..\..\Views\DashboardPages\MainDashboardPage.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button CreateModule; internal System.Windows.Controls.Button CreateModule;
#line default #line default
#line hidden #line hidden
#line 31 "..\..\..\..\..\Views\DashboardPages\MainDashboardPage.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button RemoveModule;
#line default
#line hidden
#line 32 "..\..\..\..\..\Views\DashboardPages\MainDashboardPage.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button ChangeModule;
#line default
#line hidden
private bool _contentLoaded; private bool _contentLoaded;
/// <summary> /// <summary>
@@ -90,6 +106,12 @@ namespace Server_Dashboard.Views.DashboardPages {
case 1: case 1:
this.CreateModule = ((System.Windows.Controls.Button)(target)); this.CreateModule = ((System.Windows.Controls.Button)(target));
return; return;
case 2:
this.RemoveModule = ((System.Windows.Controls.Button)(target));
return;
case 3:
this.ChangeModule = ((System.Windows.Controls.Button)(target));
return;
} }
this._contentLoaded = true; this._contentLoaded = true;
} }

View File

@@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\Views\DashboardWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "E2931D9FE448B25CA4843C7DB4CD838F94FDDCEB" #pragma checksum "..\..\..\..\Views\DashboardWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "34F9F280B2CC5ECBFCC6EA0C5845A4B16E3447E7"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.
@@ -50,7 +50,7 @@ namespace Server_Dashboard.Views {
public partial class DashboardWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector { public partial class DashboardWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector {
#line 52 "..\..\..\..\Views\DashboardWindow.xaml" #line 46 "..\..\..\..\Views\DashboardWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Grid TopBarGrid; internal System.Windows.Controls.Grid TopBarGrid;

View File

@@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\Views\DashboardWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "E2931D9FE448B25CA4843C7DB4CD838F94FDDCEB" #pragma checksum "..\..\..\..\Views\DashboardWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "34F9F280B2CC5ECBFCC6EA0C5845A4B16E3447E7"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.
@@ -50,7 +50,7 @@ namespace Server_Dashboard.Views {
public partial class DashboardWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector { public partial class DashboardWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector {
#line 52 "..\..\..\..\Views\DashboardWindow.xaml" #line 46 "..\..\..\..\Views\DashboardWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Grid TopBarGrid; internal System.Windows.Controls.Grid TopBarGrid;