From 07e9bd7ed92ec5b55b59ab7369640a6d4df10a20 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 18 Oct 2018 01:11:37 -0600 Subject: [PATCH] wip web setup --- lib/admin/documentation/index.html | 60 +++++++++++++++++++++ lib/admin/index.html | 85 +++++++++++++++++++----------- lib/admin/js/app.js | 27 +++++++++- 3 files changed, 141 insertions(+), 31 deletions(-) create mode 100644 lib/admin/documentation/index.html diff --git a/lib/admin/documentation/index.html b/lib/admin/documentation/index.html new file mode 100644 index 0000000..88cb646 --- /dev/null +++ b/lib/admin/documentation/index.html @@ -0,0 +1,60 @@ + + + + Telebit Documentation + + +
+

Telebit (Remote) Documentation

+ +
+

GET /api/config

+
{{ config }}
+
+ +
+

GET /api/status

+
{{ status }}
+
+ +
+

POST /api/init

+
+ + + +
+ + +
+ + +
+ +
+
{{ init }}
+
+ +
+

POST /api/http

+
{{ http }}
+
+ +
+

POST /api/tcp

+
{{ tcp }}
+
+ +
+

POST /api/ssh

+
{{ ssh }}
+
+ +
+ + + + + diff --git a/lib/admin/index.html b/lib/admin/index.html index 0b180dc..bf11dba 100644 --- a/lib/admin/index.html +++ b/lib/admin/index.html @@ -1,60 +1,85 @@ - Telebit Admin + Telebit Setup
-

Telebit Admin

+

Telebit (Remote) Setup

-
-

GET /api/config

-
{{ config }}
-
- -
-

GET /api/status

-
{{ status }}
-
- -
-

POST /api/init

+
+

Create Account

- +
-
-
-

POST /api/http

-
{{ http }}
-
+
+

Advanced Setup

+
-
-

POST /api/tcp

-
{{ tcp }}
-
+ + +
-
-

POST /api/ssh

-
{{ ssh }}
+ +
+ + + +
+ + + + +
{{ init }}
- - + + diff --git a/lib/admin/js/app.js b/lib/admin/js/app.js index cef624b..021f781 100644 --- a/lib/admin/js/app.js +++ b/lib/admin/js/app.js @@ -23,17 +23,42 @@ api.status = function apiStatus() { }); }; +// TODO test for internet connectivity (and telebit connectivity) +var DEFAULT_RELAY = 'telebit.cloud'; +var BETA_RELAY = 'telebit.ppl.family'; var appData = { config: null , status: null -, init: {} +, init: { + teletos: true + , letos: true + , notifications: "important" + , relay: DEFAULT_RELAY + } , http: null , tcp: null , ssh: null +, views: { + section: { + create: true + } + } }; var appMethods = { initialize: function () { console.log("call initialize"); + if (!appData.init.relay) { + appData.init.relay = DEFAULT_RELAY; + } + if (DEFAULT_RELAY !== appData.init.relay) { + window.alert("TODO: Custom Relay Not Implemented Yet"); + } + } +, defaultRelay: function () { + appData.init.relay = DEFAULT_RELAY; + } +, betaRelay: function () { + appData.init.relay = BETA_RELAY; } };