Settings UI changes complete
This commit is contained in:
@@ -311,6 +311,12 @@ namespace gaseous_server.Controllers
|
|||||||
HasheousHost = Config.MetadataConfiguration.HasheousHost,
|
HasheousHost = Config.MetadataConfiguration.HasheousHost,
|
||||||
HasheousSubmitFixes = (bool)Config.MetadataConfiguration.HasheousSubmitFixes,
|
HasheousSubmitFixes = (bool)Config.MetadataConfiguration.HasheousSubmitFixes,
|
||||||
HasheousAPIKey = Config.MetadataConfiguration.HasheousAPIKey
|
HasheousAPIKey = Config.MetadataConfiguration.HasheousAPIKey
|
||||||
|
},
|
||||||
|
MetadataSource = new SystemSettingsModel.MetadataSourceItem()
|
||||||
|
{
|
||||||
|
Source = Config.MetadataConfiguration.MetadataSource,
|
||||||
|
IGDBClientId = Config.IGDB.ClientId,
|
||||||
|
IGDBClientSecret = Config.IGDB.Secret
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -334,6 +340,9 @@ namespace gaseous_server.Controllers
|
|||||||
Config.MetadataConfiguration.HasheousHost = model.SignatureSource.HasheousHost;
|
Config.MetadataConfiguration.HasheousHost = model.SignatureSource.HasheousHost;
|
||||||
Config.MetadataConfiguration.HasheousAPIKey = model.SignatureSource.HasheousAPIKey;
|
Config.MetadataConfiguration.HasheousAPIKey = model.SignatureSource.HasheousAPIKey;
|
||||||
Config.MetadataConfiguration.HasheousSubmitFixes = model.SignatureSource.HasheousSubmitFixes;
|
Config.MetadataConfiguration.HasheousSubmitFixes = model.SignatureSource.HasheousSubmitFixes;
|
||||||
|
Config.MetadataConfiguration.MetadataSource = model.MetadataSource.Source;
|
||||||
|
Config.IGDB.ClientId = model.MetadataSource.IGDBClientId;
|
||||||
|
Config.IGDB.Secret = model.MetadataSource.IGDBClientSecret;
|
||||||
Config.UpdateConfig();
|
Config.UpdateConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -776,6 +785,7 @@ namespace gaseous_server.Controllers
|
|||||||
public int MinimumLogRetentionPeriod { get; set; }
|
public int MinimumLogRetentionPeriod { get; set; }
|
||||||
public bool EmulatorDebugMode { get; set; }
|
public bool EmulatorDebugMode { get; set; }
|
||||||
public SignatureSourceItem SignatureSource { get; set; }
|
public SignatureSourceItem SignatureSource { get; set; }
|
||||||
|
public MetadataSourceItem MetadataSource { get; set; }
|
||||||
|
|
||||||
public class SignatureSourceItem
|
public class SignatureSourceItem
|
||||||
{
|
{
|
||||||
@@ -784,5 +794,12 @@ namespace gaseous_server.Controllers
|
|||||||
public string HasheousAPIKey { get; set; }
|
public string HasheousAPIKey { get; set; }
|
||||||
public bool HasheousSubmitFixes { get; set; }
|
public bool HasheousSubmitFixes { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class MetadataSourceItem
|
||||||
|
{
|
||||||
|
public HasheousClient.Models.MetadataModel.MetadataSources Source { get; set; }
|
||||||
|
public string IGDBClientId { get; set; }
|
||||||
|
public string IGDBClientSecret { get; set; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -553,6 +553,7 @@ FROM
|
|||||||
Favourites ON Game.Id = Favourites.GameId AND Favourites.UserId = @userid " + whereClause + " " + havingClause + " " + orderByClause;
|
Favourites ON Game.Id = Favourites.GameId AND Favourites.UserId = @userid " + whereClause + " " + havingClause + " " + orderByClause;
|
||||||
List<Games.MinimalGameItem> RetVal = new List<Games.MinimalGameItem>();
|
List<Games.MinimalGameItem> RetVal = new List<Games.MinimalGameItem>();
|
||||||
|
|
||||||
|
Console.WriteLine(sql);
|
||||||
DataTable dbResponse = db.ExecuteCMD(sql, whereParams, new Database.DatabaseMemoryCacheOptions(CacheEnabled: true, ExpirationSeconds: 60));
|
DataTable dbResponse = db.ExecuteCMD(sql, whereParams, new Database.DatabaseMemoryCacheOptions(CacheEnabled: true, ExpirationSeconds: 60));
|
||||||
|
|
||||||
// get count
|
// get count
|
||||||
|
@@ -97,3 +97,11 @@ SELECT *, DATE_ADD(
|
|||||||
SessionTime, INTERVAL SessionLength MINUTE
|
SessionTime, INTERVAL SessionLength MINUTE
|
||||||
) AS SessionEnd
|
) AS SessionEnd
|
||||||
FROM UserTimeTracking;
|
FROM UserTimeTracking;
|
||||||
|
|
||||||
|
CREATE INDEX idx_game_name ON Game (`Name`);
|
||||||
|
CREATE INDEX idx_game_totalratingcount ON Game (TotalRatingCount);
|
||||||
|
CREATE INDEX idx_alternativename_game ON AlternativeName (Game);
|
||||||
|
CREATE INDEX idx_gamestate_romid ON GameState (RomId);
|
||||||
|
CREATE INDEX idx_gamestate_ismediagroup_userid ON GameState (IsMediaGroup, UserId);
|
||||||
|
CREATE INDEX idx_rommediagroup_gameid ON RomMediaGroup (GameId);
|
||||||
|
CREATE INDEX idx_favourites_userid_gameid ON Favourites (UserId, GameId);
|
@@ -129,6 +129,15 @@
|
|||||||
head.appendChild(newLink);
|
head.appendChild(newLink);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// wait for all scripts to load
|
||||||
|
do {
|
||||||
|
if (typeof getQueryString === "function") {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
console.log("Waiting for scripts to load...");
|
||||||
|
await new Promise(r => setTimeout(r, 100));
|
||||||
|
} while (typeof getQueryString !== "function");
|
||||||
|
|
||||||
// start the application
|
// start the application
|
||||||
console.log("Starting Gaseous");
|
console.log("Starting Gaseous");
|
||||||
console.log("App Version: " + AppVersion);
|
console.log("App Version: " + AppVersion);
|
||||||
@@ -157,8 +166,9 @@
|
|||||||
let pageSelection = getQueryString('page', 'string');
|
let pageSelection = getQueryString('page', 'string');
|
||||||
|
|
||||||
if (!pageSelection) {
|
if (!pageSelection) {
|
||||||
pageSelection = GetPreference("DefaultHomePage", 'home');
|
pageSelection = GetPreference("DefaultHomePage", "home");
|
||||||
}
|
}
|
||||||
|
console.log("Loading page: " + pageSelection);
|
||||||
await LoadPageContent(pageSelection, 'content');
|
await LoadPageContent(pageSelection, 'content');
|
||||||
} else {
|
} else {
|
||||||
// user is not signed in - load login page
|
// user is not signed in - load login page
|
||||||
|
@@ -3,17 +3,19 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="section">
|
<div class="section">
|
||||||
<div class="section-header">Metadata Sources</div>
|
<div class="section-header">Metadata Settings</div>
|
||||||
<div class="section-body">
|
<div class="section-body">
|
||||||
<table>
|
<div class="section">
|
||||||
|
<div class="section-header">Source</div>
|
||||||
|
<div class="section-body">
|
||||||
|
<table style="width: 100%;">
|
||||||
<tr>
|
<tr>
|
||||||
<td style="width: 25%;">
|
<td style="width: 30%;">
|
||||||
Signature Source
|
Signature Source
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="radio" name="settings_signaturesource" id="settings_signaturesource_local"
|
<input type="radio" name="settings_signaturesource" id="settings_signaturesource_local"
|
||||||
value="LocalOnly"
|
value="LocalOnly">
|
||||||
onclick="document.getElementById('settings_hasheoushost_row').style.display = 'none';">
|
|
||||||
<label for="settings_signaturesource_local">Local Only</label>
|
<label for="settings_signaturesource_local">Local Only</label>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -21,13 +23,71 @@
|
|||||||
<td></td>
|
<td></td>
|
||||||
<td>
|
<td>
|
||||||
<input type="radio" name="settings_signaturesource" id="settings_signaturesource_hasheous"
|
<input type="radio" name="settings_signaturesource" id="settings_signaturesource_hasheous"
|
||||||
value="Hasheous"
|
value="Hasheous">
|
||||||
onclick="document.getElementById('settings_hasheoushost_row').style.display = '';">
|
|
||||||
<label for="settings_signaturesource_hasheous">Hasheous</label>
|
<label for="settings_signaturesource_hasheous">Hasheous</label>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr id="settings_hasheoushost_row" style="display: none;">
|
|
||||||
|
<tr>
|
||||||
|
<td style="width: 30%;">
|
||||||
|
Metadata Source
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
<input type="radio" name="settings_metadatasource" id="settings_metadatasource_none"
|
||||||
|
value="None">
|
||||||
|
<label for="settings_metadatasource_none">None</label>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>
|
||||||
|
<input type="radio" name="settings_metadatasource" id="settings_metadatasource_hasheous"
|
||||||
|
value="Hasheous">
|
||||||
|
<label for="settings_metadatasource_hasheous">IGDB via Hasheous Proxy</label>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>
|
||||||
|
<input type="radio" name="settings_metadatasource" id="settings_metadatasource_igdb"
|
||||||
|
value="IGDB">
|
||||||
|
<label for="settings_metadatasource_igdb">IGDB</label>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div class="section-header">IGDB Configuration</div>
|
||||||
|
<div class="section-body">
|
||||||
|
<table style="width: 100%;">
|
||||||
|
<tr id="settings_igdbclientid_row">
|
||||||
|
<td style="width: 30%;">
|
||||||
|
IGDB Client ID
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" id="settings_igdbclientid" style="width: 90%;">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr id="settings_igdbclientkey_row">
|
||||||
|
<td style="width: 30%;">
|
||||||
|
IGDB Client Key
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" id="settings_igdbclientkey" style="width: 90%;">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div class="section-header">Hasheous Configuration</div>
|
||||||
|
<div class="section-body">
|
||||||
|
<table style="width: 100%;">
|
||||||
|
<tr id="settings_hasheoushost_row">
|
||||||
|
<td style="width: 30%;">
|
||||||
Hasheous Host
|
Hasheous Host
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@@ -36,14 +96,15 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<label for="settings_hasheoussubmit">Submit updates to Hasheous when fixing ROM matches</label>
|
<label for="settings_hasheoussubmit">Submit updates to Hasheous when fixing ROM
|
||||||
|
matches</label>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="checkbox" id="settings_hasheoussubmit" onchange="toggleHasheousAPIKey(this);">
|
<input type="checkbox" id="settings_hasheoussubmit" onchange="toggleHasheousAPIKey(this);">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr id="settings_hasheousapikey_row" style="display: none;">
|
<tr id="settings_hasheousapikey_row">
|
||||||
<td>
|
<td style="width: 30%;">
|
||||||
Hasheous API key
|
Hasheous API key
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@@ -52,6 +113,10 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="section">
|
||||||
<div class="section-header">Logging</div>
|
<div class="section-header">Logging</div>
|
||||||
<div class="section-body">
|
<div class="section-body">
|
||||||
<table>
|
<table>
|
||||||
@@ -85,6 +150,8 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="section">
|
||||||
<div class="section-header">Emulator</div>
|
<div class="section-header">Emulator</div>
|
||||||
<div class="section-body">
|
<div class="section-body">
|
||||||
<table>
|
<table>
|
||||||
@@ -95,9 +162,10 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div style="text-align: right;">
|
</div>
|
||||||
|
|
||||||
|
<div style="text-align: right;">
|
||||||
<button id="settings_tasktimers_new" onclick="setSystemSettings();">Save</button>
|
<button id="settings_tasktimers_new" onclick="setSystemSettings();">Save</button>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@@ -21,11 +21,28 @@ function getSystemSettings() {
|
|||||||
|
|
||||||
case "Hasheous":
|
case "Hasheous":
|
||||||
document.getElementById('settings_signaturesource_hasheous').checked = true;
|
document.getElementById('settings_signaturesource_hasheous').checked = true;
|
||||||
document.getElementById('settings_hasheoushost_row').style.display = '';
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch (result.metadataSource.source) {
|
||||||
|
case "None":
|
||||||
|
document.getElementById('settings_metadatasource_none').checked = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "Hasheous":
|
||||||
|
document.getElementById('settings_metadatasource_hasheous').checked = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "IGDB":
|
||||||
|
document.getElementById('settings_metadatasource_igdb').checked = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
document.getElementById('settings_igdbclientid').value = result.metadataSource.igdbClientId;
|
||||||
|
document.getElementById('settings_igdbclientkey').value = result.metadataSource.igdbClientSecret;
|
||||||
|
|
||||||
document.getElementById('settings_signaturesource_hasheoushost').value = result.signatureSource.hasheousHost;
|
document.getElementById('settings_signaturesource_hasheoushost').value = result.signatureSource.hasheousHost;
|
||||||
|
|
||||||
let hasheousSubmitCheck = document.getElementById('settings_hasheoussubmit');
|
let hasheousSubmitCheck = document.getElementById('settings_hasheoussubmit');
|
||||||
@@ -56,6 +73,11 @@ function setSystemSettings() {
|
|||||||
"alwaysLogToDisk": alwaysLogToDisk,
|
"alwaysLogToDisk": alwaysLogToDisk,
|
||||||
"minimumLogRetentionPeriod": Number(retentionValue),
|
"minimumLogRetentionPeriod": Number(retentionValue),
|
||||||
"emulatorDebugMode": document.getElementById('settings_emulator_debug').checked,
|
"emulatorDebugMode": document.getElementById('settings_emulator_debug').checked,
|
||||||
|
"metadataSource": {
|
||||||
|
"Source": $("input[type='radio'][name='settings_metadatasource']:checked").val(),
|
||||||
|
"IgdbClientId": document.getElementById('settings_igdbclientid').value,
|
||||||
|
"IgdbClientSecret": document.getElementById('settings_igdbclientkey').value
|
||||||
|
},
|
||||||
"signatureSource": {
|
"signatureSource": {
|
||||||
"Source": $("input[type='radio'][name='settings_signaturesource']:checked").val(),
|
"Source": $("input[type='radio'][name='settings_signaturesource']:checked").val(),
|
||||||
"HasheousHost": document.getElementById('settings_signaturesource_hasheoushost').value,
|
"HasheousHost": document.getElementById('settings_signaturesource_hasheoushost').value,
|
||||||
|
Reference in New Issue
Block a user