pinokiod 8.3.26 → 8.3.29
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/shell.js +3 -0
- package/kernel/shell_size.js +99 -0
- package/kernel/shells.js +2 -0
- package/package.json +1 -1
- package/server/index.js +7 -3
- package/server/lib/app_run_tabs.js +29 -17
- package/server/public/agent-bar-about.css +67 -0
- package/server/public/agent-bar-about.js +205 -0
- package/server/public/agent-bar-compose.js +4 -1
- package/server/public/agent-bar-modes.css +78 -0
- package/server/public/agent-bar-modes.js +97 -0
- package/server/public/agent-bar-panel.js +41 -13
- package/server/public/agent-bar.css +7 -5
- package/server/public/agent-bar.js +37 -9
- package/server/public/app-run-tabs.js +0 -10
- package/server/public/files-app/open-folder.js +58 -41
- package/server/public/files-app/toolbar.css +27 -5
- package/server/public/git-page.css +0 -1
- package/server/public/git-page.js +269 -149
- package/server/public/home-actions-menu.css +188 -0
- package/server/public/home-actions-menu.js +135 -0
- package/server/public/home-shell.css +121 -0
- package/server/public/home-shell.js +290 -0
- package/server/routes/git_page.js +4 -6
- package/server/views/app.ejs +19 -5
- package/server/views/file_browser.ejs +3 -4
- package/server/views/index.ejs +42 -3
- package/server/views/partials/home_action_modal.ejs +1 -1
- package/server/views/partials/home_ask_button.ejs +15 -0
- package/server/views/partials/home_shell_button.ejs +21 -0
- package/server/views/partials/main_sidebar.ejs +5 -1
- package/server/views/pre.ejs +1 -1
- package/test/agent-bar-about.test.js +238 -0
- package/test/agent-bar-modes.test.js +191 -0
- package/test/agent-bar-new-tab.test.js +60 -0
- package/test/app-git-files-tabs.test.js +84 -0
- package/test/home-actions-menu.test.js +187 -0
- package/test/home-shell.test.js +358 -0
- package/test/shell-size.test.js +166 -0
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
// "Open a shell" on home: a terminal icon on every row of My Apps, and one in
|
|
2
|
+
// the top bar for Pinokio's own folder. Loaded by index.ejs; the buttons are
|
|
3
|
+
// drawn by the page (partials/home_shell_button.ejs).
|
|
4
|
+
//
|
|
5
|
+
// A shell opened here never loads the app's page, so the app is not started.
|
|
6
|
+
//
|
|
7
|
+
// click -> a small menu of the folder's shells, read from the request the
|
|
8
|
+
// app page's shell button uses:
|
|
9
|
+
// GET /api/plugin/menu?workspace=<folder> -> projectShell.items
|
|
10
|
+
// The top bar's button offers plain shells only, not the Python
|
|
11
|
+
// environments found under Pinokio's own folder (those are the
|
|
12
|
+
// apps' and are on their rows). With one plain shell, as on
|
|
13
|
+
// macOS and Linux, there is nothing to choose: the click opens
|
|
14
|
+
// it. With more (Cmd and Bash on Windows) the menu lists them.
|
|
15
|
+
// pick one -> a new shell in the docked window, the one the bar's sessions
|
|
16
|
+
// open in (PinokioAgentBar.openShell, agent-bar-panel.js). The
|
|
17
|
+
// bar's "N running" lists it from then on.
|
|
18
|
+
// Where there is no docked window (a phone), the shell's own
|
|
19
|
+
// page is opened instead.
|
|
20
|
+
//
|
|
21
|
+
// One menu serves every button. It is placed under the button that was
|
|
22
|
+
// clicked, over the page, so a row never has to make room for it.
|
|
23
|
+
(function (window, document) {
|
|
24
|
+
'use strict';
|
|
25
|
+
|
|
26
|
+
if (window.PinokioHomeShell) return;
|
|
27
|
+
|
|
28
|
+
const BUTTON = '.home-shell-button';
|
|
29
|
+
|
|
30
|
+
function el(tag, className, text) {
|
|
31
|
+
const node = document.createElement(tag);
|
|
32
|
+
if (className) node.className = className;
|
|
33
|
+
if (text) node.textContent = text;
|
|
34
|
+
return node;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function newSession() {
|
|
38
|
+
if (window.crypto && typeof window.crypto.randomUUID === 'function') return window.crypto.randomUUID();
|
|
39
|
+
return `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// While a shell of one kind is running, the server hands out that kind's link
|
|
43
|
+
// with the running shell's own session on it, and a link that already names a
|
|
44
|
+
// session opens that session again. Every pick here is a new shell, so the
|
|
45
|
+
// link is used without it. The rest of the link is left exactly as it came.
|
|
46
|
+
function withoutSession(value) {
|
|
47
|
+
const at = value.indexOf('?');
|
|
48
|
+
if (at < 0) return value;
|
|
49
|
+
const kept = value.slice(at + 1).split('&')
|
|
50
|
+
.filter((part) => part && !part.startsWith('session=') && !part.startsWith('terminal_id='));
|
|
51
|
+
return kept.length ? `${value.slice(0, at)}?${kept.join('&')}` : value.slice(0, at);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function readShells(payload) {
|
|
55
|
+
const items = payload && payload.projectShell && Array.isArray(payload.projectShell.items)
|
|
56
|
+
? payload.projectShell.items
|
|
57
|
+
: [];
|
|
58
|
+
return items.map((item) => {
|
|
59
|
+
const href = withoutSession(item && typeof item.href === 'string' ? item.href.trim() : '');
|
|
60
|
+
if (!href || !href.startsWith('/shell/')) return null;
|
|
61
|
+
return {
|
|
62
|
+
label: (typeof item.title === 'string' && item.title.trim())
|
|
63
|
+
|| (typeof item.text === 'string' && item.text.trim())
|
|
64
|
+
|| 'Shell',
|
|
65
|
+
href,
|
|
66
|
+
iconClass: typeof item.icon === 'string' && item.icon.trim() ? item.icon.trim() : 'fa-solid fa-terminal',
|
|
67
|
+
description: typeof item.subtitle === 'string' ? item.subtitle.trim() : '',
|
|
68
|
+
// a shell with no environment activated (its id ends in ".plain")
|
|
69
|
+
plain: /\.plain$/.test(href.split('?')[0]),
|
|
70
|
+
kind: 'shell',
|
|
71
|
+
};
|
|
72
|
+
}).filter(Boolean);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// A folder's shells, read once per page. A failed read is tried again the
|
|
76
|
+
// next time it is asked for.
|
|
77
|
+
const reads = new Map();
|
|
78
|
+
function shellsOf(folder) {
|
|
79
|
+
if (reads.has(folder)) return reads.get(folder);
|
|
80
|
+
const read = fetch(`/api/plugin/menu?workspace=${encodeURIComponent(folder)}`)
|
|
81
|
+
.then((res) => {
|
|
82
|
+
if (!res.ok) throw new Error('Failed to load shells.');
|
|
83
|
+
return res.json();
|
|
84
|
+
})
|
|
85
|
+
.then(readShells);
|
|
86
|
+
reads.set(folder, read);
|
|
87
|
+
read.catch(() => { reads.delete(folder); });
|
|
88
|
+
return read;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function openShell(shell, folder) {
|
|
92
|
+
const bar = window.PinokioAgentBar;
|
|
93
|
+
if (bar && typeof bar.openShell === 'function' && bar.openShell(shell, folder)) return;
|
|
94
|
+
// no docked window here: the shell's own page
|
|
95
|
+
const href = `${shell.href}${shell.href.includes('?') ? '&' : '?'}session=${encodeURIComponent(newSession())}`;
|
|
96
|
+
if (typeof window.PinokioHomeGuardNavigate === 'function') window.PinokioHomeGuardNavigate(href);
|
|
97
|
+
else window.location.href = href;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// ---- the menu -------------------------------------------------------------
|
|
101
|
+
let menu = null;
|
|
102
|
+
// The button the menu is open for, and what is known of its folder's shells
|
|
103
|
+
let state = null;
|
|
104
|
+
|
|
105
|
+
function place() {
|
|
106
|
+
if (!menu || !state) return;
|
|
107
|
+
const rect = state.button.getBoundingClientRect();
|
|
108
|
+
const gap = 6;
|
|
109
|
+
const edge = 8;
|
|
110
|
+
const width = menu.offsetWidth;
|
|
111
|
+
const height = menu.offsetHeight;
|
|
112
|
+
// under the button, its left edge on the button's; kept on screen
|
|
113
|
+
let left = Math.min(rect.left, window.innerWidth - width - edge);
|
|
114
|
+
left = Math.max(edge, left);
|
|
115
|
+
let top = rect.bottom + gap;
|
|
116
|
+
// no room below: above the button
|
|
117
|
+
if (top + height > window.innerHeight - edge && rect.top - gap - height >= edge) top = rect.top - gap - height;
|
|
118
|
+
menu.style.left = `${Math.round(left)}px`;
|
|
119
|
+
menu.style.top = `${Math.round(top)}px`;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function render() {
|
|
123
|
+
if (!menu) return;
|
|
124
|
+
menu.textContent = '';
|
|
125
|
+
menu.hidden = !state;
|
|
126
|
+
if (!state) return;
|
|
127
|
+
menu.appendChild(el('div', 'home-shell-menu__title', 'Open a shell'));
|
|
128
|
+
if (state.failed) {
|
|
129
|
+
menu.appendChild(el('div', 'home-shell-menu__empty', "Couldn't read this folder's shells."));
|
|
130
|
+
} else if (!state.shells) {
|
|
131
|
+
menu.appendChild(el('div', 'home-shell-menu__empty', 'Loading…'));
|
|
132
|
+
} else if (!state.shells.length) {
|
|
133
|
+
menu.appendChild(el('div', 'home-shell-menu__empty', 'This folder has no shells.'));
|
|
134
|
+
} else {
|
|
135
|
+
const folder = state.folder;
|
|
136
|
+
state.shells.forEach((shell) => {
|
|
137
|
+
const row = el('button', 'home-shell-menu__row');
|
|
138
|
+
row.type = 'button';
|
|
139
|
+
row.setAttribute('role', 'menuitem');
|
|
140
|
+
const icon = el('i', `${shell.iconClass} home-shell-menu__row-icon`);
|
|
141
|
+
icon.setAttribute('aria-hidden', 'true');
|
|
142
|
+
row.append(icon, el('span', 'home-shell-menu__row-label', shell.label));
|
|
143
|
+
if (shell.description) row.appendChild(el('span', 'home-shell-menu__row-note', shell.description));
|
|
144
|
+
row.addEventListener('click', (event) => {
|
|
145
|
+
event.preventDefault();
|
|
146
|
+
event.stopPropagation();
|
|
147
|
+
close();
|
|
148
|
+
openShell(shell, folder);
|
|
149
|
+
});
|
|
150
|
+
menu.appendChild(row);
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
place();
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function close(refocus) {
|
|
157
|
+
if (!state) return;
|
|
158
|
+
const button = state.button;
|
|
159
|
+
button.setAttribute('aria-expanded', 'false');
|
|
160
|
+
button.classList.remove('is-open');
|
|
161
|
+
state = null;
|
|
162
|
+
render();
|
|
163
|
+
if (refocus) button.focus();
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
const folderOf = (button) => (button.dataset.shellFolder || '').trim();
|
|
167
|
+
// What a button offers of its folder's shells
|
|
168
|
+
function offered(button, shells) {
|
|
169
|
+
return button.dataset.shellPlain === 'true' ? shells.filter((shell) => shell.plain) : shells;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
function open(button, known) {
|
|
173
|
+
const folder = folderOf(button);
|
|
174
|
+
if (!folder) return;
|
|
175
|
+
if (!menu) {
|
|
176
|
+
menu = el('div', 'home-shell-menu');
|
|
177
|
+
menu.setAttribute('role', 'menu');
|
|
178
|
+
menu.hidden = true;
|
|
179
|
+
document.body.appendChild(menu);
|
|
180
|
+
}
|
|
181
|
+
close();
|
|
182
|
+
const mine = { button, folder, shells: known || null, failed: false };
|
|
183
|
+
state = mine;
|
|
184
|
+
button.setAttribute('aria-expanded', 'true');
|
|
185
|
+
button.classList.add('is-open');
|
|
186
|
+
render();
|
|
187
|
+
if (known) return;
|
|
188
|
+
shellsOf(folder)
|
|
189
|
+
.then((shells) => { mine.shells = offered(button, shells); })
|
|
190
|
+
.catch(() => { mine.failed = true; })
|
|
191
|
+
.then(() => {
|
|
192
|
+
// only if the menu is still open for this button
|
|
193
|
+
if (state === mine) render();
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// A button for plain shells only: the one there is opens at once; several, or
|
|
198
|
+
// a list that could not be read, go to the menu.
|
|
199
|
+
let asking = null;
|
|
200
|
+
function openPlain(button) {
|
|
201
|
+
const folder = folderOf(button);
|
|
202
|
+
if (!folder || asking === button) return;
|
|
203
|
+
close();
|
|
204
|
+
asking = button;
|
|
205
|
+
shellsOf(folder)
|
|
206
|
+
.then((shells) => {
|
|
207
|
+
asking = null;
|
|
208
|
+
const plain = offered(button, shells);
|
|
209
|
+
if (plain.length === 1) openShell(plain[0], folder);
|
|
210
|
+
else open(button, plain);
|
|
211
|
+
})
|
|
212
|
+
.catch(() => {
|
|
213
|
+
asking = null;
|
|
214
|
+
open(button);
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// A row of My Apps opens its app on a click anywhere on it, and the rows fill
|
|
219
|
+
// the page. The press that closes the menu must not also be that click: the
|
|
220
|
+
// click that follows it is cancelled when it would open a row. A click on a
|
|
221
|
+
// button or a link is left alone.
|
|
222
|
+
function keepRowShut() {
|
|
223
|
+
const done = () => {
|
|
224
|
+
document.removeEventListener('click', cancel, true);
|
|
225
|
+
document.removeEventListener('pointerdown', done, true);
|
|
226
|
+
};
|
|
227
|
+
function cancel(event) {
|
|
228
|
+
done();
|
|
229
|
+
const target = event.target;
|
|
230
|
+
if (!(target instanceof Element) || !target.closest('.home-app-line')) return;
|
|
231
|
+
if (target.closest('button, a, input, select, textarea, label, summary, dialog')) return;
|
|
232
|
+
event.preventDefault();
|
|
233
|
+
event.stopPropagation();
|
|
234
|
+
}
|
|
235
|
+
document.addEventListener('click', cancel, true);
|
|
236
|
+
// (the next press is something else: a press that was not followed by a click)
|
|
237
|
+
document.addEventListener('pointerdown', done, true);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// The rows of My Apps are links: a click anywhere on one opens the app. The
|
|
241
|
+
// button's click is taken here, before the page's own handlers see it.
|
|
242
|
+
document.addEventListener('click', (event) => {
|
|
243
|
+
const button = event.target && event.target.closest ? event.target.closest(BUTTON) : null;
|
|
244
|
+
if (!button) return;
|
|
245
|
+
event.preventDefault();
|
|
246
|
+
event.stopPropagation();
|
|
247
|
+
if (state && state.button === button) close();
|
|
248
|
+
else if (button.dataset.shellPlain === 'true') openPlain(button);
|
|
249
|
+
else open(button);
|
|
250
|
+
}, true);
|
|
251
|
+
// the list is read on the way to the button, so the click has it already
|
|
252
|
+
document.addEventListener('pointerover', (event) => {
|
|
253
|
+
const button = event.target && event.target.closest ? event.target.closest(BUTTON) : null;
|
|
254
|
+
const folder = button ? folderOf(button) : '';
|
|
255
|
+
if (folder) shellsOf(folder).catch(() => {});
|
|
256
|
+
}, true);
|
|
257
|
+
// (and Enter or Space on the button is the button's, not the row's)
|
|
258
|
+
document.addEventListener('keydown', (event) => {
|
|
259
|
+
if (event.key === 'Escape' && state) {
|
|
260
|
+
event.stopPropagation();
|
|
261
|
+
close(true);
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
if ((event.key === 'Enter' || event.key === ' ') && event.target && event.target.closest && event.target.closest(BUTTON)) {
|
|
265
|
+
event.stopPropagation();
|
|
266
|
+
}
|
|
267
|
+
}, true);
|
|
268
|
+
document.addEventListener('pointerdown', (event) => {
|
|
269
|
+
if (!state) return;
|
|
270
|
+
if (menu.contains(event.target) || state.button.contains(event.target)) return;
|
|
271
|
+
close();
|
|
272
|
+
keepRowShut();
|
|
273
|
+
}, true);
|
|
274
|
+
// the button moves with the page; the menu does not follow it
|
|
275
|
+
window.addEventListener('scroll', (event) => {
|
|
276
|
+
if (state && !(menu && event.target instanceof Node && menu.contains(event.target))) close();
|
|
277
|
+
}, true);
|
|
278
|
+
window.addEventListener('resize', () => close());
|
|
279
|
+
// A click inside one of the page's frames (a docked window) never reaches
|
|
280
|
+
// this document: this window loses focus and the frame becomes the active
|
|
281
|
+
// element. Any other loss of focus leaves the menu as it is.
|
|
282
|
+
window.addEventListener('blur', () => {
|
|
283
|
+
window.setTimeout(() => {
|
|
284
|
+
const active = document.activeElement;
|
|
285
|
+
if (active && active.tagName === 'IFRAME') close();
|
|
286
|
+
}, 0);
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
window.PinokioHomeShell = { readShells, withoutSession };
|
|
290
|
+
})(window, document);
|
|
@@ -11,12 +11,10 @@ module.exports = function registerGitPageRoutes(app, options = {}) {
|
|
|
11
11
|
app.get("/pinokio/git/:name", async (req, res) => {
|
|
12
12
|
const name = req.params.name
|
|
13
13
|
const cwd = kernel.path("api", name)
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
} catch (_) {
|
|
14
|
+
// an app is one folder directly inside the apps folder, nothing else
|
|
15
|
+
const valid = name && name !== "." && name !== ".." && !/[\\/\0]/.test(name)
|
|
16
|
+
const stat = valid ? await fs.promises.stat(cwd).catch(() => null) : null
|
|
17
|
+
if (!stat || !stat.isDirectory()) {
|
|
20
18
|
res.status(404).send("App not found")
|
|
21
19
|
return
|
|
22
20
|
}
|
package/server/views/app.ejs
CHANGED
|
@@ -8381,7 +8381,7 @@ body.dark .pinokio-custom-terminal-header {
|
|
|
8381
8381
|
<link rel="stylesheet" href="/agent-bar-files.css">
|
|
8382
8382
|
<script src="/agent-bar-files.js" data-agent-bar-files="true"></script>
|
|
8383
8383
|
<link rel="stylesheet" href="/agent-bar-panel.css">
|
|
8384
|
-
<script src="/agent-bar-panel.js" data-agent-bar-panel="true"></script>
|
|
8384
|
+
<script src="/agent-bar-panel.js" data-agent-bar-panel="true" data-pinokio-home="<%= locals.pinokioHome || '' %>"></script>
|
|
8385
8385
|
<link rel="stylesheet" href="/agent-bar-attach.css">
|
|
8386
8386
|
<script src="/agent-bar-attach.js" data-agent-bar-attach="true"></script>
|
|
8387
8387
|
<link rel="stylesheet" href="/agent-bar-compose.css">
|
|
@@ -8636,6 +8636,20 @@ body.dark .pinokio-custom-terminal-header {
|
|
|
8636
8636
|
<div class='flexible'></div>
|
|
8637
8637
|
</div>
|
|
8638
8638
|
</button>
|
|
8639
|
+
<button type='button' class='btn header-item' data-mobile-proxy="#files-tab" data-mobile-close-menu="true" aria-label="Files">
|
|
8640
|
+
<div class='tab'>
|
|
8641
|
+
<i class="fa-solid fa-file-lines menu-action-leading-icon"></i>
|
|
8642
|
+
<div class='display'>Files</div>
|
|
8643
|
+
<div class='flexible'></div>
|
|
8644
|
+
</div>
|
|
8645
|
+
</button>
|
|
8646
|
+
<button type='button' class='btn header-item' data-mobile-proxy="#git-tab" data-mobile-close-menu="true" aria-label="Git">
|
|
8647
|
+
<div class='tab'>
|
|
8648
|
+
<i class="fa-brands fa-git-alt menu-action-leading-icon"></i>
|
|
8649
|
+
<div class='display'>Git</div>
|
|
8650
|
+
<div class='flexible'></div>
|
|
8651
|
+
</div>
|
|
8652
|
+
</button>
|
|
8639
8653
|
<% } %>
|
|
8640
8654
|
<% if (registryEnabled) { %>
|
|
8641
8655
|
<button type='button' class='btn header-item mobile-nav-community' data-mobile-proxy="#community-mode-toggle" data-mobile-panel="feed" data-mobile-close-menu="true" aria-pressed="false" aria-label="Project feed">
|
|
@@ -12174,10 +12188,10 @@ const rerenderMenuSection = (container, html) => {
|
|
|
12174
12188
|
e.preventDefault()
|
|
12175
12189
|
e.stopPropagation()
|
|
12176
12190
|
await FSEditor({
|
|
12177
|
-
title:
|
|
12178
|
-
description:
|
|
12179
|
-
old_path:
|
|
12180
|
-
icon:
|
|
12191
|
+
title: <%-JSON.stringify(config.title || '').replace(/</g, '\\u003c')%>,
|
|
12192
|
+
description: <%-JSON.stringify(config.description || '').replace(/</g, '\\u003c')%>,
|
|
12193
|
+
old_path: <%-JSON.stringify(name)%>,
|
|
12194
|
+
icon: <%-JSON.stringify(config.icon || '').replace(/</g, '\\u003c')%>,
|
|
12181
12195
|
<% if (config.iconpath) { %>
|
|
12182
12196
|
iconpath: `<%-JSON.stringify(config.iconpath).slice(1, -1)%>`,
|
|
12183
12197
|
<% } %>
|
|
@@ -27,11 +27,10 @@
|
|
|
27
27
|
</div>
|
|
28
28
|
</aside>
|
|
29
29
|
<main class="files-app__main">
|
|
30
|
-
<button class="files-app__sidebar-toggle" id="files-app-toggle-sidebar" type="button" aria-controls="files-app-tree" aria-expanded="true">
|
|
31
|
-
<span class="sr-only">Hide files</span>
|
|
32
|
-
<i class="fa-solid fa-chevron-left" aria-hidden="true"></i>
|
|
33
|
-
</button>
|
|
34
30
|
<div class="files-app__tabbar">
|
|
31
|
+
<button class="files-app__sidebar-toggle" id="files-app-toggle-sidebar" type="button" aria-controls="files-app-tree" aria-expanded="true" title="Hide files" aria-label="Hide files">
|
|
32
|
+
<i class="fa-solid fa-chevron-left" aria-hidden="true"></i>
|
|
33
|
+
</button>
|
|
35
34
|
<button class="files-app__mobile-back" id="files-app-mobile-back" type="button" aria-label="Back to files">
|
|
36
35
|
<i class="fa-solid fa-chevron-left" aria-hidden="true"></i>
|
|
37
36
|
<span>Files</span>
|
package/server/views/index.ejs
CHANGED
|
@@ -231,6 +231,35 @@ body.dark .home-app-line .menu-btns > .btn:focus-visible {
|
|
|
231
231
|
background: rgba(255, 255, 255, 0.07) !important;
|
|
232
232
|
color: rgba(248, 250, 252, 0.9) !important;
|
|
233
233
|
}
|
|
234
|
+
/* The row's icon-only buttons (star, actions, share, shell) have no box of
|
|
235
|
+
their own: the icon alone, and a soft background under the pointer, on
|
|
236
|
+
keyboard focus and while the button's menu is open. Buttons with words
|
|
237
|
+
(Stop, a status) keep their box. */
|
|
238
|
+
.home-app-line .menu-btns > .home-icon-btn,
|
|
239
|
+
.home-app-line .menu-btns > .open-actions-modal,
|
|
240
|
+
body.dark .home-app-line .menu-btns > .home-icon-btn,
|
|
241
|
+
body.dark .home-app-line .menu-btns > .open-actions-modal {
|
|
242
|
+
border-color: transparent !important;
|
|
243
|
+
background: transparent !important;
|
|
244
|
+
}
|
|
245
|
+
.home-app-line .menu-btns > .home-icon-btn:hover,
|
|
246
|
+
.home-app-line .menu-btns > .home-icon-btn:focus-visible,
|
|
247
|
+
.home-app-line .menu-btns > .home-icon-btn.is-open,
|
|
248
|
+
.home-app-line .menu-btns > .open-actions-modal:hover,
|
|
249
|
+
.home-app-line .menu-btns > .open-actions-modal:focus-visible,
|
|
250
|
+
.home-app-line .menu-btns > .open-actions-modal[aria-expanded="true"] {
|
|
251
|
+
border-color: transparent !important;
|
|
252
|
+
background: rgba(15, 23, 42, 0.07) !important;
|
|
253
|
+
}
|
|
254
|
+
body.dark .home-app-line .menu-btns > .home-icon-btn:hover,
|
|
255
|
+
body.dark .home-app-line .menu-btns > .home-icon-btn:focus-visible,
|
|
256
|
+
body.dark .home-app-line .menu-btns > .home-icon-btn.is-open,
|
|
257
|
+
body.dark .home-app-line .menu-btns > .open-actions-modal:hover,
|
|
258
|
+
body.dark .home-app-line .menu-btns > .open-actions-modal:focus-visible,
|
|
259
|
+
body.dark .home-app-line .menu-btns > .open-actions-modal[aria-expanded="true"] {
|
|
260
|
+
border-color: transparent !important;
|
|
261
|
+
background: rgba(255, 255, 255, 0.1) !important;
|
|
262
|
+
}
|
|
234
263
|
.home-autolaunch-status {
|
|
235
264
|
min-height: 22px;
|
|
236
265
|
box-sizing: border-box;
|
|
@@ -1483,7 +1512,8 @@ body.dark .home-actions-empty {
|
|
|
1483
1512
|
color: rgba(226, 232, 240, 0.58);
|
|
1484
1513
|
}
|
|
1485
1514
|
@media only screen and (min-width: 961px) {
|
|
1486
|
-
|
|
1515
|
+
/* (not where the actions open as a menu under the row's button: home-actions-menu.js) */
|
|
1516
|
+
body.is-home.home-actions-drawer-open:not(.home-actions-menu) main > .container {
|
|
1487
1517
|
padding-right: calc(var(--home-actions-drawer-width) + 16px);
|
|
1488
1518
|
}
|
|
1489
1519
|
@keyframes homeActionsDrawerIn {
|
|
@@ -1737,6 +1767,7 @@ body.dark aside .current.selected {
|
|
|
1737
1767
|
<div class='url-dropdown' id='url-dropdown'></div>
|
|
1738
1768
|
</div>
|
|
1739
1769
|
</form>
|
|
1770
|
+
<%- include('partials/home_shell_button', { folder: kernel.homedir, name: 'Pinokio home', navbar: true }) %>
|
|
1740
1771
|
<%- include('partials/home_server_popover') %>
|
|
1741
1772
|
<a class='btn2' href="/columns" data-tippy-content="split into 2 columns">
|
|
1742
1773
|
<div><i class="fa-solid fa-table-columns"></i></div>
|
|
@@ -1855,6 +1886,8 @@ body.dark aside .current.selected {
|
|
|
1855
1886
|
>
|
|
1856
1887
|
<i class="fa-solid fa-wifi" aria-hidden="true"></i>
|
|
1857
1888
|
</button>
|
|
1889
|
+
<%- include('partials/home_ask_button', { folder: item.filepath, name: item.name, icon: item.icon }) %>
|
|
1890
|
+
<%- include('partials/home_shell_button', { folder: item.filepath, name: item.name }) %>
|
|
1858
1891
|
<% const autolaunchRunningScript = !!(item.autolaunch_starting && item.autolaunch_script && item.running_scripts && item.running_scripts.some((s) => { const scriptName = s && (s.name || s.script_path || s.path || ""); return scriptName === item.autolaunch_script || String(scriptName).endsWith(`/${item.autolaunch_script}`) })) %>
|
|
1859
1892
|
<% if (item.autolaunch_starting && !autolaunchRunningScript) { %>
|
|
1860
1893
|
<% const autolaunchStatusLabel = item.autolaunch_status_label || "Starting automatically" %>
|
|
@@ -1866,7 +1899,7 @@ body.dark aside .current.selected {
|
|
|
1866
1899
|
<% const runningTerminalOnlineCount = Number(item.terminal_online_count || 0) %>
|
|
1867
1900
|
<% const runningTerminalLabel = runningTerminalOnlineCount > 0 ? `${runningTerminalOnlineCount} terminal${runningTerminalOnlineCount === 1 ? "" : "s"} online` : "Terminals" %>
|
|
1868
1901
|
<% if (runningTerminalOnlineCount > 0) { %>
|
|
1869
|
-
<button class='btn browse terminals-link is-online' type='button' data-src="<%=item.
|
|
1902
|
+
<button class='btn browse terminals-link is-online' type='button' data-src="<%=item.dev_url%>" title="<%=runningTerminalLabel%>">
|
|
1870
1903
|
<i class="fa-solid fa-terminal" aria-hidden="true"></i>
|
|
1871
1904
|
<span><%=runningTerminalLabel%></span>
|
|
1872
1905
|
<i class="fa-solid fa-circle-notch fa-spin terminals-link-indicator" aria-hidden="true"></i>
|
|
@@ -1954,9 +1987,11 @@ body.dark aside .current.selected {
|
|
|
1954
1987
|
<button class='btn open-menu open-actions-modal' type='button' data-dialog-id="home-actions-not-running-<%=index%>" aria-haspopup="dialog" aria-expanded="false" title="Open actions panel" aria-label="Open actions panel">
|
|
1955
1988
|
<i class="fa-solid fa-list-ul" aria-hidden="true"></i>
|
|
1956
1989
|
</button>
|
|
1990
|
+
<%- include('partials/home_ask_button', { folder: item.filepath, name: item.name, icon: item.icon }) %>
|
|
1991
|
+
<%- include('partials/home_shell_button', { folder: item.filepath, name: item.name }) %>
|
|
1957
1992
|
<% if (notRunningTerminalOnlineCount > 0) { %>
|
|
1958
1993
|
<% const notRunningTerminalLabel = notRunningTerminalOnlineCount > 0 ? `${notRunningTerminalOnlineCount} terminal${notRunningTerminalOnlineCount === 1 ? "" : "s"} online` : "Terminals" %>
|
|
1959
|
-
<button class='btn browse terminals-link is-online' type='button' data-src="<%=item.
|
|
1994
|
+
<button class='btn browse terminals-link is-online' type='button' data-src="<%=item.dev_url%>" title="<%=notRunningTerminalLabel%>">
|
|
1960
1995
|
<i class="fa-solid fa-terminal" aria-hidden="true"></i>
|
|
1961
1996
|
<span><%=notRunningTerminalLabel%></span>
|
|
1962
1997
|
<i class="fa-solid fa-circle-notch fa-spin terminals-link-indicator" aria-hidden="true"></i>
|
|
@@ -2007,6 +2042,10 @@ body.dark aside .current.selected {
|
|
|
2007
2042
|
<% } %>
|
|
2008
2043
|
</div>
|
|
2009
2044
|
<%- include('partials/main_sidebar', { selected: 'home' }) %>
|
|
2045
|
+
<link rel="stylesheet" href="/home-shell.css">
|
|
2046
|
+
<script src="/home-shell.js" data-home-shell="true"></script>
|
|
2047
|
+
<link rel="stylesheet" href="/home-actions-menu.css">
|
|
2048
|
+
<script src="/home-actions-menu.js" data-home-actions-menu="true"></script>
|
|
2010
2049
|
</main>
|
|
2011
2050
|
<script>
|
|
2012
2051
|
let paths = location.pathname.split("/").filter(x=>x)
|
|
@@ -50,7 +50,7 @@ const homeActionsShareExternalReadyUrls = item && Array.isArray(item.external_re
|
|
|
50
50
|
<% } %>
|
|
51
51
|
|
|
52
52
|
<% if (item.running) { %>
|
|
53
|
-
<section class='home-actions-section' aria-labelledby='<%= id %>-share-title'>
|
|
53
|
+
<section class='home-actions-section home-actions-section--share' aria-labelledby='<%= id %>-share-title'>
|
|
54
54
|
<div class='home-actions-section-title' id='<%= id %>-share-title'>Share</div>
|
|
55
55
|
<div class='home-actions-command-list'>
|
|
56
56
|
<button
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<%
|
|
2
|
+
// Home's "Ask about this app" button, on each row of My Apps. A click points
|
|
3
|
+
// the agent bar at the top of the page at this app (agent-bar-about.js).
|
|
4
|
+
const askFolder = typeof folder === "string" ? folder : "";
|
|
5
|
+
// the app's folder name, which is how Pinokio names an app
|
|
6
|
+
const askApp = askFolder.split(/[\\/]/).filter(Boolean).pop() || "";
|
|
7
|
+
const askName = typeof name === "string" && name ? name : askApp;
|
|
8
|
+
const askIcon = typeof icon === "string" ? icon : "";
|
|
9
|
+
const askLabel = `Ask Pinokio about ${askName}`;
|
|
10
|
+
%>
|
|
11
|
+
<% if (askApp) { %>
|
|
12
|
+
<button class='btn home-icon-btn home-ask-button' type='button' data-ask-app="<%= askApp %>" data-ask-folder="<%= askFolder %>" data-ask-name="<%= askName %>" data-ask-icon="<%= askIcon %>" title="<%= askLabel %>" aria-label="<%= askLabel %>">
|
|
13
|
+
<i class="fa-regular fa-comment" aria-hidden="true"></i>
|
|
14
|
+
</button>
|
|
15
|
+
<% } %>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<%
|
|
2
|
+
// Home's "Open a shell" button: on each row of My Apps (the app's folder) and
|
|
3
|
+
// in the top bar (Pinokio's own folder). What a click does is in home-shell.js.
|
|
4
|
+
// The top bar's button is for a plain shell only (data-shell-plain): the
|
|
5
|
+
// Python environments found under Pinokio's own folder belong to the apps.
|
|
6
|
+
const shellFolder = typeof folder === "string" ? folder : "";
|
|
7
|
+
const shellName = typeof name === "string" && name ? name : "this folder";
|
|
8
|
+
const inNavbar = typeof navbar !== "undefined" && navbar === true;
|
|
9
|
+
const shellLabel = `Open a shell in ${shellName}`;
|
|
10
|
+
%>
|
|
11
|
+
<% if (shellFolder) { %>
|
|
12
|
+
<% if (inNavbar) { %>
|
|
13
|
+
<button class='btn2 home-shell-button home-shell-button--navbar' type='button' data-shell-folder="<%= shellFolder %>" data-shell-name="<%= shellName %>" data-shell-plain="true" data-tippy-content="<%= shellLabel %>" title="<%= shellLabel %>" aria-label="<%= shellLabel %>">
|
|
14
|
+
<div><i class="fa-solid fa-terminal" aria-hidden="true"></i></div>
|
|
15
|
+
</button>
|
|
16
|
+
<% } else { %>
|
|
17
|
+
<button class='btn home-icon-btn home-shell-button' type='button' data-shell-folder="<%= shellFolder %>" data-shell-name="<%= shellName %>" title="<%= shellLabel %>" aria-label="<%= shellLabel %>" aria-haspopup="menu" aria-expanded="false">
|
|
18
|
+
<i class="fa-solid fa-terminal" aria-hidden="true"></i>
|
|
19
|
+
</button>
|
|
20
|
+
<% } %>
|
|
21
|
+
<% } %>
|
|
@@ -8,11 +8,15 @@
|
|
|
8
8
|
<link rel="stylesheet" href="/agent-bar-files.css">
|
|
9
9
|
<script src="/agent-bar-files.js" data-agent-bar-files="true"></script>
|
|
10
10
|
<link rel="stylesheet" href="/agent-bar-panel.css">
|
|
11
|
-
<script src="/agent-bar-panel.js" data-agent-bar-panel="true"></script>
|
|
11
|
+
<script src="/agent-bar-panel.js" data-agent-bar-panel="true" data-pinokio-home="<%= locals.pinokioHome || '' %>"></script>
|
|
12
12
|
<link rel="stylesheet" href="/agent-bar-attach.css">
|
|
13
13
|
<script src="/agent-bar-attach.js" data-agent-bar-attach="true"></script>
|
|
14
14
|
<link rel="stylesheet" href="/agent-bar-compose.css">
|
|
15
15
|
<script src="/agent-bar-compose.js" data-agent-bar-compose="true"></script>
|
|
16
|
+
<link rel="stylesheet" href="/agent-bar-modes.css">
|
|
17
|
+
<script src="/agent-bar-modes.js" data-agent-bar-modes="true"></script>
|
|
18
|
+
<link rel="stylesheet" href="/agent-bar-about.css">
|
|
19
|
+
<script src="/agent-bar-about.js" data-agent-bar-about="true"></script>
|
|
16
20
|
<button type="button" class="main-sidebar-mobile-toggle" data-main-sidebar-toggle aria-label="Open navigation" aria-expanded="false">
|
|
17
21
|
<i class="fa-solid fa-bars" aria-hidden="true"></i>
|
|
18
22
|
</button>
|
package/server/views/pre.ejs
CHANGED
|
@@ -113,7 +113,7 @@ footer a.btn {
|
|
|
113
113
|
<h1>Requirements</h1>
|
|
114
114
|
<div class='e'>
|
|
115
115
|
<div>To run <%=name%>, you need to have the following programs installed.</div>
|
|
116
|
-
<div>Get the apps if you haven't already, and press "
|
|
116
|
+
<div>Get the apps if you haven't already, and press "Next".</div>
|
|
117
117
|
</div>
|
|
118
118
|
<div class='items'>
|
|
119
119
|
<% items.forEach((item) => { %>
|