diff --git a/TC1/http_server/web/index.html b/TC1/http_server/web/index.html index a6da030..1b67f2a 100644 --- a/TC1/http_server/web/index.html +++ b/TC1/http_server/web/index.html @@ -878,20 +878,25 @@ var tb_html = ` `; + for (var i = 0; i < actions.length; i++) { var rowId = `select-${i}`; + var index = parseInt(actions[i]); + var valueText = (isNaN(index) || index < 0 || index >= BTN_OPERATIONS.length) ? '未设置' : BTN_OPERATIONS[index]; + tb_html += ` ${i > 0 ? '连续' : ''}短按${i + 1}次
- - + + +
  • 未设置
  • + ${BTN_OPERATIONS.map((op, idx) => + `
  • ${op}
  • ` + ).join('')} +
    @@ -1226,18 +1231,22 @@ var tb_html = ` for (var i = 0; i < actions.length; i++) { var rowId = `select-${i}`; + var index = parseInt(actions[i]); + var valueText = (isNaN(index) || index < 0 || index >= BTN_OPERATIONS.length) ? '未设置' : BTN_OPERATIONS[index]; + tb_html += ` ${i > 0 ? '连续' : ''}短按${i + 1}次
    - - + + +
  • 未设置
  • + ${BTN_OPERATIONS.map((op, idx) => + `
  • ${op}
  • ` + ).join('')} +
    @@ -1324,10 +1333,15 @@ componentHandler.upgradeDom(); }, cmd); } function selectOperation(rowId, index, operations) { +if (index === -1) { + document.getElementById(`${rowId}-input`).value = '未设置'; + document.getElementById(`${rowId}-value`).value = -1; + } else { var witch = parseInt(rowId.split('-')[1]); const selectedText = operations[index]; document.getElementById(`${rowId}-input`).value = selectedText; document.getElementById(`${rowId}-value`).value = index; + } HttpDel("/shortClickEvent", function (re) { ShowToast("已设置按钮事件"); }, `${witch} index`); diff --git a/TC1/user_gpio.h b/TC1/user_gpio.h index e9abe1c..d2ac497 100644 --- a/TC1/user_gpio.h +++ b/TC1/user_gpio.h @@ -17,7 +17,7 @@ extern char socket_status[32]; void UserLedSet(char x); void KeyInit(void); -void UserRelaySet(unsigned char x,unsigned char y); +void UserRelaySet(unsigned char x, char y); void UserRelaySetAll(char y); bool RelayOut(void); char* GetSocketStatus();