From 41ca84a497ac6aa5f9f2e332dba5581d9d72f5d6 Mon Sep 17 00:00:00 2001 From: Tom Bloor Date: Sat, 24 Aug 2019 21:23:39 +0100 Subject: [PATCH] Database work --- index.html | 35 +++++++++++++++++++++++++++++++++++ js/main.js | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 87 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 70d684c..a187753 100644 --- a/index.html +++ b/index.html @@ -26,6 +26,7 @@ Tribe Log Travel Data Shared Log + Databases
@@ -486,6 +487,40 @@
+
+ + +
+
+ DB Connection: +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
diff --git a/js/main.js b/js/main.js index a5cc06c..37500aa 100644 --- a/js/main.js +++ b/js/main.js @@ -108,7 +108,9 @@ var viewmodel = ko.mapping.fromJS({ "S3KeyPrefix": "" }, + // Shared Log Tab "SharedLogConfig": { + // Main Options "FetchRateSec": 60, "SnapshotCleanupSec": 900, "SnapshotRateSec": 1800, @@ -117,6 +119,8 @@ var viewmodel = ko.mapping.fromJS({ "MaxFileHistory": 10, "HttpBackupURL": "", "HttpAPIKey": "", + + //S3 Options "S3URL": "", "S3AccessKeyId": "", "S3SecretKey": "", @@ -124,7 +128,40 @@ var viewmodel = ko.mapping.fromJS({ "S3KeyPrefix": "" }, - "DatabaseConnections": [], + // Databases Tab + "DatabaseConnections": [ + { + "Name": "Default", + "URL": "127.0.0.1", + "Port": 6390, + "Password": "" + }, + { + "Name": "TribeDB", + "URL": "127.0.0.1", + "Port": 6390, + "Password": "" + }, + { + "Name": "TravelDataDB", + "URL": "127.0.0.1", + "Port": 6390, + "Password": "" + }, + { + "Name": "TerritoryDB", + "URL": "127.0.0.1", + "Port": 6390, + "Password": "" + }, + { + "Name": "LogDB", + "URL": "127.0.0.1", + "Port": 6390, + "Password": "" + } + ], + "servers": [], "spawnerOverrideTemplates": [], "shipPaths": [], @@ -153,4 +190,18 @@ function updateEditor() { var interim = ko.mapping.toJS(viewmodel); interim.coordsScaling = Number(interim.coordsScaling).toFixed(12); editor.setValue(ko.toJSON(interim, null, 2)); +} + +function addDatabase() { + var newDB = { + "Name": ko.observable("NewDB"), + "URL": ko.observable("127.0.0.1"), + "Port": ko.observable(6390), + "Password": ko.observable("") + } + viewmodel.DatabaseConnections.push(newDB); +} + +function removeDatabase(obj) { + viewmodel.DatabaseConnections.remove(obj); } \ No newline at end of file