mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
use developer mode
This commit is contained in:
@@ -272,28 +272,30 @@ const SystemLog = () => {
|
|||||||
)}
|
)}
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Grid>
|
{data.developer_mode && (
|
||||||
{readOpen && (
|
<Grid>
|
||||||
<TextField
|
{readOpen && (
|
||||||
value={readValue}
|
<TextField
|
||||||
onChange={(event) => {
|
value={readValue}
|
||||||
const value = event.target.value;
|
onChange={(event) => {
|
||||||
if (value !== '' && !ALPHA_NUMERIC_DASH_REGEX.test(value)) {
|
const value = event.target.value;
|
||||||
return;
|
if (value !== '' && !ALPHA_NUMERIC_DASH_REGEX.test(value)) {
|
||||||
}
|
return;
|
||||||
setReadValue(value);
|
}
|
||||||
}}
|
setReadValue(value);
|
||||||
focused={true}
|
}}
|
||||||
label="Send Read command"
|
focused={true}
|
||||||
variant="outlined"
|
label="Send Read command"
|
||||||
helperText="<deviceID> <type ID> [offset] [length]"
|
variant="outlined"
|
||||||
size="small"
|
helperText="<deviceID> <type ID> [offset] [length]"
|
||||||
/>
|
size="small"
|
||||||
)}
|
/>
|
||||||
<IconButton onClick={sendReadCommand}>
|
)}
|
||||||
<PlayArrowIcon color="primary" />
|
<IconButton onClick={sendReadCommand}>
|
||||||
</IconButton>
|
<PlayArrowIcon color="primary" />
|
||||||
</Grid>
|
</IconButton>
|
||||||
|
</Grid>
|
||||||
|
)}
|
||||||
</Grid>
|
</Grid>
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
|
|||||||
@@ -67,4 +67,5 @@ export interface LogSettings {
|
|||||||
max_messages: number;
|
max_messages: number;
|
||||||
compact: boolean;
|
compact: boolean;
|
||||||
psram: boolean;
|
psram: boolean;
|
||||||
|
developer_mode: boolean;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -237,12 +237,13 @@ void WebLogService::transmit(const QueuedLogMessage & message) {
|
|||||||
void WebLogService::getSetValues(AsyncWebServerRequest * request, JsonVariant json) {
|
void WebLogService::getSetValues(AsyncWebServerRequest * request, JsonVariant json) {
|
||||||
if ((request->method() == HTTP_GET) || (!json.is<JsonObject>())) {
|
if ((request->method() == HTTP_GET) || (!json.is<JsonObject>())) {
|
||||||
// GET - return the values
|
// GET - return the values
|
||||||
auto * response = new AsyncJsonResponse(false);
|
auto * response = new AsyncJsonResponse(false);
|
||||||
JsonObject root = response->getRoot();
|
JsonObject root = response->getRoot();
|
||||||
root["level"] = log_level();
|
root["level"] = log_level();
|
||||||
root["max_messages"] = maximum_log_messages();
|
root["max_messages"] = maximum_log_messages();
|
||||||
root["compact"] = compact();
|
root["compact"] = compact();
|
||||||
root["psram"] = (EMSESP::system_.PSram() > 0);
|
root["psram"] = (EMSESP::system_.PSram() > 0);
|
||||||
|
root["developer_mode"] = EMSESP::system_.developer_mode();
|
||||||
|
|
||||||
response->setLength();
|
response->setLength();
|
||||||
request->send(response);
|
request->send(response);
|
||||||
|
|||||||
Reference in New Issue
Block a user