optimized scanner
This commit is contained in:
parent
75c69332e1
commit
e34a87d475
11 changed files with 73 additions and 32 deletions
2
run.sh
2
run.sh
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/sh
|
||||
source ./.env
|
||||
rebuild
|
||||
DEBUG=1 result/bin/xrforge.com -c 0 "$@"
|
||||
DEBUG=1 result/bin/xrforge.com -c 0 "$@" --nobrowser
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ app = require("soakbean") {
|
|||
forkpids = {},
|
||||
cmd={
|
||||
help = {file="cmd/help.lua", info="display all possible flags"},
|
||||
server = {file="cmd/server.lua", info="starts the webserver"},
|
||||
server = {file="cmd/server.lua", info="starts the webserver [without --nobrowser]"},
|
||||
admin = {file="cmd/server.lua", info="launch adminpanel to configure stuff (/admin)"},
|
||||
createplugin = {file="cmd/createplugin.lua", info="generates skeleton plugin"},
|
||||
generate = {file="cmd/generate.lua", info="generate www-folder with XR experiences"},
|
||||
|
|
|
|||
|
|
@ -1,8 +1,12 @@
|
|||
local util = require('util')
|
||||
|
||||
return function(app,argv)
|
||||
print("starting server")
|
||||
if arg[1] == 'admin' then
|
||||
LaunchBrowser('/admin')
|
||||
else
|
||||
LaunchBrowser('/')
|
||||
if not util.contains(arg,"--nobrowser") then
|
||||
if arg[1] == 'admin' then
|
||||
LaunchBrowser('/admin')
|
||||
else
|
||||
LaunchBrowser('/')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -155,6 +155,7 @@ form > table > tbody > tr > td:nth-child(3) {
|
|||
background:#224;
|
||||
}
|
||||
pre{
|
||||
line-height:initial !important;
|
||||
font-family: monospace;
|
||||
line-height: 1;
|
||||
word-spacing: normal;
|
||||
|
|
|
|||
|
|
@ -262,7 +262,7 @@ div.tab-frame > input#info:checked ~ .info{
|
|||
left:5%;
|
||||
right:5%;
|
||||
max-height:60vh;
|
||||
padding:0px 30px 30px 30px;
|
||||
padding:30px 30px 30px 30px;
|
||||
background:#112e;
|
||||
z-index:1000;
|
||||
overflow:hidden;
|
||||
|
|
|
|||
|
|
@ -92,16 +92,48 @@ div#xrecosystem{
|
|||
</header>
|
||||
|
||||
<h3>What is it</h3>
|
||||
An open, seamless XR web built from simple URLs and directories, without gatekeepers.<br>
|
||||
|
||||
XRForge is a little VR/AR utility, which projects directories from (remote) filesystems into 3D, allowing users to 'surf' the deep immersive web, of experiences (3d files) and portal-rooms (directories).
|
||||
XRForge transforms standard local or remote file directories into interconnected 3D spaces. Users can seamlessly "surf" the spatial web, turning everyday directories into gateways and portals.
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<br>
|
||||
<div class="margin1">
|
||||
<pre class="secondary">
|
||||
|
||||
┌───────────────────────────────────┐ ┌──────────────────────────────────────────┐
|
||||
│ local disk │ │ Surf via 3D portals │
|
||||
├───────────────────────────────────┤ └──────────────────────────────────────────┘
|
||||
│ │
|
||||
│ /myverse │ https://my.org/myverse
|
||||
│ /elearnings │ https://my.org/myverse/elearnings
|
||||
│ /elearning1/1.glb │ https://my.org/myverse/elearning/elearning1
|
||||
│ /elearning2/2.glb │ https://my.org/myverse/elearning/elearning2
|
||||
│ │
|
||||
│ ┌──────────────────────────────┐ │
|
||||
│ │ github / webdav / dropbox etc│ │
|
||||
│ │ │ │
|
||||
│ │ /mygames │ │ https://my.org/myverse/mygames
|
||||
│ │ /biggusgateWebXR │ │ https://my.org/myverse/mygames/biggusgate
|
||||
│ │ /spasca │ │ https://my.org/myverse/mygames/spasca
|
||||
│ │ /otherxrforge │ │ https://my.org/myverse/otherxrforge
|
||||
│ │ │ │
|
||||
│ │ ┌───────────┐ ┌───────────┐ │ │
|
||||
│ │ │/manyfold │ │archive.org│ │ │ https://my.org/myverse/manyfold
|
||||
│ │ └───────────┘ └───────────┘ │ │ https://my.org/myverse/myarchive
|
||||
│ │ │ │
|
||||
│ │ +40 integrations! │ │
|
||||
│ └──────────────────────────────┘ │
|
||||
└───────────────────────────────────┘
|
||||
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<h3>Why people want XRForge</h3>
|
||||
|
||||
<div>
|
||||
In short: a hyperscalable portal-system and <b>projection</b> of existing 2D ecosystems <b>into XR.</b><br>
|
||||
XRForge interconnects experiences via portals, according to the <a href="https://coderofsalvation.github.io/janus-guide/" target="_blank">JanusXR</a> and <a href="https://xrfragment.org" target="_blank">XR Fragments standard</a>.<br>
|
||||
In short: hyperscalability (it uses web URLs) PLUS <b>portal-system</b> and <b>projection</b> of existing 2D ecosystems <b>into XR.</b><br>
|
||||
XRForge interconnects XR experiences via portals, thanks to <a href="https://coderofsalvation.github.io/janus-guide/" target="_blank">JanusXR</a> and <a href="https://xrfragment.org" target="_blank">XR Fragments standards</a>.<br>
|
||||
The metaverse has shown: people <b>like 3D</b> but certain <b>existing</b> 2D ecosystems are king.<br>
|
||||
They're just more cost-efficient to use.<br>
|
||||
Hence, XRForge incorporates the opensource <a href="https://coderofsalvation.github.io/janus-guide/" target="_blank">JanusXR</a>-client called <a href="https://github.com/jbaicoianu/janusweb" target="_blank">JanusWeb</a>, which promotes <b>projecting these ecosystems</b> as virtual <b>hyperlinked</b> worlds (via XR translators).<br>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ end}
|
|||
local item = items[i]
|
||||
local icon = 'list-tree'
|
||||
local thumbnail = ''
|
||||
if #item.thumbnail > 0 then thumbnail = 'style="background-image: url(' .. item.thumbnail .. ');"' end
|
||||
if #item.thumbnail > 0 then thumbnail = 'style="background-image: url(' .. EscapeFragment(item.thumbnail) .. ');"' end
|
||||
if item.view3D or item.portal3D == false then icon = 'play' end
|
||||
print([[
|
||||
<div class="tile">
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ return {
|
|||
end
|
||||
|
||||
-- add items from dir
|
||||
if match(v.parent.path, matchpath) then
|
||||
if match(v.parent.path, matchpath) and (v.dir or v.view3D) then
|
||||
local parent = app.cache.items[ v.parent.id ]
|
||||
res.items[ v.id ] = v
|
||||
res.parent = parent
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ return {
|
|||
path = scandir,
|
||||
url = "/" .. util.stripPath(scandir),
|
||||
name = scandir:gsub(".*/",""),
|
||||
title = scandir:gsub(".*/",""),
|
||||
title = scandir:gsub(".*/",""):gsub("-"," "),
|
||||
file = { ino = scandir },
|
||||
id = scandir
|
||||
}
|
||||
|
|
@ -57,9 +57,11 @@ return {
|
|||
-- cleanup file handles
|
||||
foreach( app.cache.items, function(k,v)
|
||||
-- remove file attributes (which are closed already)
|
||||
v.file.stat = nil
|
||||
v.file.attr = nil
|
||||
v.file.state = nil
|
||||
if v.file then
|
||||
v.file.stat = nil
|
||||
v.file.attr = nil
|
||||
v.file.state = nil
|
||||
end
|
||||
end)
|
||||
end,
|
||||
|
||||
|
|
@ -73,7 +75,7 @@ return {
|
|||
path = fullpath,
|
||||
url = "/" .. util.stripPath(fullpath),
|
||||
name = name,
|
||||
title = name,
|
||||
title = name:gsub("-"," "),
|
||||
sidecarfile = {},
|
||||
thumbnail = '',
|
||||
tag = {},
|
||||
|
|
@ -82,22 +84,14 @@ return {
|
|||
}
|
||||
experience.parent = parent
|
||||
|
||||
-- check for thumbnail
|
||||
local thumbExt = {"png","jpg","webp"}
|
||||
foreach( thumbExt, function(k,ext)
|
||||
local thumbnailFile = fullpath .. "/" .. name .. "." .. ext
|
||||
if util.fileExist( thumbnailFile ) then
|
||||
print("✅ └─ plugin/diskscan: detected .".. ext:lower() .. " thumbnail file")
|
||||
experience.thumbnail = "/" .. util.stripPath(thumbnailFile)
|
||||
end
|
||||
end)
|
||||
|
||||
if seen[ino] then return end -- dont process dirs/files twice
|
||||
|
||||
if (kind == unix.DT_LNK) then
|
||||
local stat, err = unix.stat(fullpath)
|
||||
experience.id_target = stat:ino()
|
||||
seen.symlinks[ ino ] = experience
|
||||
if stat then
|
||||
experience.id_target = stat:ino()
|
||||
seen.symlinks[ ino ] = experience
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
|
|
@ -110,6 +104,16 @@ return {
|
|||
experience.portal3D = true -- can be viewed as 3d portal
|
||||
app.pub("scan_experience", nil, experience)
|
||||
app.cache.items[ino] = experience
|
||||
-- check for directory thumbnail sidecarfile
|
||||
local thumbExt = {"png","jpg","webp"}
|
||||
foreach( thumbExt, function(k,ext)
|
||||
local thumbnailFile = fullpath .. '.' .. ext
|
||||
if util.fileExist( thumbnailFile ) then
|
||||
experience.thumbnail = "/" .. util.stripPath(thumbnailFile)
|
||||
print("✅ └─ plugin/diskscan: detected .".. ext:lower() .. " thumbnail file: " .. thumbnailFile)
|
||||
end
|
||||
end)
|
||||
-- scan children
|
||||
me.scanDir(fullpath,experience,seen,symlinks)
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ end)
|
|||
|
||||
app.on('scan_experience_file', function(exp)
|
||||
local size = exp.file.attr:size()
|
||||
if size < 1000 then -- skip large binary files
|
||||
if size < 100000 then -- skip large binary files > 100kb
|
||||
local data = util.readfile( exp.file.fullpath)
|
||||
if data then
|
||||
if data:match(pattern_fireboxroom) then
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ app.on('scan_experience_file', function(exp)
|
|||
end)
|
||||
-- set thumbnail if any
|
||||
if exp.sidecarfile.png then
|
||||
exp.thumnbail = exp.sidecarfile.png
|
||||
exp.thumbnail = exp.sidecarfile.png
|
||||
end
|
||||
local jsonfile = exp.path:gsub("."..ext.."$",".json")
|
||||
-- scan for hrefs in json sidecarfile
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue