mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-28 05:36:37 +00:00
Update stylesheet of gpio form for #246
This commit is contained in:
parent
43ef2426da
commit
ddd35c8be7
@ -1 +1 @@
|
||||
:root{--star:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="-10 -6 16 16"><line y1="-3" y2="3" stroke="red" transform="rotate(15)"></line><line y1="-3" y2="3" stroke="red" transform="rotate(75)"></line><line y1="-3" y2="3" stroke="red" transform="rotate(-45)"></line></svg>')}a.foot:link,a.foot:visited{color:var(--footfg)}input:not([type=file]){background-color:var(--fldbg);color:var(--fldfg)}input[type=checkbox],input[type=radio]{width:1em}select{background-color:var(--fldbg);color:var(--fldfg)}input:invalid{border:1px solid var(--fldred)}body{font-family:verdana;margin:auto;background:var(--bg);color:var(--txt)}.c,body{text-align:center}.clear{clear:both}.foot{background-color:transparent!important;all:revert;float:right;margin:0;font-size:.6em}.red{background-color:var(--btnred)}.red:focus,.red:hover{background-color:var(--btnredhi)}#doc{text-align:left;margin:0 auto;display:inline-block;color:var(--txt);width:80%;min-width:300px;max-width:600px;display:table}td{font-size:.87rem;padding-bottom:0;padding-top:0}th{padding-top:.5em}*{box-sizing:border-box}a,input,select,textarea{width:100%;padding:12px;border:1px solid #ccc;border-radius:.6rem;resize:vertical}label{padding:12px 18px 12px 0;display:inline-block}.required{background-image:var(--star);background-size:1.5em 1.5em;background-position:right;background-repeat:no-repeat}a,button,input[type=submit]{padding:12px;border:1px solid var(--btnbrd);border-radius:.6rem;background-color:var(--btnbg);color:var(--btnfg);font-size:1rem;width:100%;margin:12px 0;display:flex;align-items:center;justify-content:center;text-align:center;text-decoration:none}a:hover,button:hover,input[type=submit]:hover{background-color:var(--btnbghi)}.container{background-color:var(--grpbg);color:var(--grpfg);border-radius:.6rem;padding:10px;margin:20px 0}.dist{display:flex;justify-content:space-between;width:100%}.dist > a{flex-grow:1;margin:0 6px}.dist>a:first-child{margin-left:0}.dist>a:last-child{margin-right:0}.col-25{float:left;width:25%;text-align:right;margin:0}.col-75{margin:0;float:left;width:75%}.row:after{content:"";display:table;clear:both}.row{font-size:.833rem;margin:5px}.gap,.row:last-of-type{margin:5px 5px 20px}.error,.info,.success,.validation,.warning{border:1px solid;margin:10px auto;padding:15px 10px 15px 50px;background-repeat:no-repeat;background-position:10px center;max-width:500px}.info{color:#00529B;background-color:#BDE5F8}.success{color:#4F8A10;background-color:#DFF2BF}.warning{color:#9F6000;background-color:#FEEFB3}.error{color:#D8000C;background-color:#FFD2D2}@media screen and (max-width:800px){.col-25,.col-75,input[type=submit]{width:100%;margin-top:0}.col-25{text-align:left}label{padding:5px 18px 5px 0}}
|
||||
:root{--star:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="-10 -6 16 16"><line y1="-3" y2="3" stroke="red" transform="rotate(15)"></line><line y1="-3" y2="3" stroke="red" transform="rotate(75)"></line><line y1="-3" y2="3" stroke="red" transform="rotate(-45)"></line></svg>');--trash:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" id="mdi-trash-can-outline" width="24" height="24" viewBox="0 0 24 24"><path d="M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z" /></svg>')}a.foot:link,a.foot:visited{color:var(--footfg)}input:not([type=file]){background-color:var(--fldbg);color:var(--fldfg)}input[type=checkbox],input[type=radio]{width:1em}select{background-color:var(--fldbg);color:var(--fldfg)}input:invalid{border:1px solid var(--fldred)}body{font-family:verdana;margin:auto;background:var(--bg);color:var(--txt)}.c,body{text-align:center}.clear{clear:both}.foot{background-color:transparent!important;all:revert;float:right;margin:0;font-size:.6em}.red{background-color:var(--btnred)}.red:focus,.red:hover{background-color:var(--btnredhi)}#doc{text-align:left;margin:0 auto;display:inline-block;color:var(--txt);width:80%;min-width:300px;max-width:600px;display:table}td{font-size:.87rem;padding-bottom:0;padding-top:0}th{padding-top:.5em}*{box-sizing:border-box}input,select,textarea{width:100%;padding:12px;border:1px solid #ccc;border-radius:.6rem;resize:vertical}label{padding:12px 18px 12px 0;display:inline-block}.required{background-image:var(--star);background-size:1.5em 1.5em;background-position:left;background-repeat:no-repeat}.edit::before{content:"\0000a0"}.edit{background-image:var(--edit);background-size:1.5em 1.5em;background-position:left;background-repeat:no-repeat;width:1.5em;display:inline-block}.trash::before{content:"\0000a0"}.trash{background-image:var(--trash);background-size:1.5em 1.5em;background-position:left;background-repeat:no-repeat;width:1.5em;display:inline-block}.mdi{background-size:1.5em 1.5em;background-position:right;background-repeat:no-repeat;width:1.5em;display:inline-block}#doc>a,button,input[type=submit]{padding:12px;border:1px solid var(--btnbrd);border-radius:.6rem;background-color:var(--btnbg);color:var(--btnfg);font-size:1rem;width:100%;margin:12px 0;display:flex;align-items:center;justify-content:center;text-align:center;text-decoration:none}a.btn:hover,button:hover,input[type=submit]:hover{background-color:var(--btnbghi)}.container{background-color:var(--grpbg);color:var(--grpfg);border-radius:.6rem;padding:10px;margin:20px 0}.dist{display:flex;justify-content:space-between;width:100%}.dist>a{flex-grow:1;margin:0 6px}.dist>a:first-child{margin-left:0}.dist>a:last-child{margin-right:0}.col-25{float:left;width:25%;text-align:right;margin:0}.col-75{margin:0;float:left;width:75%}.row:after{content:"";display:table;clear:both}.row{font-size:.833rem;margin:5px}.gap,.row:last-of-type{margin:5px 5px 20px}.error,.info,.success,.validation,.warning{border:1px solid;margin:10px auto;padding:15px 10px 15px 50px;background-repeat:no-repeat;background-position:10px center;max-width:500px}.info{color:#00529B;background-color:#BDE5F8}.success{color:#4F8A10;background-color:#DFF2BF}.warning{color:#9F6000;background-color:#FEEFB3}.error{color:#D8000C;background-color:#FFD2D2}@media screen and (max-width:800px){.col-25,.col-75,input[type=submit]{width:100%;margin-top:0}.col-25{text-align:left}label{padding:5px 18px 5px 0}}
|
Binary file not shown.
@ -55,7 +55,7 @@ uint32_t mqttReceiveCount;
|
||||
uint32_t mqttFailedCount;
|
||||
|
||||
char mqttServer[MAX_USERNAME_LENGTH] = MQTT_HOST;
|
||||
char mqttUsername[MAX_USERNAME_LENGTH] = MQTT_USER;
|
||||
char mqttUsername[MAX_USERNAME_LENGTH] = MQTT_USER;
|
||||
char mqttPassword[MAX_PASSWORD_LENGTH] = MQTT_PASSW;
|
||||
// char mqttNodeName[16] = MQTT_NODENAME;
|
||||
char mqttGroupName[16] = MQTT_GROUPNAME;
|
||||
|
@ -1046,8 +1046,9 @@ static void webHandleMqttConfig()
|
||||
|
||||
// Broker
|
||||
httpMessage += F("<div class='row'><div class='col-25'><label for='host'>Broker</label></div>");
|
||||
httpMessage += F("<div class='col-75'><input type='text' id='host' name='host' maxlength=63 "
|
||||
"placeholder='Server Name' value='");
|
||||
httpMessage += F("<div class='col-75'><input type='text' id='host' name='host' maxlength=");
|
||||
httpMessage += MAX_HOSTNAME_LENGTH - 1;
|
||||
httpMessage += F(" placeholder='Server Name' value='");
|
||||
httpMessage += settings[FPSTR(FP_CONFIG_HOST)].as<String>();
|
||||
httpMessage += F("'></div></div>");
|
||||
|
||||
@ -1060,15 +1061,17 @@ static void webHandleMqttConfig()
|
||||
|
||||
// Mqtt User
|
||||
httpMessage += F("<div class='row'><div class='col-25'><label for='user'>User</label></div>");
|
||||
httpMessage += F("<div class='col-75'><input type='text' id='user' name='user' maxlength=31 "
|
||||
"placeholder='MQTT User' value='");
|
||||
httpMessage += F("<div class='col-75'><input type='text' id='user' name='user' maxlength=");
|
||||
httpMessage += MAX_USERNAME_LENGTH - 1;
|
||||
httpMessage += F(" placeholder='MQTT User' value='");
|
||||
httpMessage += settings[FPSTR(FP_CONFIG_USER)].as<String>();
|
||||
httpMessage += F("'></div></div>");
|
||||
|
||||
// Mqtt Password
|
||||
httpMessage += F("<div class='row'><div class='col-25'><label for='pass'>Password</label></div>");
|
||||
httpMessage += F("<div class='col-75'><input type='password' id='pass' name='pass' maxlength=63 "
|
||||
"placeholder='MQTT Password' value='");
|
||||
httpMessage += F("<div class='col-75'><input type='password' id='pass' name='pass' maxlength=");
|
||||
httpMessage += MAX_PASSWORD_LENGTH - 1;
|
||||
httpMessage += F(" placeholder='MQTT Password' value='");
|
||||
if(settings[FPSTR(FP_CONFIG_PASS)].as<String>() != "") httpMessage += F(D_PASSWORD_MASK);
|
||||
httpMessage += F("'></div></div>");
|
||||
|
||||
@ -1206,15 +1209,17 @@ static void webHandleWifiConfig()
|
||||
|
||||
// Wifi SSID
|
||||
httpMessage += F("<div class='row'><div class='col-25 required'><label for='ssid'>SSID</label></div>");
|
||||
httpMessage += F("<div class='col-75'><input required type='text' id='ssid' name='ssid' maxlength=31 "
|
||||
"placeholder='SSID' value='");
|
||||
httpMessage += F("<div class='col-75'><input required type='text' id='ssid' name='ssid' maxlength=");
|
||||
httpMessage += MAX_USERNAME_LENGTH - 1;
|
||||
httpMessage += F(" placeholder='SSID' value='");
|
||||
httpMessage += settings[FPSTR(FP_CONFIG_SSID)].as<String>();
|
||||
httpMessage += F("'></div></div>");
|
||||
|
||||
// Wifi Password
|
||||
httpMessage += F("<div class='row'><div class='col-25 required'><label for='pass'>Password</label></div>");
|
||||
httpMessage += F("<div class='col-75'><input required type='password' id='pass' name='pass' maxlength=63 "
|
||||
"placeholder='Password' value='");
|
||||
httpMessage += F("<div class='col-75'><input required type='password' id='pass' name='pass' maxlength=");
|
||||
httpMessage += MAX_PASSWORD_LENGTH - 1;
|
||||
httpMessage += F(" placeholder='Password' value='");
|
||||
if(settings[FPSTR(FP_CONFIG_PASS)].as<String>() != "") {
|
||||
httpMessage += F(D_PASSWORD_MASK);
|
||||
}
|
||||
@ -1251,18 +1256,32 @@ static void webHandleCaptivePortalWifiConfig()
|
||||
httpMessage += F("<h1>");
|
||||
httpMessage += haspDevice.get_hostname();
|
||||
httpMessage += F("</h1><hr>");
|
||||
httpMessage += F("<h2>" D_HTTP_WIFI_SETTINGS "</h2>");
|
||||
|
||||
httpMessage += F("<form method='POST' action='/config'>");
|
||||
httpMessage += F("<b>WiFi SSID</b> <i><small>(required)</small></i><input id='ssid' required "
|
||||
"name='ssid' maxlength=31 placeholder='WiFi SSID' value='");
|
||||
// Form
|
||||
httpMessage += F("<div class='container'><form method='POST' action='/config'>");
|
||||
|
||||
// Wifi SSID
|
||||
httpMessage += F("<div class='row'><div class='col-25 required'><label for='ssid'>SSID</label></div>");
|
||||
httpMessage += F("<div class='col-75'><input required type='text' id='ssid' name='ssid' maxlength=");
|
||||
httpMessage += MAX_USERNAME_LENGTH - 1;
|
||||
httpMessage += F(" placeholder='SSID' value='");
|
||||
httpMessage += settings[FPSTR(FP_CONFIG_SSID)].as<String>();
|
||||
httpMessage += F("'><br/><b>WiFi Password</b> <i><small>(required)</small></i><input id='pass' required "
|
||||
"name='pass' type='password' maxlength=63 placeholder='WiFi Password' value='");
|
||||
httpMessage += F("'></div></div>");
|
||||
|
||||
// Wifi Password
|
||||
httpMessage += F("<div class='row'><div class='col-25 required'><label for='pass'>Password</label></div>");
|
||||
httpMessage += F("<div class='col-75'><input required type='password' id='pass' name='pass' maxlength=");
|
||||
httpMessage += MAX_PASSWORD_LENGTH - 1;
|
||||
httpMessage += F(" placeholder='Password' value='");
|
||||
if(settings[FPSTR(FP_CONFIG_PASS)].as<String>() != "") {
|
||||
httpMessage += F(D_PASSWORD_MASK);
|
||||
}
|
||||
httpMessage +=
|
||||
F("'><p><button type='submit' name='save' value='wifi'>" D_HTTP_SAVE_SETTINGS "</button></p></form>");
|
||||
httpMessage += F("'></div></div>");
|
||||
|
||||
// Submit & End Form
|
||||
httpMessage += F("<button type='submit' name='save' value='wifi'>" D_HTTP_SAVE_SETTINGS "</button>");
|
||||
httpMessage += F("</form></div>");
|
||||
|
||||
#if HASP_USE_WIFI > 0 && !defined(STM32F4xx)
|
||||
if(WiFi.getMode() == WIFI_STA) {
|
||||
@ -1487,7 +1506,7 @@ static void webHandleGpioConfig()
|
||||
httpMessage += id;
|
||||
httpMessage += ("&pin=");
|
||||
httpMessage += conf.pin;
|
||||
httpMessage += ("'>Delete</a></td><tr>");
|
||||
httpMessage += ("' class='trash'></a></td><tr>");
|
||||
configCount++;
|
||||
}
|
||||
}
|
||||
@ -1730,8 +1749,9 @@ static void webHandleDebugConfig()
|
||||
#if HASP_USE_SYSLOG > 0
|
||||
// Syslog host
|
||||
httpMessage += F("<div class='row'><div class='col-25'><label for='host'>Syslog Server</label></div>");
|
||||
httpMessage += F("<div class='col-75'><input type='text' id='host' name='host' maxlength='31' "
|
||||
"value='");
|
||||
httpMessage += F("<div class='col-75'><input type='text' id='host' name='host' maxlength=");
|
||||
httpMessage += MAX_HOSTNAME_LENGTH - 1;
|
||||
httpMessage += F(" value='");
|
||||
httpMessage += settings[FPSTR(FP_CONFIG_HOST)].as<String>();
|
||||
httpMessage += F("'></div></div>");
|
||||
|
||||
|
@ -11,7 +11,7 @@ struct hasp_http_config_t
|
||||
bool enable = true;
|
||||
uint16_t port = 80;
|
||||
|
||||
char username[MAX_USERNAME_LENGTH] = "";
|
||||
char username[MAX_USERNAME_LENGTH] = "";
|
||||
char password[MAX_PASSWORD_LENGTH] = "";
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user