Skip to content

Direct access URLs for Online & Now can invoke the browser-based FileBrowser from within Online Medley #62

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
01dd8e6
Add capability to start online medley directly, skipping login and th…
fghalasz Mar 15, 2025
ba46128
Fix typo in server/js/user.js
fghalasz Mar 15, 2025
4490725
Fix typo in server/js/app.js
fghalasz Mar 15, 2025
f7aa34e
More typos - capitalization errors
fghalasz Mar 15, 2025
8956308
Another set of typos in client/js/main.js
fghalasz Mar 15, 2025
1d395d7
Prevent disclosure dialog when doing autologin
fghalasz Mar 15, 2025
0613ac8
Try to hide main page in autologin case
fghalasz Mar 15, 2025
17b75f0
fix typo in main.css
fghalasz Mar 16, 2025
5c8c7d5
Add files via upload
fghalasz Mar 16, 2025
01b323f
Add logo to background on main page in autologin case.
fghalasz Mar 16, 2025
edfe5e1
Fix body.style.background... clauses in main.js
fghalasz Mar 16, 2025
8d2741a
Plumb return from novnc for autologin case - should just return to lo…
fghalasz Mar 16, 2025
f3317b8
Pass into MEDLEY a new env variable OIO_FB_URL that contains the url …
fghalasz Mar 16, 2025
5accf51
Suppress open in new tab warning when opening filebrowser from Medley…
fghalasz Mar 16, 2025
3890d81
Fix typo in novnc/ui.js
fghalasz Mar 16, 2025
a419e69
Fix another typo in novnc/ui.js
fghalasz Mar 16, 2025
81e0573
Update ONLINE-INIT to create a FILES Import/Export button on screen t…
fghalasz Mar 17, 2025
ba14c57
Merge branch 'fgh_importexport' into fgh_250317
fghalasz Mar 17, 2025
37572f2
Fix FILES IMPORT/EXPORT button on Medley screen so that it doesn't in…
fghalasz Mar 18, 2025
7c08227
Added in again.pug and again.css left out of last commit. In /guest r…
fghalasz Mar 18, 2025
5c43933
Fix typo
fghalasz Mar 18, 2025
682c36d
Fix urlEncode => encodeURI in app.js
fghalasz Mar 18, 2025
1514d65
Fix extra ) in again.pug causing syntax error
fghalasz Mar 19, 2025
b58f1a2
Minor fixes to again.pug and main.pug pages
fghalasz Mar 19, 2025
a762739
More fooling with css on again pag to get again button to show-up and…
fghalasz Mar 19, 2025
5b47d6d
Realigning things a bit on the the again.pug page
fghalasz Mar 19, 2025
bf67913
Adjust location of File IMPORT/EXPORT button in ONLINE-INIT
fghalasz Mar 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 61 additions & 10 deletions docker_medley/init/ONLINE-INIT
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10)

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

:EDIT-BY "fgh"
:EDIT-BY "guest"

:CHANGES-TO (FNS Online.DoInit)

:PREVIOUS-DATE "25-Feb-2024 11:21:27" {DSK}<home>medley>il>ONLINE-INIT.;14)
:PREVIOUS-DATE "17-Mar-2025 17:06:18" {DSK}<home>medley>il>ONLINE-INIT.;1)


(PRETTYCOMPRINT ONLINE-INITCOMS)
Expand All @@ -22,8 +20,8 @@
(INITVARS (Online.LogoutTimeout 30)
(ONLINEP NIL))
(ADVISE (SAVEVM :IN \IDLER))
(FNS Online.SftpInitInfo Online.SftpUpdateInfo Online.SetUpNOTECARDSDIRECTORIES Online.DoInit
ONLINEP)
(FNS Online.SftpInitInfo Online.SftpUpdateInfo Online.SetUpNOTECARDSDIRECTORIES
Online.FileButton Online.DoInit ONLINEP)
(DECLARE%: DONTEVAL@LOAD DOCOPY (P (Online.DoInit)))
(DECLARE%: FIRST DONTEVAL@LOAD DOCOPY (P (BKSYSBUF " "])

Expand Down Expand Up @@ -102,9 +100,57 @@
(PRIN1 "and Notecards will not work properly." T)
NIL])

