mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 14:41:25 +00:00
edit names of pages and paths for them
This commit is contained in:
@@ -122,27 +122,21 @@ class BlenderNamespace(socketio.AsyncNamespace):
|
|||||||
await sio.emit("theme_data", data, namespace="/web")
|
await sio.emit("theme_data", data, namespace="/web")
|
||||||
|
|
||||||
|
|
||||||
# Attach namespaces
|
async def schedules(request):
|
||||||
sio.register_namespace(WebNamespace("/web"))
|
|
||||||
sio.register_namespace(BlenderNamespace("/blender"))
|
|
||||||
|
|
||||||
|
|
||||||
# Define a route to render the index.html template
|
|
||||||
async def index(request):
|
|
||||||
with open("templates/index.html", "r") as f:
|
with open("templates/index.html", "r") as f:
|
||||||
template = f.read()
|
template = f.read()
|
||||||
html_content = pystache.render(template, {"port": sio_port, "version": bonsai_version})
|
html_content = pystache.render(template, {"port": sio_port, "version": bonsai_version})
|
||||||
return web.Response(text=html_content, content_type="text/html")
|
return web.Response(text=html_content, content_type="text/html")
|
||||||
|
|
||||||
|
|
||||||
async def gantt(request):
|
async def sequencing(request):
|
||||||
with open("templates/gantt.html", "r") as f:
|
with open("templates/gantt.html", "r") as f:
|
||||||
template = f.read()
|
template = f.read()
|
||||||
html_content = pystache.render(template, {"port": sio_port, "version": bonsai_version})
|
html_content = pystache.render(template, {"port": sio_port, "version": bonsai_version})
|
||||||
return web.Response(text=html_content, content_type="text/html")
|
return web.Response(text=html_content, content_type="text/html")
|
||||||
|
|
||||||
|
|
||||||
async def drawings(request):
|
async def documentation(request):
|
||||||
with open("templates/drawings.html", "r") as f:
|
with open("templates/drawings.html", "r") as f:
|
||||||
template = f.read()
|
template = f.read()
|
||||||
html_content = pystache.render(template, {"port": sio_port, "version": bonsai_version})
|
html_content = pystache.render(template, {"port": sio_port, "version": bonsai_version})
|
||||||
@@ -164,12 +158,21 @@ async def on_startup(app):
|
|||||||
json.dump(pids, f, indent=4)
|
json.dump(pids, f, indent=4)
|
||||||
|
|
||||||
|
|
||||||
app.router.add_get("/", index)
|
# Add on startup function
|
||||||
app.router.add_get("/drawings", drawings)
|
app.on_startup.append(on_startup)
|
||||||
app.router.add_get("/gantt", gantt)
|
|
||||||
|
# Attach namespaces
|
||||||
|
sio.register_namespace(WebNamespace("/web"))
|
||||||
|
sio.register_namespace(BlenderNamespace("/blender"))
|
||||||
|
|
||||||
|
# Regsier routes
|
||||||
|
app.router.add_get("/", schedules)
|
||||||
|
app.router.add_get("/documentation", documentation)
|
||||||
|
app.router.add_get("/sequencing", sequencing)
|
||||||
|
|
||||||
|
# Add static files
|
||||||
app.router.add_static("/jsgantt/", path="../gantt", name="jsgantt")
|
app.router.add_static("/jsgantt/", path="../gantt", name="jsgantt")
|
||||||
app.router.add_static("/static/", path="./static", name="static")
|
app.router.add_static("/static/", path="./static", name="static")
|
||||||
app.on_startup.append(on_startup)
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|||||||
@@ -54,12 +54,12 @@
|
|||||||
<a href="/"><i class="fa-solid fa-table"></i> Schedules</a>
|
<a href="/"><i class="fa-solid fa-table"></i> Schedules</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="/gantt"
|
<a href="/sequencing"
|
||||||
><i class="fa-solid fa-chart-gantt"></i> Construction Sequencing</a
|
><i class="fa-solid fa-chart-gantt"></i> Construction Sequencing</a
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="drawings" class="active"
|
<a href="/documentation" class="active"
|
||||||
><i class="fa-solid fa-images"></i> Documentation</a
|
><i class="fa-solid fa-images"></i> Documentation</a
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -36,12 +36,12 @@
|
|||||||
<a href="/"><i class="fa-solid fa-table"></i> Schedules</a>
|
<a href="/"><i class="fa-solid fa-table"></i> Schedules</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="/gantt" class="active"
|
<a href="/sequencing" class="active"
|
||||||
><i class="fa-solid fa-chart-gantt"></i> Construction Sequencing</a
|
><i class="fa-solid fa-chart-gantt"></i> Construction Sequencing</a
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="drawings"
|
<a href="/documentation"
|
||||||
><i class="fa-solid fa-images"></i> Documentation</a
|
><i class="fa-solid fa-images"></i> Documentation</a
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -45,12 +45,12 @@
|
|||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="/gantt"
|
<a href="/sequencing"
|
||||||
><i class="fa-solid fa-chart-gantt"></i> Construction Sequencing</a
|
><i class="fa-solid fa-chart-gantt"></i> Construction Sequencing</a
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="drawings"
|
<a href="/documentation"
|
||||||
><i class="fa-solid fa-images"></i> Documentation</a
|
><i class="fa-solid fa-images"></i> Documentation</a
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -1542,7 +1542,7 @@ class Sequence(bonsai.core.tool.Sequence):
|
|||||||
cls, task_json: list[dict[str, Any]], work_schedule: ifcopenshell.entity_instance
|
cls, task_json: list[dict[str, Any]], work_schedule: ifcopenshell.entity_instance
|
||||||
) -> None:
|
) -> None:
|
||||||
if not bpy.context.scene.WebProperties.is_connected:
|
if not bpy.context.scene.WebProperties.is_connected:
|
||||||
bpy.ops.bim.connect_websocket_server(page="gantt")
|
bpy.ops.bim.connect_websocket_server(page="sequencing")
|
||||||
gantt_data = {"tasks": task_json, "work_schedule": work_schedule.get_info(recursive=True)}
|
gantt_data = {"tasks": task_json, "work_schedule": work_schedule.get_info(recursive=True)}
|
||||||
tool.Web.send_webui_data(data=gantt_data, data_key="gantt_data", event="gantt_data")
|
tool.Web.send_webui_data(data=gantt_data, data_key="gantt_data", event="gantt_data")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user