-
Notifications
You must be signed in to change notification settings - Fork 3
/
help.html
255 lines (212 loc) · 8.19 KB
/
help.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>Help</title>
<style>
body {
background-color: white;
color: #666666;
margin-top: -70px;
font-family: "noto sans", Arial;
margin-left: 10px;
}
a {
transition: 0.3s;
}
a[href]:hover {
color: #44AAFF;
}
h1 {
color: black;
padding-top: 50px;
border-top: 1px solid black;
}
h2 {
color: black;
padding-top: 25px;
margin-bottom: -10px;
}
p {
padding-left: 20px;
}
ul, ol {
padding-left: 40px;
}
</style>
<script src="./.js/jquery.js"></script>
<script src="./.js/waypoints.js"></script>
<script>
/* jshint asi: true */
class HostTitle {
query (message) {
document.title = message
}
}
class HostClient {
constructor () {
this.queryIndex = 0
this.callbacks = {}
}
implementTitlebarCom () {
window.host = new HostTitle()
}
query (name, data, callback) {
if (!window.host) {
return null
}
if (callback) {
this.callbacks[this.queryIndex + ''] = callback
}
host.query(this.queryIndex + ':' + name + ':' + JSON.stringify(data))
this.queryIndex++
}
response (index, jsonText) {
if (!this.callbacks[index]) {
$('body').html('fail' + $('body').html())
return null
}
this.callbacks[index](jsonText)
delete this.callbacks[index]
}
event (name, jsonText) {
if (!this.callbacks[name]) {
$('body').html('fail' + $('body').html())
return null
}
this.callbacks[name](JSON.parse(jsonText))
}
bind (name, callback) {
this.callbacks[name] = callback
}
ready (callback) {
setTimeout(() => {
callback()
}, 5)
}
}
const hostClient = new HostClient()
$(function() {
const documentStructure = []
hostClient.ready(function () {
hostClient.query('config-path', null, function (path) {
$('.config-path').html(path)
})
hostClient.query('document-structure', documentStructure)
})
let $currentH1 = null
$('.topic').each(function () {
const $topic = $(this)
$('h1, h2', $topic).each(function () {
const $h1H2 = $(this)
const $a = $('a', $h1H2)
const headerTag = $h1H2.prop('tagName')
const name = $a.attr('name')
if (!name) {
return;
}
const $item = {'name': name, text: $a.text(), children: []}
if (headerTag == 'H1') {
documentStructure.push($item)
$currentH1 = $item
} else if ($currentH1) {
$currentH1.children.push($item)
}
})
})
function scrollTo(name) {
const selector = '[name="' + name + '"]'
$('html, body').animate({
scrollTop: $(selector).offset().top
}, 500);
}
hostClient.bind('topic-scrolled-activated', function (name) {
scrollTo(name)
})
$('h1, h2').waypoint(function() {
hostClient.query('topic-scrolled-to', $('a', this.element).attr('name'))
})
$('a[href^="#"]').click(function (e) {
scrollTo($.attr(this, 'href').substr(1))
e.preventDefault()
})
$('a[href*="://"]').click(function (event) {
event.preventDefault()
hostClient.query('link', this.href)
})
})
</script>
</head>
<body>
<div class="topic">
<h1><a name="introduction">Welcome to Database Dossier</a></h1>
<p>Database Dossier is a free database user interface program, you can use it for browsing and querying your databases.
<br />At present it can be used for accessing MariaDB and MySql database servers.</p>
</div>
<div class="topic">
<h1><a name="donations">Donations</a></h1>
<p>Database Dossier is a beautiful free open source computer program.
<br />If you are able to donate a small amount to the project - then new features can be added to make it even more awesome and useful for everyone.
<br /><a href="https://www.patreon.com/nshiell">https://www.patreon.com/nshiell</a>
</p>
</div>
<div class="topic">
<h1><a name="user-interface">User interface</a></h1>
<p>There are four main parts to the user interface.
<ol>
<li><a href="#record-sets">The Record Sets</a></li>
<li><a href="#tree">The Tree</a></li>
<li><a href="#sql-editor">The SQL Editor</a></li>
<li><a href="#log">The Log</a></li>
<li><a href="#connection">Connection</a></li>
</ol>
</p>
<h2><a name="record-sets">The Record Sets</a></h2>
<p>There are five tabs on the lower half of the window:
<ul>
<li>The first tab will show the first 1000 rows from the last table selected from the tree</li>
<li>The second tab will show the schema from last table selected from the tree</li>
<li>The third tab labelled “1” will show the result of the last query executed by pressing “1”</li>
<li>The fourth tab labelled “2” will show the result of the last query executed by pressing “2”</li>
<li>The fifth tab labelled “3” will show the result of the last query executed by pressing “3”</li>
</ul>
</p>
<p>If there is an error executing a query the error message will be displayed in red coloured text.</p>
<h2><a name="tree">The Tree</a></h2>
<p>The tree is shown to the left of the record sets,
<br />it shows all the connections in large text, in the form <i>username@host:port</i>
<br />clicking on a connection shows all the databases that that current connection provides access to
<br />clicking on a database will show all the tables in that database
<br />and clicking a table shows the first 1000 records in the “data” tab and the schema in the next tab.
</p>
<h2><a name="sql-editor">The SQL editor</a></h2>
<p>This is a free place to write any SQL code that you can execute against any connection.
<br />It is a good idea to keep an eye on the statusbar at the bottom as it shows which connection is active and which database is being used.
<br />All queries must be terminated with a semicolon.
<br />If you press the button labelled “1” then the SQL query under the cursor
<br />(the text between the preceding semicolon and the succeeding semicolon) will be executed and the result will be visible in the tab labelled “1”.
<br />The same goes for the buttons “2” and “3” with their respective result set tabs.
<br />The current query will also be selected when executing, so you can see what was run.
</p>
<h2><a name="log">The Log</a></h2>
<p>The log can viewed by clicking the “Log” tab.
<br />It will list all the queries run since the program was started <i>(with the most recent at the bottom of the list)</i>.
<br />It will also list the queries that where run as you clicked around the user interface.
</p>
<h2><a name="connection">Connection to Servers</a></h2>
<p>To create a connection, go to the menu bar and select File > Connect
<br />Fill in the username, port and password
<br />The button labelled “test”, will try and form a connection
<br />The button labelled “OK”, will try and form a connection and list the databases in the tree
<br />Please Note: To connect to remote servers using an SSH tunnel it is a good idea to do a search for “ssh port forward mysql” using your favourite search engine.
</p>
</div>
<div class="topic">
<h1><a name="storage">Storage</a></h1>
<p>When you finish using Database Dossier and close the program, the program’s state is stored and reused next time you start the program.
<br />There is a configuration JSON file stored at <b class="config-path"></b> that stores the connections and an SQL file that stores the text in the SQL editor.
<br />Please note: passwords are kept in plain text in the JSON file.
</p>
</div>
</body>
</html>