修复数据修改提示重启不出现的BUG
This commit is contained in:
parent
f908813a49
commit
6e29a5350c
|
@ -15,7 +15,7 @@ declare module "@vue/runtime-core" {
|
||||||
// for each client)
|
// for each client)
|
||||||
const api = axios.create({
|
const api = axios.create({
|
||||||
baseURL: "https://" + window.location.hostname,
|
baseURL: "https://" + window.location.hostname,
|
||||||
timeout: 10000,
|
timeout: 15000,
|
||||||
});
|
});
|
||||||
api.defaults.headers.common["X-Product-Name"] = "RK_3568";
|
api.defaults.headers.common["X-Product-Name"] = "RK_3568";
|
||||||
|
|
||||||
|
|
|
@ -627,8 +627,10 @@ export default class ClientConnection {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public restartDevice() {
|
public restartDevice(delay_ms?: number) {
|
||||||
this.ws?.send(JSON.stringify(new Protocol.RestartDeviceRequestEntity()));
|
this.ws?.send(
|
||||||
|
JSON.stringify(new Protocol.RestartDeviceRequestEntity(delay_ms))
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public destory() {
|
public destory() {
|
||||||
|
|
|
@ -194,7 +194,7 @@ export default defineComponent({
|
||||||
(response.success ? $t.t("success") : $t.t("fail")) +
|
(response.success ? $t.t("success") : $t.t("fail")) +
|
||||||
"!",
|
"!",
|
||||||
position: "top",
|
position: "top",
|
||||||
timeout: 1000,
|
timeout: 1500,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -212,7 +212,7 @@ export default defineComponent({
|
||||||
(response.success ? $t.t("success") : $t.t("fail")) +
|
(response.success ? $t.t("success") : $t.t("fail")) +
|
||||||
"!",
|
"!",
|
||||||
position: "top",
|
position: "top",
|
||||||
timeout: 1000,
|
timeout: 1500,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -876,6 +876,7 @@ export default defineComponent({
|
||||||
);
|
);
|
||||||
device_resolution.value =
|
device_resolution.value =
|
||||||
val ?? device_resolution_options.value[0];
|
val ?? device_resolution_options.value[0];
|
||||||
|
old_resolution = device_resolution.value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, 1);
|
}, 1);
|
||||||
|
@ -885,8 +886,6 @@ export default defineComponent({
|
||||||
hue.value = parseInt(config.graphics_hue.toString());
|
hue.value = parseInt(config.graphics_hue.toString());
|
||||||
|
|
||||||
device_rotate.value = parseInt(config.device_rotate.toString());
|
device_rotate.value = parseInt(config.device_rotate.toString());
|
||||||
|
|
||||||
old_resolution = device_resolution.value;
|
|
||||||
old_rotate = device_rotate.value;
|
old_rotate = device_rotate.value;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -946,6 +945,14 @@ export default defineComponent({
|
||||||
refresh_output_board();
|
refresh_output_board();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const wait_for = async (delay_ms: number) => {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
setTimeout(() => {
|
||||||
|
resolve(null);
|
||||||
|
}, delay_ms);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const applyNetwork = async () => {
|
const applyNetwork = async () => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
const request = new Protocol.SetSystemNetworkRequestEntity();
|
const request = new Protocol.SetSystemNetworkRequestEntity();
|
||||||
|
@ -989,6 +996,7 @@ export default defineComponent({
|
||||||
});
|
});
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
const applyGraphics = async () => {
|
const applyGraphics = async () => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
const request = new Protocol.SetSystemGraphicsRequestEntity();
|
const request = new Protocol.SetSystemGraphicsRequestEntity();
|
||||||
|
@ -1004,6 +1012,7 @@ export default defineComponent({
|
||||||
await GlobalData.getInstance()
|
await GlobalData.getInstance()
|
||||||
.getCurrentClient()
|
.getCurrentClient()
|
||||||
?.setSystemGraphics(request);
|
?.setSystemGraphics(request);
|
||||||
|
await wait_for(1000 * 3);
|
||||||
success = true;
|
success = true;
|
||||||
} catch {}
|
} catch {}
|
||||||
$q.notify({
|
$q.notify({
|
||||||
|
@ -1029,11 +1038,27 @@ export default defineComponent({
|
||||||
) + "?",
|
) + "?",
|
||||||
cancel: true,
|
cancel: true,
|
||||||
persistent: true,
|
persistent: true,
|
||||||
}).onOk(() => {
|
}).onOk(async () => {
|
||||||
GlobalData.getInstance().getCurrentClient()?.restartDevice();
|
await GlobalData.getInstance()
|
||||||
|
.getCurrentClient()
|
||||||
|
?.restartDevice(1000 * 3);
|
||||||
|
$q.notify({
|
||||||
|
color: "positive",
|
||||||
|
icon: "done",
|
||||||
|
message:
|
||||||
|
$t.t("restart command send") +
|
||||||
|
$t.t("success") +
|
||||||
|
"!" +
|
||||||
|
$t.t("the system will reboot after the setup is complete") +
|
||||||
|
"!",
|
||||||
|
position: "top",
|
||||||
|
timeout: 2500,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
} catch {}
|
} catch {}
|
||||||
}
|
}
|
||||||
|
old_resolution = device_resolution.value;
|
||||||
|
old_rotate = device_rotate.value;
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -235,18 +235,18 @@ export default defineComponent({
|
||||||
"the system automatically restarts after the upgrade is complete"
|
"the system automatically restarts after the upgrade is complete"
|
||||||
),
|
),
|
||||||
position: "top",
|
position: "top",
|
||||||
timeout: 1000,
|
timeout: 1500,
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
}, 1500);
|
}, 2000);
|
||||||
},
|
},
|
||||||
onFailed(info: any) {
|
onFailed(info: any) {
|
||||||
$q.notify({
|
$q.notify({
|
||||||
type: "warning",
|
type: "warning",
|
||||||
message: $t.t("update file upload") + $t.t("fail") + "!",
|
message: $t.t("update file upload") + $t.t("fail") + "!",
|
||||||
position: "top",
|
position: "top",
|
||||||
timeout: 1000,
|
timeout: 1500,
|
||||||
});
|
});
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
},
|
},
|
||||||
|
|
|
@ -1075,12 +1075,20 @@ export namespace Protocol {
|
||||||
|
|
||||||
export class RestartDeviceRequestEntity extends Protocol.PacketEntity {
|
export class RestartDeviceRequestEntity extends Protocol.PacketEntity {
|
||||||
timestamp: number;
|
timestamp: number;
|
||||||
constructor() {
|
delay_ms: number = 0;
|
||||||
|
constructor(delay_ms?: number) {
|
||||||
super();
|
super();
|
||||||
this.timestamp = new Date().getUTCMilliseconds();
|
this.timestamp = new Date().getUTCMilliseconds();
|
||||||
this.command = Protocol.Commands.kRestartDeviceCommand;
|
this.command = Protocol.Commands.kRestartDeviceCommand;
|
||||||
this.flag = Protocol.PacketEntity.FLAG_REQUEST;
|
this.flag = Protocol.PacketEntity.FLAG_REQUEST;
|
||||||
this.rpc_id = 0;
|
this.rpc_id = 0;
|
||||||
|
if (
|
||||||
|
delay_ms != null &&
|
||||||
|
delay_ms != undefined &&
|
||||||
|
!isNaN(parseInt(delay_ms.toString()))
|
||||||
|
) {
|
||||||
|
this.delay_ms = parseInt(delay_ms.toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -265,4 +265,7 @@ export default {
|
||||||
"重要图形参数已更改,需要重启后生效,是否重启",
|
"重要图形参数已更改,需要重启后生效,是否重启",
|
||||||
"output audio card": "输出声卡",
|
"output audio card": "输出声卡",
|
||||||
muted: "静音",
|
muted: "静音",
|
||||||
|
"the system will reboot after the setup is complete":
|
||||||
|
"系统将在设置完成后重启",
|
||||||
|
"restart command send": "重启指令发送",
|
||||||
};
|
};
|
||||||
|
|
|
@ -230,7 +230,7 @@ export default defineComponent({
|
||||||
type: "warning",
|
type: "warning",
|
||||||
message: $t.t("data export ") + $t.t("fail") + "!",
|
message: $t.t("data export ") + $t.t("fail") + "!",
|
||||||
position: "top",
|
position: "top",
|
||||||
timeout: 1000,
|
timeout: 1500,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue