mirror of
https://github.com/openshwprojects/OpenBK7231T_App.git
synced 2026-02-10 01:15:37 +00:00
Added nicer CSS style
This commit is contained in:
@ -121,7 +121,7 @@ int http_fn_index(http_request_t *request) {
|
||||
|
||||
http_setup(request, httpMimeTypeHTML);
|
||||
poststr(request,htmlHeader);
|
||||
poststr(request,"<style>.r { background-color: red; } .g { background-color: green; }</style>");
|
||||
//poststr(request,"<style>.r { background-color: red; } .g { background-color: green; }</style>");
|
||||
HTTP_AddHeader(request);
|
||||
if(http_getArg(request->url,"tgl",tmpA,sizeof(tmpA))) {
|
||||
j = atoi(tmpA);
|
||||
@ -251,9 +251,9 @@ int http_fn_index(http_request_t *request) {
|
||||
} else if(h_isChannelRelay(i) || channelType == ChType_Toggle) {
|
||||
const char *c;
|
||||
if(CHANNEL_Check(i)) {
|
||||
c = "r";
|
||||
c = "bgrn";
|
||||
} else {
|
||||
c = "g";
|
||||
c = "bred";
|
||||
}
|
||||
poststr(request,"<form action=\"index\">");
|
||||
hprintf128(request,"<input type=\"hidden\" name=\"tgl\" value=\"%i\">",i);
|
||||
@ -292,7 +292,7 @@ int http_fn_index(http_request_t *request) {
|
||||
|
||||
poststr(request,"<form action=\"/index\">\
|
||||
<input type=\"hidden\" id=\"restart\" name=\"restart\" value=\"1\">\
|
||||
<input type=\"submit\" value=\"Restart\" onclick=\"return confirm('Are you sure to restart module?')\">\
|
||||
<input class=\"bred\" type=\"submit\" value=\"Restart\" onclick=\"return confirm('Are you sure to restart module?')\">\
|
||||
</form> ");
|
||||
|
||||
poststr(request,"<form action=\"about\"><input type=\"submit\" value=\"About\"/></form>");
|
||||
@ -1303,13 +1303,14 @@ int http_fn_cfg_pins(http_request_t *request) {
|
||||
|
||||
// if available..
|
||||
alias = HAL_PIN_GetPinNameAlias(i);
|
||||
poststr(request, "<div class=\"hdiv\">");
|
||||
if(alias) {
|
||||
poststr(request,alias);
|
||||
poststr(request," ");
|
||||
} else {
|
||||
hprintf128(request, "P%i ",i);
|
||||
}
|
||||
hprintf128(request, "<select name=\"%i\">",i);
|
||||
hprintf128(request, "<select class=\"hele\" name=\"%i\">",i);
|
||||
for(j = 0; j < IOR_Total_Options; j++) {
|
||||
// do not show hardware PWM on non-PWM pin
|
||||
if(j == IOR_PWM) {
|
||||
@ -1325,14 +1326,14 @@ int http_fn_cfg_pins(http_request_t *request) {
|
||||
}
|
||||
}
|
||||
poststr(request, "</select>");
|
||||
hprintf128(request, "<input name=\"r%i\" type=\"text\" value=\"%i\"/>",i,ch);
|
||||
hprintf128(request, "<input class=\"hele\" name=\"r%i\" type=\"text\" value=\"%i\"/>",i,ch);
|
||||
|
||||
if(si == IOR_Button || si == IOR_Button_n)
|
||||
{
|
||||
// extra param. For button, is relay index to toggle on double click
|
||||
hprintf128(request, "<input name=\"e%i\" type=\"text\" value=\"%i\"/>",i,ch2);
|
||||
hprintf128(request, "<input class=\"hele\" name=\"e%i\" type=\"text\" value=\"%i\"/>",i,ch2);
|
||||
}
|
||||
poststr(request,"<br>");
|
||||
poststr(request,"</div>");
|
||||
}
|
||||
poststr(request,"<input type=\"submit\" value=\"Save\"/></form>");
|
||||
|
||||
|
||||
@ -19,8 +19,8 @@ const char httpMimeTypeHTML[] = "text/html" ; // HTML MIME type
|
||||
const char httpMimeTypeText[] = "text/plain" ; // TEXT MIME type
|
||||
const char httpMimeTypeJson[] = "application/json" ; // TEXT MIME type
|
||||
const char httpMimeTypeBinary[] = "application/octet-stream" ; // binary/file MIME type
|
||||
const char htmlHeader[] = "<!DOCTYPE html><html><body>" ;
|
||||
const char htmlEnd[] = "</body></html>" ;
|
||||
const char htmlHeader[] = "<!DOCTYPE html><html><head><style>div,fieldset,input,select{padding:5px;font-size:1em;margin: 0 0 0.2em 0}fieldset{background:#4f4f4f;}p{margin:0.5em 0;}input{width:100%;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;background:#dddddd;color:#000000;}form{margin-bottom:0.5em}input[type=checkbox],input[type=radio]{width:1em;margin-right:6px;vertical-align:-1px;}input[type=range]{width:99%;}select{width:100%;background:#dddddd;color:#000000;}textarea{resize:vertical;width:98%;height:318px;padding:5px;overflow:auto;background:#1f1f1f;color:#65c115;}body{text-align:center;font-family:verdana,sans-serif;background:#21333e; color:#eaeaea}td{padding:0px;}input[type=submit]{border:0;border-radius:0.3rem;background:#1fa3ec;color:#faffff;line-height:2.4rem;font-size:1.2rem;width:100%;-webkit-transition-duration:0.4s;transition-duration:0.4s;cursor:pointer;margin-buttom:0.5em}input[type=submit]:hover{background:#0e70a4;}.bred{background:#d43535 !important;}.bred:hover{background:#931f1f !important;}.bgrn{background:#47c266 !important;}.bgrn:hover{background:#5aaf6f !important;}a{color:#1fa3ec;text-decoration:none;}.p{float:left;text-align:left;}.q{float:right;text-align:right;}.r{border-radius:0.3em;padding:2px;margin:6px 2px;}.hf{display:none;}.hdiv{width:95%;white-space:nowrap;}.hele{width:210px;display:inline-block;margin-left:2px;}</style></head><body><div style=\"text-align:left; display:inline-block; color:#eaeaea; min-width:340px;max-width:800px;\">" ;
|
||||
const char htmlEnd[] = "</div></body></html>" ;
|
||||
const char htmlReturnToMenu[] = "<a href=\"index\">Return to menu</a>";
|
||||
const char htmlReturnToCfg[] = "<a href=\"cfg\">Return to cfg</a>";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user