Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Benedikt Strehle committed Mar 1, 2024
1 parent 7852d09 commit 746a4bc
Show file tree
Hide file tree
Showing 12 changed files with 93 additions and 70 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/uix-deploy-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This file was auto generated by the uix git_deploy plugin. Do not manually edit.

name: Deploy prod
on: push
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: "actions/checkout@v3"
- name: Setup Deno
uses: "denoland/setup-deno@v1"
- name: Run Tests
run: "deno run -Aq --import-map ./importmap.json https://cdn.unyt.org/unyt-tests/run.ts -s --reportfile testreport.xml"
- name: Publish Test Report
uses: "mikepenz/action-junit-report@v3"
if: "success() || failure()"
with:
report_paths: testreport.xml
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: "actions/checkout@v3"
- name: Setup Deno
uses: "denoland/setup-deno@v1"
- name: Deploy UIX App
run: "deno run --importmap ./importmap.json -Aqr https://dev.cdn.unyt.org/uix1/run.ts --stage prod --detach "
needs: test
8 changes: 7 additions & 1 deletion app.dx
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
name: "Hello UIX",
description: "A simple UIX app project"
description: "A simple UIX app project";

plugin git_deploy (
prod: {
on: "push"
}
)
9 changes: 9 additions & 0 deletions backend/.dx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
use stage from #public.uix;

endpoint: stage {
prod: @+example-video-call-1
},

location: stage {
prod: @+unyt-host-1
}
17 changes: 0 additions & 17 deletions backend/entrypoint.ts
Original file line number Diff line number Diff line change
@@ -1,17 +0,0 @@
/**
* Backend entrypoint:
* This module provides a default export that defines the UI that is returned from the backend
* when a page is visited
*/

import {provideRedirect} from "uix/html/entrypoint-providers.tsx"

export default {

// show backend (hybrid) rendered page on /backend
'/backend': import("../common/page.tsx"),

// redirect / to /backend
'/': provideRedirect('/backend')

}
Empty file added common/CallView.css
Empty file.
34 changes: 34 additions & 0 deletions common/CallView.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { Endpoint, Target } from "unyt_core/types/addressing.ts";
import { Component } from "uix/components/Component.ts";


@endpoint class CallManager {
@property static call(mediaStream: MediaStream) {
console.log("call from " + datex.meta.sender, mediaStream)
}
}


@template(async function () {

const src = null//await navigator.mediaDevices.getUserMedia({ video: true, audio: true });
console.log("src", src);

return <div>
<p>Video Call</p>
<input type="text" placeholder="Remote Endpoint" value={this.$.remoteEndpointName}/>
<button onclick={()=>{
const endpoint = Endpoint.get(this.remoteEndpointName);
CallManager.call.to(endpoint)(src);
}}>Call</button>

<div>
<video id="ownVideo" src={src} />
<video id="remoteVideo" />
</div>

</div>
})
export class CallView extends Component {
@property remoteEndpointName = ""
}
16 changes: 0 additions & 16 deletions common/page.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
"deno.window"
]
}
}
}
17 changes: 0 additions & 17 deletions frontend/entrypoint.scss

This file was deleted.

10 changes: 0 additions & 10 deletions frontend/entrypoint.ts

This file was deleted.

3 changes: 3 additions & 0 deletions frontend/entrypoint.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { CallView } from "common/CallView.tsx";

export default <CallView/>
16 changes: 8 additions & 8 deletions importmap.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"imports": {
"datex-core-legacy": "https://cdn.unyt.org/datex-core-js-legacy@0.0.x/datex.ts",
"datex-core-legacy/": "https://cdn.unyt.org/datex-core-js-legacy@0.0.x/",
"unyt_core": "https://cdn.unyt.org/datex-core-js-legacy@0.0.x/datex.ts",
"unyt_core/": "https://cdn.unyt.org/datex-core-js-legacy@0.0.x/",
"uix": "https://cdn.unyt.org/uix@0.1.x/uix.ts",
"uix/": "https://cdn.unyt.org/uix@0.1.x/src/",
"uix/jsx-runtime": "https://cdn.unyt.org/uix@0.1.x/src/jsx-runtime/jsx.ts",
"unyt-tests/": "https://cdn.unyt.org/unyt_tests/"
"datex-core-legacy": "https://dev.cdn.unyt.org/unyt_core/datex.ts",
"datex-core-legacy/": "https://dev.cdn.unyt.org/unyt_core/",
"unyt_core": "https://dev.cdn.unyt.org/unyt_core/datex.ts",
"unyt_core/": "https://dev.cdn.unyt.org/unyt_core/",
"uix": "https://dev.cdn.unyt.org/uix1/uix.ts",
"uix/": "https://dev.cdn.unyt.org/uix1/src/",
"uix/jsx-runtime": "https://dev.cdn.unyt.org/uix1/src/jsx-runtime/jsx.ts",
"unyt-tests/": "https://dev.cdn.unyt.org/unyt_tests/"
}
}

0 comments on commit 746a4bc

Please sign in to comment.