Skip to content

Commit 63fb960

Browse files
authored
Connection Choice (#25)
To offer a list of connection choices they can be specified in a JSON file. * Add ConnectionItem * LoginPage: Connection Choice * LoginPage: Tab Order * ConnectionItem: .txt and Shell * Cache Connection Choices * Optimize reading from Shell Command * Update README.md * Version 1.1.0
1 parent 90e4bb7 commit 63fb960

File tree

9 files changed

+960
-173
lines changed

9 files changed

+960
-173
lines changed

README.md

Lines changed: 35 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,78 @@
1-
# cubeSQL Web Admin
2-
A web based administration for [cubeSQL Server](https://sqlabs.com/cubesql) (© [sqlabs](https://sqlabs.com/))
1+
# cubeSQL Web Admin
2+
A web based administration for [cubeSQL Server](https://sqlabs.com/cubesql) (© [sqlabs](https://sqlabs.com/))
33

4-
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
4+
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
55

66
## Description
77

8-
*[cubeSQL Server](https://sqlabs.com/cubesql) is a fully featured and high performance relational database management system built on top of the sqlite database engine.*
8+
*[cubeSQL Server](https://sqlabs.com/cubesql) is a fully featured and high performance relational database management system built on top of the sqlite database engine.*
99

10-
cubeSQL Web Admin is a web based administration tool for [cubeSQL Server](https://sqlabs.com/cubesql).
10+
cubeSQL Web Admin is a web based administration tool for [cubeSQL Server](https://sqlabs.com/cubesql).
1111

12-
![ScreenShot: Login](screenshots/login.png?raw=true)
12+
![ScreenShot: Login](screenshots/login.png?raw=true)
1313

14-
![ScreenShot: Databases](screenshots/databases.png?raw=true)
14+
![ScreenShot: Databases](screenshots/databases.png?raw=true)
1515

1616
## Build from Source Code
1717

18-
In order to build cubeSQL Web Admin application, [Xojo](https://xojo.com/) and the latest [cubeSQL Xojo Plugin](https://github.com/cubesql/cubeSQLAdmin) are required.
18+
In order to build cubeSQL Web Admin application, [Xojo](https://xojo.com/) and the latest [cubeSQL Xojo Plugin](https://github.com/marcobambini/cubesqlplugin) are required.
1919

20-
- Xojo can be obtained from: https://xojo.com/
21-
- Latest [cubeSQL Xojo Plugin](https://github.com/cubesql/cubeSQLAdmin) can be found inside the Plugins folder
20+
- Xojo can be obtained from: [https://xojo.com/](https://xojo.com/)
21+
- Latest [cubeSQL Xojo Plugin](https://github.com/marcobambini/cubesqlplugin) can be downloaded from the [Releases](https://github.com/marcobambini/cubesqlplugin/releases)
2222

2323
## Ready to use executables and Docker Images
2424

2525
1. Executables are provided with the [Releases](https://github.com/cubesql/webadmin/releases).
2626
- A Shell Script is provided to choose a Port and launch the Web Application
2727
- It is up to you to install the Web Application as a service.
28-
See [Xojo Documentation: Deployment Overview](https://documentation.xojo.com/topics/application_deployment/web/deployment_overview.html)
28+
See [Xojo Documentation: Deployment Overview](https://documentation.xojo.com/topics/application_deployment/web/deployment_overview.html)
2929

3030
2. Docker Images provided by jo-tools can be found here:
31-
[Docker Hub: jotools/cubesql-webadmin](https://hub.docker.com/r/jotools/cubesql-webadmin)
31+
[Docker Hub: jotools/cubesql-webadmin](https://hub.docker.com/r/jotools/cubesql-webadmin)
3232

3333
3. Docker Compose setups provided by jo-tools can be found here:
3434
[GitHub: jo-tools/docker](https://github.com/jo-tools/docker)
3535
- These setups contain both cubeSQL Server and cubeSQL Web Admin
3636

3737
## Configuration
3838

39-
cubeSQL Web Admin supports the following launch arguments and corresponding environment variables:
39+
cubeSQL Web Admin supports the following launch arguments and corresponding environment variables.
4040

41-
#### Web Application
41+
*Example:*
42+
*Launch cubeSQLWebAdmin on Port 8080 and prefill login data to connect to a cubeSQL Server running on localhost Port 4440:*
43+
`/path/to/launch/cubeSQLWebAdmin --Port=8080 --CubeSQLHostname=localhost --CubeSQLPort=4440 --CubeSQLUsername=admin --CubeSQLPassword=admin`
44+
45+
### Web Application
4246
- `--Port` | `CUBESQL_WEBADMIN_PORT`
4347

44-
#### Prefill Login data:
48+
### Default New Connection
4549

4650
- `--CubeSQLHostname` | `CUBESQL_HOSTNAME`
4751
- `--CubeSQLPort` | `CUBESQL_PORT`
4852
- `--CubeSQLEncryption` | `CUBESQL_ENCRYPTION` with values: `NONE`, `AES128`, `AES128`, `SSL`
4953
For Encryption type `SSL`:
5054
- `--CubeSQLSSLCertificate` | `CUBESQL_SSL_CERTIFICATE`
51-
with value: `/path/to/file`
55+
*with value:* `/path/to/file`
5256
- `--CubeSQLSSLCertificatePassword` | `CUBESQL_SSL_CERTIFICATEPASSWORD`
53-
with value: `/path/to/file.txt` | plain text
57+
*with value:* plain text | `/path/to/file.txt` | `` `/output/of/a/shell/cmd` ``
5458
- `--CubeSQLSSLRootCertificate` | `CUBESQL_SSL_ROOTCERTIFICATE`
55-
with value: `/path/to/file`
59+
*with value:* `/path/to/file`
5660
- `--CubeSQLSSLCipherList` | `CUBESQL_SSL_CIPHERLIST`
57-
with value: `/path/to/file.txt` | plain text
61+
*with value:* plain text | `/path/to/file.txt`
5862
- `--CubeSQLUsername` | `CUBESQL_USERNAME`
5963
Only if Username is prefilled:
60-
- `--CubeSQLPassword` | `CUBESQL_PASSWORD`
64+
- `--CubeSQLPassword` | `CUBESQL_PASSWORD`
65+
*with value:* plain text | `/path/to/file.txt` | `` `/output/of/a/shell/cmd` ``
66+
67+
### Connection Choice
68+
69+
To offer a list of connection choices they can be specified in a JSON file which contains an array of [`ConnectionItems`](./webapp/ConnectionItem.xojo_code).
70+
71+
*Example:* [`connection-choice.json`](./resources/connection-choice.json)
72+
73+
- `--CubeSQLConnectionChoice` | `CUBESQL_CONNECTIONCHOICE`
74+
*with value:* `/path/to/connection-choice.json`
6175

6276

6377
## About
64-
cubeSQL Web Admin has been written by Jürg Otter, who is a long term user of Xojo and working for [CM Informatik AG](https://cmiag.ch/). Their Application [CMI LehrerOffice](https://cmi-bildung.ch/) is a Xojo Design Award Winner 2018. In his leisure time Jürg provides some [bits and pieces for Xojo Developers](https://www.jo-tools.ch/).
78+
cubeSQL Web Admin has been written by Jürg Otter, who is a long term user of Xojo and working for [CM Informatik AG](https://cmiag.ch/). Their Application [CMI LehrerOffice](https://cmi-bildung.ch/) is a Xojo Design Award Winner 2018. In his leisure time Jürg provides some [bits and pieces for Xojo Developers](https://www.jo-tools.ch/).

cubesql-webadmin.xojo_project

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ Class=DatasourceColumn;webapp/containers/base/DatasourceColumn.xojo_code;&h00000
5050
Class=App;webapp/App.xojo_code;&h0000000055A03FFF;&h0000000018D38FFF;false
5151
WebSession=Session;webapp/Session.xojo_code;&h0000000046C87FFF;&h0000000018D38FFF;false
5252
Module=modCubeSQLAdmin;webapp/modCubeSQLAdmin.xojo_code;&h00000000097C9FFF;&h0000000018D38FFF;false
53+
Class=ConnectionItem;webapp/ConnectionItem.xojo_code;&h0000000046AE4FFF;&h0000000018D38FFF;false
5354
MultiImage=icon_128;resources/icon_128.xojo_image;&h000000007294E7FF;&h0000000035B107FF;false
5455
BuildSteps=Build Automation;Build Automation.xojo_code;&h000000001394FFFF;&h0000000000000000;false
5556
ColorAsset=colTextKey;styles/colTextKey.xojo_color;&h000000005870AFFF;&h00000000139DBFFF;false
@@ -66,15 +67,16 @@ Folder=information;webapp/containers/information;&h000000005EFC7FFF;&h0000000058
6667
WebContainer=cntCommands;webapp/containers/information/cntCommands.xojo_code;&h000000002752C7FF;&h000000005EFC7FFF;false
6768
WebContainer=cntClients;webapp/containers/information/cntClients.xojo_code;&h000000002140EFFF;&h000000005EFC7FFF;false
6869
WebContainer=cntLog;webapp/containers/information/cntLog.xojo_code;&h000000002B1057FF;&h000000005EFC7FFF;false
70+
Class=thrConnectionChoices;webapp/thrConnectionChoices.xojo_code;&h00000000733557FF;&h0000000018D38FFF;false
6971
DefaultWindow=LoginPage
7072
MajorVersion=1
71-
MinorVersion=0
72-
SubVersion=1
73+
MinorVersion=1
74+
SubVersion=0
7375
NonRelease=0
7476
Release=0
7577
InfoVersion=cubeSQL Web Admin
7678
LongVersion=SQLabs and jo-tools
77-
ShortVersion=1.0.1
79+
ShortVersion=1.1.0
7880
WinCompanyName=sqlabs.com
7981
WinInternalName=cubesqlwebadmin
8082
WinProductName=cubeSQL Web Admin
@@ -93,7 +95,7 @@ MDICaption=
9395
DefaultEncoding=&h0
9496
AppIcon=cubesql-webadmin.xojo_resources;&h0
9597
OSXBundleID=com.sqlabs.cubesqlwebadmin
96-
DebuggerCommandLine=--CubeSQLHostname=localhost --CubeSQLPort=4430 --CubeSQLUsername=admin --CubeSQLPassword=admin
98+
DebuggerCommandLine=--CubeSQLHostname=localhost --CubeSQLPort=4430 --CubeSQLUsername=admin --CubeSQLPassword=admin --CubeSQLConnectionChoice=./resources/connection-choice.json
9799
UseGDIPlus=False
98100
UseBuildsFolder=True
99101
HiDPI=True

resources/connection-choice.json

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
[
2+
{
3+
"caption": "localhost (4430, AES256)",
4+
"selected": false,
5+
"hostname": "localhost",
6+
"username": "admin",
7+
"password": "admin",
8+
"port": 4430,
9+
"encryption": "AES256",
10+
"sslcertificate": "",
11+
"sslcertificatepassword": "",
12+
"sslrootcertificate": "",
13+
"sslcipherlist": ""
14+
},
15+
{
16+
"caption": "localhost (4430, AES128)",
17+
"selected": false,
18+
"hostname": "localhost",
19+
"username": "admin",
20+
"password": "admin",
21+
"port": 4430,
22+
"encryption": "AES128",
23+
"sslcertificate": "",
24+
"sslcertificatepassword": "",
25+
"sslrootcertificate": "",
26+
"sslcipherlist": ""
27+
},
28+
{
29+
"caption": "localhost (4430, NONE)",
30+
"selected": false,
31+
"hostname": "localhost",
32+
"username": "admin",
33+
"password": "admin",
34+
"port": 4430,
35+
"encryption": "NONE",
36+
"sslcertificate": "",
37+
"sslcertificatepassword": "",
38+
"sslrootcertificate": "",
39+
"sslcipherlist": ""
40+
},
41+
{
42+
"caption": "-",
43+
"hostname": "-"
44+
},
45+
{
46+
"caption": "localhost (4440, AES256)",
47+
"selected": false,
48+
"hostname": "localhost",
49+
"username": "admin",
50+
"password": "admin",
51+
"port": 4440,
52+
"encryption": "AES256",
53+
"sslcertificate": "",
54+
"sslcertificatepassword": "",
55+
"sslrootcertificate": "",
56+
"sslcipherlist": ""
57+
}
58+
]

webapp/App.xojo_code

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ Protected Class App
33
Inherits WebApplication
44
#tag Event
55
Sub Opening(args() As String)
6-
' Store Launch Arguments for later
76
modCubeSQLAdmin.StoreLaunchArguments(args)
87

8+
ethrConnectionChoices = New thrConnectionChoices
9+
ethrConnectionChoices.Start
10+
911
End Sub
1012
#tag EndEvent
1113

@@ -22,6 +24,11 @@ Inherits WebApplication
2224
#tag EndEvent
2325

2426

27+
#tag Property, Flags = &h21
28+
Private ethrConnectionChoices As thrConnectionChoices
29+
#tag EndProperty
30+
31+
2532
#tag Constant, Name = constDockerTag, Type = String, Dynamic = False, Default = \"jotools/cubesql-webadmin", Scope = Private
2633
#tag EndConstant
2734

0 commit comments

Comments
 (0)