Fixed last things for the webSpiffs

This commit is contained in:
Stefan Kremser
2018-04-03 18:03:08 +02:00
parent f70c644a9d
commit aa7c1f211e
4 changed files with 101 additions and 87 deletions

View File

@@ -222,7 +222,9 @@ f.write("#endif\n")
f.write("\n")
f.write("void copyWebFiles(bool force){\n")
f.write("#ifdef USE_PROGMEM_WEB_FILES\n")
f.write("if(settings.getWebSpiffs()){\n")
f.write(copy_files_function)
f.write("}\n")
f.write("#endif\n")
f.write("}\n")
f.write("\n")
@@ -232,11 +234,14 @@ f.close()
print("\n[+] Done, happy uploading :)")
print("Here are the updated functions for wifi.h, in case you added or removed files:")
print();
print('if(settings.getWebSpiffs()){')
print('if(!settings.getWebSpiffs()){')
print(' server.on(PSTR("/"), HTTP_GET, [](){')
print(' sendProgmem(indexhtml, sizeof(indexhtml), PSTR("text/html"));')
print('});')
print(webserver_events)
print('}')
print("server.on(str(W_DEFAULT_LANG).c_str(), HTTP_GET, [](){")
print(" if(settings.getWebSpiffs()){")
print(" if(!settings.getWebSpiffs()){")
print(load_lang)
print(' else handleFileRead("/web/lang/"+settings.getLang()+".lang");')
print(' } else {')