Database work
This commit is contained in:
parent
9e7db8f5c3
commit
41ca84a497
2 changed files with 87 additions and 1 deletions
35
index.html
35
index.html
|
|
@ -26,6 +26,7 @@
|
||||||
<a id="nav-tribe-log" class="nav-item nav-link" data-toggle="tab" href="#tab-tribe-log">Tribe Log</a>
|
<a id="nav-tribe-log" class="nav-item nav-link" data-toggle="tab" href="#tab-tribe-log">Tribe Log</a>
|
||||||
<a id="nav-travel-data" class="nav-item nav-link" data-toggle="tab" href="#tab-travel-data">Travel Data</a>
|
<a id="nav-travel-data" class="nav-item nav-link" data-toggle="tab" href="#tab-travel-data">Travel Data</a>
|
||||||
<a id="nav-shared-log" class="nav-item nav-link" data-toggle="tab" href="#tab-shared-log">Shared Log</a>
|
<a id="nav-shared-log" class="nav-item nav-link" data-toggle="tab" href="#tab-shared-log">Shared Log</a>
|
||||||
|
<a id="nav-databases" class="nav-item nav-link" data-toggle="tab" href="#tab-databases">Databases</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-content" id="tab-content">
|
<div class="tab-content" id="tab-content">
|
||||||
<div class="tab-pane fade show active" id="tab-config">
|
<div class="tab-pane fade show active" id="tab-config">
|
||||||
|
|
@ -486,6 +487,40 @@
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="tab-pane fade" id="tab-databases">
|
||||||
|
<button class="btn btn-primary" data-bind="click: addDatabase">Add Database</button>
|
||||||
|
<!-- ko foreach: DatabaseConnections -->
|
||||||
|
<form>
|
||||||
|
<fieldset>
|
||||||
|
<legend>DB Connection: <span data-bind="text: $data.Name"></span> <button class="btn btn-danger pull-right" data-bind="click: removeDatabase">Remove Database</button></legend>
|
||||||
|
<div class="form-group row">
|
||||||
|
<label data-bind="attr: { for: $index() + '-DB-Name' }" class="col-sm-2 col-form-label">Name</label>
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<input data-bind="attr: { id: $index() + '-DB-Name' }, value: $data.Name" type="text" class="form-control">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group row">
|
||||||
|
<label data-bind="attr: { for: $index() + '-DB-URL' }" class="col-sm-2 col-form-label">URL</label>
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<input data-bind="attr: { id: $index() + '-DB-URL' }, value: $data.URL" type="text" class="form-control">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group row">
|
||||||
|
<label data-bind="attr: { for: $index() + '-DB-Port' }" class="col-sm-2 col-form-label">Port</label>
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<input data-bind="attr: { id: $index() + '-DB-Port' }, numericValue: $data.Port" type="text" class="form-control">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group row">
|
||||||
|
<label data-bind="attr: { for: $index() + '-DB-Password' }" class="col-sm-2 col-form-label">Password</label>
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<input data-bind="attr: { id: $index() + '-DB-Password' }, value: $data.Password" type="text" class="form-control">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
</form>
|
||||||
|
<!-- /ko -->
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
53
js/main.js
53
js/main.js
|
|
@ -108,7 +108,9 @@ var viewmodel = ko.mapping.fromJS({
|
||||||
"S3KeyPrefix": ""
|
"S3KeyPrefix": ""
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Shared Log Tab
|
||||||
"SharedLogConfig": {
|
"SharedLogConfig": {
|
||||||
|
// Main Options
|
||||||
"FetchRateSec": 60,
|
"FetchRateSec": 60,
|
||||||
"SnapshotCleanupSec": 900,
|
"SnapshotCleanupSec": 900,
|
||||||
"SnapshotRateSec": 1800,
|
"SnapshotRateSec": 1800,
|
||||||
|
|
@ -117,6 +119,8 @@ var viewmodel = ko.mapping.fromJS({
|
||||||
"MaxFileHistory": 10,
|
"MaxFileHistory": 10,
|
||||||
"HttpBackupURL": "",
|
"HttpBackupURL": "",
|
||||||
"HttpAPIKey": "",
|
"HttpAPIKey": "",
|
||||||
|
|
||||||
|
//S3 Options
|
||||||
"S3URL": "",
|
"S3URL": "",
|
||||||
"S3AccessKeyId": "",
|
"S3AccessKeyId": "",
|
||||||
"S3SecretKey": "",
|
"S3SecretKey": "",
|
||||||
|
|
@ -124,7 +128,40 @@ var viewmodel = ko.mapping.fromJS({
|
||||||
"S3KeyPrefix": ""
|
"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": [],
|
"servers": [],
|
||||||
"spawnerOverrideTemplates": [],
|
"spawnerOverrideTemplates": [],
|
||||||
"shipPaths": [],
|
"shipPaths": [],
|
||||||
|
|
@ -154,3 +191,17 @@ function updateEditor() {
|
||||||
interim.coordsScaling = Number(interim.coordsScaling).toFixed(12);
|
interim.coordsScaling = Number(interim.coordsScaling).toFixed(12);
|
||||||
editor.setValue(ko.toJSON(interim, null, 2));
|
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);
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue