Client fixes
Client is partially done. 227 warnings left out of 1500 I like Rider
This commit is contained in:
@ -18,10 +18,10 @@
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Title" class="control-label" style="font-weight: bold">Database Type: </label>
|
||||
<label class="control-label" style="font-weight: bold">Database Type: </label>
|
||||
</td>
|
||||
<td>
|
||||
<select class="custom-select" @bind="@DatabaseType">
|
||||
<select class="custom-select" @bind="@_databaseType">
|
||||
<option value="LocalDB">Local Database</option>
|
||||
<option value="SQLServer">SQL Server</option>
|
||||
</select>
|
||||
@ -29,23 +29,23 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Title" class="control-label" style="font-weight: bold">Server: </label>
|
||||
<label class="control-label" style="font-weight: bold">Server: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" class="form-control" @bind="@ServerName" />
|
||||
<input type="text" class="form-control" @bind="@_serverName" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Title" class="control-label" style="font-weight: bold">Database: </label>
|
||||
<label class="control-label" style="font-weight: bold">Database: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" class="form-control" @bind="@DatabaseName" />
|
||||
<input type="text" class="form-control" @bind="@_databaseName" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Title" class="control-label" style="font-weight: bold">Integrated Security: </label>
|
||||
<label class="control-label" style="font-weight: bold">Integrated Security: </label>
|
||||
</td>
|
||||
<td>
|
||||
<select class="custom-select" @onchange="SetIntegratedSecurity">
|
||||
@ -54,20 +54,20 @@
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="@IntegratedSecurityDisplay">
|
||||
<tr style="@_integratedSecurityDisplay">
|
||||
<td>
|
||||
<label for="Title" class="control-label" style="font-weight: bold">Username: </label>
|
||||
<label class="control-label" style="font-weight: bold">Username: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" class="form-control" @bind="@Username" />
|
||||
<input type="text" class="form-control" @bind="@_username" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="@IntegratedSecurityDisplay">
|
||||
<tr style="@_integratedSecurityDisplay">
|
||||
<td>
|
||||
<label for="Title" class="control-label" style="font-weight: bold">Password: </label>
|
||||
<label class="control-label" style="font-weight: bold">Password: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="password" class="form-control" @bind="@Password" />
|
||||
<input type="password" class="form-control" @bind="@_password" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@ -79,34 +79,34 @@
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Title" class="control-label" style="font-weight: bold">Username: </label>
|
||||
<label class="control-label" style="font-weight: bold">Username: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" class="form-control" @bind="@HostUsername" readonly />
|
||||
<input type="text" class="form-control" @bind="@_hostUsername" readonly />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Title" class="control-label" style="font-weight: bold">Password: </label>
|
||||
<label class="control-label" style="font-weight: bold">Password: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="password" class="form-control" @bind="@HostPassword" />
|
||||
<input type="password" class="form-control" @bind="@_hostPassword" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Title" class="control-label" style="font-weight: bold">Confirm: </label>
|
||||
<label class="control-label" style="font-weight: bold">Confirm: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="password" class="form-control" @bind="@ConfirmPassword" />
|
||||
<input type="password" class="form-control" @bind="@_confirmPassword" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Title" class="control-label" style="font-weight: bold">Email: </label>
|
||||
<label class="control-label" style="font-weight: bold">Email: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" class="form-control" @bind="@HostEmail" />
|
||||
<input type="text" class="form-control" @bind="@_hostEmail" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@ -117,61 +117,61 @@
|
||||
<div class="row">
|
||||
<div class="mx-auto text-center">
|
||||
<button type="button" class="btn btn-success" @onclick="Install">Install Now</button><br /><br />
|
||||
@((MarkupString)@Message)
|
||||
@((MarkupString)_message)
|
||||
</div>
|
||||
<div class="app-progress-indicator" style="@LoadingDisplay"></div>
|
||||
<div class="app-progress-indicator" style="@_loadingDisplay"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
private string DatabaseType = "LocalDB";
|
||||
private string ServerName = "(LocalDb)\\MSSQLLocalDB";
|
||||
private string DatabaseName = "Oqtane-" + DateTime.UtcNow.ToString("yyyyMMddHHmm");
|
||||
private string Username = "";
|
||||
private string Password = "";
|
||||
private string HostUsername = Constants.HostUser;
|
||||
private string HostPassword = "";
|
||||
private string ConfirmPassword = "";
|
||||
private string HostEmail = "";
|
||||
private string Message = "";
|
||||
private string _databaseType = "LocalDB";
|
||||
private string _serverName = "(LocalDb)\\MSSQLLocalDB";
|
||||
private string _databaseName = "Oqtane-" + DateTime.UtcNow.ToString("yyyyMMddHHmm");
|
||||
private string _username = "";
|
||||
private string _password = "";
|
||||
private string _hostUsername = Constants.HostUser;
|
||||
private string _hostPassword = "";
|
||||
private string _confirmPassword = "";
|
||||
private string _hostEmail = "";
|
||||
private string _message = "";
|
||||
|
||||
private string IntegratedSecurityDisplay = "display: none;";
|
||||
private string LoadingDisplay = "display: none;";
|
||||
private string _integratedSecurityDisplay = "display: none;";
|
||||
private string _loadingDisplay = "display: none;";
|
||||
|
||||
private void SetIntegratedSecurity(ChangeEventArgs e)
|
||||
{
|
||||
if (Convert.ToBoolean((string)e.Value))
|
||||
{
|
||||
IntegratedSecurityDisplay = "display: none;";
|
||||
_integratedSecurityDisplay = "display: none;";
|
||||
}
|
||||
else
|
||||
{
|
||||
IntegratedSecurityDisplay = "";
|
||||
_integratedSecurityDisplay = "";
|
||||
}
|
||||
}
|
||||
|
||||
private async Task Install()
|
||||
{
|
||||
if (HostUsername != "" && HostPassword.Length >= 6 && HostPassword == ConfirmPassword && HostEmail != "")
|
||||
if (_hostUsername != "" && _hostPassword.Length >= 6 && _hostPassword == _confirmPassword && _hostEmail != "")
|
||||
{
|
||||
LoadingDisplay = "";
|
||||
_loadingDisplay = "";
|
||||
StateHasChanged();
|
||||
|
||||
string connectionstring = "";
|
||||
if (DatabaseType == "LocalDB")
|
||||
if (_databaseType == "LocalDB")
|
||||
{
|
||||
connectionstring = "Data Source=" + ServerName + ";AttachDbFilename=|DataDirectory|\\" + DatabaseName + ".mdf;Initial Catalog=" + DatabaseName + ";Integrated Security=SSPI;";
|
||||
connectionstring = "Data Source=" + _serverName + ";AttachDbFilename=|DataDirectory|\\" + _databaseName + ".mdf;Initial Catalog=" + _databaseName + ";Integrated Security=SSPI;";
|
||||
}
|
||||
else
|
||||
{
|
||||
connectionstring = "Data Source=" + ServerName + ";Initial Catalog=" + DatabaseName + ";";
|
||||
if (IntegratedSecurityDisplay == "display: none;")
|
||||
connectionstring = "Data Source=" + _serverName + ";Initial Catalog=" + _databaseName + ";";
|
||||
if (_integratedSecurityDisplay == "display: none;")
|
||||
{
|
||||
connectionstring += "Integrated Security=SSPI;";
|
||||
}
|
||||
else
|
||||
{
|
||||
connectionstring += "User ID=" + Username + ";Password=" + Password;
|
||||
connectionstring += "User ID=" + _username + ";Password=" + _password;
|
||||
|
||||
}
|
||||
}
|
||||
@ -189,23 +189,23 @@
|
||||
|
||||
User user = new User();
|
||||
user.SiteId = site.SiteId;
|
||||
user.Username = HostUsername;
|
||||
user.Password = HostPassword;
|
||||
user.Email = HostEmail;
|
||||
user.DisplayName = HostUsername;
|
||||
user.Username = _hostUsername;
|
||||
user.Password = _hostPassword;
|
||||
user.Email = _hostEmail;
|
||||
user.DisplayName = _hostUsername;
|
||||
user = await UserService.AddUserAsync(user);
|
||||
|
||||
NavigationManager.NavigateTo("", true);
|
||||
}
|
||||
else
|
||||
{
|
||||
Message = "<div class=\"alert alert-danger\" role=\"alert\">" + response.Message + "</div>";
|
||||
LoadingDisplay = "display: none;";
|
||||
_message = "<div class=\"alert alert-danger\" role=\"alert\">" + response.Message + "</div>";
|
||||
_loadingDisplay = "display: none;";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Message = "<div class=\"alert alert-danger\" role=\"alert\">Please Enter All Fields And Ensure Passwords Match And Are Greater Than 5 Characters In Length</div>";
|
||||
_message = "<div class=\"alert alert-danger\" role=\"alert\">Please Enter All Fields And Ensure Passwords Match And Are Greater Than 5 Characters In Length</div>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user