(Online.FileButton
[LAMBDA NIL (* ; "Edited 18-Mar-2025 22:31 by guest")
(* ; "Edited 17-Mar-2025 16:51 by fgh")
(* ; "Edited 16-Mar-2025 23:40 by guest")

(* ;; " Add the FILES IMPORT/EXPORT button to the bottom of the button stack on the right side of the screen")

(LET* ((RIGHTMARGINISH 140)
(Apps.BUTTONS (for B in *ALL-BUTTONS* when (WINDOWPROP B 'Apps.BUTTON) collect B))
(LowestButton (CAR Apps.BUTTONS))
P B L)
(if LowestButton
then
(* ;; " Find the lowest existing button on the right side of the screen")

(for B in Apps.BUTTONS when [ILESSP (fetch BOTTOM of (WINDOWPROP B 'REGION))
(fetch BOTTOM of (WINDOWPROP LowestButton
'REGION]
do (SETQ LowestButton B))

(* ;;
 " Set the y-position for the label based on the lowest button, then create the label")

(SETQ L (Apps.CreateLabel "FILES" (IDIFFERENCE SCREENWIDTH (IDIFFERENCE
RIGHTMARGINISH
50))
(IDIFFERENCE (fetch BOTTOM of (WINDOWPROP LowestButton 'REGION))
35)))
(WINDOWPROP L 'RIGHTBUTTONFN 'NILL)

(* ;;
 " Set the position of the files button based on the label, then create the button")

(SETQ P (create POSITION
XCOORD _ (IDIFFERENCE SCREENWIDTH RIGHTMARGINISH)
YCOORD _ (IDIFFERENCE (fetch BOTTOM of (WINDOWPROP LowestButton
'REGION))
85)))
(SETQ B (CREATE-BUTTON '(ShellBrowse (UNIX-GETENV "OIO_FB_URL"))
"IMPORT/EXPORT" P))
(WINDOWPROP B 'RIGHTBUTTONFN 'NILL)
[WINDOWPROP B 'BUTTONEVENTFN (FUNCTION (LAMBDA (BUTTON)
(if (LASTMOUSESTATE (ONLY LEFT))
then (EXECUTE-BUTTON BUTTON]
T])

(Online.DoInit
[LAMBDA NIL

(* ;; "Edited 16-Mar-2025 23:26 by guest")

(* ;; "Edited 25-Feb-2024 11:37 by fgh")

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

(Online.SetUpNOTECARDSDIRECTORIES])
(Online.SetUpNOTECARDSDIRECTORIES)

(* ;; "Create File Import/Export Button")

(Online.FileButton])

(ONLINEP
[LAMBDA NIL (* ; "Edited 24-Feb-2024 22:31 by fgh")
Expand All @@ -189,6 +239,7 @@
(BKSYSBUF " ")
)
(DECLARE%: DONTCOPY
(FILEMAP (NIL (1660 7576 (Online.SftpInitInfo 1670 . 2543) (Online.SftpUpdateInfo 2545 . 2800) (
Online.SetUpNOTECARDSDIRECTORIES 2802 . 4510) (Online.DoInit 4512 . 7437) (ONLINEP 7439 . 7574)))))
(FILEMAP (NIL (1640 10532 (Online.SftpInitInfo 1650 . 2523) (Online.SftpUpdateInfo 2525 . 2780) (
Online.SetUpNOTECARDSDIRECTORIES 2782 . 4490) (Online.FileButton 4492 . 7320) (Online.DoInit 7322 .
10393) (ONLINEP 10395 . 10530)))))
STOP
Binary file modified docker_medley/init/ONLINE-INIT.LCOM
100644 → 100755
Binary file not shown.
3 changes: 2 additions & 1 deletion docker_medley/scripts/request_new_tab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
# 2022-10-11 Frank Halasz
#
#
URL=5d4f26d9d86696b6$1
if [ $(echo $1 | grep -q "online.interlisp.org:3" | echo $?) -eq 0 ]; then nowarn=1; else nowarn=0; fi
URL="5d4f26d9d86696b${nowarn}$1"
OLD_NAME=$(/usr/bin/vncconfig -display ${DISPLAY} -get desktop)
/usr/bin/vncconfig -display ${DISPLAY} -set desktop="${URL}"
/usr/bin/vncconfig -display ${DISPLAY} -set desktop="${OLD_NAME}"
Expand Down
1 change: 1 addition & 0 deletions docker_medley/scripts/run-online-medley
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ fi
-d ${FILEBROWSER_DATABASE} --lockPassword --perm.share=false --perm.execute=false
/usr/local/bin/filebrowser -d ${FILEBROWSER_DATABASE} --port ${FILEBROWSER_PORT} \
${FILEBROWSER_CERT} ${FILEBROWSER_KEY} &
export OIO_FB_URL="${OIO_FB_URL}:${FILEBROWSER_PORT}/files/il?u=${MEDLEY_UNAME}&p=${SFTP_PWD}"
#
#
#
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 28 additions & 9 deletions web-portal/client/js/main.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/*******************************************************************************
*
*
* main.js: Page-level code used by the main.pug page.
*
*
*
*
* 2022-03-09 Frank Halasz
*
*
* Copyright: 2022 by Interlisp.org
*
*
*
* Copyright: 2022 by Interlisp.org
*
*
******************************************************************************/

Expand All @@ -21,7 +21,7 @@
var localStore;

window.addEventListener('resize', (event) => {
fillWindowOnClick();
fillWindowOnClick();
});

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

if (isAutoLogin) {
document.body.style.backgroundImage = "url('images/logos/logo_red_no_border_568x385.png')";
document.body.style.backgroundRepeat = "no-repeat";
document.body.style.backgroundPosition = "center";
document.body.style.position = "relative";
}
else document.getElementById("page-container").style.visibility = "visible";

if (targetSystem == "Notecards") {
document.getElementById("fill_window_cb").checked = true;
document.getElementById("dev-div").style.display = "none";
Expand All @@ -50,6 +58,14 @@ window.addEventListener('load', (event) => {
document.getElementById("custom_init_cb").checked = false;
document.getElementById("sftp_checkbox").checked = false;
document.getElementById("interlisp_rb").checked = true;
} else if(isAutoLogin) {
document.getElementById("fill_window_cb").checked = true;
document.getElementById("dev-div").style.display = "none";
document.getElementById("do_not_checkbox_div").style.display = "none";
document.getElementById("run_notecards_cb").checked = alNotecards;
document.getElementById("run_rooms_cb").checked = alRooms;
document.getElementById("sftp_checkbox").checked = false;
document.getElementById("interlisp_rb").checked = true;
} else if(isGuest) {
document.getElementById("fill_window_cb").checked = true;
document.getElementById("dev-div").style.display = "none";
Expand Down Expand Up @@ -85,7 +101,7 @@ window.addEventListener('load', (event) => {
fillWindowOnClick();
document.getElementById("dev-options-checkbox").checked = (localStore.getItem("show_dev_options") == "true");
showDevOptionsOnClick();
if(! fromvnc) {
if( ! (isAutoLogin || fromvnc)) {
if(isVerified != true) {
const dlg = document.getElementById(rr ? "verification-dialog2" : "verification-dialog1");
dlg.showModal();
Expand All @@ -97,6 +113,7 @@ window.addEventListener('load', (event) => {
dlg.showModal();
}
}
if(isAutoLogin && (! fromvnc)) startSession("interlisp");
});

function startSession (interlispOrXterm) {
Expand Down Expand Up @@ -165,6 +182,7 @@ function startSession (interlispOrXterm) {
+ `&rooms=${runRooms || "false"}`
+ `&sftp=${startSftp || "false"}`
+ `&exec=${medleyExec || "inter"}`
+ ( isAutoLogin ? "&autologin" : "")
);
}
);
Expand All @@ -181,6 +199,7 @@ function startSession (interlispOrXterm) {
+ `&rooms=${runRooms || "false"}`
+ `&sftp=${startSftp || "false"}`
+ `&exec=${medleyExec || "inter"}`
+ ( isAutoLogin ? "&autologin" : "")
);
}
},
Expand Down
28 changes: 17 additions & 11 deletions web-portal/client/novnc_oio/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,10 @@ const UI = {
//
// UI.openControlbar();
// UI.openConnectPanel();
window.location.assign(window.location.origin + "/main?fromvnc=1");
if(document.location.href.match(/autologin/))
window.location.assign(window.location.origin + "/main?fromvnc=1&autologin=1");
else
window.location.assign(window.location.origin + "/main?fromvnc=1");
},

securityFailed(e) {
Expand Down Expand Up @@ -1355,17 +1358,18 @@ const UI = {
// Interlisp Online
//

async openCLHSTab(url) {
let noWarn = false;
async openCLHSTab(url, noWarn) {
let guest = false;
let response = await window.fetch('/user/clhstabnotice');
if(response.ok) {
let txt = await response.text();
noWarn = (txt == "true");
guest = (txt == "guest");
if (!noWarn) {
let response = await window.fetch('/user/clhstabnotice');
if(response.ok) {
let txt = await response.text();
noWarn = (txt == "true");
guest = (txt == "guest");
}
}
if(noWarn)
UI.openCLHSTabFinish(url);
UI.openCLHSTabFinish(url);
else {
const dlg = document.getElementById('OIO_CLHS_tab_notice_dlg');
if(guest) document.getElementById('OIO_CLHS_do_not_checkbox_div').hidden = true;
Expand Down Expand Up @@ -1815,11 +1819,13 @@ const UI = {
},

// Interlisp Online
// Used as a way to open a new tab to show a url
// url is encoded in new desktop name
updateDesktopName(e) {
let payload = e.detail.name;
if (payload.match(/^5d4f26d9d86696b6/)) {
if (payload.match(/^5d4f26d9d86696b/)) {
let url=payload.slice(16);
UI.openCLHSTab(url);
UI.openCLHSTab(url, payload.match(/^5d4f26d9d86696b1/));
} else {
UI.desktopName = payload;
// Display the desktop name in the document title
Expand Down
35 changes: 35 additions & 0 deletions web-portal/client/stylesheets/again.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/***************************************************************************
*
* again.css: css code for again.pug on online.interlisp.org web portal.
*
* 2025-03-17 Frank Halasz
*
*
* Copyright: 2025 by Interlisp.org
*
*
**************************************************************************/

#page-container {
text-align: center;
display: table-cell;
visibility: hidden;
height: 100vh;
width: 100vw;
}

#again-button {
font-size: 24px;
line-height: 1.6;
padding: 1rem 0rem;
visibility: visible;
}

body {
height: 100vh;
background-image: url('/images/logos/logo_red_no_border_568x385.png');
background-repeat: no-repeat;
background-position: center;
position: relative;
}

4 changes: 4 additions & 0 deletions web-portal/client/stylesheets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
*
**************************************************************************/

#page-container {
visibility: hidden;
}

#logged-in-as {
font-size: 15px;
font-style: italic;
Expand Down
32 changes: 32 additions & 0 deletions web-portal/client/views/again.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//-
/***************************************************************************
*
* again.pug: page for online.interlisp.org web portal to be used in
* the autologin case when returneing from noVnc
*
* 2025-03-17 Frank Halasz
*
*
* Copyright: 2025 by Interlisp.org
*
*
**************************************************************************/

extends layout

block variables

block headeradds

script.
const alURL = "#{alURL}";

link(rel="stylesheet", href="/stylesheets/again.css")



block content

.row.text-center#again-button
button.main-button(type="button" onclick='window.location.assign(decodeURI(alURL));')!= "Run Medley Again"

4 changes: 4 additions & 0 deletions web-portal/client/views/main.pug
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ block headeradds
const isGuest = #{isGuest};
const isVerified = #{isVerified};
const nodisclaimer = #{nodisclaimer};
const isAutoLogin = #{isAutoLogin};
const alNotecards = #{notecards};
const alRooms = #{rooms};
const alURL = "#{alURL}";

link(rel="stylesheet", href="/stylesheets/main.css")

Expand Down
Loading