Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
adnanwahab committed Oct 11, 2024
1 parent d967945 commit 48b2428
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 6 deletions.
5 changes: 4 additions & 1 deletion js/bun-livekit-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ const wsUrl = "wss://omnissiah-university-kmuz0plz.livekit.cloud";

async function connect_to_livekit(options) {
console.log("options", options);
if (!options.identity) throw new Error("requester must have an identity");
//if (!options.identity) throw new Error("requester must have an identity");
if (!options.identity) {
options.identity = 'anonymous' + Math.random().toString(36).substring(2, 15);
}
const token = new AccessToken(apiKey, apiSecret, {
identity: options.identity,
});
Expand Down
8 changes: 6 additions & 2 deletions js/robotics-odyssey-backend.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ const observable_links = {
//"worrydream": "https://observablehq.com/embed/@roboticsuniversity/worrydream?cell=*",
//"dynamicland.org": "https://observablehq.com/embed/@roboticsuniversity/dynamicland.org?cell=*",
dynamicland: "https://observablehq.com/embed/@roboticsuniversity/dynamicland?cell=*",
livekit: "https://observablehq.com/embed/@roboticsuniversity/livekit?cell=*",
"livekit_subscriber": "https://observablehq.com/embed/@roboticsuniversity/livekit?cell=*",
// "livekit_subscriber": "https://observablehq.com/embed/@roboticsuniversity/livekit-robotics-tele-guidance?cell=*",

alan_how:
"https://observablehq.com/embed/@roboticsuniversity/alan-how?cell=*",
hardware: "https://observablehq.com/embed/@roboticsuniversity/robotics-hardware?cell=*",
Expand Down Expand Up @@ -59,7 +61,9 @@ function stubObservable(name) {
// learn react

function observable_template(name) {

if (name === 'livekit') {
return stubObservable(name)
}

const _ = observable_links[name];
if (!_) {
Expand Down
6 changes: 6 additions & 0 deletions pkg/utils/rendering.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,14 @@ func SetupRendering(e *echo.Echo) {
})
e.GET("/office-hours", func(c echo.Context) error {
fmt.Println("cgi page", "hi")
// headless ui
return c.Render(http.StatusOK, "office-hours.html", nil)
})

e.POST("/signup", func(c echo.Context) error {
fmt.Println("signup page", "hi")
return c.Render(http.StatusOK, "signup.html", nil)
})
}

// func getFilePaths(pattern string) ([]string, error) {
Expand Down
Binary file modified tmp/main
Binary file not shown.
16 changes: 13 additions & 3 deletions views/odyssey/1_tele_guidance.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
<!-- -->
<!-- https://observablehq.com/@roboticsuniversity/collaborative-ui-twitch-plays-robot -->
<!-- retool - study - them - anything dataregl -->

<style>
.tele-guidance-livekit {
height: 800px;
}

.tele-guidance-voxels {
width: 600px;
}
</style>
{{define "tele-guidance-frame"}}
<iframe src="http://localhost:3003/{{.}}" class="h-80 w-full"></iframe>
<iframe src="http://localhost:3003/{{.}}" class="tele-guidance-{{.}} h-80 w-full"></iframe>
{{end}}

<div class="mx-auto max-w-2xl px-6 lg:max-w-7xl lg:px-8">
Expand All @@ -20,7 +30,7 @@
>
<div id="livekit-container" class="h-80 w-full">
<!-- <img src="https://files.hashirama.blog/static/blog/5.png" class="h-80 w-full" /> -->
{{template "tele-guidance-frame" "livekit"}}
{{template "tele-guidance-frame" "livekit_subscriber"}}
</div>

</div>
Expand All @@ -47,7 +57,7 @@
class="overflow-hidden rounded-lg bg-gray-800 ring-1 ring-white/15 max-lg:rounded-b-[2rem] lg:rounded-br-[2rem]"
>
{{template "tele-guidance-frame" "voxels"}}
<iframe style="width: 600px; " class="iframe-container" src="https://observablehq.com/embed/@roboticsuniversity/voxels-diffusion-policy-3d?cell=*"></iframe>
<!-- <iframe style="width: 600px; " class="iframe-container" src="https://observablehq.com/embed/@roboticsuniversity/voxels-diffusion-policy-3d?cell=*"></iframe> -->
</div>
</div>
</div>
Expand Down

0 comments on commit 48b2428

Please sign in to comment.