improvements to module/theme installation and removal
This commit is contained in:
@ -8,6 +8,7 @@ namespace Oqtane.Services
|
||||
{
|
||||
Task<List<ModuleDefinition>> GetModuleDefinitionsAsync(int SiteId);
|
||||
Task UpdateModuleDefinitionAsync(ModuleDefinition ModuleDefinition);
|
||||
Task InstallModulesAsync();
|
||||
Task InstallModuleDefinitionsAsync();
|
||||
Task DeleteModuleDefinitionAsync(int ModuleDefinitionId, int SiteId);
|
||||
}
|
||||
}
|
||||
|
@ -7,9 +7,10 @@ namespace Oqtane.Services
|
||||
public interface IThemeService
|
||||
{
|
||||
Task<List<Theme>> GetThemesAsync();
|
||||
Dictionary<string, string> GetThemeTypes(List<Theme> themes);
|
||||
Dictionary<string, string> GetPaneLayoutTypes(List<Theme> themes);
|
||||
Dictionary<string, string> GetContainerTypes(List<Theme> themes);
|
||||
Dictionary<string, string> GetThemeTypes(List<Theme> Themes);
|
||||
Dictionary<string, string> GetPaneLayoutTypes(List<Theme> Themes);
|
||||
Dictionary<string, string> GetContainerTypes(List<Theme> Themes);
|
||||
Task InstallThemesAsync();
|
||||
Task DeleteThemeAsync(string ThemeName);
|
||||
}
|
||||
}
|
||||
|
@ -69,9 +69,14 @@ namespace Oqtane.Services
|
||||
await http.PutJsonAsync(apiurl + "/" + ModuleDefinition.ModuleDefinitionId.ToString(), ModuleDefinition);
|
||||
}
|
||||
|
||||
public async Task InstallModulesAsync()
|
||||
public async Task InstallModuleDefinitionsAsync()
|
||||
{
|
||||
await http.GetJsonAsync<List<string>>(apiurl + "/install");
|
||||
}
|
||||
|
||||
public async Task DeleteModuleDefinitionAsync(int ModuleDefinitionId, int SiteId)
|
||||
{
|
||||
await http.DeleteAsync(apiurl + "/" + ModuleDefinitionId.ToString() + "?siteid=" + SiteId.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -61,10 +61,10 @@ namespace Oqtane.Services
|
||||
return themes.OrderBy(item => item.Name).ToList();
|
||||
}
|
||||
|
||||
public Dictionary<string, string> GetThemeTypes(List<Theme> themes)
|
||||
public Dictionary<string, string> GetThemeTypes(List<Theme> Themes)
|
||||
{
|
||||
var selectableThemes = new Dictionary<string, string>();
|
||||
foreach (Theme theme in themes)
|
||||
foreach (Theme theme in Themes)
|
||||
{
|
||||
foreach (string themecontrol in theme.ThemeControls.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
|
||||
{
|
||||
@ -74,10 +74,10 @@ namespace Oqtane.Services
|
||||
return selectableThemes;
|
||||
}
|
||||
|
||||
public Dictionary<string, string> GetPaneLayoutTypes(List<Theme> themes)
|
||||
public Dictionary<string, string> GetPaneLayoutTypes(List<Theme> Themes)
|
||||
{
|
||||
var selectablePaneLayouts = new Dictionary<string, string>();
|
||||
foreach (Theme theme in themes)
|
||||
foreach (Theme theme in Themes)
|
||||
{
|
||||
foreach (string panelayout in theme.PaneLayouts.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
|
||||
{
|
||||
@ -87,10 +87,10 @@ namespace Oqtane.Services
|
||||
return selectablePaneLayouts;
|
||||
}
|
||||
|
||||
public Dictionary<string, string> GetContainerTypes(List<Theme> themes)
|
||||
public Dictionary<string, string> GetContainerTypes(List<Theme> Themes)
|
||||
{
|
||||
var selectableContainers = new Dictionary<string, string>();
|
||||
foreach (Theme theme in themes)
|
||||
foreach (Theme theme in Themes)
|
||||
{
|
||||
foreach (string container in theme.ContainerControls.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
|
||||
{
|
||||
@ -104,5 +104,10 @@ namespace Oqtane.Services
|
||||
{
|
||||
await http.GetJsonAsync<List<string>>(apiurl + "/install");
|
||||
}
|
||||
|
||||
public async Task DeleteThemeAsync(string ThemeName)
|
||||
{
|
||||
await http.DeleteAsync(apiurl + "/" + ThemeName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user