Skip to content

Commit

Permalink
ReportWindow design part 3
Browse files Browse the repository at this point in the history
  • Loading branch information
Zerumi committed Nov 21, 2020
1 parent c7a990d commit fc0c347
Show file tree
Hide file tree
Showing 3 changed files with 199 additions and 4 deletions.
46 changes: 44 additions & 2 deletions AMWE Administrator/ReportWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,42 @@
<RowDefinition Height="2*"/>
<RowDefinition Height="9*"/>
</Grid.RowDefinitions>
<Rectangle Margin="10,10.2,10.4,0" Grid.Row="1" HorizontalAlignment="Stretch" StrokeThickness="3" Stroke="Black" VerticalAlignment="Top" Height="201">
<Rectangle x:Name="rOverallRating" Margin="10,10.2,10.4,0" Grid.Row="1" HorizontalAlignment="Stretch" StrokeThickness="3" Stroke="Black" VerticalAlignment="Top" Height="201">
<Rectangle.Clip>
<RectangleGeometry Rect="0,0,146.395,201.595" RadiusX="14" RadiusY="14"/>
</Rectangle.Clip>
<Rectangle.Fill>
<LinearGradientBrush StartPoint="1, 0">
<GradientStop Color="#C1ff0000" Offset="0.09"/>
<GradientStop Color="Black" Offset="0.1"/>
<GradientStop Color="#C1ff4000" Offset="0.11"/>
<GradientStop Color="#C1ff4000" Offset="0.19"/>
<GradientStop Color="Black" Offset="0.2"/>
<GradientStop Color="#C1ff8000" Offset="0.21"/>
<GradientStop Color="#C1ff8000" Offset="0.29"/>
<GradientStop Color="Black" Offset="0.3"/>
<GradientStop Color="#C1ffc000" Offset="0.31"/>
<GradientStop Color="#C1ffc000" Offset="0.39"/>
<GradientStop Color="Black" Offset="0.4"/>
<GradientStop Color="#C1ffff00" Offset="0.41"/>
<GradientStop Color="#C1ffff00" Offset="0.49"/>
<GradientStop Color="Black" Offset="0.5"/>
<GradientStop Color="#C1c0ff00" Offset="0.51"/>
<GradientStop Color="#C1c0ff00" Offset="0.59"/>
<GradientStop Color="Black" Offset="0.6"/>
<GradientStop Color="#C1a0ff00" Offset="0.61"/>
<GradientStop Color="#C1a0ff00" Offset="0.69"/>
<GradientStop Color="Black" Offset="0.7"/>
<GradientStop Color="#C180ff00" Offset="0.71"/>
<GradientStop Color="#C180ff00" Offset="0.79"/>
<GradientStop Color="Black" Offset="0.8"/>
<GradientStop Color="#C160ff00" Offset="0.81"/>
<GradientStop Color="#C160ff00" Offset="0.89"/>
<GradientStop Color="Black" Offset="0.9"/>
<GradientStop Color="#C120ff00" Offset="0.91"/>
<GradientStop Color="#C120ff00" Offset="1"/>
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
<Label x:Name="ReportHeader" Content="Отчет №{No} от {pcusername}:" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Height="36" Width="420" FontSize="15" FontWeight="Bold" Grid.ColumnSpan="2"/>
<TabControl x:Name="products" Grid.Column="1" Grid.Row="1" Margin="0,0,10,10">
Expand Down Expand Up @@ -256,7 +288,7 @@
<TabItem x:Name="Proccesses">
<TabItem.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Margin="3">Клавиатура</TextBlock>
<TextBlock Margin="3">Процессы</TextBlock>
</StackPanel>
</TabItem.Header>
<TabItem.Content>
Expand All @@ -267,5 +299,15 @@
</TabItem>
</TabControl>
<TextBlock Text="looks like it's Beta /_/ \_\" Grid.Column="1" Margin="0,10,9.6,0" VerticalAlignment="Top" Height="39" TextWrapping="WrapWithOverflow" TextAlignment="Center" HorizontalAlignment="Right" Width="89"/>
<Label Content="1" HorizontalAlignment="Left" Margin="10,11.8,0,0" VerticalAlignment="Top" Grid.Row="1" Height="20" FontSize="8.67" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Width="22"/>
<Label Content="0,9" HorizontalAlignment="Left" Margin="10,31.8,0,0" VerticalAlignment="Top" Grid.Row="1" Height="19" FontSize="8.67" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Width="22"/>
<Label Content="0,8" HorizontalAlignment="Left" Margin="10,50.8,0,0" VerticalAlignment="Top" Grid.Row="1" Height="20" FontSize="8.67" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
<Label Content="0,7" HorizontalAlignment="Left" Margin="10,70.8,0,0" VerticalAlignment="Top" Grid.Row="1" Height="20" FontSize="8.67" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
<Label Content="0,6" HorizontalAlignment="Left" Margin="10,89.8,0,0" VerticalAlignment="Top" Grid.Row="1" Height="20" FontSize="8.67" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
<Label Content="0,5" HorizontalAlignment="Left" Margin="10,109.8,0,0" VerticalAlignment="Top" Grid.Row="1" Height="20" FontSize="8.67" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
<Label Content="0,4" HorizontalAlignment="Left" Margin="10,129.8,0,0" VerticalAlignment="Top" Grid.Row="1" Height="20" FontSize="8.67" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
<Label Content="0,3" HorizontalAlignment="Left" Margin="10,149.8,0,0" VerticalAlignment="Top" Grid.Row="1" Height="20" FontSize="8.67" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
<Label Content="0,2" HorizontalAlignment="Left" Margin="10,169.8,0,0" VerticalAlignment="Top" Grid.Row="1" Height="20" FontSize="8.67" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
<Label Content="0,1" HorizontalAlignment="Left" Margin="10,189.8,0,0" VerticalAlignment="Top" Grid.Row="1" Height="20" FontSize="8.67" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
</Grid>
</Window>
148 changes: 148 additions & 0 deletions AMWE Administrator/ReportWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,154 @@ public ReportWindow(Report report)
{
_Report = report;
InitializeComponent();
LinearGradientBrush ovbrush = new LinearGradientBrush()
{
StartPoint = new Point(1, 0),
GradientStops = new GradientStopCollection()
{
new GradientStop()
{
Color = report.OverallRating >= 1 ? (Color)ColorConverter.ConvertFromString("#C1ff0000") : Colors.White,
Offset = 0.09
},
new GradientStop()
{
Color = Colors.Black,
Offset = 0.1
},
new GradientStop()
{
Color = report.OverallRating >= 0.9 ? (Color)ColorConverter.ConvertFromString("#C1ff4000") : Colors.White,
Offset = 0.11
},
new GradientStop()
{
Color = report.OverallRating >= 0.9 ? (Color)ColorConverter.ConvertFromString("#C1ff4000") : Colors.White,
Offset = 0.19
},
new GradientStop()
{
Color = Colors.Black,
Offset = 0.2
},
new GradientStop()
{
Color = report.OverallRating >= 0.8 ? (Color)ColorConverter.ConvertFromString("#C1ff8000") : Colors.White,
Offset = 0.21
},
new GradientStop()
{
Color = report.OverallRating >= 0.8 ? (Color)ColorConverter.ConvertFromString("#C1ff8000") : Colors.White,
Offset = 0.29
},
new GradientStop()
{
Color = Colors.Black,
Offset = 0.3
},
new GradientStop()
{
Color = report.OverallRating >= 0.7 ? (Color)ColorConverter.ConvertFromString("#C1ffc000") : Colors.White,
Offset = 0.31
},
new GradientStop()
{
Color = report.OverallRating >= 0.7 ? (Color)ColorConverter.ConvertFromString("#C1ffc000") : Colors.White,
Offset = 0.39
},
new GradientStop()
{
Color = Colors.Black,
Offset = 0.4
},
new GradientStop()
{
Color = report.OverallRating >= 0.6 ? (Color)ColorConverter.ConvertFromString("#C1ffff00") : Colors.White,
Offset = 0.41
},
new GradientStop()
{
Color = report.OverallRating >= 0.6 ? (Color)ColorConverter.ConvertFromString("#C1ffff00") : Colors.White,
Offset = 0.49
},
new GradientStop()
{
Color = Colors.Black,
Offset = 0.5
},
new GradientStop()
{
Color = report.OverallRating >= 0.5 ? (Color)ColorConverter.ConvertFromString("#C1c0ff00") : Colors.White,
Offset = 0.51
},
new GradientStop()
{
Color = report.OverallRating >= 0.5 ? (Color)ColorConverter.ConvertFromString("#C1c0ff00") : Colors.White,
Offset = 0.59
},
new GradientStop()
{
Color = Colors.Black,
Offset = 0.6
},
new GradientStop()
{
Color = report.OverallRating >= 0.4 ? (Color)ColorConverter.ConvertFromString("#C1a0ff00") : Colors.White,
Offset = 0.61
},
new GradientStop()
{
Color = report.OverallRating >= 0.4 ? (Color)ColorConverter.ConvertFromString("#C1a0ff00") : Colors.White,
Offset = 0.69
},
new GradientStop()
{
Color = Colors.Black,
Offset = 0.7
},
new GradientStop()
{
Color = report.OverallRating >= 0.3 ? (Color)ColorConverter.ConvertFromString("#C180ff00") : Colors.White,
Offset = 0.71
},
new GradientStop()
{
Color = report.OverallRating >= 0.3 ? (Color)ColorConverter.ConvertFromString("#C180ff00") : Colors.White,
Offset = 0.79
},
new GradientStop()
{
Color = Colors.Black,
Offset = 0.8
},
new GradientStop()
{
Color = report.OverallRating >= 0.2 ? (Color)ColorConverter.ConvertFromString("#C160ff00") : Colors.White,
Offset = 0.81
},
new GradientStop()
{
Color = report.OverallRating >= 0.2 ? (Color)ColorConverter.ConvertFromString("#C160ff00") : Colors.White,
Offset = 0.89
},
new GradientStop()
{
Color = Colors.Black,
Offset = 0.9
},
new GradientStop()
{
Color = report.OverallRating >= 0.1 ? (Color)ColorConverter.ConvertFromString("#C120ff00") : Colors.White,
Offset = 0.91
},
new GradientStop()
{
Color = report.OverallRating >= 0.1 ? (Color)ColorConverter.ConvertFromString("#C120ff00") : Colors.White,
Offset = 1
}
}
};
rOverallRating.Fill = ovbrush;
ReportHeader.Content = $"Отчет №{App.reports.IndexOf(report)} от {report.Client.Nameofpc} ({report.Client.Id}):";
string sKeyPressedInfo = string.Empty;
foreach (var item in report.KeyPressedInfo)
Expand Down
9 changes: 7 additions & 2 deletions AMWE RealTime Server/Controllers/AuthController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
namespace AMWE_RealTime_Server.Controllers
{
[Route("/[controller]")]
[Produces("application/json")]
[ApiController]
[Authorize]
public class AuthController : ControllerBase
Expand Down Expand Up @@ -89,10 +90,14 @@ public async Task<dynamic> Auth([FromBody] string[] authdata)
return false;
}

[HttpDelete]
public async Task Logout(Client client)
[HttpDelete("{id}")]
public async Task<ActionResult> Logout(uint id)
{
var a = GlobalUsersList.Find(x => x.Id == id);
await HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
await _hubContext.Clients.Group(Role.GlobalAdminGroup).SendAsync("OnUserLeft", a);
GlobalUsersList.Remove(a);
return NoContent();
}

public static VerifyVersion[] adminversions = new VerifyVersion[]
Expand Down

0 comments on commit fc0c347

Please sign in to comment.