mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-15 09:42:56 -07:00
Merge pull request #776 from tidusjar/dev
Final bug fixed and code changes.
This commit is contained in:
commit
cbb5f3ff73
4 changed files with 219 additions and 154 deletions
|
@ -51,7 +51,7 @@ namespace PlexRequests.Core.Migration
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
_log.Fatal("Error when migrating");
|
_log.Fatal("Error when migrating version : {0}", v.Value.Version);
|
||||||
_log.Fatal(e);
|
_log.Fatal(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#region Copyright
|
#region Copyright
|
||||||
|
|
||||||
// /************************************************************************
|
// /************************************************************************
|
||||||
// Copyright (c) 2016 Jamie Rees
|
// Copyright (c) 2016 Jamie Rees
|
||||||
// File: Version1100.cs
|
// File: Version1100.cs
|
||||||
|
@ -23,16 +24,15 @@
|
||||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
// ************************************************************************/
|
// ************************************************************************/
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using NLog;
|
using NLog;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using PlexRequests.Api.Interfaces;
|
using PlexRequests.Api.Interfaces;
|
||||||
using PlexRequests.Core.SettingModels;
|
using PlexRequests.Core.SettingModels;
|
||||||
using PlexRequests.Core.Users;
|
|
||||||
using PlexRequests.Helpers;
|
using PlexRequests.Helpers;
|
||||||
using PlexRequests.Helpers.Permissions;
|
using PlexRequests.Helpers.Permissions;
|
||||||
using PlexRequests.Store;
|
using PlexRequests.Store;
|
||||||
|
@ -44,8 +44,10 @@ namespace PlexRequests.Core.Migration.Migrations
|
||||||
[Migration(11000, "v1.10.0.0")]
|
[Migration(11000, "v1.10.0.0")]
|
||||||
public class Version1100 : BaseMigration, IMigration
|
public class Version1100 : BaseMigration, IMigration
|
||||||
{
|
{
|
||||||
public Version1100(IUserRepository userRepo, IRequestService requestService, ISettingsService<LogSettings> log, IPlexApi plexApi, ISettingsService<PlexSettings> plexService,
|
public Version1100(IUserRepository userRepo, IRequestService requestService, ISettingsService<LogSettings> log,
|
||||||
IPlexUserRepository plexusers, ISettingsService<PlexRequestSettings> prSettings, ISettingsService<UserManagementSettings> umSettings,
|
IPlexApi plexApi, ISettingsService<PlexSettings> plexService,
|
||||||
|
IPlexUserRepository plexusers, ISettingsService<PlexRequestSettings> prSettings,
|
||||||
|
ISettingsService<UserManagementSettings> umSettings,
|
||||||
ISettingsService<ScheduledJobsSettings> sjs, IRepository<UsersToNotify> usersToNotify)
|
ISettingsService<ScheduledJobsSettings> sjs, IRepository<UsersToNotify> usersToNotify)
|
||||||
{
|
{
|
||||||
UserRepo = userRepo;
|
UserRepo = userRepo;
|
||||||
|
@ -59,7 +61,9 @@ namespace PlexRequests.Core.Migration.Migrations
|
||||||
ScheduledJobSettings = sjs;
|
ScheduledJobSettings = sjs;
|
||||||
UserNotifyRepo = usersToNotify;
|
UserNotifyRepo = usersToNotify;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Version => 11000;
|
public int Version => 11000;
|
||||||
|
|
||||||
private IUserRepository UserRepo { get; }
|
private IUserRepository UserRepo { get; }
|
||||||
private IRequestService RequestService { get; }
|
private IRequestService RequestService { get; }
|
||||||
private ISettingsService<LogSettings> Log { get; }
|
private ISettingsService<LogSettings> Log { get; }
|
||||||
|
@ -71,6 +75,9 @@ namespace PlexRequests.Core.Migration.Migrations
|
||||||
private ISettingsService<ScheduledJobsSettings> ScheduledJobSettings { get; }
|
private ISettingsService<ScheduledJobsSettings> ScheduledJobSettings { get; }
|
||||||
private IRepository<UsersToNotify> UserNotifyRepo { get; }
|
private IRepository<UsersToNotify> UserNotifyRepo { get; }
|
||||||
|
|
||||||
|
|
||||||
|
private static Logger Logger = LogManager.GetCurrentClassLogger();
|
||||||
|
|
||||||
public void Start(IDbConnection con)
|
public void Start(IDbConnection con)
|
||||||
{
|
{
|
||||||
UpdateDb(con);
|
UpdateDb(con);
|
||||||
|
@ -89,194 +96,250 @@ namespace PlexRequests.Core.Migration.Migrations
|
||||||
|
|
||||||
private void MigrateUserNotifications()
|
private void MigrateUserNotifications()
|
||||||
{
|
{
|
||||||
var usersToNotify = UserNotifyRepo.GetAll();
|
try
|
||||||
var plexUsers = PlexUsers.GetAll().ToList();
|
|
||||||
var users = UserRepo.GetAll().ToList();
|
|
||||||
|
|
||||||
if (usersToNotify == null)
|
|
||||||
{
|
{
|
||||||
return;
|
var usersToNotify = UserNotifyRepo.GetAll();
|
||||||
|
var plexUsers = PlexUsers.GetAll().ToList();
|
||||||
|
var users = UserRepo.GetAll().ToList();
|
||||||
|
|
||||||
|
if (usersToNotify == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var u in usersToNotify)
|
||||||
|
{
|
||||||
|
var selectedPlexUser =
|
||||||
|
plexUsers.FirstOrDefault(
|
||||||
|
x => x.Username.Equals(u.Username, StringComparison.CurrentCultureIgnoreCase));
|
||||||
|
if (selectedPlexUser != null)
|
||||||
|
{
|
||||||
|
selectedPlexUser.Features += (int)Features.RequestAddedNotification;
|
||||||
|
PlexUsers.Update(selectedPlexUser);
|
||||||
|
}
|
||||||
|
|
||||||
|
var selectedLocalUser =
|
||||||
|
users.FirstOrDefault(x => x.UserName.Equals(u.Username, StringComparison.CurrentCultureIgnoreCase));
|
||||||
|
if (selectedLocalUser != null)
|
||||||
|
{
|
||||||
|
selectedLocalUser.Features += (int)Features.RequestAddedNotification;
|
||||||
|
UserRepo.Update(selectedLocalUser);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
foreach (var u in usersToNotify)
|
|
||||||
{
|
{
|
||||||
var selectedPlexUser = plexUsers.FirstOrDefault(x => x.Username.Equals(u.Username, StringComparison.CurrentCultureIgnoreCase));
|
Logger.Fatal("Exception when migrating Version 1.10.0 (UpdateScheduledJobs)");
|
||||||
if (selectedPlexUser != null)
|
Logger.Fatal(e);
|
||||||
{
|
|
||||||
selectedPlexUser.Features += (int)Features.RequestAddedNotification;
|
|
||||||
PlexUsers.Update(selectedPlexUser);
|
|
||||||
}
|
|
||||||
|
|
||||||
var selectedLocalUser =
|
|
||||||
users.FirstOrDefault(x => x.UserName.Equals(u.Username, StringComparison.CurrentCultureIgnoreCase));
|
|
||||||
if (selectedLocalUser != null)
|
|
||||||
{
|
|
||||||
selectedLocalUser.Features += (int)Features.RequestAddedNotification;
|
|
||||||
UserRepo.Update(selectedLocalUser);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateScheduledJobs()
|
private void UpdateScheduledJobs()
|
||||||
{
|
{
|
||||||
var settings = ScheduledJobSettings.GetSettings();
|
try
|
||||||
|
{
|
||||||
|
var settings = ScheduledJobSettings.GetSettings();
|
||||||
|
|
||||||
settings.PlexUserChecker = 24;
|
settings.PlexUserChecker = 24;
|
||||||
settings.PlexContentCacher = 60;
|
settings.PlexContentCacher = 60;
|
||||||
|
|
||||||
ScheduledJobSettings.SaveSettings(settings);
|
ScheduledJobSettings.SaveSettings(settings);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Logger.Fatal("Exception when migrating Version 1.10.0 (UpdateScheduledJobs)");
|
||||||
|
Logger.Fatal(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PopulateDefaultUserManagementSettings()
|
private void PopulateDefaultUserManagementSettings()
|
||||||
{
|
{
|
||||||
var plexRequestSettings = PlexRequestSettings.GetSettings();
|
try
|
||||||
|
|
||||||
UserManagementSettings.SaveSettings(new UserManagementSettings
|
|
||||||
{
|
{
|
||||||
AutoApproveMovies = !plexRequestSettings.RequireMovieApproval,
|
var plexRequestSettings = PlexRequestSettings.GetSettings();
|
||||||
RequestTvShows = plexRequestSettings.SearchForTvShows,
|
|
||||||
RequestMusic = plexRequestSettings.SearchForMusic,
|
UserManagementSettings.SaveSettings(new UserManagementSettings
|
||||||
RequestMovies = plexRequestSettings.SearchForMovies,
|
{
|
||||||
AutoApproveMusic = !plexRequestSettings.RequireMusicApproval,
|
AutoApproveMovies = !plexRequestSettings.RequireMovieApproval,
|
||||||
AutoApproveTvShows = !plexRequestSettings.RequireTvShowApproval
|
RequestTvShows = plexRequestSettings.SearchForTvShows,
|
||||||
});
|
RequestMusic = plexRequestSettings.SearchForMusic,
|
||||||
|
RequestMovies = plexRequestSettings.SearchForMovies,
|
||||||
|
AutoApproveMusic = !plexRequestSettings.RequireMusicApproval,
|
||||||
|
AutoApproveTvShows = !plexRequestSettings.RequireTvShowApproval
|
||||||
|
});
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Logger.Fatal("Exception when migrating Version 1.10.0 (PopulateDefaultUserMngmentSettings)");
|
||||||
|
Logger.Fatal(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdatePlexUsers()
|
private void UpdatePlexUsers()
|
||||||
{
|
{
|
||||||
var settings = PlexSettings.GetSettings();
|
try
|
||||||
if (string.IsNullOrEmpty(settings.PlexAuthToken))
|
|
||||||
{
|
{
|
||||||
return;
|
var settings = PlexSettings.GetSettings();
|
||||||
}
|
if (string.IsNullOrEmpty(settings.PlexAuthToken))
|
||||||
var plexUsers = PlexApi.GetUsers(settings.PlexAuthToken);
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var plexUsers = PlexApi.GetUsers(settings.PlexAuthToken);
|
||||||
|
|
||||||
if (plexUsers?.User == null)
|
if (plexUsers?.User == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var prSettings = PlexRequestSettings.GetSettings();
|
||||||
|
|
||||||
|
var dbUsers = PlexUsers.GetAll().ToList();
|
||||||
|
foreach (var user in plexUsers.User)
|
||||||
|
{
|
||||||
|
if (dbUsers.FirstOrDefault(x => x.PlexUserId == user.Id) != null)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int permissions = 0;
|
||||||
|
if (prSettings.SearchForMovies)
|
||||||
|
{
|
||||||
|
permissions = (int)Permissions.RequestMovie;
|
||||||
|
}
|
||||||
|
if (prSettings.SearchForTvShows)
|
||||||
|
{
|
||||||
|
permissions += (int)Permissions.RequestTvShow;
|
||||||
|
}
|
||||||
|
if (prSettings.SearchForMusic)
|
||||||
|
{
|
||||||
|
permissions += (int)Permissions.RequestMusic;
|
||||||
|
}
|
||||||
|
if (!prSettings.RequireMovieApproval)
|
||||||
|
{
|
||||||
|
permissions += (int)Permissions.AutoApproveMovie;
|
||||||
|
}
|
||||||
|
if (!prSettings.RequireTvShowApproval)
|
||||||
|
{
|
||||||
|
permissions += (int)Permissions.AutoApproveTv;
|
||||||
|
}
|
||||||
|
if (!prSettings.RequireMusicApproval)
|
||||||
|
{
|
||||||
|
permissions += (int)Permissions.AutoApproveAlbum;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add report Issues
|
||||||
|
|
||||||
|
permissions += (int)Permissions.ReportIssue;
|
||||||
|
|
||||||
|
var m = new PlexUsers
|
||||||
|
{
|
||||||
|
PlexUserId = user.Id,
|
||||||
|
Permissions = permissions,
|
||||||
|
Features = 0,
|
||||||
|
UserAlias = string.Empty,
|
||||||
|
EmailAddress = user.Email,
|
||||||
|
Username = user.Username,
|
||||||
|
LoginId = Guid.NewGuid().ToString()
|
||||||
|
};
|
||||||
|
|
||||||
|
PlexUsers.Insert(m);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
return;
|
Logger.Fatal("Exception when migrating Version 1.10.0 (UpdatePlexUsers)");
|
||||||
|
Logger.Fatal(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
var prSettings = PlexRequestSettings.GetSettings();
|
|
||||||
|
|
||||||
var dbUsers = PlexUsers.GetAll().ToList();
|
|
||||||
foreach (var user in plexUsers.User)
|
|
||||||
{
|
|
||||||
if (dbUsers.FirstOrDefault(x => x.PlexUserId == user.Id) != null)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
int permissions = 0;
|
|
||||||
if (prSettings.SearchForMovies)
|
|
||||||
{
|
|
||||||
permissions = (int)Permissions.RequestMovie;
|
|
||||||
}
|
|
||||||
if (prSettings.SearchForTvShows)
|
|
||||||
{
|
|
||||||
permissions += (int)Permissions.RequestTvShow;
|
|
||||||
}
|
|
||||||
if (prSettings.SearchForMusic)
|
|
||||||
{
|
|
||||||
permissions += (int)Permissions.RequestMusic;
|
|
||||||
}
|
|
||||||
if (!prSettings.RequireMovieApproval)
|
|
||||||
{
|
|
||||||
permissions += (int)Permissions.AutoApproveMovie;
|
|
||||||
}
|
|
||||||
if (!prSettings.RequireTvShowApproval)
|
|
||||||
{
|
|
||||||
permissions += (int)Permissions.AutoApproveTv;
|
|
||||||
}
|
|
||||||
if (!prSettings.RequireMusicApproval)
|
|
||||||
{
|
|
||||||
permissions += (int)Permissions.AutoApproveAlbum;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add report Issues
|
|
||||||
|
|
||||||
permissions += (int)Permissions.ReportIssue;
|
|
||||||
|
|
||||||
var m = new PlexUsers
|
|
||||||
{
|
|
||||||
PlexUserId = user.Id,
|
|
||||||
Permissions = permissions,
|
|
||||||
Features = 0,
|
|
||||||
UserAlias = string.Empty,
|
|
||||||
EmailAddress = user.Email,
|
|
||||||
Username = user.Username,
|
|
||||||
LoginId = Guid.NewGuid().ToString()
|
|
||||||
};
|
|
||||||
|
|
||||||
PlexUsers.Insert(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ResetLogLevel()
|
private void ResetLogLevel()
|
||||||
{
|
{
|
||||||
var logSettings = Log.GetSettings();
|
try
|
||||||
logSettings.Level = LogLevel.Error.Ordinal;
|
{
|
||||||
Log.SaveSettings(logSettings);
|
var logSettings = Log.GetSettings();
|
||||||
|
logSettings.Level = LogLevel.Error.Ordinal;
|
||||||
|
Log.SaveSettings(logSettings);
|
||||||
|
|
||||||
LoggingHelper.ReconfigureLogLevel(LogLevel.FromOrdinal(logSettings.Level));
|
LoggingHelper.ReconfigureLogLevel(LogLevel.FromOrdinal(logSettings.Level));
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Logger.Fatal("Exception when migrating Version 1.10.0 (ResetLogLvl)");
|
||||||
|
Logger.Fatal(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateDb(IDbConnection con)
|
private void UpdateDb(IDbConnection con)
|
||||||
{
|
{
|
||||||
// Create the two new columns
|
try
|
||||||
con.AlterTable("Users", "ADD", "Permissions", true, "INTEGER");
|
|
||||||
con.AlterTable("Users", "ADD", "Features", true, "INTEGER");
|
|
||||||
|
|
||||||
con.AlterTable("PlexUsers", "ADD", "Permissions", true, "INTEGER");
|
|
||||||
con.AlterTable("PlexUsers", "ADD", "Features", true, "INTEGER");
|
|
||||||
con.AlterTable("PlexUsers", "ADD", "Username", true, "VARCHAR(100)");
|
|
||||||
con.AlterTable("PlexUsers", "ADD", "EmailAddress", true, "VARCHAR(100)");
|
|
||||||
con.AlterTable("PlexUsers", "ADD", "LoginId", true, "VARCHAR(100)");
|
|
||||||
|
|
||||||
//https://image.tmdb.org/t/p/w150/https://image.tmdb.org/t/p/w150//aqhAqttDq7zgsTaBHtCD8wmTk6k.jpg
|
|
||||||
|
|
||||||
// UI = https://image.tmdb.org/t/p/w150/{{posterPath}}
|
|
||||||
// Update old invalid posters
|
|
||||||
var allRequests = RequestService.GetAll();
|
|
||||||
if (allRequests == null)
|
|
||||||
{
|
{
|
||||||
return;
|
// Create the two new columns
|
||||||
|
con.AlterTable("Users", "ADD", "Permissions", true, "INTEGER");
|
||||||
|
con.AlterTable("Users", "ADD", "Features", true, "INTEGER");
|
||||||
|
|
||||||
|
con.AlterTable("PlexUsers", "ADD", "Permissions", true, "INTEGER");
|
||||||
|
con.AlterTable("PlexUsers", "ADD", "Features", true, "INTEGER");
|
||||||
|
con.AlterTable("PlexUsers", "ADD", "Username", true, "VARCHAR(100)");
|
||||||
|
con.AlterTable("PlexUsers", "ADD", "EmailAddress", true, "VARCHAR(100)");
|
||||||
|
con.AlterTable("PlexUsers", "ADD", "LoginId", true, "VARCHAR(100)");
|
||||||
|
|
||||||
|
//https://image.tmdb.org/t/p/w150/https://image.tmdb.org/t/p/w150//aqhAqttDq7zgsTaBHtCD8wmTk6k.jpg
|
||||||
|
|
||||||
|
// UI = https://image.tmdb.org/t/p/w150/{{posterPath}}
|
||||||
|
// Update old invalid posters
|
||||||
|
var allRequests = RequestService.GetAll();
|
||||||
|
if (allRequests == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var requestedModels = allRequests.ToList();
|
||||||
|
foreach (var req in requestedModels)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(req.PosterPath))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (req.PosterPath.Contains("https://image.tmdb.org/t/p/w150/"))
|
||||||
|
{
|
||||||
|
var newImg = req.PosterPath.Replace("https://image.tmdb.org/t/p/w150/", string.Empty);
|
||||||
|
req.PosterPath = newImg;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
RequestService.BatchUpdate(requestedModels);
|
||||||
}
|
}
|
||||||
var requestedModels = allRequests.ToList();
|
catch (Exception e)
|
||||||
foreach (var req in requestedModels)
|
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(req.PosterPath))
|
Logger.Fatal("Exception when migrating Version 1.10.0 (UpdateDb)");
|
||||||
{
|
Logger.Fatal(e);
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (req.PosterPath.Contains("https://image.tmdb.org/t/p/w150/"))
|
|
||||||
{
|
|
||||||
var newImg = req.PosterPath.Replace("https://image.tmdb.org/t/p/w150/", string.Empty);
|
|
||||||
req.PosterPath = newImg;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
RequestService.BatchUpdate(requestedModels);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateAdmin()
|
private void UpdateAdmin()
|
||||||
{
|
{
|
||||||
var users = UserRepo.GetAll().ToList();
|
try
|
||||||
|
|
||||||
foreach (var user in users)
|
|
||||||
{
|
{
|
||||||
user.Permissions = (int)
|
var users = UserRepo.GetAll().ToList();
|
||||||
(Permissions.Administrator
|
|
||||||
| Permissions.ReportIssue
|
|
||||||
| Permissions.RequestMusic
|
|
||||||
| Permissions.RequestTvShow
|
|
||||||
| Permissions.RequestMovie
|
|
||||||
| Permissions.AutoApproveAlbum
|
|
||||||
| Permissions.AutoApproveMovie
|
|
||||||
| Permissions.AutoApproveTv);
|
|
||||||
}
|
|
||||||
|
|
||||||
UserRepo.UpdateAll(users);
|
foreach (var user in users)
|
||||||
|
{
|
||||||
|
user.Permissions = (int)
|
||||||
|
(Permissions.Administrator
|
||||||
|
| Permissions.ReportIssue
|
||||||
|
| Permissions.RequestMusic
|
||||||
|
| Permissions.RequestTvShow
|
||||||
|
| Permissions.RequestMovie
|
||||||
|
| Permissions.AutoApproveAlbum
|
||||||
|
| Permissions.AutoApproveMovie
|
||||||
|
| Permissions.AutoApproveTv);
|
||||||
|
}
|
||||||
|
|
||||||
|
UserRepo.UpdateAll(users);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Logger.Fatal("Exception when migrating Version 1.10.0 (UpdateAdmin)");
|
||||||
|
Logger.Fatal(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
<button id="clearLogs" type="submit" class="btn btn-danger-outline ">Clear Logs</button>
|
<button id="clearLogs" type="submit" class="btn btn-danger-outline ">Clear Logs</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<table id="example" class="table table-striped table-hover table-responsive">
|
<table id="logDatatable" class="table table-striped table-hover table-responsive">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Message</th>
|
<th>Message</th>
|
||||||
|
@ -63,7 +63,7 @@
|
||||||
|
|
||||||
var logsUrl = "/admin/loadlogs";
|
var logsUrl = "/admin/loadlogs";
|
||||||
var url = createBaseUrl(baseUrl, logsUrl);
|
var url = createBaseUrl(baseUrl, logsUrl);
|
||||||
$('#example').DataTable({
|
$('#logDatatable').DataTable({
|
||||||
"ajax": url,
|
"ajax": url,
|
||||||
"columns": [
|
"columns": [
|
||||||
{ "data": "message" },
|
{ "data": "message" },
|
||||||
|
@ -147,5 +147,8 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$('body .dropdown-toggle').dropdown();
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
|
@ -57,7 +57,6 @@
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="ApiKey" class="control-label">Api Key</label>
|
<label for="ApiKey" class="control-label">Api Key</label>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input type="text" hidden="hidden" name="ApiKey" value="@Model.ApiKey"/>
|
|
||||||
<input type="text" readonly="readonly" class="form-control form-control-custom" id="ApiKey" name="ApiKey" value="@Model.ApiKey">
|
<input type="text" readonly="readonly" class="form-control form-control-custom" id="ApiKey" name="ApiKey" value="@Model.ApiKey">
|
||||||
|
|
||||||
<div class="input-group-addon">
|
<div class="input-group-addon">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue