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;
|
||||
processArchitecture: string;
|
||||
applicationBasePath: string;
|
||||
ombiDatabaseType: string;
|
||||
externalDatabaseType: string;
|
||||
settingsDatabaseType: string;
|
||||
ombiConnectionString: string;
|
||||
externalConnectionString: string;
|
||||
settingsConnectionString: string;
|
||||
storagePath: string;
|
||||
}
|
||||
|
||||
export interface ICouchPotatoSettings extends IExternalSettings {
|
||||
|
|
|
@ -98,6 +98,44 @@
|
|||
<span>{{about.applicationBasePath}}</span>
|
||||
</td>
|
||||
</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>
|
||||
</table>
|
||||
</div>
|
||||
|
|
|
@ -27,6 +27,7 @@ using Ombi.Store.Entities;
|
|||
using Ombi.Store.Repository;
|
||||
using Ombi.Api.Github;
|
||||
using Ombi.Core.Engine;
|
||||
using Ombi.Extensions;
|
||||
using Ombi.Schedule;
|
||||
using Quartz;
|
||||
|
||||
|
@ -93,15 +94,25 @@ namespace Ombi.Controllers
|
|||
[HttpGet("about")]
|
||||
public AboutViewModel About()
|
||||
{
|
||||
var dbConfiguration = DatabaseExtensions.GetDatabaseConfiguration();
|
||||
var storage = StoragePathSingleton.Instance;
|
||||
var model = new AboutViewModel
|
||||
{
|
||||
FrameworkDescription = RuntimeInformation.FrameworkDescription,
|
||||
OsArchitecture = RuntimeInformation.OSArchitecture.ToString(),
|
||||
OsDescription = RuntimeInformation.OSDescription,
|
||||
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 productArray = version.Split('-');
|
||||
model.Version = productArray[0];
|
||||
|
@ -233,8 +244,8 @@ namespace Ombi.Controllers
|
|||
[AllowAnonymous]
|
||||
public async Task<string> GetDefaultLanguage()
|
||||
{
|
||||
var s = await Get<OmbiSettings>();
|
||||
return s.DefaultLanguageCode;
|
||||
var s = await Get<OmbiSettings>();
|
||||
return s.DefaultLanguageCode;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -431,7 +442,7 @@ namespace Ombi.Controllers
|
|||
[HttpGet("Update")]
|
||||
public async Task<UpdateSettings> UpdateSettings()
|
||||
{
|
||||
var settings = await Get<UpdateSettings>();
|
||||
var settings = await Get<UpdateSettings>();
|
||||
|
||||
return Mapper.Map<UpdateSettingsViewModel>(settings);
|
||||
}
|
||||
|
|
|
@ -19,14 +19,7 @@ namespace Ombi.Extensions
|
|||
|
||||
public static void ConfigureDatabases(this IServiceCollection services)
|
||||
{
|
||||
var i = StoragePathSingleton.Instance;
|
||||
if (string.IsNullOrEmpty(i.StoragePath))
|
||||
{
|
||||
i.StoragePath = string.Empty;
|
||||
}
|
||||
|
||||
var databaseFileLocation = Path.Combine(i.StoragePath, "database.json");
|
||||
var configuration = GetDatabaseConfiguration(databaseFileLocation, i.StoragePath);
|
||||
var configuration = GetDatabaseConfiguration();
|
||||
|
||||
// Ombi db
|
||||
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))
|
||||
{
|
||||
var databaseJson = File.ReadAllText(databaseFileLocation);
|
||||
|
|
|
@ -9,5 +9,12 @@
|
|||
public string OsDescription { get; set; }
|
||||
public string ProcessArchitecture { 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