From 772294726362f438f3776cbf2e983d43a72b79f2 Mon Sep 17 00:00:00 2001 From: "Kevin Veen-Birkenbach [aka. Frantz]" Date: Fri, 8 May 2020 14:08:27 +0200 Subject: [PATCH] Created an extra template file --- main/config.h.dist | 40 ------------------------------------- main/homepage_template.h | 43 ++++++++++++++++++++++++++++++++++++++++ main/main.ino | 4 +++- 3 files changed, 46 insertions(+), 41 deletions(-) create mode 100644 main/homepage_template.h diff --git a/main/config.h.dist b/main/config.h.dist index 72780d4..ab9fc04 100644 --- a/main/config.h.dist +++ b/main/config.h.dist @@ -2,43 +2,3 @@ const String titel = "Physical Interface"; // Setup for wifi connection. const char *ssid = ""; //SSID const char *password = ""; //Wlan-Passwort - -const String homepage = -"" -"" - "" - ""+String(titel)+"" - "" - "" - "" - "" - "" - "
" - "

"+String(titel)+"

" - "

An REST-API Arduino microcontroller, which allows you to interact with hardware and the physical environment.

" - "

Actors

" - "

Remote Plug Interface

" - "
" - "
" - "" - "" - "
" - "
" - "" - "" - "
" - "" - "
" - "

Sensors

" - "

The sensor datas can be reached here.

" - "
" - "

Please check out the git-repository to get more information about this software.

" - "
" - "" -""; diff --git a/main/homepage_template.h b/main/homepage_template.h new file mode 100644 index 0000000..5656ab7 --- /dev/null +++ b/main/homepage_template.h @@ -0,0 +1,43 @@ +String homepage_template(void){ +return +"" +"" + "" + ""+String(titel)+"" + "" + "" + "" + "" + "" + "" + "" + "
" + "

"+String(titel)+"

" + "

An REST-API Arduino microcontroller, which allows you to interact with hardware and the physical environment.

" + "

Actors

" + "

Remote Plugs

" + "
" + "
" + "" + "" + "
" + "
" + "" + "" + "
" + "" + "
" + "

Sensors

" + "

The sensor datas can be reached here.

" + "
" + "

Please check out the git-repository to get more information about this software.

" + "
" + "" +""; +} diff --git a/main/main.ino b/main/main.ino index f59969e..73acfad 100644 --- a/main/main.ino +++ b/main/main.ino @@ -11,6 +11,7 @@ #include #include #include "config.h" +#include "homepage_template.h" // Define Constants const int pin_ritter = 13; @@ -116,6 +117,7 @@ String getJson(void){ } void handleRequest(void){ + Serial.println("Website was called."); if(server.arg("plug_id") && server.arg("status")){ if(server.arg("plug_id")=="group"){ setRitterGroup(server.arg("status").toInt()); @@ -126,7 +128,7 @@ void handleRequest(void){ if(server.arg("format")=="json"){ server.send ( 200, "text/html", getJson()); }else{ - server.send ( 200, "text/html", homepage); + server.send ( 200, "text/html", homepage_template()); } delay(100); }