Compare commits
No commits in common. "main" and "2023-11-11-add-market-cap-screen" have entirely different histories.
main
...
2023-11-11
11 changed files with 5 additions and 39 deletions
|
@ -191,13 +191,6 @@
|
||||||
<input type="text" name="mempoolInstance" id="mempoolInstance" class="form-control">
|
<input type="text" name="mempoolInstance" id="mempoolInstance" class="form-control">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
|
||||||
<label for="hostnamePrefix" class="col-sm-6 col-form-label col-form-label-sm">Hostname prefix</label>
|
|
||||||
<div class="col-sm-6">
|
|
||||||
<input type="text" name="hostnamePrefix" id="hostnamePrefix" class="form-control">
|
|
||||||
<div class="form-text">A restart is required to apply new hostname prefix.</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class=" col-sm-6">
|
<div class=" col-sm-6">
|
||||||
<div class="form-check form-switch">
|
<div class="form-check form-switch">
|
||||||
|
|
|
@ -76,7 +76,6 @@ fetch('/api/settings', {
|
||||||
document.getElementById('fullRefreshMin').value = jsonData.fullRefreshMin;
|
document.getElementById('fullRefreshMin').value = jsonData.fullRefreshMin;
|
||||||
document.getElementById('wpTimeout').value = jsonData.wpTimeout;
|
document.getElementById('wpTimeout').value = jsonData.wpTimeout;
|
||||||
document.getElementById('mempoolInstance').value = jsonData.mempoolInstance;
|
document.getElementById('mempoolInstance').value = jsonData.mempoolInstance;
|
||||||
document.getElementById('hostnamePrefix').value = jsonData.hostnamePrefix;
|
|
||||||
|
|
||||||
if (jsonData.gitRev)
|
if (jsonData.gitRev)
|
||||||
document.getElementById('gitRev').innerHTML = "Version: " + jsonData.gitRev;
|
document.getElementById('gitRev').innerHTML = "Version: " + jsonData.gitRev;
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 1.3 MiB |
Binary file not shown.
Before Width: | Height: | Size: 2.2 MiB |
Binary file not shown.
Before Width: | Height: | Size: 2 MiB |
Binary file not shown.
Before Width: | Height: | Size: 1.9 MiB |
|
@ -36,8 +36,8 @@ void setupSoftAP()
|
||||||
{
|
{
|
||||||
byte mac[6];
|
byte mac[6];
|
||||||
WiFi.macAddress(mac);
|
WiFi.macAddress(mac);
|
||||||
softAP_SSID = getMyHostname().c_str();
|
softAP_SSID = String("BTClock" + String(mac[5], 16) + String(mac[1], 16));
|
||||||
WiFi.setHostname(getMyHostname().c_str());
|
WiFi.setHostname(softAP_SSID.c_str());
|
||||||
softAP_password = base64::encode(String(mac[2], 16) + String(mac[4], 16) + String(mac[5], 16) + String(mac[1], 16)).substring(2, 10);
|
softAP_password = base64::encode(String(mac[2], 16) + String(mac[4], 16) + String(mac[5], 16) + String(mac[1], 16)).substring(2, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
//#include <WiFiMulti.h>
|
//#include <WiFiMulti.h>
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "utils.hpp"
|
|
||||||
#include "shared.hpp"
|
#include "shared.hpp"
|
||||||
#include "Adafruit_GFX.h"
|
#include "Adafruit_GFX.h"
|
||||||
#include "lib/epd.hpp"
|
#include "lib/epd.hpp"
|
||||||
|
|
|
@ -41,14 +41,3 @@ std::string formatNumberWithSuffix(int64_t num) {
|
||||||
return std::to_string(num);
|
return std::to_string(num);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String getMyHostname() {
|
|
||||||
uint8_t mac[6];
|
|
||||||
//WiFi.macAddress(mac);
|
|
||||||
esp_efuse_mac_get_default(mac);
|
|
||||||
char hostname[15];
|
|
||||||
String hostnamePrefix = preferences.getString("hostnamePrefix", "btclock");
|
|
||||||
snprintf(hostname, sizeof(hostname), "%s-%02x%02x%02x",
|
|
||||||
hostnamePrefix, mac[3], mac[4], mac[5]);
|
|
||||||
return hostname;
|
|
||||||
}
|
|
|
@ -4,4 +4,3 @@
|
||||||
|
|
||||||
double getSupplyAtBlock(uint blockNr);
|
double getSupplyAtBlock(uint blockNr);
|
||||||
std::string formatNumberWithSuffix(int64_t num);
|
std::string formatNumberWithSuffix(int64_t num);
|
||||||
String getMyHostname();
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ void setupWebserver()
|
||||||
|
|
||||||
// Start server
|
// Start server
|
||||||
server.begin();
|
server.begin();
|
||||||
if (!MDNS.begin(getMyHostname()))
|
if (!MDNS.begin(HOSTNAME))
|
||||||
{
|
{
|
||||||
Serial.println(F("Error setting up MDNS responder!"));
|
Serial.println(F("Error setting up MDNS responder!"));
|
||||||
while (1)
|
while (1)
|
||||||
|
@ -61,9 +61,6 @@ void setupWebserver()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MDNS.addService("http", "tcp", 80);
|
MDNS.addService("http", "tcp", 80);
|
||||||
MDNS.addServiceTxt("http", "tcp", "model", "BTClock");
|
|
||||||
MDNS.addServiceTxt("http", "tcp", "version", "2.0");
|
|
||||||
MDNS.addServiceTxt("http", "tcp", "rev", GIT_REV);
|
|
||||||
Serial.println(F("Webserver should be running"));
|
Serial.println(F("Webserver should be running"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,8 +184,6 @@ void onApiSettingsGet(AsyncWebServerRequest *request)
|
||||||
root["rpcUser"] = preferences.getString("rpcUser", BITCOIND_RPC_USER);
|
root["rpcUser"] = preferences.getString("rpcUser", BITCOIND_RPC_USER);
|
||||||
root["rpcHost"] = preferences.getString("rpcHost", BITCOIND_HOST);
|
root["rpcHost"] = preferences.getString("rpcHost", BITCOIND_HOST);
|
||||||
root["mempoolInstance"] = preferences.getString("mempoolInstance", DEFAULT_MEMPOOL_INSTANCE);
|
root["mempoolInstance"] = preferences.getString("mempoolInstance", DEFAULT_MEMPOOL_INSTANCE);
|
||||||
root["hostnamePrefix"] = preferences.getString("hostnamePrefix", "btclock");
|
|
||||||
root["hostname"] = getMyHostname();
|
|
||||||
|
|
||||||
#ifdef IS_BW
|
#ifdef IS_BW
|
||||||
root["epdColors"] = 2;
|
root["epdColors"] = 2;
|
||||||
|
@ -295,14 +290,6 @@ void onApiSettingsPost(AsyncWebServerRequest *request)
|
||||||
settingsChanged = true;
|
settingsChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request->hasParam("hostnamePrefix", true))
|
|
||||||
{
|
|
||||||
AsyncWebParameter *hostnamePrefix = request->getParam("hostnamePrefix", true);
|
|
||||||
|
|
||||||
preferences.putString("hostnamePrefix", hostnamePrefix->value().c_str());
|
|
||||||
settingsChanged = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (request->hasParam("ledBrightness", true))
|
if (request->hasParam("ledBrightness", true))
|
||||||
{
|
{
|
||||||
AsyncWebParameter *ledBrightness = request->getParam("ledBrightness", true);
|
AsyncWebParameter *ledBrightness = request->getParam("ledBrightness", true);
|
||||||
|
|
Loading…
Add table
Reference in a new issue