#6 add pat support to iframe to automate setting websockify endpoint

This commit is contained in:
thelamer 2024-02-14 09:12:55 -08:00
parent 400db19ae1
commit 76a2776c83
2 changed files with 8 additions and 3 deletions

View File

@ -6,7 +6,12 @@ var PASSWORD = process.env.PASSWORD || 'abc';
var SUBFOLDER = process.env.SUBFOLDER || '/';
var TITLE = process.env.TITLE || 'KasmVNC Client';
var FM_HOME = process.env.FM_HOME || '/config';
var PATH;
if (SUBFOLDER != '/') {
PATH = '&path=' + SUBFOLDER + 'websockify'
} else {
PATH = false;
}
//// Application Variables ////
var socketIO = require('socket.io');
var express = require('express');
@ -33,7 +38,7 @@ app.engine('json', require('ejs').renderFile);
baseRouter.use('/public', express.static(__dirname + '/public'));
baseRouter.use('/vnc', express.static("/usr/share/kasmvnc/www/"));
baseRouter.get('/', function (req, res) {
res.render(__dirname + '/public/index.html', {title: TITLE});
res.render(__dirname + '/public/index.html', {title: TITLE, path: PATH});
});
baseRouter.get('/favicon.ico', function (req, res) {
res.sendFile(__dirname + '/public/favicon.ico');

View File

@ -14,7 +14,7 @@
</head>
<body>
<!--KasmVNC Iframe-->
<iframe class="vnc" src="vnc/index.html?autoconnect=1&resize=remote&clipboard_up=true&clipboard_down=true&clipboard_seamless=true&show_control_bar=true"></iframe>
<iframe class="vnc" src="vnc/index.html?autoconnect=1&resize=remote&clipboard_up=true&clipboard_down=true&clipboard_seamless=true&show_control_bar=true<% if(path){ %><%- path -%><% } %>"></iframe>
<!--LSIO Function Bar-->
<div id="lsbar">
<img class="icons" id="fileButton" title="File Manager" src="public/css/files.svg" onclick="toggle('#files')"/>