Merge remote-tracking branch 'oqtane/dev' into dev

This commit is contained in:
Leigh
2021-11-04 05:53:42 +01:00
11 changed files with 62 additions and 33 deletions

View File

@ -1,6 +1,7 @@
@namespace Oqtane.Installer.Controls @namespace Oqtane.Installer.Controls
@implements Oqtane.Interfaces.IDatabaseConfigControl @implements Oqtane.Interfaces.IDatabaseConfigControl
@inject IStringLocalizer<SqlServerConfig> Localizer @inject IStringLocalizer<SqlServerConfig> Localizer
@inject IStringLocalizer<SharedResources> SharedLocalizer
<div class="row mb-1 align-items-center"> <div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="server" HelpText="Enter the database server" ResourceKey="Server">Server:</Label> <Label Class="col-sm-3" For="server" HelpText="Enter the database server" ResourceKey="Server">Server:</Label>
@ -38,6 +39,15 @@
</div> </div>
</div> </div>
} }
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="encryption" HelpText="Specify if you are using an encrypted database connection. It is highly recommended to use encryption in a production environment." ResourceKey="Encryption">Encryption:</Label>
<div class="col-sm-9">
<select id="encryption" class="form-select custom-select" @bind="@_encryption">
<option value="true">@SharedLocalizer["True"]</option>
<option value="false">@SharedLocalizer["False"]</option>
</select>
</div>
</div>
@code { @code {
private string _server = String.Empty; private string _server = String.Empty;
@ -45,6 +55,7 @@
private string _security = "integrated"; private string _security = "integrated";
private string _uid = String.Empty; private string _uid = String.Empty;
private string _pwd = String.Empty; private string _pwd = String.Empty;
private string _encryption = "false";
public string GetConnectionString() public string GetConnectionString()
{ {
@ -61,15 +72,9 @@
} }
else else
{ {
if (!String.IsNullOrEmpty(_uid) && !String.IsNullOrEmpty(_pwd)) connectionString += $"User ID={_uid};Password={_pwd};";
{
connectionString += $"User ID={_uid};Password={_pwd};";
}
else
{
connectionString = String.Empty;
}
} }
connectionString += $"Encrypt={_encryption};";
return connectionString; return connectionString;
} }

View File

@ -11,13 +11,14 @@
<Pager Items="@PageState.Pages.Where(item => !item.IsDeleted)"> <Pager Items="@PageState.Pages.Where(item => !item.IsDeleted)">
<Header> <Header>
<th style="width: 1px;">&nbsp;</th> <th style="width: 1px;">&nbsp;</th>
<th style="width: 1px;">&nbsp;</th> <th style="width: 1px;">&nbsp;</th>
<th>@SharedLocalizer["Name"]</th> <th>@SharedLocalizer["Name"]</th>
</Header> </Header>
<Row> <Row>
<td><ActionLink Action="Edit" Parameters="@($"id=" + context.PageId.ToString())" ResourceKey="EditPage" /></td> <td><ActionLink Action="Edit" Parameters="@($"id=" + context.PageId.ToString())" ResourceKey="EditPage" /></td>
<td><ActionDialog Header="Delete Page" Message="@string.Format(Localizer["Confirm.Page.Delete"], context.Name)" Action="Delete" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeletePage(context))" ResourceKey="DeletePage" /></td> <td><ActionDialog Header="Delete Page" Message="@string.Format(Localizer["Confirm.Page.Delete"], context.Name)" Action="Delete" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeletePage(context))" ResourceKey="DeletePage" /></td>
<td><button type="button" class="btn btn-secondary" @onclick="@(async () => Browse(context))">@Localizer["Browse"]</button></td>
<td>@(new string('-', context.Level * 2))@(context.Name)</td> <td>@(new string('-', context.Level * 2))@(context.Name)</td>
</Row> </Row>
</Pager> </Pager>
@ -42,4 +43,8 @@
AddModuleMessage(Localizer["Error.Page.Delete"], MessageType.Error); AddModuleMessage(Localizer["Error.Page.Delete"], MessageType.Error);
} }
} }
protected string Browse(Page page)
{
return string.IsNullOrEmpty(page.Url) ? NavigateUrl(page.Path) : page.Url;
}
} }

View File

