mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-15 01:32:55 -07:00
Output some useful stuff to the about window regarding the databases
This commit is contained in:
parent
f4933bfc26
commit
63b8b8882c
5 changed files with 82 additions and 18 deletions
|
@ -192,6 +192,13 @@ export interface IAbout {
|
||||||
osDescription: string;
|
osDescription: string;
|
||||||
processArchitecture: string;
|
processArchitecture: string;
|
||||||
applicationBasePath: string;
|
applicationBasePath: string;
|
||||||
|
ombiDatabaseType: string;
|
||||||
|
externalDatabaseType: string;
|
||||||
|
settingsDatabaseType: string;
|
||||||
|
ombiConnectionString: string;
|
||||||
|
externalConnectionString: string;
|
||||||
|
settingsConnectionString: string;
|
||||||
|
storagePath: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ICouchPotatoSettings extends IExternalSettings {
|
export interface ICouchPotatoSettings extends IExternalSettings {
|
||||||
|
|
|
@ -98,6 +98,44 @@
|
||||||
<span>{{about.applicationBasePath}}</span>
|
<span>{{about.applicationBasePath}}</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<span>Storage Path</span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<span>{{about.storagePath}}</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<span>Ombi Database</span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<span>{{about.ombiDatabaseType}} - {{about.ombiConnectionString}}</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<span>External Database</span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<span>{{about.externalDatabaseType}} - {{about.externalConnectionString}}</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<span>Settings Database</span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<span>{{about.settingsDatabaseType}} - {{about.settingsConnectionString}}</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -27,6 +27,7 @@ using Ombi.Store.Entities;
|
||||||
using Ombi.Store.Repository;
|
using Ombi.Store.Repository;
|
||||||
using Ombi.Api.Github;
|
using Ombi.Api.Github;
|
||||||
using Ombi.Core.Engine;
|
using Ombi.Core.Engine;
|
||||||
|
using Ombi.Extensions;
|
||||||
using Ombi.Schedule;
|
using Ombi.Schedule;
|
||||||
using Quartz;
|
using Quartz;
|
||||||
|
|
||||||
|
@ -93,15 +94,25 @@ namespace Ombi.Controllers
|
||||||
[HttpGet("about")]
|
[HttpGet("about")]
|
||||||
public AboutViewModel About()
|
public AboutViewModel About()
|
||||||
{
|
{
|
||||||
|
var dbConfiguration = DatabaseExtensions.GetDatabaseConfiguration();
|
||||||
|
var storage = StoragePathSingleton.Instance;
|
||||||
var model = new AboutViewModel
|
var model = new AboutViewModel
|
||||||
{
|
{
|
||||||
FrameworkDescription = RuntimeInformation.FrameworkDescription,
|
FrameworkDescription = RuntimeInformation.FrameworkDescription,
|
||||||
OsArchitecture = RuntimeInformation.OSArchitecture.ToString(),
|
OsArchitecture = RuntimeInformation.OSArchitecture.ToString(),
|
||||||
OsDescription = RuntimeInformation.OSDescription,
|
OsDescription = RuntimeInformation.OSDescription,
|
||||||
ProcessArchitecture = RuntimeInformation.ProcessArchitecture.ToString(),
|
ProcessArchitecture = RuntimeInformation.ProcessArchitecture.ToString(),
|
||||||
ApplicationBasePath =Directory.GetCurrentDirectory()
|
ApplicationBasePath = Directory.GetCurrentDirectory(),
|
||||||
|
ExternalConnectionString = dbConfiguration.ExternalDatabase.ConnectionString,
|
||||||
|
ExternalDatabaseType = dbConfiguration.ExternalDatabase.Type,
|
||||||
|
OmbiConnectionString = dbConfiguration.OmbiDatabase.ConnectionString,
|
||||||
|
OmbiDatabaseType = dbConfiguration.OmbiDatabase.Type,
|
||||||
|
SettingsConnectionString = dbConfiguration.SettingsDatabase.ConnectionString,
|
||||||
|
SettingsDatabaseType = dbConfiguration.SettingsDatabase.Type,
|
||||||
|
StoragePath = storage.StoragePath.HasValue() ? storage.StoragePath : "None Specified"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
var version = AssemblyHelper.GetRuntimeVersion();
|
var version = AssemblyHelper.GetRuntimeVersion();
|
||||||
var productArray = version.Split('-');
|
var productArray = version.Split('-');
|
||||||
model.Version = productArray[0];
|
model.Version = productArray[0];
|
||||||
|
@ -233,8 +244,8 @@ namespace Ombi.Controllers
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
public async Task<string> GetDefaultLanguage()
|
public async Task<string> GetDefaultLanguage()
|
||||||
{
|
{
|
||||||
var s = await Get<OmbiSettings>();
|
var s = await Get<OmbiSettings>();
|
||||||
return s.DefaultLanguageCode;
|
return s.DefaultLanguageCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -431,7 +442,7 @@ namespace Ombi.Controllers
|
||||||
[HttpGet("Update")]
|
[HttpGet("Update")]
|
||||||
public async Task<UpdateSettings> UpdateSettings()
|
public async Task<UpdateSettings> UpdateSettings()
|
||||||
{
|
{
|
||||||
var settings = await Get<UpdateSettings>();
|
var settings = await Get<UpdateSettings>();
|
||||||
|
|
||||||
return Mapper.Map<UpdateSettingsViewModel>(settings);
|
return Mapper.Map<UpdateSettingsViewModel>(settings);
|
||||||
}
|
}
|
||||||
|
@ -586,7 +597,7 @@ namespace Ombi.Controllers
|
||||||
Message = $"CRON Expression {body.Expression} is not valid"
|
Message = $"CRON Expression {body.Expression} is not valid"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
model.Success = true;
|
model.Success = true;
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,14 +19,7 @@ namespace Ombi.Extensions
|
||||||
|
|
||||||
public static void ConfigureDatabases(this IServiceCollection services)
|
public static void ConfigureDatabases(this IServiceCollection services)
|
||||||
{
|
{
|
||||||
var i = StoragePathSingleton.Instance;
|
var configuration = GetDatabaseConfiguration();
|
||||||
if (string.IsNullOrEmpty(i.StoragePath))
|
|
||||||
{
|
|
||||||
i.StoragePath = string.Empty;
|
|
||||||
}
|
|
||||||
|
|
||||||
var databaseFileLocation = Path.Combine(i.StoragePath, "database.json");
|
|
||||||
var configuration = GetDatabaseConfiguration(databaseFileLocation, i.StoragePath);
|
|
||||||
|
|
||||||
// Ombi db
|
// Ombi db
|
||||||
switch (configuration.OmbiDatabase.Type)
|
switch (configuration.OmbiDatabase.Type)
|
||||||
|
@ -60,9 +53,17 @@ namespace Ombi.Extensions
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DatabaseConfiguration GetDatabaseConfiguration(string databaseFileLocation, string storagePath)
|
public static DatabaseConfiguration GetDatabaseConfiguration()
|
||||||
{
|
{
|
||||||
var configuration = new DatabaseConfiguration(storagePath);
|
var i = StoragePathSingleton.Instance;
|
||||||
|
if (string.IsNullOrEmpty(i.StoragePath))
|
||||||
|
{
|
||||||
|
i.StoragePath = string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
var databaseFileLocation = Path.Combine(i.StoragePath, "database.json");
|
||||||
|
|
||||||
|
var configuration = new DatabaseConfiguration(i.StoragePath);
|
||||||
if (File.Exists(databaseFileLocation))
|
if (File.Exists(databaseFileLocation))
|
||||||
{
|
{
|
||||||
var databaseJson = File.ReadAllText(databaseFileLocation);
|
var databaseJson = File.ReadAllText(databaseFileLocation);
|
||||||
|
@ -94,7 +95,7 @@ namespace Ombi.Extensions
|
||||||
{
|
{
|
||||||
public DatabaseConfiguration()
|
public DatabaseConfiguration()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public DatabaseConfiguration(string defaultSqlitePath)
|
public DatabaseConfiguration(string defaultSqlitePath)
|
||||||
|
@ -119,7 +120,7 @@ namespace Ombi.Extensions
|
||||||
// Used in Deserialization
|
// Used in Deserialization
|
||||||
public PerDatabaseConfiguration()
|
public PerDatabaseConfiguration()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
public string Type { get; set; }
|
public string Type { get; set; }
|
||||||
public string ConnectionString { get; set; }
|
public string ConnectionString { get; set; }
|
||||||
|
|
|
@ -9,5 +9,12 @@
|
||||||
public string OsDescription { get; set; }
|
public string OsDescription { get; set; }
|
||||||
public string ProcessArchitecture { get; set; }
|
public string ProcessArchitecture { get; set; }
|
||||||
public string ApplicationBasePath { get; set; }
|
public string ApplicationBasePath { get; set; }
|
||||||
|
public string OmbiDatabaseType { get; set; }
|
||||||
|
public string ExternalDatabaseType { get; set; }
|
||||||
|
public string SettingsDatabaseType { get; set; }
|
||||||
|
public string OmbiConnectionString { get; set; }
|
||||||
|
public string ExternalConnectionString { get; set; }
|
||||||
|
public string SettingsConnectionString { get; set; }
|
||||||
|
public string StoragePath { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue