修复本地信号源修改失败的BUG

This commit is contained in:
fangxiang 2021-12-28 15:24:51 +08:00
parent 923dce1c87
commit 1a542b50a7
8 changed files with 59 additions and 83 deletions

View File

@ -39,7 +39,6 @@ export default defineComponent({
} catch {}
};
setInterval(refreshFanTemp, 1000 * 3);
refreshFanTemp();
return {};
},

View File

@ -138,7 +138,7 @@
<q-input
type="number"
v-model="props.row.value"
min="180"
:min="min_delay"
dense
autofocus
>
@ -347,6 +347,8 @@ const getEWeekDays = (str: string) => {
}
};
const __MIN_DELAY = 10;
export default defineComponent({
name: "ComponentPlanDialog",
@ -355,6 +357,7 @@ export default defineComponent({
let $q = useQuasar();
let $t = useI18n();
const min_delay = ref(__MIN_DELAY);
let show_dialog = ref(false);
let type = ref(1);
let name = ref(null);
@ -413,8 +416,8 @@ export default defineComponent({
const requestAddPlan = async () => {
let entity = new PlanEntity();
for (let i = 1; i < datas.value.length; i += 2) {
if (parseInt(datas.value[i].value) < 180) {
datas.value[i].value = "180";
if (parseInt(datas.value[i].value) < __MIN_DELAY) {
datas.value[i].value = __MIN_DELAY.toString();
}
}
entity.group_uuid = selected.value;
@ -451,8 +454,8 @@ export default defineComponent({
const requestEditPlan = async () => {
let entity = new PlanEntity();
for (let i = 1; i < datas.value.length; i += 2) {
if (parseInt(datas.value[i].value) < 180) {
datas.value[i].value = "180";
if (parseInt(datas.value[i].value) < __MIN_DELAY) {
datas.value[i].value = __MIN_DELAY.toString();
}
}
entity.group_uuid = selected.value;
@ -489,6 +492,7 @@ export default defineComponent({
return {
show_dialog,
min_delay,
type,
name,
uuid,
@ -573,8 +577,8 @@ export default defineComponent({
}
for (let i = 1; i < datas.value.length; i += 2) {
if (parseInt(datas.value[i].value) < 180) {
datas.value[i].value = "180";
if (parseInt(datas.value[i].value) < __MIN_DELAY) {
datas.value[i].value = __MIN_DELAY.toString();
}
}
@ -611,7 +615,7 @@ export default defineComponent({
datas.value.push({
key: "param_delay",
value: "180",
value: __MIN_DELAY.toString(),
});
},
onContextMenu(

View File

@ -438,6 +438,38 @@ export default defineComponent({
if (item_data) {
setMediaUrlLabel(item_data.window_type);
}
try {
console.log(item_data.media_url);
const url = new URL(item_data.media_url);
console.log(url);
console.log(url.host);
console.log(url.pathname);
if (url.host == "media" && url.pathname.startsWith("/usb")) {
const usb_index = parseInt(url.pathname.substr("/usb".length, 1));
if (!isNaN(usb_index)) {
const target_path = decodeURI(url.pathname);
item_data.media_url =
"/usb" +
(usb_index + 1).toString() +
target_path.substr("/usb0".length);
} else {
console.error("url:", item_data.media_url);
console.error("url:", url);
console.error(
"usb_index:",
url.pathname.substr("/usb".length, 1)
);
console.error("usb_index:", usb_index);
}
} else if (
url.host == "userdata" &&
url.pathname.startsWith("/media_player_datas")
) {
item_data.media_url = decodeURI(url.pathname).substr(
"/media_player_datas/".length
);
}
} catch {}
show_dialog.value = true;
},
resetData() {

View File

@ -54,55 +54,9 @@
<q-item>
<q-item-section>
<q-input
type="number"
v-model="subtitle.width"
:label="$t('width')"
/>
</q-item-section>
<q-item-section>
<q-input
type="number"
v-model="subtitle.height"
:label="$t('height')"
/>
</q-item-section>
</q-item>
<q-item>
<q-item-section>
<q-input
type="number"
v-model="subtitle.x"
:label="$t('x pos')"
/>
</q-item-section>
<q-item-section>
<q-input
type="number"
v-model="subtitle.y"
:label="$t('y pos')"
/>
</q-item-section>
</q-item>
<q-item>
<q-item-section>
<q-checkbox :label="$t('roll switch')" v-model="subtitle.on" />
</q-item-section>
<q-item-section>
<q-checkbox
:label="$t('move forward')"
v-model="subtitle.x_move_forward"
/>
</q-item-section>
</q-item>
<q-separator inset />
<q-item>
<q-item-section>
<q-input
filled
:label="$t('background color')"
v-model="subtitle.background"
:rules="['anyColor']"
hint=""
>
<template v-slot:append>
<q-icon name="colorize" class="cursor-pointer">
@ -129,10 +83,15 @@
<q-select
:label="$t('speed')"
v-model="subtitle.x_speed"
:options="[1, 2, 3, 4, 5, 6, 7, 8, 9, 15, 20]"
:options="[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 15, 20]"
></q-select>
</q-item-section>
<q-item-section></q-item-section>
<q-item-section>
<q-checkbox
:label="$t('enable subtitle')"
v-model="subtitle.show"
/>
</q-item-section>
</q-item>
<q-separator inset />
@ -390,25 +349,7 @@ export default defineComponent({
return;
}
subtitle.value.text = editor.getData();
subtitle.value.width = parseInt(subtitle.value.width.toString());
subtitle.value.height = parseInt(subtitle.value.height.toString());
subtitle.value.x = parseInt(subtitle.value.x.toString());
subtitle.value.y = parseInt(subtitle.value.y.toString());
if (
isNaN(subtitle.value.width) ||
isNaN(subtitle.value.height) ||
isNaN(subtitle.value.x) ||
isNaN(subtitle.value.y)
) {
$q.notify({
color: "negative",
icon: "warning",
message: $t.t("input data error") + "!",
position: "top",
timeout: 1500,
});
return;
}
GlobalData.getInstance()
.getCurrentClient()
?.setSubtitle(subtitle.value);

View File

@ -1,11 +1,6 @@
export default class SubtitleEntity {
on: boolean = false;
x: number = 0;
y: number = 0;
width: number = 0;
height: number = 0;
show: boolean = false;
x_speed: number = 1;
x_move_forward: boolean = false;
text: string = "";
background: string = "";
bakcground_transparent: boolean = false;

View File

@ -287,4 +287,5 @@ export default {
"server branch name": "服务端分支",
"server build date": "服务端编译日期",
"restart device3568": "重启电视机拼接盒",
"enable subtitle": "启用字幕",
};

View File

@ -47,6 +47,11 @@ export default defineComponent({
EventBus.getInstance().on(EventNamesDefine.CurrentConnectConnected, () => {
$q.loading.hide();
setTimeout(() => {
new Initializer(options).initialize().then(() => {
$store.commit("setInitialized");
});
}, 500);
});
$store.commit(

View File

@ -637,7 +637,6 @@ export default store(function (/* { ssrContext } */) {
},
setFanTemp(state: StateInterface, playload?: any) {
const f = parseFloat(playload);
console.log(f);
if (!isNaN(f)) {
state.fan_temp = f;
}