Replace custom socket implementation with SignalR.

Replace MSAL and custom cookie auth with Microsoft.Identity.EntityFramework
Also some UI redesign to accommodate different login experience.
This commit is contained in:
2024-08-25 03:46:44 +00:00
parent d688afaeae
commit 51d234d871
172 changed files with 3857 additions and 4045 deletions

View File

@@ -1,7 +1,13 @@
{
"Logging": {
"LogLevel": {
"Default": "Warning"
"Default": "Warning",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Error",
"Microsoft.AspNetCore.HttpLogging.HttpLoggingMiddleware": "Information",
"System.Net.Http.HttpClient": "Error",
"Microsoft.AspNetCore.SignalR": "Debug",
"Microsoft.AspNetCore.Http.Connections": "Debug"
}
},
"AzureAd": {
@@ -12,9 +18,9 @@
"api://c1e94676-cab0-42ba-8b6c-9532b8486fff/DefaultScope"
]
},
"ShogiApiUrl": "https://api.lucaserver.space/Shogi.Api/",
"SocketUrl": "wss://api.lucaserver.space/Shogi.Api/",
"ShogiApiUrl2": "https://api.lucaserver.space/Shogi.Api/",
"SocketUrl2": "wss://api.lucaserver.space/Shogi.Api/",
"ShogiApiUrl2": "https://localhost:5001",
"SocketUrl2": "wss://localhost:5001"
"ShogiApiUrl": "https://localhost:5001",
"SocketUrl": "wss://localhost:5001"
}

View File

@@ -1,65 +1,16 @@
@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');
html, body, #app {
html, body, #app {
height: 100vh;
}
body {
margin: 0;
padding: 0;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
color: var(--primary-color);
}
span {
display: inline-block;
vertical-align: middle;
}
a {
text-decoration: none;
}
a.plain {
color: inherit;
}
a:hover {
text-decoration: underline;
}
button {
background-color: var(--primary-color);
color: var(--contrast-color);
border: none;
padding: 0.3rem 0.7rem;
border: 1px solid var(--primary-color);
border-radius: 2px;
cursor: pointer;
font: inherit;
font-size: 85%;
}
.smaller {
font-size: smaller;
}
#app {
display: grid;
}
.valid.modified:not([type=checkbox]) {
outline: 1px solid #26b050;
}
.invalid {
outline: 1px solid red;
}
.validation-message {
color: red;
}
#blazor-error-ui {
background: lightyellow;
bottom: 0;
@@ -88,40 +39,3 @@ button {
.blazor-error-boundary::after {
content: "An error has occurred."
}
p {
margin-bottom: 0.5rem;
}
/* Layout */
.flex-between {
display: flex;
justify-content: space-between;
}
/* Variables */
html {
--primary-color: #444;
--secondary-color: #5e5e5e;
--contrast-color: #eaeaea;
}
/* Bootstrap overrides */
h1, h2, h3, h4, h5, h6 {
all: revert;
margin-top: 0;
margin-bottom: 0.5rem;
}
button.btn-link {
color: #0066cc;
}
button.btn.btn-link:not(:hover) {
text-decoration: none;
}
.place-self-center {
place-self: center;
}

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 1.0 MiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,68 @@
.PrimaryTheme {
--backgroundColor: #444444;
--foregroundColor: #eaeaea;
--hrefColor: #99c3ff;
--uniformBottomMargin: 0.5rem;
background-color: var(--backgroundColor);
color: var(--foregroundColor);
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.PrimaryTheme a {
color: var(--hrefColor);
}
.PrimaryTheme a:not(:hover) {
text-decoration: none;
}
.PrimaryTheme button {
background-color: var(--foregroundColor);
color: var(--backgroundColor);
border: none;
padding: 0.3rem 0.7rem;
border: 1px solid var(--backgroundColor);
border-radius: 2px;
cursor: pointer;
font: inherit;
font-size: 85%;
}
.PrimaryTheme button.href {
border: 0;
background: unset;
color: var(--hrefColor);
padding: 0;
font-size: 100%;
}
.PrimaryTheme button.href:hover {
text-decoration: underline;
}
.PrimaryTheme p, .PrimaryTheme h1, .PrimaryTheme h2, .PrimaryTheme h3, .PrimaryTheme h4, .PrimaryTheme h5, .PrimaryTheme h6 {
margin-top: 0;
margin-bottom: var(--uniformBottomMargin);
}
.PrimaryTheme ul {
padding: 0.3rem;
margin: 0;
margin-bottom: var(--uniformBottomMargin);
background-color: var(--foregroundColor);
color: var(--backgroundColor);
list-style-position: inside;
}
/***************************
* Contrast Variant *
***************************/
.PrimaryTheme .ThemeVariant--Contrast {
--backgroundColor: #eaeaea;
--foregroundColor: #444444;
--hrefColor: #0065be;
}

View File

@@ -2,35 +2,32 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>Shogi.UI</title>
<script type="text/javascript">
var base = document.createElement('base');
base.href = window.location.href.includes("localhost")
? "/"
: "/shogi/";
document.head.appendChild(base);
</script>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>Shogi.UI</title>
<script type="text/javascript">
var base = document.createElement('base');
base.href = window.location.href.includes("localhost")
? "/"
: "/shogi/";
document.head.appendChild(base);
</script>
<link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" />
<link href="css/icons/bootstrap-icons.css" rel="stylesheet" />
<script type="text/javascript" src="css/bootstrap/bootstrap.min.js"></script>
<link href="css/app.css" rel="stylesheet" />
<link href="Shogi.UI.styles.css" rel="stylesheet" />
<link href="css/app.css" rel="stylesheet" />
<link href="css/themes.css" rel="stylesheet" />
<link href="Shogi.UI.styles.css" rel="stylesheet" />
</head>
<body>
<div id="app"></div>
<div id="app"></div>
<div id="blazor-error-ui">
An unhandled error has occurred.
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>
<script src="_content/Microsoft.AspNetCore.Components.WebAssembly.Authentication/AuthenticationService.js"></script>
<script src="_content/Microsoft.Authentication.WebAssembly.Msal/AuthenticationService.js"></script>
<script src="_framework/blazor.webassembly.js"></script>
<div id="blazor-error-ui">
An unhandled error has occurred.
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>
<script src="_content/Microsoft.AspNetCore.Components.WebAssembly.Authentication/AuthenticationService.js"></script>
<script src="_framework/blazor.webassembly.js"></script>
</body>
</html>