Code clean up and API versioning (#178)

* Merged tools project into main project

* Applied API versioning
This commit is contained in:
Michael Green
2023-10-31 10:42:15 +11:00
committed by GitHub
parent 1cc7eb22dc
commit 2ade60c551
85 changed files with 338 additions and 297 deletions

View File

@@ -8,7 +8,7 @@
</table>
<script type="text/javascript">
ajaxCall('/api/v1/Bios', 'GET', function (result) {
ajaxCall('/api/v1.0/Bios', 'GET', function (result) {
result.sort((a, b) => a.platformname.charCodeAt(0) - b.platformname.charCodeAt(0));
var lastPlatform = '';
@@ -28,7 +28,7 @@
}
var biosFilename = document.createElement('a');
biosFilename.href = '/api/v1/Bios/' + result[i].platformid + '/' + result[i].filename;
biosFilename.href = '/api/v1.0/Bios/' + result[i].platformid + '/' + result[i].filename;
biosFilename.innerHTML = result[i].filename;
biosFilename.className = 'romlink';
@@ -38,7 +38,7 @@
availableText.className = 'greentext';
biosFilename = document.createElement('a');
biosFilename.href = '/api/v1/Bios/' + result[i].platformid + '/' + result[i].filename;
biosFilename.href = '/api/v1.0/Bios/' + result[i].platformid + '/' + result[i].filename;
biosFilename.innerHTML = result[i].filename;
biosFilename.className = 'romlink';
} else {

View File

@@ -26,7 +26,7 @@
}
ajaxCall(
'/api/v1/Logs' + apiQuery,
'/api/v1.0/Logs' + apiQuery,
'GET',
function (result) {
var newTable = document.getElementById('settings_events_table');

View File

@@ -22,7 +22,7 @@
}
ajaxCall(
'/api/v1/PlatformMaps' + queryString,
'/api/v1.0/PlatformMaps' + queryString,
'GET',
function (result) {
var newTable = document.getElementById('settings_mapping_table');
@@ -61,7 +61,7 @@
}
function DownloadJSON() {
window.open('/api/v1/PlatformMaps', '_blank');
window.open('/api/v1.0/PlatformMaps', '_blank');
}
document.getElementById('importjson').addEventListener('click', openDialog);
@@ -71,7 +71,7 @@
}
$('#uploadjson').change(function () {
$(this).simpleUpload("/api/v1/PlatformMaps", {
$(this).simpleUpload("/api/v1.0/PlatformMaps", {
start: function (file) {
//upload started
console.log("JSON upload started");

View File

@@ -11,7 +11,7 @@
<script type="text/javascript">
function drawLibrary() {
ajaxCall(
'/api/v1/Library',
'/api/v1.0/Library',
'GET',
function (result) {
var newTable = document.getElementById('settings_libraries');

View File

@@ -26,7 +26,7 @@
<div id="system_signatures"></div>
<script type="text/javascript">function SystemLoadStatus() {
ajaxCall('/api/v1/BackgroundTasks', 'GET', function (result) {
ajaxCall('/api/v1.0/BackgroundTasks', 'GET', function (result) {
var newTable = document.createElement('table');
newTable.className = 'romtable';
newTable.setAttribute('cellspacing', 0);
@@ -119,7 +119,7 @@
}
function SystemLoadSystemStatus() {
ajaxCall('/api/v1/System', 'GET', function (result) {
ajaxCall('/api/v1.0/System', 'GET', function (result) {
if (result) {
var totalLibrarySpace = 0;
@@ -234,7 +234,7 @@
}
function SystemSignaturesStatus() {
ajaxCall('/api/v1/Signatures/Status', 'GET', function (result) {
ajaxCall('/api/v1.0/Signatures/Status', 'GET', function (result) {
var newTable = document.createElement('table');
newTable.className = 'romtable';
newTable.setAttribute('cellspacing', 0);
@@ -257,7 +257,7 @@
}
function StartProcess(itemType) {
ajaxCall('/api/v1/BackgroundTasks/' + itemType + '?ForceRun=true', 'GET', function (result) {
ajaxCall('/api/v1.0/BackgroundTasks/' + itemType + '?ForceRun=true', 'GET', function (result) {
SystemLoadStatus();
});
}