Refactor host user security model, support static assets in modules and themes, module definition permissions and categories, paging control, remove SiteUsers, move seed data from script to site template for installation
This commit is contained in:
39
Oqtane.Client/Services/InstallationService.cs
Normal file
39
Oqtane.Client/Services/InstallationService.cs
Normal file
@ -0,0 +1,39 @@
|
||||
using Oqtane.Models;
|
||||
using System.Threading.Tasks;
|
||||
using System.Net.Http;
|
||||
using System.Linq;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using System.Collections.Generic;
|
||||
using Oqtane.Shared;
|
||||
|
||||
namespace Oqtane.Services
|
||||
{
|
||||
public class InstallationService : ServiceBase, IInstallationService
|
||||
{
|
||||
private readonly HttpClient http;
|
||||
private readonly SiteState sitestate;
|
||||
private readonly NavigationManager NavigationManager;
|
||||
|
||||
public InstallationService(HttpClient http, SiteState sitestate, NavigationManager NavigationManager)
|
||||
{
|
||||
this.http = http;
|
||||
this.sitestate = sitestate;
|
||||
this.NavigationManager = NavigationManager;
|
||||
}
|
||||
|
||||
private string apiurl
|
||||
{
|
||||
get { return CreateApiUrl(sitestate.Alias, NavigationManager.Uri, "Installation"); }
|
||||
}
|
||||
|
||||
public async Task<GenericResponse> IsInstalled()
|
||||
{
|
||||
return await http.GetJsonAsync<GenericResponse>(apiurl + "/installed");
|
||||
}
|
||||
|
||||
public async Task<GenericResponse> Install(string connectionstring)
|
||||
{
|
||||
return await http.PostJsonAsync<GenericResponse>(apiurl, connectionstring);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user