Skip to content

Commit

Permalink
render markup but hide video containers with css
Browse files Browse the repository at this point in the history
  • Loading branch information
mrloureed committed Oct 17, 2022
1 parent b67b404 commit eea5d35
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 26 deletions.
14 changes: 7 additions & 7 deletions web/frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion web/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"@rollup/plugin-alias": "^3.1.9",
"@rollup/plugin-commonjs": "^22.0.2",
"@rollup/plugin-node-resolve": "^14.1.0",
"@viamrobotics/prime": "0.0.69",
"@viamrobotics/prime": "0.0.71",
"@viamrobotics/rpc": "^0.1.23",
"@vitejs/plugin-vue": "^3.1.0",
"@vueuse/core": "^8.9.4",
Expand Down
1 change: 1 addition & 0 deletions web/frontend/src/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,7 @@ let baseCameraState = new Map<string, boolean>();

const updatedBaseCameraState = (e: Map<string, boolean>) => {
baseCameraState = e;
console.log('baseCameraState', baseCameraState);
};

onMounted(async () => {
Expand Down
27 changes: 15 additions & 12 deletions web/frontend/src/components/base.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { grpc } from '@improbable-eng/grpc-web';
import { ref } from 'vue';
import { ref, onMounted } from 'vue';
import { computeKeyboardBaseControls, BaseControlHelper } from '../rc/control_helpers';
import baseApi from '../gen/proto/api/component/base/v1/base_pb.esm';
import commonApi from '../gen/proto/api/common/v1/common_pb.esm';
Expand Down Expand Up @@ -42,6 +42,18 @@ const speed = ref(200);
const spinSpeed = ref(90);
const angle = ref(0);
let videoStreamStates = new Map<string, boolean>();
const resetStreamState = () => {
for (var value of filterResources(props.resources, 'rdk', 'component', 'camera')) {
videoStreamStates.set(value.name, false);
}
}
onMounted(() => {
resetStreamState();
})
const resetDiscreteState = () => {
movementMode.value = 'Straight';
movementType.value = 'Continuous';
Expand Down Expand Up @@ -131,16 +143,6 @@ const baseRun = () => {
}
};
let videoStreamStates = new Map<string, boolean>();
const resetStreamState = () => {
for (var value of filterResources(props.resources, 'rdk', 'component', 'camera')) {
videoStreamStates.set(value.name, false);
}
}
resetStreamState();
const viewPreviewCamera = async (name: string) => {
for (let [key, value] of videoStreamStates) {
const streamContainers = document.querySelectorAll(`[data-stream="${key}"]`);
Expand Down Expand Up @@ -217,7 +219,7 @@ const handleTabSelect = (tab: Tabs) => {
class="h-auto p-4"
>
<div class="grid grid-cols-2">
<div class="mt-2">
<div>
<KeyboardInput
:name="name"
@keyboard-ctl="baseKeyboardCtl(name, $event)"
Expand All @@ -228,6 +230,7 @@ const handleTabSelect = (tab: Tabs) => {
class="mb-4"
variant="multiple"
placeholder="Select Cameras"
aria-label="Select Cameras"
:options="
filterResources(resources, 'rdk', 'component', 'camera')
.map(({ name }) => name)
Expand Down
2 changes: 1 addition & 1 deletion web/frontend/src/components/camera.vue
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ const exportScreenshot = (cameraName: string) => {
</div>
</div>
<div
v-if="camera"
:data-stream="props.cameraName"
:class="{ 'hidden': !camera }"
class="clear-both h-fit transition-all duration-300 ease-in-out"
/>
</div>
Expand Down
6 changes: 2 additions & 4 deletions web/frontend/src/components/keyboard-input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,14 @@ onClickOutside(root, () => {
class="h-23 flex w-full flex-col items-center"
>
<div
class="flex gap-2 pb-4"
class="flex gap-2 pb-4 w-48"
@click="toggleKeyboard"
>
<v-switch
:label="isActive ? 'Keyboard Enabled' : 'Keyboard Disabled'"
class="pr-4"
:value="isActive ? 'on' : 'off'"
/>
<h3>
Keyboard {{ isActive ? 'active' : 'disabled' }}
</h3>
</div>
<div
v-for="(lineKeys, index) in keysLayout"
Expand Down
2 changes: 1 addition & 1 deletion web/runtime-shared/static/prime.css

Large diffs are not rendered by default.

0 comments on commit eea5d35

Please sign in to comment.