diff --git a/LANCommander.Server/LANCommander.Server.csproj b/LANCommander.Server/LANCommander.Server.csproj
index 60469d69..324464f6 100644
--- a/LANCommander.Server/LANCommander.Server.csproj
+++ b/LANCommander.Server/LANCommander.Server.csproj
@@ -38,7 +38,6 @@
-
diff --git a/LANCommander.Server/Models/Settings.cs b/LANCommander.Server/Models/Settings.cs
index c1dff46e..39386bb8 100644
--- a/LANCommander.Server/Models/Settings.cs
+++ b/LANCommander.Server/Models/Settings.cs
@@ -24,7 +24,6 @@ namespace LANCommander.Server.Models
public LANCommanderMediaSettings Media { get; set; } = new LANCommanderMediaSettings();
public LANCommanderIPXRelaySettings IPXRelay { get; set; } = new LANCommanderIPXRelaySettings();
public LANCommanderServerSettings Servers { get; set; } = new LANCommanderServerSettings();
- public LANCommanderWikiSettings Wiki { get; set; } = new LANCommanderWikiSettings();
public LANCommanderUpdateSettings Update { get; set; } = new LANCommanderUpdateSettings();
public LANCommanderLauncherSettings Launcher { get; set; } = new LANCommanderLauncherSettings();
public LANCommanderLogSettings Logs { get; set; } = new LANCommanderLogSettings();
@@ -98,13 +97,6 @@ namespace LANCommander.Server.Models
public string StoragePath { get; set; } = "Servers";
}
- public class LANCommanderWikiSettings
- {
- public bool Enabled { get; set; } = false;
- public string Username { get; set; } = "";
- public string Password { get; set; } = "";
- }
-
public class LANCommanderUpdateSettings
{
public string StoragePath { get; set; } = "Updates";
diff --git a/LANCommander.Server/Program.cs b/LANCommander.Server/Program.cs
index b3bc6312..69c2a8b6 100644
--- a/LANCommander.Server/Program.cs
+++ b/LANCommander.Server/Program.cs
@@ -188,7 +188,6 @@ namespace LANCommander.Server
builder.Services.AddScoped();
builder.Services.AddScoped();
builder.Services.AddScoped();
- builder.Services.AddScoped();
builder.Services.AddScoped();
builder.Services.AddScoped();
diff --git a/LANCommander.Server/Services/WikiService.cs b/LANCommander.Server/Services/WikiService.cs
deleted file mode 100644
index 1622b947..00000000
--- a/LANCommander.Server/Services/WikiService.cs
+++ /dev/null
@@ -1,94 +0,0 @@
-using LANCommander.Server.Data.Models;
-using LANCommander.PCGamingWiki;
-using Razor.Templating.Core;
-using System.Reflection;
-using System.Text;
-using WikiClientLibrary.Client;
-using WikiClientLibrary.Pages;
-using WikiClientLibrary.Sites;
-
-namespace LANCommander.Server.Services
-{
- public class WikiService : IDisposable
- {
- private GameService GameService;
- private RedistributableService RedistributableService;
- private WikiClient WikiClient;
- private WikiSite WikiSite;
-
- public WikiService(GameService gameService, RedistributableService redistributableService)
- {
- GameService = gameService;
- RedistributableService = redistributableService;
- WikiClient = new WikiClient();
- }
-
- public async Task AuthenticateAsync(string username, string password)
- {
- WikiSite = new WikiSite(WikiClient, "https://lancommander.app/api.php");
-
- await WikiSite.Initialization;
-
- await WikiSite.LoginAsync(username, password);
- }
-
- public async Task GetPage(Game game)
- {
- var page = new WikiPage(WikiSite, game.Title);
-
- await page.RefreshAsync(PageQueryOptions.FetchContent);
-
- return page;
- }
-
- public async Task GetPage(Redistributable redistributable)
- {
- var page = new WikiPage(WikiSite, redistributable.Name);
-
- await page.RefreshAsync(PageQueryOptions.FetchContent);
-
- return page;
- }
-
- public async Task PublishPage(WikiPage page, string summary, bool minor = false)
- {
- await page.UpdateContentAsync(summary, minor);
- }
-
- public string GetUrl(WikiPage page)
- {
- if (page == null)
- return "";
-
- return $"https://lancommander.app/index.php/{page.PageStub.Title}";
- }
-
- public async Task GenerateRedistributablePage(Guid id)
- {
- var redistributable = await RedistributableService.Get(id);
-
- var result = await RazorTemplateEngine.RenderAsync("~/Templates/Wiki/Redistributable.cshtml", redistributable);
-
- return result.Trim();
- }
-
- public async Task GenerateGamePage(Guid id)
- {
- var game = await GameService.Get(id);
-
- var result = await RazorTemplateEngine.RenderAsync("~/Templates/Wiki/Game.cshtml", game);
-
- return result.Trim();
- }
-
- public async void Dispose()
- {
- try
- {
- await WikiSite.LogoutAsync();
- WikiClient.Dispose();
- }
- catch { }
- }
- }
-}
diff --git a/LANCommander.Server/UI/Components/WikiEditor.razor b/LANCommander.Server/UI/Components/WikiEditor.razor
deleted file mode 100644
index a4d0fa52..00000000
--- a/LANCommander.Server/UI/Components/WikiEditor.razor
+++ /dev/null
@@ -1,153 +0,0 @@
-@using LANCommander.Server.Models
-@using System.ComponentModel.DataAnnotations
-@using WikiClientLibrary.Pages
-@inject GameService GameService
-@inject RedistributableService RedistributableService
-@inject WikiService WikiService
-@inject IMessageService MessageService
-@inject IJSRuntime JS
-@inject ILogger Logger
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- View
-
-
-
-
-
-
-
-
-
-
-
-@code {
- [Parameter] public Guid GameId { get; set; }
- [Parameter] public Guid RedistributableId { get; set; }
-
- LANCommanderSettings Settings = SettingService.GetSettings();
-
- bool Loading = true;
- bool Authenticated = false;
-
- bool Minor = false;
- string Summary = "";
-
- string OriginalContents = "";
- string ModifiedContents = "";
-
- StandaloneDiffEditor DiffEditor;
- Game Game;
- Redistributable Redistributable;
- WikiPage Page;
- WikiPageChanges Changes = new WikiPageChanges();
-
- StandaloneDiffEditorConstructionOptions DiffEditorConstructionOptions(StandaloneDiffEditor editor)
- {
- return new StandaloneDiffEditorConstructionOptions
- {
- OriginalEditable = true,
- AutomaticLayout = true,
- Theme = "vs-dark",
- };
- }
-
- class WikiPageChanges
- {
- public bool Minor { get; set; } = false;
- [Required]
- public string Summary { get; set; } = "";
- }
-
- async Task LoadDiff()
- {
- try
- {
- await WikiService.AuthenticateAsync(Settings.Wiki.Username, Settings.Wiki.Password);
-
- if (GameId != Guid.Empty)
- {
- Game = await GameService.Get(GameId);
- Page = await WikiService.GetPage(Game);
-
- ModifiedContents = await WikiService.GenerateGamePage(Game.Id);
- }
- else if (RedistributableId != Guid.Empty)
- {
- Redistributable = await RedistributableService.Get(RedistributableId);
- Page = await WikiService.GetPage(Redistributable);
-
- ModifiedContents = await WikiService.GenerateRedistributablePage(Redistributable.Id);
- }
-
- OriginalContents = Page.Content;
-
- if (!Page.Exists)
- Changes.Summary = $"Created new page for {Game.Title}";
-
- Authenticated = true;
-
- TextModel originalModel = await BlazorMonaco.Editor.Global.CreateModel(JS, OriginalContents, "plaintext", "sample-diff-editor-originalModel");
- TextModel modifiedModel = await BlazorMonaco.Editor.Global.CreateModel(JS, ModifiedContents, "plaintext", "sample-diff-editor-modifiedModel");
-
- await DiffEditor.SetModel(new DiffEditorModel
- {
- Original = originalModel,
- Modified = modifiedModel
- });
- }
- catch (Exception ex)
- {
- MessageService.Error("Wiki initialization failed!");
- Logger.LogError(ex, "Wiki initialization failed!");
- }
- finally
- {
- Loading = false;
- }
- }
-
- async Task Publish()
- {
- try
- {
- Loading = true;
-
- Page.Content = ModifiedContents;
-
- await WikiService.PublishPage(Page, Changes.Summary, Changes.Minor);
-
- MessageService.Success("Changes published!");
- }
- catch (Exception ex)
- {
- MessageService.Error("Could not publish changes!");
- Logger.LogError(ex, "Could not publish changes!");
- }
- finally
- {
- Loading = false;
- }
- }
-}
diff --git a/LANCommander.Server/UI/Pages/Games/Edit.razor b/LANCommander.Server/UI/Pages/Games/Edit.razor
index c614c06e..e569b5f0 100644
--- a/LANCommander.Server/UI/Pages/Games/Edit.razor
+++ b/LANCommander.Server/UI/Pages/Games/Edit.razor
@@ -59,11 +59,6 @@
{
}
-
- if (Settings.Wiki.Enabled)
- {
-
- }
}
@@ -323,13 +318,6 @@
-
- @if (Settings.Wiki.Enabled)
- {
-
-
-
- }
}
diff --git a/LANCommander.Server/UI/Pages/Redistributables/Edit.razor b/LANCommander.Server/UI/Pages/Redistributables/Edit.razor
index 2c4af71c..19a770ac 100644
--- a/LANCommander.Server/UI/Pages/Redistributables/Edit.razor
+++ b/LANCommander.Server/UI/Pages/Redistributables/Edit.razor
@@ -18,11 +18,6 @@
{
-
- if (Settings.Wiki.Enabled)
- {
-
- }
}
@@ -79,13 +74,6 @@
-
- @if (Settings.Wiki.Enabled)
- {
-
-
-
- }
}