From 57eb9b3a7e1b6696d378d164f534face32258bbd Mon Sep 17 00:00:00 2001 From: Jared Goodwin Date: Thu, 5 Mar 2020 22:20:17 -0800 Subject: [PATCH] Added server config page. --- README.md | 2 +- .../Pages/Account/Manage/Index.cshtml | 2 +- .../Pages/Account/Manage/ManageNavPages.cs | 4 + .../Pages/Account/Manage/Options.cshtml | 18 +- .../Pages/Account/Manage/Organization.cshtml | 14 +- .../Pages/Account/Manage/ServerConfig.cshtml | 255 +++++++ .../Account/Manage/ServerConfig.cshtml.cs | 205 ++++++ .../Pages/Account/Manage/_ManageNav.cshtml | 17 +- .../Identity/Pages/Account/Register.cshtml.cs | 7 +- ...6013915_IsServerAdmin property.Designer.cs | 662 ++++++++++++++++++ .../20200306013915_IsServerAdmin property.cs | 22 + .../ApplicationDbContextModelSnapshot.cs | 3 + Server/Server.csproj | 2 + Server/wwwroot/css/site.css | 5 + Server/wwwroot/scripts/Pages/ServerConfig.js | 76 ++ .../wwwroot/scripts/Pages/ServerConfig.js.map | 1 + Server/wwwroot/scripts/Pages/ServerConfig.ts | 90 +++ Shared/Models/RemotelyUser.cs | 2 +- 18 files changed, 1362 insertions(+), 25 deletions(-) create mode 100644 Server/Areas/Identity/Pages/Account/Manage/ServerConfig.cshtml create mode 100644 Server/Areas/Identity/Pages/Account/Manage/ServerConfig.cshtml.cs create mode 100644 Server/Migrations/20200306013915_IsServerAdmin property.Designer.cs create mode 100644 Server/Migrations/20200306013915_IsServerAdmin property.cs create mode 100644 Server/wwwroot/scripts/Pages/ServerConfig.js create mode 100644 Server/wwwroot/scripts/Pages/ServerConfig.js.map create mode 100644 Server/wwwroot/scripts/Pages/ServerConfig.ts diff --git a/README.md b/README.md index 5a691486..a1cf284c 100644 --- a/README.md +++ b/README.md @@ -122,7 +122,7 @@ Note: To retain your settings between upgrades, copy your settings to appsetting * RemoteControlSessionLimit: How many concurrent remote control sessions are allowed per organization. * RemoteControlRequiresAuthentication: Whether the remote control page requires authentication to establish a connection. * Require2FA: Require users to set up 2FA before they can use the main app. -* AllowApiLogin: Whether to allow logging in via the API (see below). +* AllowApiLogin: Whether to allow logging in via the API controller. API access tokens are recommended over this approach. * TrustedCorsOrigins: For cross-origin API requests via JavaScript. The websites listed in this array with be allowed to make requests to the API. This does not grant authentication, which is still required on most endpoints. * KnownProxies: If your Nginx server is on a different machine and is forwarding requests to the Remotely server, you will need to add the IP of the Nginx server to this array. * Smpt*: SMTP settings for auto-generated system emails (such as registration and password reset). diff --git a/Server/Areas/Identity/Pages/Account/Manage/Index.cshtml b/Server/Areas/Identity/Pages/Account/Manage/Index.cshtml index ae71694f..2cf76332 100644 --- a/Server/Areas/Identity/Pages/Account/Manage/Index.cshtml +++ b/Server/Areas/Identity/Pages/Account/Manage/Index.cshtml @@ -36,7 +36,7 @@ - + diff --git a/Server/Areas/Identity/Pages/Account/Manage/ManageNavPages.cs b/Server/Areas/Identity/Pages/Account/Manage/ManageNavPages.cs index db68ae85..288d6dc2 100644 --- a/Server/Areas/Identity/Pages/Account/Manage/ManageNavPages.cs +++ b/Server/Areas/Identity/Pages/Account/Manage/ManageNavPages.cs @@ -27,6 +27,8 @@ namespace Remotely.Server.Areas.Identity.Pages.Account.Manage public static string ServerLogs => "ServerLogs"; + public static string ServerConfig => "ServerConfig"; + public static string IndexNavClass(ViewContext viewContext) => PageNavClass(viewContext, Index); public static string ChangePasswordNavClass(ViewContext viewContext) => PageNavClass(viewContext, ChangePassword); @@ -45,6 +47,8 @@ namespace Remotely.Server.Areas.Identity.Pages.Account.Manage public static string ApiTokensNavClass(ViewContext viewContext) => PageNavClass(viewContext, ApiTokens); public static string ServerLogsNavClass(ViewContext viewContext) => PageNavClass(viewContext, ServerLogs); + public static string ServerConfigNavClass(ViewContext viewContext) => PageNavClass(viewContext, ServerConfig); + public static string PageNavClass(ViewContext viewContext, string page) { var activePage = viewContext.ViewData["ActivePage"] as string diff --git a/Server/Areas/Identity/Pages/Account/Manage/Options.cshtml b/Server/Areas/Identity/Pages/Account/Manage/Options.cshtml index e2798ffa..dfb87626 100644 --- a/Server/Areas/Identity/Pages/Account/Manage/Options.cshtml +++ b/Server/Areas/Identity/Pages/Account/Manage/Options.cshtml @@ -9,14 +9,14 @@
-
+


- +
@@ -25,7 +25,7 @@

- +
@@ -40,39 +40,39 @@

- +


- +


- +


- +


- +
- +
diff --git a/Server/Areas/Identity/Pages/Account/Manage/Organization.cshtml b/Server/Areas/Identity/Pages/Account/Manage/Organization.cshtml index cb491ac2..76807064 100644 --- a/Server/Areas/Identity/Pages/Account/Manage/Organization.cshtml +++ b/Server/Areas/Identity/Pages/Account/Manage/Organization.cshtml @@ -61,9 +61,7 @@
- - - +
@@ -161,7 +159,7 @@
- +
@@ -210,11 +208,9 @@
- - - +