#pragma once #include #include #include #include "../Global/GlobalDataController.h" /** * Webpage form items for reuse */ static const char FORM_ITEM_CHECKBOX[] PROGMEM = "
" "
" "" "" "
" "
"; static const char FORM_ITEM_CHECKBOX_ON[] PROGMEM = " activated"; static const char FORM_ITEM_CHECKBOX_OFF[] PROGMEM = " deactivated"; /** * Webpage side menu right for main items */ static const char MENUE_ITEMS[] PROGMEM = "
  • " "Home" "" "
  • " "
  • " "Configure Printers" "" "
  • " "
  • " "Configure Station" "" "
  • " "
  • " "Configure Weather" "" "
  • " "
  • " "Configure Sensor" "" "
  • " "
  • " "Reset Settings" "" "
  • " "
  • " "Forget WiFi" "" "
  • " "
  • " "Firmware Update" "" "
  • " "
  • " "About" "" "
  • "; /** * Basic header/footer blocks */ static const char HEADER_BLOCK1[] PROGMEM = "" "PrintBuddy" "" ""; static const char HEADER_BLOCK2[] PROGMEM = "" "" "" "" "" "" "" "" "
    " ""; static const char HEADER_BLOCK3[] PROGMEM = "" "" "
    " "" "" "
    " "" "" "
    " "" "
    " "" "" "" "" "" ""; /** * Controls for update firmware/filesystem */ static const char UPDATE_FORM[] PROGMEM = "
    " "
    " "
    " "
    " "Update Firmware" "

    Select the firmware you want to upload

    " "
    " "" "
    " "
    " "
    " "" "
    " "
    " "
    " "
    " "
    " "Update FileSystem" "

    Select the filesystem you want to upload

    " "
    " "" "
    " "
    " "
    " "" "
    " "
    " "
    "; /** * Controls for weather configuration */ static const char WEATHER_FORM_START[] PROGMEM = "
    "; static const char WEATHER_FORM1_ID[] PROGMEM = "isWeatherEnabled"; static const char WEATHER_FORM1_LABEL[] PROGMEM = "Display Weather when printer is off"; static const char WEATHER_FORM2_ID[] PROGMEM = "metric"; static const char WEATHER_FORM2_LABEL_ON[] PROGMEM = "Show in Celsius"; static const char WEATHER_FORM2_LABEL_OFF[] PROGMEM = "Show in Fahrenheit"; static const char WEATHER_FORM3[] PROGMEM = "
    " "
    " "" "" "
    " "
    "; static const char WEATHER_FORM4[] PROGMEM = "
    " "
    " "" "" "
    " "
    " "
    " "
    " "" "
    " "" "" "
    " "
    " "
    " "
    " "
    " "" "
    " "
    " "
    " ""; static const char WEATHER_FORM_OPTIONS[] PROGMEM = "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""; /** * Controls for station configuration */ static const char STATION_CONFIG_FORM_START[] PROGMEM = "
    "; static const char STATION_CONFIG_FORM1_ID[] PROGMEM = "isClockEnabled"; static const char STATION_CONFIG_FORM1_LABEL[] PROGMEM = "Display Clock when printer is off"; static const char STATION_CONFIG_FORM2_ID[] PROGMEM = "is24hour"; static const char STATION_CONFIG_FORM2_LABEL[] PROGMEM = "Use 24 Hour Clock (military time)"; static const char STATION_CONFIG_FORM3_ID[] PROGMEM = "invDisp"; static const char STATION_CONFIG_FORM3_LABEL[] PROGMEM = "Flip display orientation"; static const char STATION_CONFIG_FORM4_ID[] PROGMEM = "useFlash"; static const char STATION_CONFIG_FORM4_LABEL[] PROGMEM = "Flash System LED on Service Call"; static const char STATION_CONFIG_FORM5[] PROGMEM = "
    " "
    " "" "
    " "" "" "
    " "
    " "
    "; static const char STATION_CONFIG_FORM5OPT[] PROGMEM = "" "" "" "" ""; static const char STATION_CONFIG_FORM6[] PROGMEM = "
    " "
    " "" "" "
    " "
    "; static const char STATION_CONFIG_FORM7_ID[] PROGMEM = "isBasicAuth"; static const char STATION_CONFIG_FORM7_LABEL[] PROGMEM = "Use Security Credentials for Configuration Changes"; static const char STATION_CONFIG_FORM8[] PROGMEM = "
    " "
    " "" "" "
    " "
    " "
    " "
    " "" "" "
    " "
    " "
    " "
    " "" "
    " "
    " "
    "; /** * Controls for printer configuration */ static const char CONFPRINTER_FORM_START[] PROGMEM = "
    " "
    " "
    " "

    Printers to monitor

    " "

    Configurationdata

    " "
    " "
    " "
    " "" "
    " "
    " "" "" "" "" "" "" "" "" "" ""; static const char CONFPRINTER_FORM_ROW_ERROR[] PROGMEM = "
    " "%STATUS%" "
    "; static const char CONFPRINTER_FORM_ROW_OK[] PROGMEM = "
    " "%STATUS%" "
    "; static const char CONFPRINTER_FORM_ROW[] PROGMEM = "" "" "" "" "" ""; static const char CONFPRINTER_FORM_END[] PROGMEM = "" "
    NameTypeState
    %NAME%%TYPE%%STATE%" "" "
    " "
    " "
    "; static const char CONFPRINTER_FORM_ADDEDIT_TA[] PROGMEM = "Create new printer"; static const char CONFPRINTER_FORM_ADDEDIT_TE[] PROGMEM = "Edit data for printer"; static const char CONFPRINTER_FORM_ADDEDIT1[] PROGMEM = "" "
    "; /** * @brief Class to generate HTML content from Memory */ class WebserverMemoryVariables { public: static void sendHeader(ESP8266WebServer *server, GlobalDataController *globalDataController, String pageLabel, String pageTitle); static void sendHeader(ESP8266WebServer *server, GlobalDataController *globalDataController, String pageLabel, String pageTitle, boolean refresh); static void sendFooter(ESP8266WebServer *server, GlobalDataController *globalDataController); static void sendUpdateForm(ESP8266WebServer *server, GlobalDataController *globalDataController); static void sendWeatherConfigForm(ESP8266WebServer *server, GlobalDataController *globalDataController); static void sendStationConfigForm(ESP8266WebServer *server, GlobalDataController *globalDataController); static void sendPrinterConfigForm(ESP8266WebServer *server, GlobalDataController *globalDataController); private: static void sendFormCheckbox(ESP8266WebServer *server, String formId, bool isChecked, String label); static void sendFormCheckbox(ESP8266WebServer *server, String formId, bool isChecked, String labelOn, String labelOff); static void sendFormCheckboxEvent(ESP8266WebServer *server, String formId, bool isChecked, String label, String onChange); static void sendFormCheckboxEvent(ESP8266WebServer *server, String formId, bool isChecked, String labelOn, String labelOff, String onChange); static void sendPrinterConfigFormAEModal(ESP8266WebServer *server, int id, PrinterDataStruct *forPrinter); };