milestone 7d. Dynamic content: server-generated URL src-embeds
This commit is contained in:
parent
3981800e42
commit
9b22ed13b4
3 changed files with 33 additions and 2 deletions
|
|
@ -7,7 +7,7 @@ return {
|
|||
middleware = function(req,res,next)
|
||||
local rootpath = "/" .. app.opts.plugin_diskscan_dirname
|
||||
local urlpath = req.url
|
||||
local isroot = urlpath == "/" or urlpath:match("^"..rootpath.."[/]?$")
|
||||
local isroot = urlpath == "/" or urlpath:match("^"..rootpath.."[/]?$") or urlpath == '/index.html'
|
||||
res.items = {}
|
||||
res.template = res.template or 'page/dir.html'
|
||||
local isdir = urlpath:sub(-1) == "/"
|
||||
|
|
@ -62,6 +62,7 @@ return {
|
|||
items = {},
|
||||
isroot = isroot,
|
||||
referrer = referrer,
|
||||
req = req,
|
||||
parent=res.parent,
|
||||
template=res.template
|
||||
},{ opts = app.opts })
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
<link rel="stylesheet" href="css/xrforge.css"></link>
|
||||
${opts.plugin_global_header_html}
|
||||
<noscript>
|
||||
{if urlpath == '/' or urlpath == '/index.html' then
|
||||
{if isroot then
|
||||
print('<meta http-equiv="refresh" content="0;url=${opts.plugin_diskscan_dirname}">')
|
||||
end}
|
||||
</noscript>
|
||||
|
|
|
|||
|
|
@ -117,6 +117,36 @@ end}
|
|||
addPortal('parent',5, v, v.url, 0, 0, ' shader_id="defaultportal"', '0 -90 0', '0.2 0.2 0.2')
|
||||
end}
|
||||
|
||||
{if isroot then
|
||||
|
||||
local plugins = {}
|
||||
foreach(app.plugin, function(name,p)
|
||||
if not tostring(name):match("[0-9]") then table.insert(plugins,name) end
|
||||
end)
|
||||
|
||||
local embedsrc = EscapeFragment(
|
||||
"config\n======\n" ..
|
||||
util.dump({
|
||||
plugins = plugins,
|
||||
host = app.host,
|
||||
protocol = app.scheme,
|
||||
convert_assimp_filetypes_in = app.opts.plugin_convert_assimp_filetypes_in,
|
||||
convert_assimp_filetypes_out = app.opts.plugin_convert_assimp_filetypes_out,
|
||||
janusxr_portalroom = app.opts.plugin_janusxr_wrap_video,
|
||||
janusxr_wrap_3dfile = app.opts.plugin_janusxr_wrap_3dfile,
|
||||
janusxr_wrap_video = app.opts.plugin_janusxr_wrap_video,
|
||||
janusxr_wrap_aframe = app.opts.plugin_janusxr_wrap_aframe,
|
||||
janusxr_janusweb_corsproxies = util.split("https://p.janusxr.org https://cors.xrforge.org"," ")
|
||||
})
|
||||
)
|
||||
print([[
|
||||
<text text="Server statistics" position="-3 2.5 0" scale="3 3 3" rotation="0 90 0"/>
|
||||
<paragraph id="encoded" url="/statusz" rotation="0 90 0" use_proxy="false" cull_face='none' position="-3 1 0.7" width="400" height="900" scale="0.6 1.2 1" lighting="false" css=".paragraphcontainer{height:100%; white-space: pre ; display: block; unicode-bidi: embed; border-radius:10px; background:#000; color:#AFF; font-family:monospace; padding:20px;}"/>
|
||||
|
||||
<paragraph id="encoded" rotation="0 90 0" url="data:text/plain,]] .. embedsrc .. [[" use_proxy="false" cull_face='none' position="-3 1 -0.7" width="400" height="900" scale="0.6 1.2 1" lighting="false" css=".paragraphcontainer{height:100%; white-space: pre ; display: block; unicode-bidi: embed; border-radius:10px; background:#000; color:#FAF; font-family:monospace; padding:20px;"/>
|
||||
]])
|
||||
end}
|
||||
|
||||
<object id="cube" rotation="0 45 0" pos="${pos}" scale="2 0.1 2"/> <!-- something to stand on -->
|
||||
{if not defined(item) then
|
||||
print('${janusxr_jml_deco}')
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue