Skip to content

Commit f036088

Browse files
authored
Merge pull request #62 from Interlisp/fgh_250317
Direct access URLs for Online & Now can invoke the browser-based FileBrowser from within Online Medley
2 parents 100e195 + dc3892c commit f036088

File tree

16 files changed

+274
-83
lines changed

16 files changed

+274
-83
lines changed

docker_medley/init/ONLINE-INIT

100644100755
Lines changed: 61 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10)
22

3-
(FILECREATED "25-Feb-2024 11:38:10" {DSK}<home>medley>il>ONLINE-INIT.;15 7712
3+
(FILECREATED "18-Mar-2025 22:45:51" {DSK}<home>medley>il>ONLINE-INIT.;1 10668
44

5-
:EDIT-BY "fgh"
5+
:EDIT-BY "guest"
66

7-
:CHANGES-TO (FNS Online.DoInit)
8-
9-
:PREVIOUS-DATE "25-Feb-2024 11:21:27" {DSK}<home>medley>il>ONLINE-INIT.;14)
7+
:PREVIOUS-DATE "17-Mar-2025 17:06:18" {DSK}<home>medley>il>ONLINE-INIT.;1)
108

119

1210
(PRETTYCOMPRINT ONLINE-INITCOMS)
@@ -22,8 +20,8 @@
2220
(INITVARS (Online.LogoutTimeout 30)
2321
(ONLINEP NIL))
2422
(ADVISE (SAVEVM :IN \IDLER))
25-
(FNS Online.SftpInitInfo Online.SftpUpdateInfo Online.SetUpNOTECARDSDIRECTORIES Online.DoInit
26-
ONLINEP)
23+
(FNS Online.SftpInitInfo Online.SftpUpdateInfo Online.SetUpNOTECARDSDIRECTORIES
24+
Online.FileButton Online.DoInit ONLINEP)
2725
(DECLARE%: DONTEVAL@LOAD DOCOPY (P (Online.DoInit)))
2826
(DECLARE%: FIRST DONTEVAL@LOAD DOCOPY (P (BKSYSBUF " "])
2927

@@ -102,9 +100,57 @@
102100
(PRIN1 "and Notecards will not work properly." T)
103101
NIL])
104102

