diff --git a/.gitignore b/.gitignore index 01c6660..35f5a71 100644 --- a/.gitignore +++ b/.gitignore @@ -501,3 +501,7 @@ src/Otchinslator/appsettings.Development.json src/.idea/.idea.Otchinslator/.idea/ src/.vscode/ + +src/Otchinslator/wwwroot/img/memes/ + +src/Otchinslator/wwwroot/img/notifications/ diff --git a/src/Otchinslator/Components/Pages/Home.razor b/src/Otchinslator/Components/Pages/Home.razor index 3f400d3..c309cbd 100644 --- a/src/Otchinslator/Components/Pages/Home.razor +++ b/src/Otchinslator/Components/Pages/Home.razor @@ -1,4 +1,4 @@ -@using Microsoft.AspNetCore.Components.Authorization +@using Microsoft.AspNetCore.Components.Authorization @inject AuthenticationStateProvider AuthenticationStateProvider @page "/" @attribute [DiscoverCollocatedJS] @@ -20,13 +20,32 @@ + + + @* TODO: Исправить расположение названия *@ -

Отчислятор 3000

alpha

+
+
Отчислятор 3000
+

alpha

-

Мне нужно...

+ @*

Мне нужно...

*@
- - - -
+
+ @* *@ + @* *@ - + @context.User.Identity?.Name!.Split("@")[0] -
- +
\ No newline at end of file diff --git a/src/Otchinslator/Components/Pages/Home.razor.js b/src/Otchinslator/Components/Pages/Home.razor.js index b2828a3..b30979e 100644 --- a/src/Otchinslator/Components/Pages/Home.razor.js +++ b/src/Otchinslator/Components/Pages/Home.razor.js @@ -1,17 +1,24 @@ export default class extends BlazorJSComponents.Component { setParameters(IsAuthenticated) { - const buttons = document.querySelectorAll('.action-button'); - buttons.forEach(button => { - button.addEventListener('click', () => { - localStorage.setItem('action', button.id); - if (IsAuthenticated) { - window.location.href = '/chooseinstitut'; - } else { - window.location.href = '/MicrosoftIdentity/Account/SignIn'; - } + const button = document.querySelector('.action-button'); + button.addEventListener('click', () => { + localStorage.setItem('action', button.id); + if (IsAuthenticated) { + window.location.href = '/chooseinstitut'; + } else { + window.location.href = '/MicrosoftIdentity/Account/SignIn'; } - ) - }); - this.render(); + } + ) + const nextMemeButton = document.getElementById('nextmeme'); + const nextMemeImg = document.getElementById('memeImg'); + var random = Math.floor(Math.random() * 100) + 1; + nextMemeImg.src = "/img/memes/" + random + ".jpg"; + + nextMemeButton.addEventListener('click', () => { + random = Math.floor(Math.random() * 100) + 1; + nextMemeImg.src = "/img/memes/" + random + ".jpg"; + }) + } } \ No newline at end of file diff --git a/src/Otchinslator/DatabaseContext.cs b/src/Otchinslator/DatabaseContext.cs index f5cf753..e98bd7e 100644 --- a/src/Otchinslator/DatabaseContext.cs +++ b/src/Otchinslator/DatabaseContext.cs @@ -38,7 +38,13 @@ public class DatabaseContext : DbContext new Specialty() { Id = 7, Name = "Применение и эксплуатация автоматизированных систем специального назначения", Code = "09.05.01", InstitutId = 1 }, new Specialty() { Id = 8, Name = "Информационная безопасность телекоммуникационных систем", Code = "10.05.02", InstitutId = 1 }, new Specialty() { Id = 9, Name = "Информационная безопасность автоматизированных систем", Code = "10.05.03", InstitutId = 1 }, - new Specialty() { Id = 10, Name = "Безопасность информационных технологий в правоохранительной сфере", Code = "10.05.05", InstitutId = 1 } + new Specialty() { Id = 10, Name = "Безопасность информационных технологий в правоохранительной сфере", Code = "10.05.05", InstitutId = 1 }, + // ИРТСУ + new Specialty() { Id = 10, Name = "НЕ ЗАПОЛНЕНО", Code = "0.0.0", InstitutId = 2 }, + // ИУЭС + new Specialty() { Id = 11, Name = "НЕ ЗАПОЛНЕНО", Code = "0.0.0", InstitutId = 3 }, + // ИНЭП + new Specialty() { Id = 12, Name = "НЕ ЗАПОЛНЕНО", Code = "0.0.0", InstitutId = 4 } ); } } \ No newline at end of file diff --git a/src/Otchinslator/Dockerfile b/src/Otchinslator/Dockerfile index 06c226e..d70f3e0 100644 --- a/src/Otchinslator/Dockerfile +++ b/src/Otchinslator/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/aspnet:9.0.1-alpine3.21 AS base +FROM mcr.microsoft.com/dotnet/aspnet:9.0.2-alpine3.21 AS base USER root RUN apk update && apk add --no-cache curl icu tzdata musl-locales musl-locales-lang USER $APP_UID diff --git a/src/Otchinslator/Otchinslator.csproj b/src/Otchinslator/Otchinslator.csproj index 1456ff4..13d3c66 100644 --- a/src/Otchinslator/Otchinslator.csproj +++ b/src/Otchinslator/Otchinslator.csproj @@ -28,17 +28,15 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + +