mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-03-03 02:48:32 -06:00
Introduce ability to configure ports etc for external applications. (#785)
Introduce ability to configure ports etc for external applications, including webgui
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
local guiCustomization = asset.require('customization/gui')
|
||||
|
||||
-- Select which commit hashes to use for the frontend and backend
|
||||
local frontendHash = "f6db6a5dd79df1e310a75d50f8b1f97aea8a9596"
|
||||
local backendHash = "3e862a67ff2869d83187ad8bda05746b583d13d4"
|
||||
local frontendHash = "abf5fe23ef29af408d6c071057f1cc706c9b09a3"
|
||||
local backendHash = "6e773425b3e90ba93f0090e44427e474fe5c633f"
|
||||
|
||||
local dataProvider = "data.openspaceproject.com/files/webgui"
|
||||
|
||||
@@ -10,7 +10,7 @@ local backend = asset.syncedResource({
|
||||
Identifier = "WebGuiBackend",
|
||||
Name = "Web Gui Backend",
|
||||
Type = "UrlSynchronization",
|
||||
Url = dataProvider .. "/backend/" .. backendHash .. "/backend.js"
|
||||
Url = dataProvider .. "/backend/" .. backendHash .. "/backend.zip"
|
||||
})
|
||||
|
||||
local frontend = asset.syncedResource({
|
||||
@@ -26,14 +26,21 @@ asset.onInitialize(function ()
|
||||
if not openspace.directoryExists(dest) then
|
||||
openspace.unzipFile(frontend .. "/frontend.zip", dest, true)
|
||||
end
|
||||
|
||||
-- Unzip the frontend bundle
|
||||
dest = backend .. "/backend"
|
||||
if not openspace.directoryExists(dest) then
|
||||
openspace.unzipFile(backend .. "/backend.zip", dest, true)
|
||||
end
|
||||
|
||||
-- Do not serve the files if we are in webgui development mode.
|
||||
-- In that case, you have to serve the webgui manually, using `npm start`.
|
||||
if not guiCustomization.webguiDevelopmentMode then
|
||||
openspace.setPropertyValueSingle(
|
||||
"Modules.WebGui.ServerProcessEntryPoint", backend .. "/backend.js"
|
||||
"Modules.WebGui.ServerProcessEntryPoint", backend .. "/backend/backend.js"
|
||||
)
|
||||
openspace.setPropertyValueSingle(
|
||||
"Modules.WebGui.ServerProcessWorkingDirectory", frontend .. "/frontend"
|
||||
"Modules.WebGui.WebDirectory", frontend .. "/frontend"
|
||||
)
|
||||
openspace.setPropertyValueSingle("Modules.WebGui.ServerProcessEnabled", true)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user