103+
(Online.FileButton
104+
[LAMBDA NIL (* ; "Edited 18-Mar-2025 22:31 by guest")
105+
(* ; "Edited 17-Mar-2025 16:51 by fgh")
106+
(* ; "Edited 16-Mar-2025 23:40 by guest")
107+
108+
(* ;; " Add the FILES IMPORT/EXPORT button to the bottom of the button stack on the right side of the screen")
109+
110+
(LET* ((RIGHTMARGINISH 140)
111+
(Apps.BUTTONS (for B in *ALL-BUTTONS* when (WINDOWPROP B 'Apps.BUTTON) collect B))
112+
(LowestButton (CAR Apps.BUTTONS))
113+
P B L)
114+
(if LowestButton
115+
then
116+
(* ;; " Find the lowest existing button on the right side of the screen")
117+
118+
(for B in Apps.BUTTONS when [ILESSP (fetch BOTTOM of (WINDOWPROP B 'REGION))
119+
(fetch BOTTOM of (WINDOWPROP LowestButton
120+
'REGION]
121+
do (SETQ LowestButton B))
122+
123+
(* ;;
124+
 " Set the y-position for the label based on the lowest button, then create the label")
125+
126+
(SETQ L (Apps.CreateLabel "FILES" (IDIFFERENCE SCREENWIDTH (IDIFFERENCE
127+
RIGHTMARGINISH
128+
50))
129+
(IDIFFERENCE (fetch BOTTOM of (WINDOWPROP LowestButton 'REGION))
130+
35)))
131+
(WINDOWPROP L 'RIGHTBUTTONFN 'NILL)
132+
133+
(* ;;
134+
 " Set the position of the files button based on the label, then create the button")
135+
136+
(SETQ P (create POSITION
137+
XCOORD _ (IDIFFERENCE SCREENWIDTH RIGHTMARGINISH)
138+
YCOORD _ (IDIFFERENCE (fetch BOTTOM of (WINDOWPROP LowestButton
139+
'REGION))
140+
85)))
141+
(SETQ B (CREATE-BUTTON '(ShellBrowse (UNIX-GETENV "OIO_FB_URL"))
142+
"IMPORT/EXPORT" P))
143+
(WINDOWPROP B 'RIGHTBUTTONFN 'NILL)
144+
[WINDOWPROP B 'BUTTONEVENTFN (FUNCTION (LAMBDA (BUTTON)
145+
(if (LASTMOUSESTATE (ONLY LEFT))
146+
then (EXECUTE-BUTTON BUTTON]
147+
T])
148+
105149
(Online.DoInit
106150
[LAMBDA NIL
107151

152+
(* ;; "Edited 16-Mar-2025 23:26 by guest")
153+
108154
(* ;; "Edited 25-Feb-2024 11:37 by fgh")
109155

110156
(* ;; "Edited 24-Feb-2024 00:26 by runner")
@@ -174,7 +220,11 @@
174220
(* ;;
175221
 "Setup NOTECARDSDIRECTORIES. Should be done it APPS-INIT. But until thats done, we'll do it here.")
176222

177-
(Online.SetUpNOTECARDSDIRECTORIES])
223+
(Online.SetUpNOTECARDSDIRECTORIES)
224+
225+
(* ;; "Create File Import/Export Button")
226+
227+
(Online.FileButton])
178228

179229
(ONLINEP
180230
[LAMBDA NIL (* ; "Edited 24-Feb-2024 22:31 by fgh")
@@ -189,6 +239,7 @@
189239
(BKSYSBUF " ")
190240
)
191241
(DECLARE%: DONTCOPY
192-
(FILEMAP (NIL (1660 7576 (Online.SftpInitInfo 1670 . 2543) (Online.SftpUpdateInfo 2545 . 2800) (
193-
Online.SetUpNOTECARDSDIRECTORIES 2802 . 4510) (Online.DoInit 4512 . 7437) (ONLINEP 7439 . 7574)))))
242+
(FILEMAP (NIL (1640 10532 (Online.SftpInitInfo 1650 . 2523) (Online.SftpUpdateInfo 2525 . 2780) (
243+
Online.SetUpNOTECARDSDIRECTORIES 2782 . 4490) (Online.FileButton 4492 . 7320) (Online.DoInit 7322 .
244+
10393) (ONLINEP 10395 . 10530)))))
194245
STOP

docker_medley/init/ONLINE-INIT.LCOM

100644100755
917 Bytes
Binary file not shown.

docker_medley/scripts/request_new_tab.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
# 2022-10-11 Frank Halasz
1414
#
1515
#
16-
URL=5d4f26d9d86696b6$1
16+
if [ $(echo $1 | grep -q "online.interlisp.org:3" | echo $?) -eq 0 ]; then nowarn=1; else nowarn=0; fi
17+
URL="5d4f26d9d86696b${nowarn}$1"
1718
OLD_NAME=$(/usr/bin/vncconfig -display ${DISPLAY} -get desktop)
1819
/usr/bin/vncconfig -display ${DISPLAY} -set desktop="${URL}"
1920
/usr/bin/vncconfig -display ${DISPLAY} -set desktop="${OLD_NAME}"

docker_medley/scripts/run-online-medley

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ fi
142142
-d ${FILEBROWSER_DATABASE} --lockPassword --perm.share=false --perm.execute=false
143143
/usr/local/bin/filebrowser -d ${FILEBROWSER_DATABASE} --port ${FILEBROWSER_PORT} \
144144
${FILEBROWSER_CERT} ${FILEBROWSER_KEY} &
145+
export OIO_FB_URL="${OIO_FB_URL}:${FILEBROWSER_PORT}/files/il?u=${MEDLEY_UNAME}&p=${SFTP_PWD}"
145146
#
146147
#
147148
#

docker_portal/Dockerfile_development

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,6 @@ RUN ( curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg |
3636
&& apt-get update \
3737
&& apt-get install -y gh
3838
#
39-
# Install Python 2.7 (required by Cloud 9
40-
#
41-
RUN apt-add-repository universe \
42-
&& apt-get update \
43-
&& apt-get install -y python2-minimal
44-
#
45-
# Install Cloud9 IDE
46-
#
47-
RUN curl -L https://raw.githubusercontent.com/c9/install/master/install.sh | bash
48-
#
4939
# Repopulate the web-portal source code with full portal code base and .git directory
5040
#
5141
COPY --chown=oio:oio . /opt/oio

docker_portal/mongodb/mongodb.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
# Where and how to store data.
88
storage:
99
dbPath: /srv/oio/mongodb/db
10-
journal:
11-
enabled: true
10+
# journal:
11+
# enabled: true
1212
# engine:
1313
# wiredTiger:
1414

19 KB
Loading

web-portal/client/js/main.js

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/*******************************************************************************
2-
*
2+
*
33
* main.js: Page-level code used by the main.pug page.
4-
*
5-
*
4+
*
5+
*
66
* 2022-03-09 Frank Halasz
7-
*
8-
*
9-
* Copyright: 2022 by Interlisp.org
10-
*
7+
*
8+
*
9+
* Copyright: 2022 by Interlisp.org
10+
*
1111
*
1212
******************************************************************************/
1313

@@ -21,7 +21,7 @@
2121
var localStore;
2222

2323
window.addEventListener('resize', (event) => {
24-
fillWindowOnClick();
24+
fillWindowOnClick();
2525
});
2626

2727
window.addEventListener('load', (event) => {
@@ -30,6 +30,14 @@ window.addEventListener('load', (event) => {
3030
const rr = urlParams.get('rr') || false;
3131
const fromvnc = urlParams.get('fromvnc') || false;
3232

33+
if (isAutoLogin) {
34+
document.body.style.backgroundImage = "url('images/logos/logo_red_no_border_568x385.png')";
35+
document.body.style.backgroundRepeat = "no-repeat";
36+
document.body.style.backgroundPosition = "center";
37+
document.body.style.position = "relative";
38+
}
39+
else document.getElementById("page-container").style.visibility = "visible";
40+
3341
if (targetSystem == "Notecards") {
3442
document.getElementById("fill_window_cb").checked = true;
3543
document.getElementById("dev-div").style.display = "none";
@@ -50,6 +58,14 @@ window.addEventListener('load', (event) => {
5058
document.getElementById("custom_init_cb").checked = false;
5159
document.getElementById("sftp_checkbox").checked = false;
5260
document.getElementById("interlisp_rb").checked = true;
61+
} else if(isAutoLogin) {
62+
document.getElementById("fill_window_cb").checked = true;
63+
document.getElementById("dev-div").style.display = "none";
64+
document.getElementById("do_not_checkbox_div").style.display = "none";
65+
document.getElementById("run_notecards_cb").checked = alNotecards;
66+
document.getElementById("run_rooms_cb").checked = alRooms;
67+
document.getElementById("sftp_checkbox").checked = false;
68+
document.getElementById("interlisp_rb").checked = true;
5369
} else if(isGuest) {
5470
document.getElementById("fill_window_cb").checked = true;
5571
document.getElementById("dev-div").style.display = "none";
@@ -85,7 +101,7 @@ window.addEventListener('load', (event) => {
85101
fillWindowOnClick();
86102
document.getElementById("dev-options-checkbox").checked = (localStore.getItem("show_dev_options") == "true");
87103
showDevOptionsOnClick();
88-
if(! fromvnc) {
104+
if( ! (isAutoLogin || fromvnc)) {
89105
if(isVerified != true) {
90106
const dlg = document.getElementById(rr ? "verification-dialog2" : "verification-dialog1");
91107
dlg.showModal();
@@ -97,6 +113,7 @@ window.addEventListener('load', (event) => {
97113
dlg.showModal();
98114
}
99115
}
116+
if(isAutoLogin && (! fromvnc)) startSession("interlisp");
100117
});
101118

102119
function startSession (interlispOrXterm) {
@@ -165,6 +182,7 @@ function startSession (interlispOrXterm) {
165182
+ `&rooms=${runRooms || "false"}`
166183
+ `&sftp=${startSftp || "false"}`
167184
+ `&exec=${medleyExec || "inter"}`
185+
+ ( isAutoLogin ? "&autologin" : "")
168186
);
169187
}
170188
);
@@ -181,6 +199,7 @@ function startSession (interlispOrXterm) {
181199
+ `&rooms=${runRooms || "false"}`
182200
+ `&sftp=${startSftp || "false"}`
183201
+ `&exec=${medleyExec || "inter"}`
202+
+ ( isAutoLogin ? "&autologin" : "")
184203
);
185204
}
186205
},

web-portal/client/novnc_oio/ui.js

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,10 @@ const UI = {
11611161
//
11621162
// UI.openControlbar();
11631163
// UI.openConnectPanel();
1164-
window.location.assign(window.location.origin + "/main?fromvnc=1");
1164+
if(document.location.href.match(/autologin/))
1165+
window.location.assign(window.location.origin + "/main?fromvnc=1&autologin=1");
1166+
else
1167+
window.location.assign(window.location.origin + "/main?fromvnc=1");
11651168
},
11661169

11671170
securityFailed(e) {
@@ -1355,17 +1358,18 @@ const UI = {
13551358
// Interlisp Online
13561359
//
13571360

1358-
async openCLHSTab(url) {
1359-
let noWarn = false;
1361+
async openCLHSTab(url, noWarn) {
13601362
let guest = false;
1361-
let response = await window.fetch('/user/clhstabnotice');
1362-
if(response.ok) {
1363-
let txt = await response.text();
1364-
noWarn = (txt == "true");
1365-
guest = (txt == "guest");
1363+
if (!noWarn) {
1364+
let response = await window.fetch('/user/clhstabnotice');
1365+
if(response.ok) {
1366+
let txt = await response.text();
1367+
noWarn = (txt == "true");
1368+
guest = (txt == "guest");
1369+
}
13661370
}
13671371
if(noWarn)
1368-
UI.openCLHSTabFinish(url);
1372+
UI.openCLHSTabFinish(url);
13691373
else {
13701374
const dlg = document.getElementById('OIO_CLHS_tab_notice_dlg');
13711375
if(guest) document.getElementById('OIO_CLHS_do_not_checkbox_div').hidden = true;
@@ -1815,11 +1819,13 @@ const UI = {
18151819
},
18161820

18171821
// Interlisp Online
1822+
// Used as a way to open a new tab to show a url
1823+
// url is encoded in new desktop name
18181824
updateDesktopName(e) {
18191825
let payload = e.detail.name;
1820-
if (payload.match(/^5d4f26d9d86696b6/)) {
1826+
if (payload.match(/^5d4f26d9d86696b/)) {
18211827
let url=payload.slice(16);
1822-
UI.openCLHSTab(url);
1828+
UI.openCLHSTab(url, payload.match(/^5d4f26d9d86696b1/));
18231829
} else {
18241830
UI.desktopName = payload;
18251831
// Display the desktop name in the document title
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/***************************************************************************
2+
*
3+
* again.css: css code for again.pug on online.interlisp.org web portal.
4+
*
5+
* 2025-03-17 Frank Halasz
6+
*
7+
*
8+
* Copyright: 2025 by Interlisp.org
9+
*
10+
*
11+
**************************************************************************/
12+
13+
#page-container {
14+
text-align: center;
15+
display: table-cell;
16+
visibility: hidden;
17+
height: 100vh;
18+
width: 100vw;
19+
}
20+
21+
#again-button {
22+
font-size: 24px;
23+
line-height: 1.6;
24+
padding: 1rem 0rem;
25+
visibility: visible;
26+
}
27+
28+
body {
29+
height: 100vh;
30+
background-image: url('/images/logos/logo_red_no_border_568x385.png');
31+
background-repeat: no-repeat;
32+
background-position: center;
33+
position: relative;
34+
}
35+

0 commit comments

Comments
 (0)