@ -35,6 +35,9 @@
[Parameter] [Parameter]
public string Style { get; set; } public string Style { get; set; }
[Parameter]
public string DateTimeFormat { get; set; } = "MMM dd yyyy HH:mm:ss";
protected override void OnParametersSet() protected override void OnParametersSet()
{ {
_text = string.Empty; _text = string.Empty;
@ -49,7 +52,7 @@
if (CreatedOn != null) if (CreatedOn != null)
{ {
_text += $" {Localizer["On"]} <b>{CreatedOn.Value.ToString("MMM dd yyyy HH:mm:ss")}</b>"; _text += $" {Localizer["On"]} <b>{CreatedOn.Value.ToString(DateTimeFormat)}</b>";
} }
_text += "</p>"; _text += "</p>";
@ -66,7 +69,7 @@
if (ModifiedOn != null) if (ModifiedOn != null)
{ {
_text += $" {Localizer["on"]} <b>{ModifiedOn.Value.ToString("MMM dd yyyy HH:mm:ss")}</b>"; _text += $" {Localizer["on"]} <b>{ModifiedOn.Value.ToString(DateTimeFormat)}</b>";
} }
_text += "</p>"; _text += "</p>";
@ -83,7 +86,7 @@
if (DeletedOn != null) if (DeletedOn != null)
{ {
_text += $" {Localizer["On"]} <b>{DeletedOn.Value.ToString("MMM dd yyyy HH:mm:ss")}</b>"; _text += $" {Localizer["On"]} <b>{DeletedOn.Value.ToString(DateTimeFormat)}</b>";
} }
_text += "</p>"; _text += "</p>";

View File

@ -153,4 +153,10 @@
<data name="Integrated" xml:space="preserve"> <data name="Integrated" xml:space="preserve">
<value>Integrated</value> <value>Integrated</value>
</data> </data>
<data name="Encryption,Text" xml:space="preserve">
<value>Encryption:</value>
</data>
<data name="Encryption.HelpText" xml:space="preserve">
<value>Specify if you are using an encrypted database connection. It is highly recommended to use encryption in a production environment.</value>
</data>
</root> </root>

View File

@ -129,4 +129,7 @@
<data name="DeletePage.Header" xml:space="preserve"> <data name="DeletePage.Header" xml:space="preserve">
<value>Delete Page</value> <value>Delete Page</value>
</data> </data>
<data name="Browse" xml:space="preserve">
<value>Browse</value>
</data>
</root> </root>

View File

@ -297,4 +297,7 @@
<data name="Runtime.Text" xml:space="preserve"> <data name="Runtime.Text" xml:space="preserve">
<value>Runtime: </value> <value>Runtime: </value>
</data> </data>
<data name="Browse" xml:space="preserve">
<value>Browse</value>
</data>
</root> </root>

View File

@ -1,7 +1,7 @@
@namespace Oqtane.Themes.BlazorTheme @namespace Oqtane.Themes.BlazorTheme
@inherits ContainerBase @inherits ContainerBase
<div class="container"> <div class="container">
<div class="row px-4"> <div class="row p-4">
<div class="d-flex flex-nowrap"> <div class="d-flex flex-nowrap">
<ModuleActions /><h2><ModuleTitle /></h2> <ModuleActions /><h2><ModuleTitle /></h2>
</div> </div>

View File

@ -1,23 +1,26 @@
@namespace Oqtane.Themes.BlazorTheme @namespace Oqtane.Themes.BlazorTheme
@inherits ThemeBase @inherits ThemeBase
<div class="breadcrumbs"> <div class="breadcrumbs">
<Breadcrumbs /> <Breadcrumbs />
</div> </div>
<div class="sidebar"> <div class="row flex-xl-nowrap gx-0">
<nav class="navbar"> <div class="sidebar">
<Logo /><Menu Orientation="Vertical" /> <nav class="navbar">
</nav> <Logo /><Menu Orientation="Vertical" />
</div> </nav>
<div class="main">
<div class="top-row px-4">
<div class="ms-auto"><UserProfile /> <Login /> <ControlPanel /></div>
</div> </div>
<div class="container">
<div class="row px-4"> <div class="main g-0">
<Pane Name="@PaneNames.Admin" /> <div class="top-row px-4">
<div class="ms-auto"><UserProfile /> <Login /> <ControlPanel /></div>
</div>
<div class="container">
<div class="row px-4">
<Pane Name="@PaneNames.Admin" />
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -33,7 +33,7 @@
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="6.0.0-rc.2.21480.10" /> <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="6.0.0-rc.2.21480.10" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.0-rc.2.21480.10" /> <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.0-rc.2.21480.10" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.0-rc.2.21480.10" /> <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.0-rc.2.21480.10" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="4.0.0-preview2.21264.2" /> <PackageReference Include="Microsoft.Data.SqlClient" Version="4.0.0-preview3.21293.2" />
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="6.0.0-rc.2.21480.5" /> <PackageReference Include="Microsoft.Data.Sqlite.Core" Version="6.0.0-rc.2.21480.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.0-rc.2.21480.5" /> <PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.0-rc.2.21480.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.0-rc.2.21480.5"> <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.0-rc.2.21480.5">

View File

@ -124,6 +124,7 @@
@media (min-width: 768px) { @media (min-width: 768px) {
app { app {
flex-direction: row; flex-direction: row;
display: block;
} }
.app-logo { .app-logo {

View File

@ -20,10 +20,10 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Localization" Version="2.2.0" /> <PackageReference Include="Microsoft.AspNetCore.Localization" Version="2.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="bunit.web" Version="1.0.0-beta-10" /> <PackageReference Include="bunit.web" Version="1.3.35-preview" />
<PackageReference Include="bunit.xunit" Version="1.0.0-beta-10" /> <PackageReference Include="bunit.xunit" Version="1.0.0-preview-02" />
<PackageReference Include="xunit.core" Version="2.4.1" /> <PackageReference Include="xunit.core" Version="2.4.2-pre.12" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3"> <PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>