add ability to register for updates
This commit is contained in:
@ -101,6 +101,11 @@
|
||||
</div>
|
||||
<div class="app-progress-indicator" style="@_loadingDisplay"></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="mx-auto text-center">
|
||||
<input type="checkbox" @bind="@_register" /> @Localizer["Register"]
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
@ -114,6 +119,7 @@
|
||||
private string _hostPassword = string.Empty;
|
||||
private string _confirmPassword = string.Empty;
|
||||
private string _hostEmail = string.Empty;
|
||||
private bool _register = true;
|
||||
private string _message = string.Empty;
|
||||
private string _loadingDisplay = "display: none;";
|
||||
|
||||
@ -169,7 +175,7 @@
|
||||
connectionString = databaseConfigControl.GetConnectionString();
|
||||
}
|
||||
|
||||
if (connectionString != "" && _hostUsername != "" && _hostPassword.Length >= 6 && _hostPassword == _confirmPassword && _hostEmail != "")
|
||||
if (connectionString != "" && _hostUsername != "" && _hostPassword.Length >= 6 && _hostPassword == _confirmPassword && _hostEmail != "" && _hostEmail.Contains("@"))
|
||||
{
|
||||
_loadingDisplay = "";
|
||||
StateHasChanged();
|
||||
@ -188,7 +194,8 @@
|
||||
HostName = UserNames.Host,
|
||||
TenantName = TenantNames.Master,
|
||||
IsNewTenant = true,
|
||||
SiteName = Constants.DefaultSite
|
||||
SiteName = Constants.DefaultSite,
|
||||
Register = _register
|
||||
};
|
||||
|
||||
var installation = await InstallationService.Install(config);
|
||||
|
@ -56,6 +56,12 @@
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="row">
|
||||
<div class="mx-auto text-center">
|
||||
<input type="checkbox" @onchange="(e => RegisterChecked(e))" /> @Localizer["Register"]
|
||||
</div>
|
||||
</div>
|
||||
<br /><br />
|
||||
<a class="btn btn-primary" href="swagger/index.html" target="_new">@Localizer["Access.ApiFramework"]</a>
|
||||
<ActionDialog Header="Restart Application" Message="Are You Sure You Wish To Restart The Application?" Action="Restart Application" Security="SecurityAccessLevel.Host" Class="btn btn-danger" OnClick="@(async () => await RestartApplication())" ResourceKey="RestartApplication" />
|
||||
</TabPanel>
|
||||
@ -183,4 +189,20 @@
|
||||
await logger.LogError(ex, "Error Restarting Application");
|
||||
}
|
||||
}
|
||||
|
||||
private async Task RegisterChecked(ChangeEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if ((bool)e.Value)
|
||||
{
|
||||
await InstallationService.RegisterAsync(PageState.User.Email);
|
||||
AddModuleMessage(Localizer["Success.Register"], MessageType.Success);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
await logger.LogError(ex, "Error On Register");
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
@ -148,6 +148,9 @@
|
||||
<value>Error loading Database Configuration Control</value>
|
||||
</data>
|
||||
<data name="Message.Require.DbInfo" xml:space="preserve">
|
||||
<value>Please Enter All Fields And Ensure Passwords Match And Are Greater Than 5 Characters In Length</value>
|
||||
<value>Please Enter All Required Fields. Ensure Passwords Match And Are Greater Than 5 Characters In Length. Ensure Email Address Provided Is Valid.</value>
|
||||
</data>
|
||||
<data name="Register" xml:space="preserve">
|
||||
<value>Please Register Me For Major Product Updates And Security Bulletins</value>
|
||||
</data>
|
||||
</root>
|
@ -204,16 +204,16 @@
|
||||
<data name="LoggingLevel.HelpText" xml:space="preserve">
|
||||
<value>The Minimum Logging Level For The Event Log. This Option Can Be Used To Control The Volume Of Items Stored In Your Event Log.</value>
|
||||
</data>
|
||||
<data name="Trace" xml:space="preserve">
|
||||
<data name="Trace" xml:space="preserve">
|
||||
<value>Trace</value>
|
||||
</data>
|
||||
<data name="Debug" xml:space="preserve">
|
||||
<data name="Debug" xml:space="preserve">
|
||||
<value>Debug</value>
|
||||
</data>
|
||||
<data name="Information" xml:space="preserve">
|
||||
<data name="Information" xml:space="preserve">
|
||||
<value>Information</value>
|
||||
</data>
|
||||
<data name="Warning" xml:space="preserve">
|
||||
<data name="Warning" xml:space="preserve">
|
||||
<value>Warning</value>
|
||||
</data>
|
||||
<data name="Error" xml:space="preserve">
|
||||
@ -228,4 +228,10 @@
|
||||
<data name="Options" xml:space="preserve">
|
||||
<value>Options</value>
|
||||
</data>
|
||||
<data name="Register" xml:space="preserve">
|
||||
<value>Please Register Me For Major Product Updates And Security Bulletins</value>
|
||||
</data>
|
||||
<data name="Success.Register" xml:space="preserve">
|
||||
<value>You Have Been Successfully Registered For Updates</value>
|
||||
</data>
|
||||
</root>
|
@ -45,5 +45,10 @@ namespace Oqtane.Services
|
||||
{
|
||||
await PostAsync($"{ApiUrl}/restart");
|
||||
}
|
||||
|
||||
public async Task RegisterAsync(string email)
|
||||
{
|
||||
await PostAsync($"{ApiUrl}/register?email={WebUtility.UrlEncode(email)}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10,5 +10,6 @@ namespace Oqtane.Services
|
||||
Task<Installation> Install(InstallConfig config);
|
||||
Task<Installation> Upgrade();
|
||||
Task RestartAsync();
|
||||
Task RegisterAsync(string email);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user