mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-11 15:56:05 -07:00
Small improvements to the wizard
This commit is contained in:
parent
963b4e6ee8
commit
d6c2956ee7
5 changed files with 52 additions and 54 deletions
|
@ -176,6 +176,14 @@ namespace PlexRequests.Core
|
||||||
Log.Error(ex, "Failed to cache CouchPotato quality profiles!");
|
Log.Error(ex, "Failed to cache CouchPotato quality profiles!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Migrates to version 1.9.
|
||||||
|
/// Move the Plex auth token to the new field.
|
||||||
|
/// Reconfigure the log level
|
||||||
|
/// Set the wizard flag to true if we already have settings
|
||||||
|
/// </summary>
|
||||||
public void MigrateToVersion1900()
|
public void MigrateToVersion1900()
|
||||||
{
|
{
|
||||||
// Need to change the Plex Token location
|
// Need to change the Plex Token location
|
||||||
|
@ -183,10 +191,22 @@ namespace PlexRequests.Core
|
||||||
var auth = authSettings.GetSettings();
|
var auth = authSettings.GetSettings();
|
||||||
var plexSettings = new SettingsServiceV2<PlexSettings>(new SettingsJsonRepository(Db, new MemoryCacheProvider()));
|
var plexSettings = new SettingsServiceV2<PlexSettings>(new SettingsJsonRepository(Db, new MemoryCacheProvider()));
|
||||||
|
|
||||||
var currentSettings = plexSettings.GetSettings();
|
if (auth != null)
|
||||||
if (!string.IsNullOrEmpty(auth?.OldPlexAuthToken))
|
|
||||||
{
|
{
|
||||||
currentSettings.PlexAuthToken = auth?.OldPlexAuthToken;
|
//If we have an authToken we do not need to go through the setup
|
||||||
|
if (!string.IsNullOrEmpty(auth.OldPlexAuthToken))
|
||||||
|
{
|
||||||
|
var prServuce = new SettingsServiceV2<PlexRequestSettings>(new SettingsJsonRepository(Db, new MemoryCacheProvider()));
|
||||||
|
var settings = prServuce.GetSettings();
|
||||||
|
settings.Wizard = true;
|
||||||
|
prServuce.SaveSettings(settings);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Clear out the old token and save it to the new field
|
||||||
|
var currentSettings = plexSettings.GetSettings();
|
||||||
|
if (!string.IsNullOrEmpty(auth.OldPlexAuthToken))
|
||||||
|
{
|
||||||
|
currentSettings.PlexAuthToken = auth.OldPlexAuthToken;
|
||||||
plexSettings.SaveSettings(currentSettings);
|
plexSettings.SaveSettings(currentSettings);
|
||||||
|
|
||||||
// Clear out the old value
|
// Clear out the old value
|
||||||
|
@ -194,47 +214,10 @@ namespace PlexRequests.Core
|
||||||
authSettings.SaveSettings(auth);
|
authSettings.SaveSettings(auth);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//If we have an authToken we do not need to go through the setup
|
|
||||||
if (!string.IsNullOrEmpty(auth?.OldPlexAuthToken))
|
|
||||||
{
|
|
||||||
var prServuce = new SettingsServiceV2<PlexRequestSettings>(new SettingsJsonRepository(Db, new MemoryCacheProvider()));
|
|
||||||
var settings = prServuce.GetSettings();
|
|
||||||
settings.Wizard = true;
|
|
||||||
prServuce.SaveSettings(settings);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Migrates to version 1.8.
|
|
||||||
/// <para>This includes updating the admin account to have all roles.</para>
|
|
||||||
/// <para>Set the log level to Error</para>
|
|
||||||
/// <para>Enable Analytics by default</para>
|
|
||||||
/// </summary>
|
|
||||||
private void MigrateToVersion1800()
|
|
||||||
{
|
|
||||||
|
|
||||||
// Give admin all roles/claims
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var userMapper = new UserMapper(new UserRepository<UsersModel>(Db, new MemoryCacheProvider()));
|
|
||||||
var users = userMapper.GetUsers();
|
|
||||||
|
|
||||||
foreach (var u in users)
|
|
||||||
{
|
|
||||||
var claims = new[] { UserClaims.User, UserClaims.Admin, UserClaims.PowerUser };
|
|
||||||
u.Claims = ByteConverterHelper.ReturnBytes(claims);
|
|
||||||
|
|
||||||
userMapper.EditUser(u);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Log.Error(e);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Set log level
|
// Set the log level
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var settingsService = new SettingsServiceV2<LogSettings>(new SettingsJsonRepository(Db, new MemoryCacheProvider()));
|
var settingsService = new SettingsServiceV2<LogSettings>(new SettingsJsonRepository(Db, new MemoryCacheProvider()));
|
||||||
|
@ -243,7 +226,6 @@ namespace PlexRequests.Core
|
||||||
settingsService.SaveSettings(logSettings);
|
settingsService.SaveSettings(logSettings);
|
||||||
|
|
||||||
LoggingHelper.ReconfigureLogLevel(LogLevel.FromOrdinal(logSettings.Level));
|
LoggingHelper.ReconfigureLogLevel(LogLevel.FromOrdinal(logSettings.Level));
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -265,7 +247,6 @@ namespace PlexRequests.Core
|
||||||
{
|
{
|
||||||
Log.Error(e);
|
Log.Error(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
5
PlexRequests.UI/Content/base.css
vendored
5
PlexRequests.UI/Content/base.css
vendored
|
@ -336,3 +336,8 @@ label {
|
||||||
.tooltip_templates {
|
.tooltip_templates {
|
||||||
display: none; }
|
display: none; }
|
||||||
|
|
||||||
|
.shadow {
|
||||||
|
-moz-box-shadow: 3px 3px 5px 6px #191919;
|
||||||
|
-webkit-box-shadow: 3px 3px 5px 6px #191919;
|
||||||
|
box-shadow: 3px 3px 5px 6px #191919; }
|
||||||
|
|
||||||
|
|
2
PlexRequests.UI/Content/base.min.css
vendored
2
PlexRequests.UI/Content/base.min.css
vendored
File diff suppressed because one or more lines are too long
|
@ -416,8 +416,17 @@ $border-radius: 10px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.checkbox-custom{
|
.checkbox-custom {
|
||||||
margin-top:0 $i;
|
margin-top: 0 $i;
|
||||||
margin-bottom:0 $i;
|
margin-bottom: 0 $i;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tooltip_templates {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shadow {
|
||||||
|
-moz-box-shadow: 3px 3px 5px 6px #191919;
|
||||||
|
-webkit-box-shadow: 3px 3px 5px 6px #191919;
|
||||||
|
box-shadow: 3px 3px 5px 6px #191919;
|
||||||
}
|
}
|
||||||
.tooltip_templates { display: none; }
|
|
|
@ -12,7 +12,7 @@
|
||||||
@Html.LoadWizardAssets()
|
@Html.LoadWizardAssets()
|
||||||
|
|
||||||
<img class="landing-header" src="@formAction/Content/images/logo.png" width="300" />
|
<img class="landing-header" src="@formAction/Content/images/logo.png" width="300" />
|
||||||
<div id="area" class="landing-block">
|
<div id="area" class="landing-block shadow">
|
||||||
|
|
||||||
|
|
||||||
<div class="media">
|
<div class="media">
|
||||||
|
@ -30,6 +30,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<!--Templates-->
|
||||||
|
|
||||||
<script id="plexAuthArea" type="text/html">
|
<script id="plexAuthArea" type="text/html">
|
||||||
<form method="post" action="/wizard/plexAuth" id="plexAuthForm">
|
<form method="post" action="/wizard/plexAuth" id="plexAuthForm">
|
||||||
|
@ -153,6 +154,8 @@
|
||||||
|
|
||||||
<script id="adminArea" type="text/html">
|
<script id="adminArea" type="text/html">
|
||||||
<form method="post" action="/wizard/createuser" id="adminForm">
|
<form method="post" action="/wizard/createuser" id="adminForm">
|
||||||
|
<h4 class="media-heading landing-title">Create the Admin account</h4>
|
||||||
|
<small>This account will be used to configure your settings and also manage all of the requests.</small>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div>
|
<div>
|
||||||
<label for="adminUsername">Username</label><input type="text" class="form-control form-control-custom" id="adminUsername" name="Username" placeholder="Username">
|
<label for="adminUsername">Username</label><input type="text" class="form-control form-control-custom" id="adminUsername" name="Username" placeholder="Username">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue