WebFileServer20

Мелкие правки

10/30/2020 2:56:37 PM

Details

diff --git a/Web/.config/dotnet-tools.json b/Web/.config/dotnet-tools.json
new file mode 100644
index 0000000..c6f5df7
--- /dev/null
+++ b/Web/.config/dotnet-tools.json
@@ -0,0 +1,12 @@
+{
+  "version": 1,
+  "isRoot": true,
+  "tools": {
+    "dotnet-ef": {
+      "version": "3.1.9",
+      "commands": [
+        "dotnet-ef"
+      ]
+    }
+  }
+}
\ No newline at end of file
diff --git a/Web/ClientApp/public/index.html b/Web/ClientApp/public/index.html
index 4d6b37e..1e0ff94 100644
--- a/Web/ClientApp/public/index.html
+++ b/Web/ClientApp/public/index.html
@@ -1,5 +1,5 @@
-<!DOCTYPE html>
-<html lang="en">
+<!DOCTYPE html>
+<html lang="ru">
   <head>
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
@@ -20,7 +20,7 @@
       work correctly both with client-side routing and a non-root public URL.
       Learn how to configure a non-root public URL by running `npm run build`.
     -->
-    <title>Web</title>
+    <title>Файловый веб сервер</title>
   </head>
   <body>
     <noscript>
diff --git a/Web/ClientApp/src/components/api-authorization/LoginMenu.js b/Web/ClientApp/src/components/api-authorization/LoginMenu.js
index 41734f9..479417a 100644
--- a/Web/ClientApp/src/components/api-authorization/LoginMenu.js
+++ b/Web/ClientApp/src/components/api-authorization/LoginMenu.js
@@ -47,10 +47,10 @@ export class LoginMenu extends Component {
     authenticatedView(userName, profilePath, logoutPath) {
         return (<Fragment>
             <NavItem>
-                <NavLink tag={Link} className="text-dark" to={profilePath}>Hello {userName}</NavLink>
+                <NavLink tag={Link} className="text-dark" to={profilePath}>Личный кабинет{/*Здравствуйте, {userName}*/}</NavLink>
             </NavItem>
             <NavItem>
-                <NavLink tag={Link} className="text-dark" to={logoutPath}>Logout</NavLink>
+                <NavLink tag={Link} className="text-dark" to={logoutPath}>Выйти</NavLink>
             </NavItem>
         </Fragment>);
 
@@ -58,11 +58,15 @@ export class LoginMenu extends Component {
 
     anonymousView(registerPath, loginPath) {
         return (<Fragment>
-            <NavItem>
-                <NavLink tag={Link} className="text-dark" to={registerPath}>Register</NavLink>
+            {
+                /*
+                 <NavItem>
+                <NavLink tag={Link} className="text-dark" to={registerPath}>Регистрация</NavLink>
             </NavItem>
+                 */
+            }
             <NavItem>
-                <NavLink tag={Link} className="text-dark" to={loginPath}>Login</NavLink>
+                <NavLink tag={Link} className="text-dark" to={loginPath}>Войти</NavLink>
             </NavItem>
         </Fragment>);
     }
diff --git a/Web/ClientApp/src/components/Home.js b/Web/ClientApp/src/components/Home.js
index 7f6b28e..e36bc3e 100644
--- a/Web/ClientApp/src/components/Home.js
+++ b/Web/ClientApp/src/components/Home.js
@@ -6,8 +6,10 @@ export class Home extends Component {
   render () {
     return (
       <div>
-        <h1>Hello, world!</h1>
-        <p>Welcome to your new single-page application, built with:</p>
+            <h1>Главная страница файлового веб-сервера компании "Сибинтек".</h1>
+            {
+                /*
+                 <p>Welcome to your new single-page application, built with:</p>
         <ul>
           <li><a href='https://get.asp.net/'>ASP.NET Core</a> and <a href='https://msdn.microsoft.com/en-us/library/67ef8sbd.aspx'>C#</a> for cross-platform server-side code</li>
           <li><a href='https://facebook.github.io/react/'>React</a> for client-side code</li>
@@ -20,6 +22,8 @@ export class Home extends Component {
           <li><strong>Efficient production builds</strong>. In production mode, development-time features are disabled, and your <code>dotnet publish</code> configuration produces minified, efficiently bundled JavaScript files.</li>
         </ul>
         <p>The <code>ClientApp</code> subdirectory is a standard React application based on the <code>create-react-app</code> template. If you open a command prompt in that directory, you can run <code>npm</code> commands such as <code>npm test</code> or <code>npm install</code>.</p>
+                 */
+            }
       </div>
     );
   }
diff --git a/Web/ClientApp/src/components/NavMenu.js b/Web/ClientApp/src/components/NavMenu.js
index f41ed03..f88d0a0 100644
--- a/Web/ClientApp/src/components/NavMenu.js
+++ b/Web/ClientApp/src/components/NavMenu.js
@@ -27,19 +27,25 @@ export class NavMenu extends Component {
       <header>
         <Navbar className="navbar-expand-sm navbar-toggleable-sm ng-white border-bottom box-shadow mb-3" light>
           <Container>
-            <NavbarBrand tag={Link} to="/">Web</NavbarBrand>
+            <NavbarBrand tag={Link} to="/">Веб сервер</NavbarBrand>
             <NavbarToggler onClick={this.toggleNavbar} className="mr-2" />
             <Collapse className="d-sm-inline-flex flex-sm-row-reverse" isOpen={!this.state.collapsed} navbar>
               <ul className="navbar-nav flex-grow">
                 <NavItem>
-                  <NavLink tag={Link} className="text-dark" to="/">Home</NavLink>
+                  <NavLink tag={Link} className="text-dark" to="/">Главная</NavLink>
                 </NavItem>
-                <NavItem>
+
+                {
+                    /*
+                     <NavItem>
                   <NavLink tag={Link} className="text-dark" to="/counter">Counter</NavLink>
                 </NavItem>
                 <NavItem>
                   <NavLink tag={Link} className="text-dark" to="/fetch-data">Fetch data</NavLink>
                 </NavItem>
+                     */
+                }
+                
                 <LoginMenu>
                 </LoginMenu>
               </ul>
diff --git a/Web/Pages/Shared/_LoginPartial.cshtml b/Web/Pages/Shared/_LoginPartial.cshtml
index 51a7a59..fefdb9b 100644
--- a/Web/Pages/Shared/_LoginPartial.cshtml
+++ b/Web/Pages/Shared/_LoginPartial.cshtml
@@ -16,21 +16,21 @@
     @if (SignInManager.IsSignedIn(User))
     {
         <li class="nav-item">
-            <a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Manage/Index" title="Manage">Hello @User.Identity.Name!</a>
+            <a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Manage/Index" title="Manage">Личный кабинет@*@User.Identity.Name*@</a>
         </li>
         <li class="nav-item">
             <form class="form-inline" asp-area="Identity" asp-page="/Account/Logout" asp-route-returnUrl="/">
-                <button type="submit" class="nav-link btn btn-link text-dark">Logout</button>
+                <button type="submit" class="nav-link btn btn-link text-dark">Выход</button>
             </form>
         </li>
     }
     else
     {
         <li class="nav-item">
-            <a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Register" asp-route-returnUrl="@returnUrl">Register</a>
+            <a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Register" asp-route-returnUrl="@returnUrl">Регистрация</a>
         </li>
         <li class="nav-item">
-            <a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Login"asp-route-returnUrl="@returnUrl">Login</a>
+            <a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Login"asp-route-returnUrl="@returnUrl">Вход</a>
         </li>
     }
 </ul>
diff --git a/Web/Properties/launchSettings.json b/Web/Properties/launchSettings.json
index 83a044a..73382c3 100644
--- a/Web/Properties/launchSettings.json
+++ b/Web/Properties/launchSettings.json
@@ -1,4 +1,4 @@
-{
+{
   "iisSettings": {
     "windowsAuthentication": false,
     "anonymousAuthentication": true,
@@ -13,15 +13,16 @@
       "launchBrowser": true,
       "environmentVariables": {
         "ASPNETCORE_ENVIRONMENT": "Development"
-      }
+      },
+      "ancmHostingModel": "OutOfProcess"
     },
     "Web": {
       "commandName": "Project",
       "launchBrowser": true,
-      "applicationUrl": "https://localhost:5001;http://localhost:5000",
       "environmentVariables": {
         "ASPNETCORE_ENVIRONMENT": "Development"
-      }
+      },
+      "applicationUrl": "https://localhost:5001;http://localhost:5000"
     }
   }
-}
+}
\ No newline at end of file

Web/Startup.cs 7(+6 -1)

diff --git a/Web/Startup.cs b/Web/Startup.cs
index 99aaa84..2a86add 100644
--- a/Web/Startup.cs
+++ b/Web/Startup.cs
@@ -30,7 +30,12 @@ namespace Web
                 options.UseSqlServer(
                     Configuration.GetConnectionString("DefaultConnection")));
 
-            services.AddDefaultIdentity<ApplicationUser>(options => options.SignIn.RequireConfirmedAccount = true)
+            services.AddDefaultIdentity<ApplicationUser>(options =>
+
+            {
+                options.SignIn.RequireConfirmedAccount = false;
+                options.Password.RequiredLength = 7;
+                })
                 .AddEntityFrameworkStores<ApplicationDbContext>();
 
             services.AddIdentityServer()

Web/Web.csproj 1(+1 -0)

diff --git a/Web/Web.csproj b/Web/Web.csproj
index 07e7d13..d59ccfc 100644
--- a/Web/Web.csproj
+++ b/Web/Web.csproj
@@ -7,6 +7,7 @@
     <IsPackable>false</IsPackable>
     <SpaRoot>ClientApp\</SpaRoot>
     <DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes>
+    <UserSecretsId>daf39a4d-4ceb-4154-9538-b52ed2b29f34</UserSecretsId>
   </PropertyGroup>
 
   <ItemGroup>