Skip to content

Commit

Permalink
core: fix checkbox ui
Browse files Browse the repository at this point in the history
  • Loading branch information
koush committed Apr 3, 2023
1 parent 0b0e90f commit 9b5ea27
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
4 changes: 2 additions & 2 deletions plugins/core/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 plugins/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scrypted/core",
"version": "0.1.105",
"version": "0.1.106",
"description": "Scrypted Core plugin. Provides the UI, websocket, and engine.io APIs.",
"author": "Scrypted",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion plugins/core/ui/src/interfaces/Charger.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</template>

<script>
import { ChargeState } from '@scrypted/sdk';
import { ChargeState } from '@scrypted/types';
import RPCInterface from "./RPCInterface.vue";
export default {
Expand Down
19 changes: 15 additions & 4 deletions plugins/core/ui/src/interfaces/Setting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@
</template>
</DevicePicker>
<DevicePicker v-else-if="lazyValue.type === 'interface'" v-model="lazyValue.value" :multiple="lazyValue.multiple"
:readonly="lazyValue.readonly" :devices="interfaces" :title="lazyValue.title"
:description="lazyValue.description">
:readonly="lazyValue.readonly" :devices="interfaces" :title="lazyValue.title" :description="lazyValue.description">
<template v-slot:append-outer>
<v-btn v-if="dirty && device" color="success" @click="save" class="shift-up">
<v-icon>send</v-icon>
Expand All @@ -52,7 +51,7 @@
<div v-else-if="lazyValue.type === 'clippath'" class="mb-2">
<v-btn small block @click="editZone">{{ lazyValue.title }} </v-btn>
<Camera :value="device" :device="device" :clipPathValue="sanitizedClipPathValue" :showDialog="editingZone"
:hidePreview="true" @dialog="editingZoneChanged" @clipPath="lazyValue.value = $event"></Camera>
:hidePreview="true" @dialog="editingZoneChanged" @clipPath="updateClipPath"></Camera>
</div>
<v-textarea v-else-if="lazyValue.type === 'textarea'" v-model="lazyValue.value" outlined persistent-hint
:hint="lazyValue.description" :label="lazyValue.title">
Expand Down Expand Up @@ -88,6 +87,7 @@ export default {
data() {
return {
editingZone: false,
clipPathThrottle: null,
};
},
watch: {
Expand Down Expand Up @@ -142,7 +142,7 @@ export default {
);
},
set(val) {
this.lazyValue.value = val.toString();
this.lazyValue.value = !!val;
},
},
dirty() {
Expand Down Expand Up @@ -228,6 +228,17 @@ export default {
},
methods: {
onChange() { },
updateClipPath(e) {
clearTimeout(this.clipPathThrottle);
this.clipPathThrottle = setTimeout(() => {
// this.lazyValue.value = e;
this.rpc().putSetting(
this.lazyValue.key,
this.createInputValue().value
);
this.onInput();
}, 500)
},
editingZoneChanged(value) {
this.editingZone = value;
if (!value) {
Expand Down

0 comments on commit 9b5ea27

Please sign in to comment.