Browse Source

Clean web UI

fastled
Xose Pérez 7 years ago
parent
commit
a1489d752d
8 changed files with 3417 additions and 3429 deletions
  1. +0
    -13
      code/espurna/config/general.h
  2. BIN
      code/espurna/data/index.html.gz
  3. +1
    -1
      code/espurna/migrate.ino
  4. +3064
    -3068
      code/espurna/static/index.html.gz.h
  5. +1
    -0
      code/html/checkboxes.css
  6. +17
    -10
      code/html/custom.css
  7. +4
    -3
      code/html/custom.js
  8. +330
    -334
      code/html/index.html

+ 0
- 13
code/espurna/config/general.h View File

@ -451,23 +451,10 @@ PROGMEM const char* const custom_reset_string[] = {
#define MQTT_TOPIC_INTERVAL "interval" #define MQTT_TOPIC_INTERVAL "interval"
#define MQTT_TOPIC_HOSTNAME "host" #define MQTT_TOPIC_HOSTNAME "host"
#define MQTT_TOPIC_TIME "time" #define MQTT_TOPIC_TIME "time"
#define MQTT_TOPIC_ANALOG "analog"
#define MQTT_TOPIC_COUNTER "counter"
#define MQTT_TOPIC_RFOUT "rfout" #define MQTT_TOPIC_RFOUT "rfout"
#define MQTT_TOPIC_RFIN "rfin" #define MQTT_TOPIC_RFIN "rfin"
#define MQTT_TOPIC_RFLEARN "rflearn" #define MQTT_TOPIC_RFLEARN "rflearn"
// Power module
#define MQTT_TOPIC_CURRENT "current"
#define MQTT_TOPIC_VOLTAGE "voltage"
#define MQTT_TOPIC_POWER_ACTIVE "power"
#define MQTT_TOPIC_POWER_APPARENT "apparent"
#define MQTT_TOPIC_POWER_REACTIVE "reactive"
#define MQTT_TOPIC_MAX_POWER "max_power"
#define MQTT_TOPIC_POWER_FACTOR "factor"
#define MQTT_TOPIC_ENERGY_DELTA "energy_delta"
#define MQTT_TOPIC_ENERGY_TOTAL "energy_total"
// Light module // Light module
#define MQTT_TOPIC_CHANNEL "channel" #define MQTT_TOPIC_CHANNEL "channel"
#define MQTT_TOPIC_COLOR "color" // DEPRECATED, use RGB instead #define MQTT_TOPIC_COLOR "color" // DEPRECATED, use RGB instead


BIN
code/espurna/data/index.html.gz View File


+ 1
- 1
code/espurna/migrate.ino View File

@ -8,7 +8,7 @@ Copyright (C) 2016-2017 by Xose Pérez <xose dot perez at gmail dot com>
void _cmpMoveIndexDown(const char * key, int offset = 0) { void _cmpMoveIndexDown(const char * key, int offset = 0) {
if (hasSetting(key, 0)) return; if (hasSetting(key, 0)) return;
for (unsigned char index = 1; index < 10; index++) {
for (unsigned char index = 1; index < SETTINGS_MAX_LIST_COUNT; index++) {
if (hasSetting(key, index)) { if (hasSetting(key, index)) {
setSetting(key, index - 1, getSetting(key, index).toInt() + offset); setSetting(key, index - 1, getSetting(key, index).toInt() + offset);
} else { } else {


+ 3064
- 3068
code/espurna/static/index.html.gz.h
File diff suppressed because it is too large
View File


+ 1
- 0
code/html/checkboxes.css View File

@ -4,6 +4,7 @@
height: 27px; height: 27px;
cursor: pointer; cursor: pointer;
overflow: hidden; overflow: hidden;
margin-bottom: 10px;
} }
.iPhoneCheckContainer input { .iPhoneCheckContainer input {


+ 17
- 10
code/html/custom.css View File

@ -25,7 +25,7 @@
margin: 0px; margin: 0px;
} }
.page { .page {
margin-top: 40px;
margin-top: 10px;
} }
.pure-button { .pure-button {
color: white; color: white;
@ -67,6 +67,7 @@
} }
.button-del-network { .button-del-network {
background: rgb(202, 60, 60); background: rgb(202, 60, 60);
letter-spacing: 0px;
} }
.button-more-network, .button-more-network,
.button-rfb-send { .button-rfb-send {
@ -75,37 +76,39 @@
.button-settings-backup, .button-settings-backup,
.button-settings-restore { .button-settings-restore {
background: rgb(0, 202, 0); background: rgb(0, 202, 0);
margin-bottom: 10px;
} }
.pure-g { .pure-g {
margin-bottom: 20px;
margin-bottom: 0px;
} }
.pure-form legend { .pure-form legend {
font-weight: bold; font-weight: bold;
letter-spacing: 0; letter-spacing: 0;
margin-bottom: 1em;
margin: 10px 0 1em 0;
} }
.l-box { .l-box {
padding-right: 1px; padding-right: 1px;
} }
.pure-form input {
margin-bottom: 10px;
}
.pure-form input[type=text][disabled] { .pure-form input[type=text][disabled] {
color: #777777; color: #777777;
} }
div.hint { div.hint {
font-size: 80%; font-size: 80%;
color: #ccc; color: #ccc;
}
div.hint.inline {
margin-top: 6px;
margin: -10px 0 10px 0;
} }
.break { .break {
margin-top: 5px; margin-top: 5px;
} }
#networks .pure-g { #networks .pure-g {
padding-bottom: 10px;
padding: 10px 0 10px 0;
margin-bottom: 5px; margin-bottom: 5px;
border-bottom: 2px dashed #e5e5e5; border-bottom: 2px dashed #e5e5e5;
} }
#networks div.more {
#networks .more {
display: none; display: none;
} }
legend.module, legend.module,
@ -124,8 +127,11 @@ input[name=upgrade] {
height: 20px; height: 20px;
margin-top: 10px; margin-top: 10px;
} }
.pure-form .center {
margin: .5em 0 .2em;
input.center {
margin-bottom: 0px;
}
div.center {
margin: .5em 0 1em;
} }
.webmode { .webmode {
display: none; display: none;
@ -190,4 +196,5 @@ span.slider {
} }
select { select {
width: 100%; width: 100%;
margin-bottom: 10px;
} }

+ 4
- 3
code/html/custom.js View File

@ -133,6 +133,7 @@ function getData(form) {
// Delete unwanted fields // Delete unwanted fields
delete(data["filename"]); delete(data["filename"]);
delete(data["rfbcode"]);
return data; return data;
@ -452,7 +453,7 @@ function delNetwork() {
function moreNetwork() { function moreNetwork() {
var parent = $(this).parents(".pure-g"); var parent = $(this).parents(".pure-g");
$("div.more", parent).toggle();
$(".more", parent).toggle();
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
@ -631,7 +632,7 @@ function initChannels(num) {
function addRfbNode() { function addRfbNode() {
var numNodes = $("#rfbNodes > fieldset").length;
var numNodes = $("#rfbNodes > legend").length;
var template = $("#rfbNodeTemplate").children(); var template = $("#rfbNodeTemplate").children();
var line = $(template).clone(); var line = $(template).clone();
@ -1021,7 +1022,7 @@ $(function() {
$("input[name='filename']").val(fileName.replace(/^.*[\\\/]/, '')); $("input[name='filename']").val(fileName.replace(/^.*[\\\/]/, ''));
}); });
$(".button-add-network").on('click', function() { $(".button-add-network").on('click', function() {
$("div.more", addNetwork()).toggle();
$(".more", addNetwork()).toggle();
}); });
$(document).on('change', 'input', hasChanged); $(document).on('change', 'input', hasChanged);


+ 330
- 334
code/html/index.html
File diff suppressed because it is too large
View File


Loading…
Cancel
Save