@using TightWiki.Models @model TightWiki.Models.ViewModels.Admin.DatabaseViewModel @{ Layout = "/Views/Shared/_Layout.cshtml"; var sessionState = ViewData["SessionState"] as TightWiki.SessionState ?? throw new Exception("Wiki State Context cannot be null."); }

Database

Various utilities to assist in management of the SQLite database.

@if (!string.IsNullOrEmpty(Model.ErrorMessage)) {
@Html.Raw(Model.ErrorMessage)
} @if (!string.IsNullOrEmpty(Model.SuccessMessage)) {
@Html.Raw(Model.SuccessMessage)
} @using (Html.BeginForm(null, null, FormMethod.Get, new { action = $"{GlobalConfiguration.BasePath}{Context.Request.Path}" })) { @foreach (var info in Model.Info) { }
Name Version Size Action
@info.Name @info.Version @NTDLS.Helpers.Formatters.FileSize((long)info.DatabaseSize) @Html.Raw(TightWiki.Library.ConfirmActionHelper.GenerateSafeLink(GlobalConfiguration.BasePath, "This will optimize the database indexes and structure. Continue?", "Optimize", $"/Admin/Database/Optimize/{info.Name}", Context.Request.Path.Value)) @Html.Raw(TightWiki.Library.ConfirmActionHelper.GenerateSafeLink(GlobalConfiguration.BasePath, "This will remove empty space from the database, which can free space if a lot of data has been deleted. Continue?", "Vacuum", $"/Admin/Database/Vacuum/{info.Name}", Context.Request.Path.Value)) @Html.Raw(TightWiki.Library.ConfirmActionHelper.GenerateSafeLink(GlobalConfiguration.BasePath, "This will check the database integrity and validate all foreign keys. Continue?", "Verify", $"/Admin/Database/Verify/{info.Name}", Context.Request.Path.Value))
}