pinokiod 3.16.2 → 3.16.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/kernel/gitconfig_template +3 -0
- package/package.json +2 -1
- package/server/index.js +37 -2
- package/server/public/style.css +6 -0
- package/server/views/app.ejs +104 -30
- package/server/views/connect/x.ejs +2 -2
- package/server/views/connect.ejs +2 -2
- package/server/views/download.ejs +2 -2
- package/server/views/explore.ejs +2 -2
- package/server/views/file_explorer.ejs +1 -1
- package/server/views/github.ejs +62 -2
- package/server/views/help.ejs +2 -2
- package/server/views/index.ejs +2 -2
- package/server/views/network.ejs +2 -2
- package/server/views/partials/dynamic.ejs +4 -2
- package/server/views/partials/menu.ejs +4 -2
- package/server/views/settings.ejs +2 -2
- package/server/views/shell.ejs +17 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pinokiod",
|
|
3
|
-
"version": "3.16.
|
|
3
|
+
"version": "3.16.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"http-proxy-middleware": "^3.0.0",
|
|
38
38
|
"http-terminator": "^3.2.0",
|
|
39
39
|
"https": "^1.0.0",
|
|
40
|
+
"ini": "^5.0.0",
|
|
40
41
|
"isomorphic-git": "^1.23.0",
|
|
41
42
|
"jimini": "^0.0.8",
|
|
42
43
|
"jsdom": "^24.0.0",
|
package/server/index.js
CHANGED
|
@@ -25,6 +25,7 @@ const git = require('isomorphic-git')
|
|
|
25
25
|
const http = require('isomorphic-git/http/node')
|
|
26
26
|
const marked = require('marked')
|
|
27
27
|
const multer = require('multer');
|
|
28
|
+
const ini = require('ini')
|
|
28
29
|
//const localtunnel = require('localtunnel');
|
|
29
30
|
//const ngrok = require("@ngrok/ngrok");
|
|
30
31
|
|
|
@@ -167,9 +168,11 @@ class Server {
|
|
|
167
168
|
let _filepath = uri_path.split("/").filter(x=>x).slice(1)
|
|
168
169
|
let filepath = this.kernel.path(..._filepath)
|
|
169
170
|
let id = `${filepath}?cwd=${cwd}`
|
|
171
|
+
obj.script_id = id
|
|
170
172
|
//if (this.kernel.api.running[filepath]) {
|
|
171
173
|
if (this.kernel.api.running[id]) {
|
|
172
174
|
obj.display = "indent"
|
|
175
|
+
console.log("OBJ", obj)
|
|
173
176
|
running_dynamic.push(obj)
|
|
174
177
|
}
|
|
175
178
|
}
|
|
@@ -1584,6 +1587,7 @@ class Server {
|
|
|
1584
1587
|
*/
|
|
1585
1588
|
if (keypath) {
|
|
1586
1589
|
config.href = base.href + "/" + keypath.join("/") + "?path=" + base.cwd
|
|
1590
|
+
config.script_id = this.kernel.path(keypath) + "?cwd=" + base.cwd
|
|
1587
1591
|
}
|
|
1588
1592
|
return config
|
|
1589
1593
|
}
|
|
@@ -1734,6 +1738,7 @@ class Server {
|
|
|
1734
1738
|
// shell_id = encodeURIComponent(`${name}_${i}_${hash}`)
|
|
1735
1739
|
// }
|
|
1736
1740
|
menuitem.href = "/shell/" + shell_id + "?" + params.toString()
|
|
1741
|
+
menuitem.shell_id = shell_id
|
|
1737
1742
|
let shell = this.kernel.shell.get(shell_id)
|
|
1738
1743
|
if (shell) {
|
|
1739
1744
|
menuitem.running = true
|
|
@@ -1889,6 +1894,10 @@ class Server {
|
|
|
1889
1894
|
}
|
|
1890
1895
|
}
|
|
1891
1896
|
|
|
1897
|
+
if (menuitem.shell_id) {
|
|
1898
|
+
config.menu[i].shell_id = menuitem.shell_id
|
|
1899
|
+
}
|
|
1900
|
+
|
|
1892
1901
|
|
|
1893
1902
|
}
|
|
1894
1903
|
|
|
@@ -3106,7 +3115,11 @@ class Server {
|
|
|
3106
3115
|
}]
|
|
3107
3116
|
}
|
|
3108
3117
|
|
|
3118
|
+
const gitConfigPath = this.kernel.path("gitconfig")
|
|
3119
|
+
const content = await fs.promises.readFile(gitConfigPath, 'utf-8');
|
|
3120
|
+
const gitconfig = ini.parse(content);
|
|
3109
3121
|
res.render("github", {
|
|
3122
|
+
gitconfig,
|
|
3110
3123
|
hosts,
|
|
3111
3124
|
readme,
|
|
3112
3125
|
portal: this.portal,
|
|
@@ -3132,6 +3145,30 @@ class Server {
|
|
|
3132
3145
|
// }]
|
|
3133
3146
|
})
|
|
3134
3147
|
}))
|
|
3148
|
+
this.app.post("/github/config", ex(async (req, res) => {
|
|
3149
|
+
const gitConfigPath = this.kernel.path("gitconfig")
|
|
3150
|
+
const content = await fs.promises.readFile(gitConfigPath, 'utf-8');
|
|
3151
|
+
const gitconfig = ini.parse(content);
|
|
3152
|
+
function set(obj, path, value) {
|
|
3153
|
+
const keys = path.split('.');
|
|
3154
|
+
let current = obj;
|
|
3155
|
+
for (let i = 0; i < keys.length - 1; i++) {
|
|
3156
|
+
const k = keys[i];
|
|
3157
|
+
if (!(k in current) || typeof current[k] !== 'object') {
|
|
3158
|
+
current[k] = {};
|
|
3159
|
+
}
|
|
3160
|
+
current = current[k];
|
|
3161
|
+
}
|
|
3162
|
+
current[keys[keys.length - 1]] = value;
|
|
3163
|
+
}
|
|
3164
|
+
for(let key in req.body) {
|
|
3165
|
+
set(gitconfig, key, req.body[key])
|
|
3166
|
+
}
|
|
3167
|
+
let text = ini.stringify(gitconfig)
|
|
3168
|
+
await fs.promises.writeFile(gitConfigPath, text)
|
|
3169
|
+
res.json({ success: true })
|
|
3170
|
+
|
|
3171
|
+
}))
|
|
3135
3172
|
this.app.get("/github/status", ex(async (req, res) => {
|
|
3136
3173
|
let id = "gh_status"
|
|
3137
3174
|
let params = new URLSearchParams()
|
|
@@ -3336,7 +3373,6 @@ class Server {
|
|
|
3336
3373
|
console.log({ wait, cr })
|
|
3337
3374
|
|
|
3338
3375
|
let current = req.query.callback || req.originalUrl
|
|
3339
|
-
console.log("render setup", { current })
|
|
3340
3376
|
|
|
3341
3377
|
// console.log("2", { requirements_pending, install_required })
|
|
3342
3378
|
// if (!requirements_pending && !install_required) {
|
|
@@ -4391,7 +4427,6 @@ class Server {
|
|
|
4391
4427
|
} else if (req.body.type === 'env') {
|
|
4392
4428
|
let envpath = this.kernel.path("ENVIRONMENT")
|
|
4393
4429
|
let str = await Environment.ENV("system", this.kernel.homedir)
|
|
4394
|
-
console.log({ str })
|
|
4395
4430
|
await fs.promises.writeFile(path.resolve(this.kernel.homedir, "ENVIRONMENT"), str)
|
|
4396
4431
|
res.json({ success: true })
|
|
4397
4432
|
} else if (req.body.type === 'browser-cache') {
|
package/server/public/style.css
CHANGED
|
@@ -227,6 +227,12 @@ body.dark .type-tabs {
|
|
|
227
227
|
padding: 15px;
|
|
228
228
|
*/
|
|
229
229
|
}
|
|
230
|
+
.navheader a:hover, .navheader button:hover {
|
|
231
|
+
color: royalblue;
|
|
232
|
+
}
|
|
233
|
+
.navheader a, .navheader button {
|
|
234
|
+
cursor: pointer;
|
|
235
|
+
}
|
|
230
236
|
.navheader .btn2 {
|
|
231
237
|
text-transform: lowercase;
|
|
232
238
|
}
|
package/server/views/app.ejs
CHANGED
|
@@ -369,13 +369,18 @@ body.dark .frame-link.selected {
|
|
|
369
369
|
padding: 5px;
|
|
370
370
|
*/
|
|
371
371
|
}
|
|
372
|
+
.loader {
|
|
373
|
+
flex-shrink: 0;
|
|
374
|
+
}
|
|
372
375
|
.loader .btn:hover {
|
|
373
376
|
color: royalblue;
|
|
374
377
|
border-color: royalblue;
|
|
375
378
|
}
|
|
376
379
|
.loader .btn {
|
|
377
380
|
padding: 4px 8px;
|
|
381
|
+
/*
|
|
378
382
|
border: 1px solid rgba(255,255,255,0.3);
|
|
383
|
+
*/
|
|
379
384
|
}
|
|
380
385
|
.frame-link .tab {
|
|
381
386
|
flex-grow: 1;
|
|
@@ -738,17 +743,17 @@ body.dark .appcanvas {
|
|
|
738
743
|
<body class='<%=theme%>' data-platform="<%=platform%>" data-agent="<%=agent%>">
|
|
739
744
|
<header class='navheader grabbable'>
|
|
740
745
|
<h1>
|
|
741
|
-
<a class='home' href="/"><
|
|
746
|
+
<a class='home' href="/"><i class="fa-solid fa-house"></i></a>
|
|
742
747
|
<button class='btn2' id='back'><div><i class="fa-solid fa-chevron-left"></i></div><div>Prev</div></button>
|
|
743
748
|
<button class='btn2' id='forward'><div><i class="fa-solid fa-chevron-right"></i></div><div>Next</div></button>
|
|
744
749
|
<button class='btn2' id='refresh-page'><div><i class="fa-solid fa-rotate-right"></i></div><div>Refresh</div></button>
|
|
745
750
|
<a class='btn2 create-new' id='create-new-folder'><div><i class="fa-solid fa-folder-plus"></i></div><div>Create</div></a>
|
|
746
|
-
<a class='btn2' id='explore' href="/?mode=explore"><div><i class="fa-solid fa-magnifying-glass"></i></div><div>Discover</div></a>
|
|
747
751
|
<a href="/network" class='btn2'><div><i class="fa-solid fa-wifi"></i></div><div>Network</div></a>
|
|
748
752
|
<a href="/connect" class='btn2'><div><i class="fa-solid fa-circle-user"></i></div><div>Connect</div></a>
|
|
749
753
|
<input type='url' id='location' readonly value="<%=execUrl%>">
|
|
750
754
|
<a id='open-location' target="_blank" features="browser"><i class="fa-solid fa-arrow-up-right-from-square"></i></a>
|
|
751
755
|
<div class='nav-btns'>
|
|
756
|
+
<a class='btn2' id='explore' href="/?mode=explore"><div><i class="fa-solid fa-magnifying-glass"></i></div><div>Discover</div></a>
|
|
752
757
|
<a class='btn2' href="<%=portal%>" target="_blank"><div><i class="fa-solid fa-question"></i></div><div>Help</div></a>
|
|
753
758
|
<button class='btn2' id='genlog'><div><i class="fa-solid fa-laptop-code"></i></div><div>Logs</div></button>
|
|
754
759
|
<a id='downloadlogs' download class='hidden btn2' href="/pinokio/logs.zip"><div><i class="fa-solid fa-download"></i></div><div>Download logs</div></a>
|
|
@@ -1441,7 +1446,9 @@ body.dark .appcanvas {
|
|
|
1441
1446
|
move: true,
|
|
1442
1447
|
edit: true,
|
|
1443
1448
|
redirect: (new_path) => {
|
|
1444
|
-
|
|
1449
|
+
let u = location.href.replace(/(\/pinokio\/browser\/)[^\/]+(?=\/|$)/, `$1${new_path}`)
|
|
1450
|
+
debugger
|
|
1451
|
+
return u
|
|
1445
1452
|
}
|
|
1446
1453
|
})
|
|
1447
1454
|
})
|
|
@@ -1458,7 +1465,9 @@ body.dark .appcanvas {
|
|
|
1458
1465
|
<% } %>
|
|
1459
1466
|
edit: true,
|
|
1460
1467
|
redirect: (new_path) => {
|
|
1461
|
-
|
|
1468
|
+
let u = location.href.replace(/(\/pinokio\/browser\/)[^\/]+(?=\/|$)/, `$1${new_path}`)
|
|
1469
|
+
debugger
|
|
1470
|
+
return u
|
|
1462
1471
|
}
|
|
1463
1472
|
})
|
|
1464
1473
|
})
|
|
@@ -1476,7 +1485,9 @@ body.dark .appcanvas {
|
|
|
1476
1485
|
copy: true,
|
|
1477
1486
|
edit: true,
|
|
1478
1487
|
redirect: (new_path) => {
|
|
1479
|
-
|
|
1488
|
+
let u = location.href.replace(/(\/pinokio\/browser\/)[^\/]+(?=\/|$)/, `$1${new_path}`)
|
|
1489
|
+
debugger
|
|
1490
|
+
return u
|
|
1480
1491
|
}
|
|
1481
1492
|
})
|
|
1482
1493
|
/*
|
|
@@ -1614,34 +1625,97 @@ body.dark .appcanvas {
|
|
|
1614
1625
|
if (target) {
|
|
1615
1626
|
e.preventDefault()
|
|
1616
1627
|
e.stopPropagation()
|
|
1617
|
-
let
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
}
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1628
|
+
let shell = target.closest("[data-shell]")
|
|
1629
|
+
if (shell) {
|
|
1630
|
+
debugger
|
|
1631
|
+
let shell_id = shell.getAttribute("data-shell")
|
|
1632
|
+
n.Noty({
|
|
1633
|
+
text: `stopping shell`,
|
|
1634
|
+
silent: true,
|
|
1635
|
+
timeout: 2000
|
|
1636
|
+
})
|
|
1637
|
+
let socket = new Socket()
|
|
1638
|
+
socket.run({
|
|
1639
|
+
method: "kernel.bin.shell_kill",
|
|
1640
|
+
params: {
|
|
1641
|
+
id: shell_id
|
|
1642
|
+
}
|
|
1643
|
+
}, (packet) => {
|
|
1644
|
+
console.log("packet", packet)
|
|
1645
|
+
if (packet.type === "result") {
|
|
1646
|
+
socket.close()
|
|
1647
|
+
n.Noty({
|
|
1648
|
+
timeout: 2000,
|
|
1649
|
+
text: `stopped`,
|
|
1650
|
+
silent: true
|
|
1651
|
+
})
|
|
1652
|
+
console.log("Refresh 4")
|
|
1653
|
+
refresh(true)
|
|
1654
|
+
}
|
|
1655
|
+
})
|
|
1656
|
+
} else {
|
|
1657
|
+
let script = target.closest("[data-script]")
|
|
1658
|
+
if (script) {
|
|
1659
|
+
let script_id = script.getAttribute("data-script")
|
|
1660
|
+
target.querySelector("i.fa-square").className = "fa-solid fa-check"
|
|
1636
1661
|
n.Noty({
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1662
|
+
text: `stopping script`,
|
|
1663
|
+
silent: true,
|
|
1664
|
+
timeout: 2000
|
|
1640
1665
|
})
|
|
1641
|
-
|
|
1642
|
-
|
|
1666
|
+
|
|
1667
|
+
let socket = new Socket()
|
|
1668
|
+
socket.run({
|
|
1669
|
+
method: "kernel.api.stop",
|
|
1670
|
+
params: {
|
|
1671
|
+
id: script_id
|
|
1672
|
+
}
|
|
1673
|
+
}, (packet) => {
|
|
1674
|
+
if (packet.type === "result") {
|
|
1675
|
+
socket.close()
|
|
1676
|
+
n.Noty({
|
|
1677
|
+
timeout: 2000,
|
|
1678
|
+
text: `stopped`,
|
|
1679
|
+
silent: true
|
|
1680
|
+
})
|
|
1681
|
+
console.log("Refresh 4")
|
|
1682
|
+
refresh(true)
|
|
1683
|
+
}
|
|
1684
|
+
})
|
|
1685
|
+
} else {
|
|
1686
|
+
let link = target.closest("[href]")
|
|
1687
|
+
debugger
|
|
1688
|
+
if (link) {
|
|
1689
|
+
let src = new URL(link.href).pathname
|
|
1690
|
+
target.querySelector("i.fa-square").className = "fa-solid fa-check"
|
|
1691
|
+
n.Noty({
|
|
1692
|
+
text: `stopping ${src}`,
|
|
1693
|
+
silent: true,
|
|
1694
|
+
timeout: 2000
|
|
1695
|
+
})
|
|
1696
|
+
console.log("src", src)
|
|
1697
|
+
|
|
1698
|
+
let socket = new Socket()
|
|
1699
|
+
socket.run({
|
|
1700
|
+
method: "kernel.api.stop",
|
|
1701
|
+
params: {
|
|
1702
|
+
uri: "~" + src
|
|
1703
|
+
}
|
|
1704
|
+
}, (packet) => {
|
|
1705
|
+
if (packet.type === "result") {
|
|
1706
|
+
socket.close()
|
|
1707
|
+
n.Noty({
|
|
1708
|
+
timeout: 2000,
|
|
1709
|
+
text: `stopped`,
|
|
1710
|
+
silent: true
|
|
1711
|
+
})
|
|
1712
|
+
console.log("Refresh 4")
|
|
1713
|
+
refresh(true)
|
|
1714
|
+
}
|
|
1715
|
+
})
|
|
1716
|
+
}
|
|
1643
1717
|
}
|
|
1644
|
-
}
|
|
1718
|
+
}
|
|
1645
1719
|
|
|
1646
1720
|
return
|
|
1647
1721
|
}
|
|
@@ -191,16 +191,16 @@ pre {
|
|
|
191
191
|
<body class='<%=theme%>' data-agent="<%=agent%>">
|
|
192
192
|
<header class='navheader grabbable'>
|
|
193
193
|
<h1>
|
|
194
|
-
<a class='home' href="/"><
|
|
194
|
+
<a class='home' href="/"><i class="fa-solid fa-house"></i></a>
|
|
195
195
|
<button class='btn2' id='back'><div><i class="fa-solid fa-chevron-left"></i></div><div>Prev</div></button>
|
|
196
196
|
<button class='btn2' id='forward'><div><i class="fa-solid fa-chevron-right"></i></div><div>Next</div></button>
|
|
197
197
|
<button class='btn2' id='refresh-page'><div><i class="fa-solid fa-rotate-right"></i></div><div>Refresh</div></button>
|
|
198
198
|
<a class='btn2 create-new' id='create-new-folder'><div><i class="fa-solid fa-folder-plus"></i></div><div>Create</div></a>
|
|
199
|
-
<a class='btn2' id='explore' href="/?mode=explore"><div><i class="fa-solid fa-magnifying-glass"></i></div><div>Discover</div></a>
|
|
200
199
|
<a href="/network" class='btn2'><div><i class="fa-solid fa-wifi"></i></div><div>Network</div></a>
|
|
201
200
|
<a href="/connect" class='btn2'><div><i class="fa-solid fa-circle-user"></i></div><div>Connect</div></a>
|
|
202
201
|
<div class='flexible'></div>
|
|
203
202
|
<div class='nav-btns'>
|
|
203
|
+
<a class='btn2' id='explore' href="/?mode=explore"><div><i class="fa-solid fa-magnifying-glass"></i></div><div>Discover</div></a>
|
|
204
204
|
<a class='btn2' href="<%=portal%>" target="_blank"><div><i class="fa-solid fa-question"></i></div><div>Help</div></a>
|
|
205
205
|
<a class='btn2' href="/?mode=settings"><div><i class="fa-solid fa-gear"></i></div><div>Settings</div></a>
|
|
206
206
|
<button id='new-window' title='open a new window' class='btn2' data-agent="<%=agent%>"><div><i class="fa-solid fa-plus"></i></div><div>Window</div></button>
|
package/server/views/connect.ejs
CHANGED
|
@@ -226,16 +226,16 @@ body.dark .config {
|
|
|
226
226
|
<body class='<%=theme%>' data-agent="<%=agent%>">
|
|
227
227
|
<header class='navheader grabbable'>
|
|
228
228
|
<h1>
|
|
229
|
-
<a class='home' href="/"><
|
|
229
|
+
<a class='home' href="/"><i class="fa-solid fa-house"></i></a>
|
|
230
230
|
<button class='btn2' id='back'><div><i class="fa-solid fa-chevron-left"></i></div><div>Prev</div></button>
|
|
231
231
|
<button class='btn2' id='forward'><div><i class="fa-solid fa-chevron-right"></i></div><div>Next</div></button>
|
|
232
232
|
<button class='btn2' id='refresh-page'><div><i class="fa-solid fa-rotate-right"></i></div><div>Refresh</div></button>
|
|
233
233
|
<a class='btn2 create-new' id='create-new-folder'><div><i class="fa-solid fa-folder-plus"></i></div><div>Create</div></a>
|
|
234
|
-
<a class='btn2' id='explore' href="/?mode=explore"><div><i class="fa-solid fa-magnifying-glass"></i></div><div>Discover</div></a>
|
|
235
234
|
<a href="/network" class='btn2'><div><i class="fa-solid fa-wifi"></i></div><div>Network</div></a>
|
|
236
235
|
<a href="/connect" class='btn2'><div><i class="fa-solid fa-circle-user"></i></div><div>Connect</div></a>
|
|
237
236
|
<div class='flexible'></div>
|
|
238
237
|
<div class='nav-btns'>
|
|
238
|
+
<a class='btn2' id='explore' href="/?mode=explore"><div><i class="fa-solid fa-magnifying-glass"></i></div><div>Discover</div></a>
|
|
239
239
|
<a class='btn2' href="<%=portal%>" target="_blank"><div><i class="fa-solid fa-question"></i></div><div>Help</div></a>
|
|
240
240
|
<button class='btn2' id='genlog'><div><i class="fa-solid fa-laptop-code"></i></div><div>Logs</div></button>
|
|
241
241
|
<a id='downloadlogs' download class='hidden btn2' href="/pinokio/logs.zip"><div><i class="fa-solid fa-download"></i></div><div>Download logs</div></a>
|
|
@@ -111,16 +111,16 @@ body.frozen {
|
|
|
111
111
|
<% } %>
|
|
112
112
|
<header class='grabbable'>
|
|
113
113
|
<h1>
|
|
114
|
-
<a class='home' href="/"><
|
|
114
|
+
<a class='home' href="/"><i class="fa-solid fa-house"></i></a>
|
|
115
115
|
<button class='btn2' id='back'><div><i class="fa-solid fa-chevron-left"></i></div><div>Prev</div></button>
|
|
116
116
|
<button class='btn2' id='forward'><div><i class="fa-solid fa-chevron-right"></i></div><div>Next</div></button>
|
|
117
117
|
<button class='btn2' id='refresh-page'><div><i class="fa-solid fa-rotate-right"></i></div><div>Refresh</div></button>
|
|
118
118
|
<a class='btn2 create-new' id='create-new-folder'><div><i class="fa-solid fa-folder-plus"></i></div><div>Create</div></a>
|
|
119
|
-
<a class='btn2' id='explore' href="/?mode=explore"><div><i class="fa-solid fa-magnifying-glass"></i></div><div>Discover</div></a>
|
|
120
119
|
<a href="/network" class='btn2'><div><i class="fa-solid fa-wifi"></i></div><div>Network</div></a>
|
|
121
120
|
<a href="/connect" class='btn2'><div><i class="fa-solid fa-circle-user"></i></div><div>Connect</div></a>
|
|
122
121
|
<div class='flexible'></div>
|
|
123
122
|
<div class='nav-btns'>
|
|
123
|
+
<a class='btn2' id='explore' href="/?mode=explore"><div><i class="fa-solid fa-magnifying-glass"></i></div><div>Discover</div></a>
|
|
124
124
|
<a class='btn2' href="<%=portal%>" target="_blank"><div><i class="fa-solid fa-question"></i></div><div>Help</div></a>
|
|
125
125
|
<button class='btn2' id='genlog'><div><i class="fa-solid fa-laptop-code"></i></div><div>Logs</div></button>
|
|
126
126
|
<a id='downloadlogs' download class='hidden btn2' href="/pinokio/logs.zip"><div><i class="fa-solid fa-download"></i></div><div>Download logs</div></a>
|
package/server/views/explore.ejs
CHANGED
|
@@ -120,16 +120,16 @@ body main iframe {
|
|
|
120
120
|
<body class='<%=theme%>' data-agent="<%=agent%>">
|
|
121
121
|
<header class='navheader grabbable'>
|
|
122
122
|
<h1>
|
|
123
|
-
<a class='home' href="/"><
|
|
123
|
+
<a class='home' href="/"><i class="fa-solid fa-house"></i></a>
|
|
124
124
|
<button class='btn2' id='back'><div><i class="fa-solid fa-chevron-left"></i></div><div>Prev</div></button>
|
|
125
125
|
<button class='btn2' id='forward'><div><i class="fa-solid fa-chevron-right"></i></div><div>Next</div></button>
|
|
126
126
|
<button class='btn2' id='refresh-page'><div><i class="fa-solid fa-rotate-right"></i></div><div>Refresh</div></button>
|
|
127
127
|
<a class='btn2 create-new' id='create-new-folder'><div><i class="fa-solid fa-folder-plus"></i></div><div>Create</div></a>
|
|
128
|
-
<a class='btn2' id='explore' href="/?mode=explore"><div><i class="fa-solid fa-magnifying-glass"></i></div><div>Discover</div></a>
|
|
129
128
|
<a href="/network" class='btn2'><div><i class="fa-solid fa-wifi"></i></div><div>Network</div></a>
|
|
130
129
|
<a href="/connect" class='btn2'><div><i class="fa-solid fa-circle-user"></i></div><div>Connect</div></a>
|
|
131
130
|
<div class='flexible'></div>
|
|
132
131
|
<div class='nav-btns'>
|
|
132
|
+
<a class='btn2' id='explore' href="/?mode=explore"><div><i class="fa-solid fa-magnifying-glass"></i></div><div>Discover</div></a>
|
|
133
133
|
<a class='btn2' href="<%=portal%>" target="_blank"><div><i class="fa-solid fa-question"></i></div><div>Help</div></a>
|
|
134
134
|
<button class='btn2' id='genlog'><div><i class="fa-solid fa-laptop-code"></i></div><div>Logs</div></button>
|
|
135
135
|
<a id='downloadlogs' download class='hidden btn2' href="/pinokio/logs.zip"><div><i class="fa-solid fa-download"></i></div><div>Download logs</div></a>
|
|
@@ -162,7 +162,7 @@ body.dark .browser-options-row {
|
|
|
162
162
|
<header class='navheader grabbable'>
|
|
163
163
|
<h1>
|
|
164
164
|
<% if (ishome) { %>
|
|
165
|
-
<a class='home' href="/"><
|
|
165
|
+
<a class='home' href="/"><i class="fa-solid fa-house"></i></a>
|
|
166
166
|
<button class='btn2' id='back'><i class="fa-solid fa-chevron-left"></i></button>
|
|
167
167
|
<button class='btn2' id='forward'><i class="fa-solid fa-chevron-right"></i></button>
|
|
168
168
|
<button class='btn2' id='refresh-page'><div><i class="fa-solid fa-rotate-right"></i></div><div>Refresh</div></button>
|
package/server/views/github.ejs
CHANGED
|
@@ -112,6 +112,29 @@ main {
|
|
|
112
112
|
width: 100%;
|
|
113
113
|
align-items: center;
|
|
114
114
|
}
|
|
115
|
+
.setup-items .gitconfig .field input {
|
|
116
|
+
padding: 10px;
|
|
117
|
+
box-sizing: border-box;
|
|
118
|
+
border: 1px solid silver;
|
|
119
|
+
width: 100%;
|
|
120
|
+
|
|
121
|
+
}
|
|
122
|
+
.setup-items .gitconfig .field {
|
|
123
|
+
padding-bottom: 15px;
|
|
124
|
+
}
|
|
125
|
+
.setup-items .gitconfig label {
|
|
126
|
+
display: block;
|
|
127
|
+
margin-bottom: 5px;
|
|
128
|
+
}
|
|
129
|
+
.setup-items .gitconfig-footer .btn {
|
|
130
|
+
margin: 0 0 5px;
|
|
131
|
+
}
|
|
132
|
+
.setup-items .gitconfig {
|
|
133
|
+
flex-grow: 1;
|
|
134
|
+
padding: 30px;
|
|
135
|
+
background: rgba(0,0,0,0.04) !important;
|
|
136
|
+
margin-bottom: 20px;
|
|
137
|
+
}
|
|
115
138
|
.setup-items pre {
|
|
116
139
|
width: 100%;
|
|
117
140
|
padding: 30px;
|
|
@@ -182,16 +205,16 @@ hr {
|
|
|
182
205
|
<body class='<%=theme%>' data-agent="<%=agent%>">
|
|
183
206
|
<header class='navheader grabbable'>
|
|
184
207
|
<h1>
|
|
185
|
-
<a class='home' href="/"><
|
|
208
|
+
<a class='home' href="/"><i class="fa-solid fa-house"></i></a>
|
|
186
209
|
<button class='btn2' id='back'><div><i class="fa-solid fa-chevron-left"></i></div><div>Prev</div></button>
|
|
187
210
|
<button class='btn2' id='forward'><div><i class="fa-solid fa-chevron-right"></i></div><div>Next</div></button>
|
|
188
211
|
<button class='btn2' id='refresh-page'><div><i class="fa-solid fa-rotate-right"></i></div><div>Refresh</div></button>
|
|
189
212
|
<a class='btn2 create-new' id='create-new-folder'><div><i class="fa-solid fa-folder-plus"></i></div><div>Create</div></a>
|
|
190
|
-
<a class='btn2' id='explore' href="/?mode=explore"><div><i class="fa-solid fa-magnifying-glass"></i></div><div>Discover</div></a>
|
|
191
213
|
<a href="/network" class='btn2'><div><i class="fa-solid fa-wifi"></i></div><div>Network</div></a>
|
|
192
214
|
<a href="/connect" class='btn2'><div><i class="fa-solid fa-circle-user"></i></div><div>Connect</div></a>
|
|
193
215
|
<div class='flexible'></div>
|
|
194
216
|
<div class='nav-btns'>
|
|
217
|
+
<a class='btn2' id='explore' href="/?mode=explore"><div><i class="fa-solid fa-magnifying-glass"></i></div><div>Discover</div></a>
|
|
195
218
|
<a class='btn2' href="<%=portal%>" target="_blank"><div><i class="fa-solid fa-question"></i></div><div>Help</div></a>
|
|
196
219
|
<button class='btn2' id='genlog'><div><i class="fa-solid fa-laptop-code"></i></div><div>Logs</div></button>
|
|
197
220
|
<a id='downloadlogs' download class='hidden btn2' href="/pinokio/logs.zip"><div><i class="fa-solid fa-download"></i></div><div>Download logs</div></a>
|
|
@@ -205,6 +228,22 @@ hr {
|
|
|
205
228
|
<div class='head'>
|
|
206
229
|
<h3><i class="fa-brands fa-github"></i><br><br>Connect with Github</h3>
|
|
207
230
|
</div>
|
|
231
|
+
<div class='setup-items'>
|
|
232
|
+
<form class='gitconfig'>
|
|
233
|
+
<div class='field'>
|
|
234
|
+
<label>username</label>
|
|
235
|
+
<input id='username' type='text' value="<%=gitconfig.user && gitconfig.user.name ? gitconfig.user.name : ''%>">
|
|
236
|
+
</div>
|
|
237
|
+
<div class='field'>
|
|
238
|
+
<label>email</label>
|
|
239
|
+
<input id='email' type='text' value="<%=gitconfig.user && gitconfig.user.email ? gitconfig.user.email : ''%>">
|
|
240
|
+
</div>
|
|
241
|
+
<div class='gitconfig-footer'>
|
|
242
|
+
<button class='btn'>Update</button>
|
|
243
|
+
<div>gitconfig stored in ~/pinokio/gitconfig file </div>
|
|
244
|
+
</div>
|
|
245
|
+
</form>
|
|
246
|
+
</div>
|
|
208
247
|
<div class='setup-items'>
|
|
209
248
|
<% if (hosts.length > 0) { %>
|
|
210
249
|
<pre><%=hosts%></pre>
|
|
@@ -223,5 +262,26 @@ hr {
|
|
|
223
262
|
<div id='readme'><%-readme%></div>
|
|
224
263
|
</div>
|
|
225
264
|
</main>
|
|
265
|
+
<script>
|
|
266
|
+
document.querySelector("form.gitconfig").addEventListener("submit", (e) => {
|
|
267
|
+
e.preventDefault()
|
|
268
|
+
e.stopPropagation()
|
|
269
|
+
fetch("/github/config", {
|
|
270
|
+
method: "POST",
|
|
271
|
+
headers: {
|
|
272
|
+
"Content-Type": "application/json"
|
|
273
|
+
},
|
|
274
|
+
body: JSON.stringify({
|
|
275
|
+
"user.name": document.querySelector("#username").value,
|
|
276
|
+
"user.email": document.querySelector("#email").value
|
|
277
|
+
})
|
|
278
|
+
}).then((res) => {
|
|
279
|
+
return res.json()
|
|
280
|
+
}).then((res) => {
|
|
281
|
+
alert("Updated")
|
|
282
|
+
location.href = location.href
|
|
283
|
+
})
|
|
284
|
+
})
|
|
285
|
+
</script>
|
|
226
286
|
</body>
|
|
227
287
|
</html>
|
package/server/views/help.ejs
CHANGED
|
@@ -253,14 +253,14 @@ body.dark .item .tile .badge {
|
|
|
253
253
|
<body class='<%=theme%>' data-agent="<%=agent%>">
|
|
254
254
|
<header class='navheader grabbable'>
|
|
255
255
|
<h1>
|
|
256
|
-
<a class='home' href="/"><
|
|
256
|
+
<a class='home' href="/"><i class="fa-solid fa-house"></i></a>
|
|
257
257
|
<button class='btn2' id='back'><div><i class="fa-solid fa-chevron-left"></i></div><div>Prev</div></button>
|
|
258
258
|
<button class='btn2' id='forward'><div><i class="fa-solid fa-chevron-right"></i></div><div>Next</div></button>
|
|
259
259
|
<button class='btn2' id='refresh-page'><div><i class="fa-solid fa-rotate-right"></i></div><div>Refresh</div></button>
|
|
260
260
|
<a class='btn2 create-new' id='create-new-folder'><div><i class="fa-solid fa-folder-plus"></i></div><div>Create</div></a>
|
|
261
|
-
<a class='btn2' id='explore' href="/?mode=explore"><div><i class="fa-solid fa-magnifying-glass"></i></div><div>Discover</div></a>
|
|
262
261
|
<div class='flexible'></div>
|
|
263
262
|
<div class='nav-btns'>
|
|
263
|
+
<a class='btn2' id='explore' href="/?mode=explore"><div><i class="fa-solid fa-magnifying-glass"></i></div><div>Discover</div></a>
|
|
264
264
|
<a class='btn2' href="/?mode=help"><div><i class="fa-regular fa-face-smile"></i></div><div>Community</div></a>
|
|
265
265
|
<a class='btn2' href="/?mode=settings"><div><i class="fa-solid fa-gear"></i></div><div>Settings</div></a>
|
|
266
266
|
<button id='new-window' title='open a new window' class='btn2' data-agent="<%=agent%>"><div><i class="fa-solid fa-plus"></i></div><div>Window</div></button>
|
package/server/views/index.ejs
CHANGED
|
@@ -243,7 +243,7 @@ body.dark .open-menu, body.dark .browse {
|
|
|
243
243
|
<header class='navheader grabbable'>
|
|
244
244
|
<h1>
|
|
245
245
|
<% if (ishome) { %>
|
|
246
|
-
<a class='home' href="/"><
|
|
246
|
+
<a class='home' href="/"><i class="fa-solid fa-house"></i></a>
|
|
247
247
|
<button class='btn2' id='back'><div><i class="fa-solid fa-chevron-left"></i></div><div>Prev</div></button>
|
|
248
248
|
<button class='btn2' id='forward'><div><i class="fa-solid fa-chevron-right"></i></div><div>Next</div></button>
|
|
249
249
|
<button class='btn2' id='refresh-page'><div><i class="fa-solid fa-rotate-right"></i></div><div>Refresh</div></button>
|
|
@@ -251,7 +251,6 @@ body.dark .open-menu, body.dark .browse {
|
|
|
251
251
|
<!--
|
|
252
252
|
<a href="/new" class='btn2'><div><i class='fa-solid fa-folder-plus'></i></div><div>Create</div></a>
|
|
253
253
|
-->
|
|
254
|
-
<a class='btn2' id='explore' href="/?mode=explore"><div><i class="fa-solid fa-magnifying-glass"></i></div><div>Discover</div></a>
|
|
255
254
|
<a href="/network" class='btn2'><div><i class="fa-solid fa-wifi"></i></div><div>Network</div></a>
|
|
256
255
|
<a href="/connect" class='btn2'><div><i class="fa-solid fa-circle-user"></i></div><div>Connect</div></a>
|
|
257
256
|
<!--
|
|
@@ -273,6 +272,7 @@ body.dark .open-menu, body.dark .browse {
|
|
|
273
272
|
</form>
|
|
274
273
|
<% if (ishome) { %>
|
|
275
274
|
<div class='nav-btns'>
|
|
275
|
+
<a class='btn2' id='explore' href="/?mode=explore"><div><i class="fa-solid fa-magnifying-glass"></i></div><div>Discover</div></a>
|
|
276
276
|
<a class='btn2' href="<%=portal%>" target="_blank"><div><i class="fa-solid fa-question"></i></div><div>Help</div></a>
|
|
277
277
|
<button class='btn2' id='genlog'><div><i class="fa-solid fa-laptop-code"></i></div><div>Logs</div></button>
|
|
278
278
|
<a id='downloadlogs' download class='hidden btn2' href="/pinokio/logs.zip"><div><i class="fa-solid fa-download"></i></div><div>Download logs</div></a>
|
package/server/views/network.ejs
CHANGED
|
@@ -401,16 +401,16 @@ input:checked + .slider:before {
|
|
|
401
401
|
<body class='<%=theme%>' data-agent="<%=agent%>">
|
|
402
402
|
<header class='navheader grabbable'>
|
|
403
403
|
<h1>
|
|
404
|
-
<a class='home' href="/"><
|
|
404
|
+
<a class='home' href="/"><i class="fa-solid fa-house"></i></a>
|
|
405
405
|
<button class='btn2' id='back'><div><i class="fa-solid fa-chevron-left"></i></div><div>Prev</div></button>
|
|
406
406
|
<button class='btn2' id='forward'><div><i class="fa-solid fa-chevron-right"></i></div><div>Next</div></button>
|
|
407
407
|
<button class='btn2' id='refresh-page'><div><i class="fa-solid fa-rotate-right"></i></div><div>Refresh</div></button>
|
|
408
408
|
<a class='btn2 create-new' id='create-new-folder'><div><i class="fa-solid fa-folder-plus"></i></div><div>Create</div></a>
|
|
409
|
-
<a class='btn2' id='explore' href="/?mode=explore"><div><i class="fa-solid fa-magnifying-glass"></i></div><div>Discover</div></a>
|
|
410
409
|
<a href="/network" class='btn2'><div><i class="fa-solid fa-wifi"></i></div><div>Network</div></a>
|
|
411
410
|
<a href="/connect" class='btn2'><div><i class="fa-solid fa-circle-user"></i></div><div>Connect</div></a>
|
|
412
411
|
<div class='flexible'></div>
|
|
413
412
|
<div class='nav-btns'>
|
|
413
|
+
<a class='btn2' id='explore' href="/?mode=explore"><div><i class="fa-solid fa-magnifying-glass"></i></div><div>Discover</div></a>
|
|
414
414
|
<a class='btn2' href="<%=portal%>" target="_blank"><div><i class="fa-solid fa-question"></i></div><div>Help</div></a>
|
|
415
415
|
<button class='btn2' id='genlog'><div><i class="fa-solid fa-laptop-code"></i></div><div>Logs</div></button>
|
|
416
416
|
<a id='downloadlogs' download class='hidden btn2' href="/pinokio/logs.zip"><div><i class="fa-solid fa-download"></i></div><div>Download logs</div></a>
|
|
@@ -35,12 +35,14 @@
|
|
|
35
35
|
</div>
|
|
36
36
|
</a>
|
|
37
37
|
<% } else { %>
|
|
38
|
-
<a <%=item.default ? 'data-default' : ''%> data-confirm="<%=item.confirm%>" data-index="<%=index+4%>" target="<%=item.target%>" data-mode="<%=item.mode%>" href="<%=item.href%>" class='btn header-item frame-link <%=item.display || ""%>'
|
|
38
|
+
<a <%=item.default ? 'data-default' : ''%> data-confirm="<%=item.confirm%>" data-index="<%=index+4%>" target="<%=item.target%>" data-mode="<%=item.mode%>" href="<%=item.href%>" class='btn header-item frame-link <%=item.display || ""%>' <%=item.shell_id ? `data-shell=${item.shell_id}` : ""%> <%=item.script_id ? `data-script=${item.script_id}` : ''%>>
|
|
39
39
|
<div class='tab'><%-item.btn%></div>
|
|
40
40
|
<% if (item.running) { %>
|
|
41
|
+
<!--
|
|
41
42
|
<div class='loader shutdown online'>
|
|
42
43
|
</div>
|
|
43
|
-
|
|
44
|
+
-->
|
|
45
|
+
<div class='loader shutdown'>
|
|
44
46
|
<button class='btn'>
|
|
45
47
|
<i class="fa-solid fa-square"></i> Stop
|
|
46
48
|
</button>
|
|
@@ -50,12 +50,14 @@
|
|
|
50
50
|
</div>
|
|
51
51
|
</a>
|
|
52
52
|
<% } else { %>
|
|
53
|
-
<a <%=item.default ? 'data-default' : ''%> data-confirm="<%=item.confirm%>" data-index="<%=index%>" target="<%=item.target%>" data-mode="<%=item.mode%>" href="<%=item.href%>" class='btn header-item frame-link <%=item.display || ""%>'
|
|
53
|
+
<a <%=item.default ? 'data-default' : ''%> data-confirm="<%=item.confirm%>" data-index="<%=index%>" target="<%=item.target%>" data-mode="<%=item.mode%>" href="<%=item.href%>" class='btn header-item frame-link <%=item.display || ""%>' <%=item.shell_id ? `data-shell=${item.shell_id}` : ""%> <%=item.script_id ? `data-script=${item.script_id}` : ''%>>
|
|
54
54
|
<div class='tab'><%-item.btn%></div>
|
|
55
55
|
<% if (item.running) { %>
|
|
56
|
+
<!--
|
|
56
57
|
<div class='loader shutdown online'>
|
|
57
58
|
</div>
|
|
58
|
-
|
|
59
|
+
-->
|
|
60
|
+
<div class='loader shutdown'>
|
|
59
61
|
<!--
|
|
60
62
|
<i class='fa-solid fa-spin fa-circle-notch'></i>
|
|
61
63
|
<i class="fa-solid fa-chevron-right"></i>
|
|
@@ -268,12 +268,11 @@ body.dark .keys pre {
|
|
|
268
268
|
-->
|
|
269
269
|
<header class='navheader grabbable'>
|
|
270
270
|
<h1>
|
|
271
|
-
<a class='home' href="/"><
|
|
271
|
+
<a class='home' href="/"><i class="fa-solid fa-house"></i></a>
|
|
272
272
|
<button class='btn2' id='back'><div><i class="fa-solid fa-chevron-left"></i></div><div>Prev</div></button>
|
|
273
273
|
<button class='btn2' id='forward'><div><i class="fa-solid fa-chevron-right"></i></div><div>Next</div></button>
|
|
274
274
|
<button class='btn2' id='refresh-page'><div><i class="fa-solid fa-rotate-right"></i></div><div>Refresh</div></button>
|
|
275
275
|
<a class='btn2 create-new' id='create-new-folder'><div><i class="fa-solid fa-folder-plus"></i></div><div>Create</div></a>
|
|
276
|
-
<a class='btn2' id='explore' href="/?mode=explore"><div><i class="fa-solid fa-magnifying-glass"></i></div><div>Discover</div></a>
|
|
277
276
|
<a href="/network" class='btn2'><div><i class="fa-solid fa-wifi"></i></div><div>Network</div></a>
|
|
278
277
|
<a href="/connect" class='btn2'><div><i class="fa-solid fa-circle-user"></i></div><div>Connect</div></a>
|
|
279
278
|
<% paths.forEach((path) => { %>
|
|
@@ -285,6 +284,7 @@ body.dark .keys pre {
|
|
|
285
284
|
<% }) %>
|
|
286
285
|
<div class='flexible'></div>
|
|
287
286
|
<div class='nav-btns'>
|
|
287
|
+
<a class='btn2' id='explore' href="/?mode=explore"><div><i class="fa-solid fa-magnifying-glass"></i></div><div>Discover</div></a>
|
|
288
288
|
<a class='btn2' href="<%=portal%>" target="_blank"><div><i class="fa-solid fa-question"></i></div><div>Help</div></a>
|
|
289
289
|
<button class='btn2' id='genlog'><div><i class="fa-solid fa-laptop-code"></i></div><div>Logs</div></button>
|
|
290
290
|
<a id='downloadlogs' download class='hidden btn2' href="/pinokio/logs.zip"><div><i class="fa-solid fa-download"></i></div><div>Download logs</div></a>
|
package/server/views/shell.ejs
CHANGED
|
@@ -185,6 +185,7 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
|
185
185
|
this.dirty = true
|
|
186
186
|
}
|
|
187
187
|
finished() {
|
|
188
|
+
debugger
|
|
188
189
|
/*
|
|
189
190
|
n.Noty({
|
|
190
191
|
text: `[Success] All steps complete`,
|
|
@@ -327,6 +328,7 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
|
327
328
|
this.write("\r\n")
|
|
328
329
|
}
|
|
329
330
|
if (packet.data.type === "shell.kill") {
|
|
331
|
+
debugger
|
|
330
332
|
this.socket.close()
|
|
331
333
|
}
|
|
332
334
|
if (packet.data.type === "emit2") {
|
|
@@ -345,6 +347,7 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
|
345
347
|
document.querySelector(".starting-btn").classList.add("hidden")
|
|
346
348
|
document.querySelector(".stop-btn").classList.remove("hidden")
|
|
347
349
|
} else if (packet.type === 'disconnect') {
|
|
350
|
+
debugger
|
|
348
351
|
console.log("refreshParent", packet)
|
|
349
352
|
refreshParent(packet)
|
|
350
353
|
this.term.write("\r\nDisconnected...\r\n")
|
|
@@ -612,8 +615,10 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
|
612
615
|
refreshParent({
|
|
613
616
|
type: "disconnect"
|
|
614
617
|
})
|
|
618
|
+
document.querySelector(".play-btn").classList.remove("hidden")
|
|
615
619
|
document.querySelector(".stop-btn").classList.add("hidden")
|
|
616
|
-
document.querySelector(".stopped-btn").classList.
|
|
620
|
+
document.querySelector(".stopped-btn").classList.add("hidden")
|
|
621
|
+
debugger
|
|
617
622
|
<% if (kill_message) { %>
|
|
618
623
|
n.Noty({
|
|
619
624
|
text: "<%-kill_message%>",
|
|
@@ -803,17 +808,26 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
|
803
808
|
document.querySelector(".play-btn").classList.add("hidden")
|
|
804
809
|
document.querySelector(".starting-btn").classList.remove("hidden")
|
|
805
810
|
await rpc.run()
|
|
811
|
+
document.querySelector(".play-btn").classList.remove("hidden")
|
|
812
|
+
document.querySelector(".stop-btn").classList.add("hidden")
|
|
806
813
|
})
|
|
814
|
+
debugger
|
|
807
815
|
<% if (running) { %>
|
|
808
816
|
// if running, connect
|
|
809
|
-
rpc.run("listen")
|
|
817
|
+
rpc.run("listen").then(() => {
|
|
818
|
+
document.querySelector(".play-btn").classList.remove("hidden")
|
|
819
|
+
document.querySelector(".stop-btn").classList.add("hidden")
|
|
820
|
+
})
|
|
810
821
|
// hide play button
|
|
811
822
|
document.querySelector(".play-btn").classList.add("hidden")
|
|
812
823
|
// show stop button
|
|
813
824
|
document.querySelector(".stop-btn").classList.remove("hidden")
|
|
814
825
|
<% } else { %>
|
|
815
826
|
// if not running, start
|
|
816
|
-
rpc.run()
|
|
827
|
+
rpc.run().then(() => {
|
|
828
|
+
document.querySelector(".play-btn").classList.remove("hidden")
|
|
829
|
+
document.querySelector(".stop-btn").classList.add("hidden")
|
|
830
|
+
})
|
|
817
831
|
// show starting button
|
|
818
832
|
document.querySelector(".starting-btn").classList.remove("hidden")
|
|
819
833
|
<% } %>
|