From 0c691cdefb5a74364585a23f6ffdfd55a89dd9f7 Mon Sep 17 00:00:00 2001 From: Anton Franzluebbers Date: Wed, 26 Jul 2023 12:17:37 -0400 Subject: [PATCH] simplify deploy actions, make static velconnect url available, smaller bugs --- ...deploy_oracle_v3.yml => deploy_oracle.yml} | 2 +- .github/workflows/deploy_oracle_v2.yml | 20 ------------------- .github/workflows/publish_cloudflare.yml | 1 - unity_package/Runtime/VELConnectManager.cs | 1 + unity_package/package.json | 2 +- velconnect-svelte-npm/package.json | 2 +- velconnect-svelte-npm/src/index.ts | 4 +++- 7 files changed, 7 insertions(+), 25 deletions(-) rename .github/workflows/{deploy_oracle_v3.yml => deploy_oracle.yml} (93%) delete mode 100644 .github/workflows/deploy_oracle_v2.yml diff --git a/.github/workflows/deploy_oracle_v3.yml b/.github/workflows/deploy_oracle.yml similarity index 93% rename from .github/workflows/deploy_oracle_v3.yml rename to .github/workflows/deploy_oracle.yml index 9a8de9d..9ebbf0c 100644 --- a/.github/workflows/deploy_oracle_v3.yml +++ b/.github/workflows/deploy_oracle.yml @@ -2,7 +2,7 @@ name: Deploy to VelNet Oracle server (Pocketbase edition) on: push: - branches: ["feature/pocketbase-server"] + branches: ["main"] paths: ["velconnect/**"] jobs: run_pull: diff --git a/.github/workflows/deploy_oracle_v2.yml b/.github/workflows/deploy_oracle_v2.yml deleted file mode 100644 index bfcb029..0000000 --- a/.github/workflows/deploy_oracle_v2.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Deploy to VelNet Oracle server - -on: - push: - branches: ["main"] - paths: ["velconnect/**"] -jobs: - run_pull: - name: Pull new version - runs-on: ubuntu-latest - steps: - - name: install ssh keys - run: | - install -m 600 -D /dev/null ~/.ssh/id_rsa - echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa - ssh-keyscan -H ${{ secrets.SSH_HOST }} > ~/.ssh/known_hosts - - name: connect and pull - run: ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "cd /home/ubuntu/VEL-Connect-v2/velconnect && git pull && docker compose up -d --build && exit" - - name: cleanup - run: rm -rf ~/.ssh diff --git a/.github/workflows/publish_cloudflare.yml b/.github/workflows/publish_cloudflare.yml index 27fc5a6..a69f7c5 100644 --- a/.github/workflows/publish_cloudflare.yml +++ b/.github/workflows/publish_cloudflare.yml @@ -3,7 +3,6 @@ env: on: push: - branches: ["feature/pocketbase-server"] paths: ["example_dashboard/**"] jobs: diff --git a/unity_package/Runtime/VELConnectManager.cs b/unity_package/Runtime/VELConnectManager.cs index dfa319a..2bdab21 100644 --- a/unity_package/Runtime/VELConnectManager.cs +++ b/unity_package/Runtime/VELConnectManager.cs @@ -19,6 +19,7 @@ namespace VELConnect public class VELConnectManager : MonoBehaviour { public string velConnectUrl = "http://localhost"; + public static string VelConnectUrl => instance.velConnectUrl; private static VELConnectManager instance; public class State diff --git a/unity_package/package.json b/unity_package/package.json index c0f94a6..bbf7a92 100644 --- a/unity_package/package.json +++ b/unity_package/package.json @@ -1,7 +1,7 @@ { "name": "edu.uga.engr.vel.vel-connect", "displayName": "VEL-Connect", - "version": "2.0.2", + "version": "2.0.3", "unity": "2019.1", "description": "Web-based configuration for VR applications", "keywords": [], diff --git a/velconnect-svelte-npm/package.json b/velconnect-svelte-npm/package.json index 3b9eb18..81d8484 100644 --- a/velconnect-svelte-npm/package.json +++ b/velconnect-svelte-npm/package.json @@ -1,6 +1,6 @@ { "name": "@velaboratory/velconnect-svelte", - "version": "1.0.3", + "version": "1.0.4", "description": "Use VEL-Connect with a Svelte dashboard", "main": "src/index.js", "files": [ diff --git a/velconnect-svelte-npm/src/index.ts b/velconnect-svelte-npm/src/index.ts index 27e814a..9d446d5 100644 --- a/velconnect-svelte-npm/src/index.ts +++ b/velconnect-svelte-npm/src/index.ts @@ -29,6 +29,7 @@ export interface Device extends Record { current_room: string; current_app: string; pairing_code: string; + last_online: string; data: string; expand: { data?: DataBlock }; } @@ -229,7 +230,6 @@ export async function pair(pairingCode: string) { .getFirstListItem(`pairing_code="${pairingCode}"`)) as Device; // add it to the local data - currentDeviceId.set(device.id); if (!get(pairedDevices).includes(device.id)) { pairedDevices.set([...get(pairedDevices), device.id]); } @@ -262,6 +262,8 @@ export async function pair(pairingCode: string) { await pb.collection("Users").update(u.id, u); } + currentDeviceId.set(device.id); + return { error: null }; } catch (e) { console.error("Not found: " + e);