Fixed issue #107
This commit is contained in:
parent
4de8572a87
commit
0de2250ada
|
@ -1,50 +0,0 @@
|
|||
@namespace YourCompany.Module.HelloWorld
|
||||
@inherits ModuleBase
|
||||
@inject ISettingService SettingService
|
||||
|
||||
<div class="mx-auto">
|
||||
@if (UserSecurity.IsAuthorized(PageState.User, "Edit", ModuleState.Permissions))
|
||||
{
|
||||
<div class="input-group">
|
||||
<input type="text" name="Url" class="form-control" placeholder="Enter An Image Url" @bind="@url1" />
|
||||
<span class="input-group-btn">
|
||||
<button type="button" class="btn btn-primary" @onclick="Save">Save</button>
|
||||
</span>
|
||||
</div>
|
||||
}
|
||||
<div>
|
||||
@if (!string.IsNullOrEmpty(url2))
|
||||
{
|
||||
<br /><img src="@url2" />
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
|
||||
@code {
|
||||
string url1 = ""; // use https://www.oqtane.org/Portals/0/Images/helloworld.png
|
||||
string url2 = "";
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
Dictionary<string, string> settings = await SettingService.GetModuleSettingsAsync(ModuleState.ModuleId);
|
||||
url2 = SettingService.GetSetting(settings, "url", "");
|
||||
}
|
||||
|
||||
private async Task Save()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(url1))
|
||||
{
|
||||
Dictionary<string, string> settings = await SettingService.GetModuleSettingsAsync(ModuleState.ModuleId);
|
||||
SettingService.SetSetting(settings, "url", url1);
|
||||
await SettingService.UpdateModuleSettingsAsync(settings, ModuleState.ModuleId);
|
||||
ModuleInstance.AddModuleMessage("Url Saved", MessageType.Success);
|
||||
url2 = url1;
|
||||
StateHasChanged();
|
||||
}
|
||||
else
|
||||
{
|
||||
ModuleInstance.AddModuleMessage("You Must Enter A Url", MessageType.Warning);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -86,7 +86,6 @@
|
|||
</td>
|
||||
<td>
|
||||
<select class="form-control" @bind="@containertype">
|
||||
<option value=""><Select Container></option>
|
||||
@foreach (KeyValuePair<string, string> container in containers)
|
||||
{
|
||||
<option value="@container.Key">@container.Value</option>
|
||||
|
@ -145,6 +144,7 @@
|
|||
}
|
||||
moduledefinitions = PageState.ModuleDefinitions.Where(item => item.Categories == "").ToList();
|
||||
containers = ThemeService.GetContainerTypes(PageState.Themes);
|
||||
containertype = containers.FirstOrDefault().Key;
|
||||
List<Module> modules = await ModuleService.GetModulesAsync(PageState.Site.SiteId, Constants.PageManagementModule);
|
||||
if (modules.Count > 0)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user