fix standby_time
This commit is contained in:
@@ -77,7 +77,7 @@ target="_blank"
|
||||
>)
|
||||
</small></div><div class="form-group"><label class="form-label">自动熄屏时间</label><input
|
||||
type="time"
|
||||
id="screen-timeout-input"
|
||||
id="standby-time-input"
|
||||
class="form-control"
|
||||
/><small class="text-muted">留空表示不自动熄屏</small></div><button class="btn btn-success" id="save-config-btn">
|
||||
保存配置
|
||||
@@ -228,10 +228,10 @@ const response = await mw.ajax.get("/config");
|
||||
const data = JSON.parse(response);currentConfig = data;// 更新配置表单
|
||||
if (data.city) {
|
||||
mw.val(mw.$("#city-input"), data.city);
|
||||
}if (data.screen_timeout) {
|
||||
}if (data.standby_time) {
|
||||
mw.val(
|
||||
mw.$("#screen-timeout-input"),
|
||||
data.screen_timeout,
|
||||
mw.$("#standby-time-input"),
|
||||
data.standby_time,
|
||||
);
|
||||
}// 更新配置表
|
||||
updateConfigTable(data);
|
||||
@@ -271,14 +271,14 @@ mw.text(cell2, value);
|
||||
async function saveConfig() {
|
||||
try {
|
||||
const city = mw.val(mw.$("#city-input"));
|
||||
const screenTimeout = mw.val(mw.$("#screen-timeout-input"));if (!city) {
|
||||
const standbyTime = mw.val(mw.$("#standby-time-input"));if (!city) {
|
||||
showMessage("城市名称不能为空", "error");
|
||||
return;
|
||||
}const configData = {
|
||||
city: city,
|
||||
};// 只有当输入了熄屏时间时才添加到配置中
|
||||
if (screenTimeout !== "") {
|
||||
configData.screen_timeout = screenTimeout;
|
||||
if (standbyTime !== "") {
|
||||
configData.standby_time = standbyTime;
|
||||
}const response = await mw.ajax.post(
|
||||
"/config/set",
|
||||
configData,
|
||||
|
||||
Reference in New Issue
Block a user