mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
Add endpoint to read firmware capabilities #1218
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"adapter": "react",
|
||||
"baseLocale": "pl",
|
||||
"$schema": "https://unpkg.com/typesafe-i18n@5.24.3/schema/typesafe-i18n.json"
|
||||
}
|
||||
"adapter": "react",
|
||||
"baseLocale": "pl",
|
||||
"$schema": "https://unpkg.com/typesafe-i18n@5.24.4/schema/typesafe-i18n.json"
|
||||
}
|
||||
@@ -44,13 +44,13 @@
|
||||
"react-router-dom": "^6.14.1",
|
||||
"react-toastify": "^9.1.3",
|
||||
"sockette": "^2.0.6",
|
||||
"typesafe-i18n": "^5.24.3",
|
||||
"typesafe-i18n": "^5.24.4",
|
||||
"typescript": "^5.1.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/mime-types": "^2",
|
||||
"@typescript-eslint/eslint-plugin": "^5.61.0",
|
||||
"@typescript-eslint/parser": "^5.61.0",
|
||||
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
||||
"@typescript-eslint/parser": "^6.0.0",
|
||||
"@vitejs/plugin-react-swc": "^3.3.2",
|
||||
"eslint": "^8.44.0",
|
||||
"eslint-config-airbnb": "^19.0.4",
|
||||
|
||||
@@ -4,6 +4,7 @@ import { ToastContainer, Slide } from 'react-toastify';
|
||||
import 'react-toastify/dist/ReactToastify.min.css';
|
||||
|
||||
import { localStorageDetector } from 'typesafe-i18n/detectors';
|
||||
import { FeaturesLoader } from './contexts/features';
|
||||
import type { FC } from 'react';
|
||||
import AppRouting from 'AppRouting';
|
||||
import CustomTheme from 'CustomTheme';
|
||||
@@ -26,7 +27,9 @@ const App: FC = () => {
|
||||
return (
|
||||
<TypesafeI18n locale={detectedLocale}>
|
||||
<CustomTheme>
|
||||
<AppRouting />
|
||||
<FeaturesLoader>
|
||||
<AppRouting />
|
||||
</FeaturesLoader>
|
||||
<ToastContainer
|
||||
position="bottom-left"
|
||||
autoClose={3000}
|
||||
|
||||
@@ -5,28 +5,19 @@ import type { FC } from 'react';
|
||||
|
||||
import type { RequiredChildrenProps } from 'utils';
|
||||
import * as FeaturesApi from 'api/features';
|
||||
import { ApplicationError, LoadingSpinner } from 'components';
|
||||
|
||||
const FeaturesLoader: FC<RequiredChildrenProps> = (props) => {
|
||||
const { data: features, error } = useRequest(FeaturesApi.readFeatures);
|
||||
const { data: features } = useRequest(FeaturesApi.readFeatures);
|
||||
|
||||
if (features) {
|
||||
return (
|
||||
<FeaturesContext.Provider
|
||||
value={{
|
||||
features
|
||||
}}
|
||||
>
|
||||
{props.children}
|
||||
</FeaturesContext.Provider>
|
||||
);
|
||||
}
|
||||
|
||||
if (error) {
|
||||
return <ApplicationError message={error?.message} />;
|
||||
}
|
||||
|
||||
return <LoadingSpinner height="100vh" />;
|
||||
return (
|
||||
<FeaturesContext.Provider
|
||||
value={{
|
||||
features
|
||||
}}
|
||||
>
|
||||
{props.children}
|
||||
</FeaturesContext.Provider>
|
||||
);
|
||||
};
|
||||
|
||||
export default FeaturesLoader;
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import CancelIcon from '@mui/icons-material/Cancel';
|
||||
import WarningIcon from '@mui/icons-material/Warning';
|
||||
import { Button, Checkbox, MenuItem, Grid, Typography, InputAdornment, TextField } from '@mui/material';
|
||||
import { useState } from 'react';
|
||||
import { useContext, useState } from 'react';
|
||||
import { FeaturesContext } from '../../contexts/features';
|
||||
import type { ValidateFieldsError } from 'async-validator';
|
||||
import type { FC } from 'react';
|
||||
|
||||
@@ -39,6 +40,7 @@ const MqttSettingsForm: FC = () => {
|
||||
});
|
||||
|
||||
const { LL } = useI18nContext();
|
||||
const { features } = useContext(FeaturesContext);
|
||||
|
||||
const [fieldErrors, setFieldErrors] = useState<ValidateFieldsError>();
|
||||
|
||||
@@ -169,6 +171,10 @@ const MqttSettingsForm: FC = () => {
|
||||
</TextField>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
{/* TODO here */}
|
||||
<div>{JSON.stringify(features, null, 2)}</div>
|
||||
|
||||
<BlockFormControlLabel
|
||||
control={<Checkbox name="clean_session" checked={data.clean_session} onChange={updateFormValue} />}
|
||||
label={LL.MQTT_CLEAN_SESSION()}
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
export interface Features {
|
||||
project: boolean;
|
||||
security: boolean;
|
||||
mqtt: boolean;
|
||||
ntp: boolean;
|
||||
ota: boolean;
|
||||
upload_firmware: boolean;
|
||||
version: string;
|
||||
platform: string; // "ESP32-C3" "ESP32-S2" "ESP32-S3" "ESP32"
|
||||
}
|
||||
|
||||
@@ -572,7 +572,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@eslint-community/eslint-utils@npm:^4.2.0":
|
||||
"@eslint-community/eslint-utils@npm:^4.2.0, @eslint-community/eslint-utils@npm:^4.3.0":
|
||||
version: 4.4.0
|
||||
resolution: "@eslint-community/eslint-utils@npm:4.4.0"
|
||||
dependencies:
|
||||
@@ -583,7 +583,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@eslint-community/regexpp@npm:^4.4.0":
|
||||
"@eslint-community/regexpp@npm:^4.4.0, @eslint-community/regexpp@npm:^4.5.0":
|
||||
version: 4.5.1
|
||||
resolution: "@eslint-community/regexpp@npm:4.5.1"
|
||||
checksum: d79cbd99cc4dcfbb17e8dd30a30bb5aec5da9c60b9471043f886f116615bb15f0d417cb0ca638cefedba0b4c67c339e2011b53d88264a4540775f042a5879e01
|
||||
@@ -1254,7 +1254,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@types/json-schema@npm:^7.0.9":
|
||||
"@types/json-schema@npm:^7.0.11":
|
||||
version: 7.0.12
|
||||
resolution: "@types/json-schema@npm:7.0.12"
|
||||
checksum: 2c39946ae321fe42d085c61a85872a81bbee70f9b2054ad344e8811dfc478fdbaf1ebf5f2989bb87c895ba2dfc3b1dcba85db11e467bbcdc023708814207791c
|
||||
@@ -1385,124 +1385,128 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@typescript-eslint/eslint-plugin@npm:^5.61.0":
|
||||
version: 5.61.0
|
||||
resolution: "@typescript-eslint/eslint-plugin@npm:5.61.0"
|
||||
"@typescript-eslint/eslint-plugin@npm:^6.0.0":
|
||||
version: 6.0.0
|
||||
resolution: "@typescript-eslint/eslint-plugin@npm:6.0.0"
|
||||
dependencies:
|
||||
"@eslint-community/regexpp": ^4.4.0
|
||||
"@typescript-eslint/scope-manager": 5.61.0
|
||||
"@typescript-eslint/type-utils": 5.61.0
|
||||
"@typescript-eslint/utils": 5.61.0
|
||||
"@eslint-community/regexpp": ^4.5.0
|
||||
"@typescript-eslint/scope-manager": 6.0.0
|
||||
"@typescript-eslint/type-utils": 6.0.0
|
||||
"@typescript-eslint/utils": 6.0.0
|
||||
"@typescript-eslint/visitor-keys": 6.0.0
|
||||
debug: ^4.3.4
|
||||
grapheme-splitter: ^1.0.4
|
||||
graphemer: ^1.4.0
|
||||
ignore: ^5.2.0
|
||||
ignore: ^5.2.4
|
||||
natural-compare: ^1.4.0
|
||||
natural-compare-lite: ^1.4.0
|
||||
semver: ^7.3.7
|
||||
tsutils: ^3.21.0
|
||||
semver: ^7.5.0
|
||||
ts-api-utils: ^1.0.1
|
||||
peerDependencies:
|
||||
"@typescript-eslint/parser": ^5.0.0
|
||||
eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
|
||||
"@typescript-eslint/parser": ^6.0.0 || ^6.0.0-alpha
|
||||
eslint: ^7.0.0 || ^8.0.0
|
||||
peerDependenciesMeta:
|
||||
typescript:
|
||||
optional: true
|
||||
checksum: 5ee13b7b776d7d910082cb1bc31efe6e94fcb22ee163636df28bcc49891d678c05632c8f0900b954ea82701270bd135d45cc1b8234caf4f97864e49b54c04799
|
||||
checksum: 0928778c40fe632b3b4672e7d724d0f624724da36fa3c37fe831fc6e7b6e3f80bb860fc5e46457bd2e61ed863af3122dec3d75f843e81b866fe7bd6f7b4cbf7d
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@typescript-eslint/parser@npm:^5.61.0":
|
||||
version: 5.61.0
|
||||
resolution: "@typescript-eslint/parser@npm:5.61.0"
|
||||
"@typescript-eslint/parser@npm:^6.0.0":
|
||||
version: 6.0.0
|
||||
resolution: "@typescript-eslint/parser@npm:6.0.0"
|
||||
dependencies:
|
||||
"@typescript-eslint/scope-manager": 5.61.0
|
||||
"@typescript-eslint/types": 5.61.0
|
||||
"@typescript-eslint/typescript-estree": 5.61.0
|
||||
"@typescript-eslint/scope-manager": 6.0.0
|
||||
"@typescript-eslint/types": 6.0.0
|
||||
"@typescript-eslint/typescript-estree": 6.0.0
|
||||
"@typescript-eslint/visitor-keys": 6.0.0
|
||||
debug: ^4.3.4
|
||||
peerDependencies:
|
||||
eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
|
||||
eslint: ^7.0.0 || ^8.0.0
|
||||
peerDependenciesMeta:
|
||||
typescript:
|
||||
optional: true
|
||||
checksum: 4fd5a589b0e27a931f32296cc020e7b6052337ceb8312008e5cacbbcd6706f12b2bc481398c40d6e8c482770929593564a6ed2a3b681e7a7634282bd9c12afc4
|
||||
checksum: f4e4de103534378c7835bea95299282c2f997061c304a242f4fac7ccca3862f3b98b634ee0b3bb2627ac557f84fd012ab8478d6207849d6b4e6b389b02444efb
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@typescript-eslint/scope-manager@npm:5.61.0":
|
||||
version: 5.61.0
|
||||
resolution: "@typescript-eslint/scope-manager@npm:5.61.0"
|
||||
"@typescript-eslint/scope-manager@npm:6.0.0":
|
||||
version: 6.0.0
|
||||
resolution: "@typescript-eslint/scope-manager@npm:6.0.0"
|
||||
dependencies:
|
||||
"@typescript-eslint/types": 5.61.0
|
||||
"@typescript-eslint/visitor-keys": 5.61.0
|
||||
checksum: 3f4cc831094490d1d201ed1bdf4441eb807b3d6613898b0683ff989bb6dbaeef0311a6dd9d8deb2e4efa2a84d9c857de058edba2eb92abbaeb0385d1dd2ab564
|
||||
"@typescript-eslint/types": 6.0.0
|
||||
"@typescript-eslint/visitor-keys": 6.0.0
|
||||
checksum: 0a4666f84775e335c985b1c118a15fd99b741316395d85e5d207ef2d6192f9aae91ed7771849f780b4c57772795868aecb60a2f1ace9f4f1202c183373a565a8
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@typescript-eslint/type-utils@npm:5.61.0":
|
||||
version: 5.61.0
|
||||
resolution: "@typescript-eslint/type-utils@npm:5.61.0"
|
||||
"@typescript-eslint/type-utils@npm:6.0.0":
|
||||
version: 6.0.0
|
||||
resolution: "@typescript-eslint/type-utils@npm:6.0.0"
|
||||
dependencies:
|
||||
"@typescript-eslint/typescript-estree": 5.61.0
|
||||
"@typescript-eslint/utils": 5.61.0
|
||||
"@typescript-eslint/typescript-estree": 6.0.0
|
||||
"@typescript-eslint/utils": 6.0.0
|
||||
debug: ^4.3.4
|
||||
tsutils: ^3.21.0
|
||||
ts-api-utils: ^1.0.1
|
||||
peerDependencies:
|
||||
eslint: "*"
|
||||
eslint: ^7.0.0 || ^8.0.0
|
||||
peerDependenciesMeta:
|
||||
typescript:
|
||||
optional: true
|
||||
checksum: a99775baf0a6401bb937c9fdf4f1d23a16428c7ec96c39e549ed313af6ffff3274bad7684d9fc7f846e15c4ef7343a7372a6e6868f9e1ea4061ced7c67f50d9a
|
||||
checksum: b655304feb7f1c8b641c312bec68e74243f408d24543af2e84bc591a14379814ed6c65f6fa061202b04dd39b02152f38c11cd50dd614967fa8027c5b831da3a5
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@typescript-eslint/types@npm:5.61.0":
|
||||
version: 5.61.0
|
||||
resolution: "@typescript-eslint/types@npm:5.61.0"
|
||||
checksum: f6aacd4ee3180d851463976696d9c43df2debf3bad2c3f26aeaf2a0cab30235152efb5f04e649863548bfc57f454d6c0a2f12f68508feb4771d7e6b1b72bc066
|
||||
"@typescript-eslint/types@npm:6.0.0":
|
||||
version: 6.0.0
|
||||
resolution: "@typescript-eslint/types@npm:6.0.0"
|
||||
checksum: 5183652b95cc8cabfb87e3e2acde9c0c72defc784419f8f45cbe650c4f7a17e3064696a9c35cda6819986da2793b054e027d59ab661862cb73beb58f62155b25
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@typescript-eslint/typescript-estree@npm:5.61.0":
|
||||
version: 5.61.0
|
||||
resolution: "@typescript-eslint/typescript-estree@npm:5.61.0"
|
||||
"@typescript-eslint/typescript-estree@npm:6.0.0":
|
||||
version: 6.0.0
|
||||
resolution: "@typescript-eslint/typescript-estree@npm:6.0.0"
|
||||
dependencies:
|
||||
"@typescript-eslint/types": 5.61.0
|
||||
"@typescript-eslint/visitor-keys": 5.61.0
|
||||
"@typescript-eslint/types": 6.0.0
|
||||
"@typescript-eslint/visitor-keys": 6.0.0
|
||||
debug: ^4.3.4
|
||||
globby: ^11.1.0
|
||||
is-glob: ^4.0.3
|
||||
semver: ^7.3.7
|
||||
tsutils: ^3.21.0
|
||||
semver: ^7.5.0
|
||||
ts-api-utils: ^1.0.1
|
||||
peerDependenciesMeta:
|
||||
typescript:
|
||||
optional: true
|
||||
checksum: 78f60103ad7c282840bd7623b38b785fdd46a75511354e1336589bae532daab7e7f297b1264814e7cd3191cf2e0608b1cc89fc599c0b03085b709a6490965233
|
||||
checksum: 0845e6fd2d2dc4b7187b910b8ceda4bdb2d89090fbbcf294c8b8d36701ff5c81f1efc6424860db15c6a6367f4205d0f3c24a5293f1a6cc25a39ebbd52ef2b91d
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@typescript-eslint/utils@npm:5.61.0":
|
||||
version: 5.61.0
|
||||
resolution: "@typescript-eslint/utils@npm:5.61.0"
|
||||
"@typescript-eslint/utils@npm:6.0.0":
|
||||
version: 6.0.0
|
||||
resolution: "@typescript-eslint/utils@npm:6.0.0"
|
||||
dependencies:
|
||||
"@eslint-community/eslint-utils": ^4.2.0
|
||||
"@types/json-schema": ^7.0.9
|
||||
"@eslint-community/eslint-utils": ^4.3.0
|
||||
"@types/json-schema": ^7.0.11
|
||||
"@types/semver": ^7.3.12
|
||||
"@typescript-eslint/scope-manager": 5.61.0
|
||||
"@typescript-eslint/types": 5.61.0
|
||||
"@typescript-eslint/typescript-estree": 5.61.0
|
||||
"@typescript-eslint/scope-manager": 6.0.0
|
||||
"@typescript-eslint/types": 6.0.0
|
||||
"@typescript-eslint/typescript-estree": 6.0.0
|
||||
eslint-scope: ^5.1.1
|
||||
semver: ^7.3.7
|
||||
semver: ^7.5.0
|
||||
peerDependencies:
|
||||
eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
|
||||
checksum: f55bc4a0637e5f529260a0240ae7ecca04b20fde69e1892991d1087b3e230fa02df1c46e671359b3789f15bcfb90cf9f47bb79fa5f48b41b92966706cc66f413
|
||||
eslint: ^7.0.0 || ^8.0.0
|
||||
checksum: 7027316300d337e0004b56db0de53bb74c71a06b508377d9ce3bce9a8698f33aaf9e4f1ddbaec2daf6f9bfcf2f6ee80dd9c35117858ab72e2ca17d7abfae9313
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@typescript-eslint/visitor-keys@npm:5.61.0":
|
||||
version: 5.61.0
|
||||
resolution: "@typescript-eslint/visitor-keys@npm:5.61.0"
|
||||
"@typescript-eslint/visitor-keys@npm:6.0.0":
|
||||
version: 6.0.0
|
||||
resolution: "@typescript-eslint/visitor-keys@npm:6.0.0"
|
||||
dependencies:
|
||||
"@typescript-eslint/types": 5.61.0
|
||||
eslint-visitor-keys: ^3.3.0
|
||||
checksum: f438b68b67e03fc39e39537a594259f5df64155f775ef7afb915507f7c364ba8a93567302080c3364d270001d5dd67ee0a0632a92d8d6f6fc776f97c082c130a
|
||||
"@typescript-eslint/types": 6.0.0
|
||||
eslint-visitor-keys: ^3.4.1
|
||||
checksum: 389eee2b479d47b1afbf6c344fa8601e6a47499cce069acd9e94fc57bd85bc16af1c8583bb301b704076e33589b0eec9ee71e6977709c18b59e345f45e3a9277
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -1534,8 +1538,8 @@ __metadata:
|
||||
"@types/react": ^18.2.14
|
||||
"@types/react-dom": ^18.2.6
|
||||
"@types/react-router-dom": ^5.3.3
|
||||
"@typescript-eslint/eslint-plugin": ^5.61.0
|
||||
"@typescript-eslint/parser": ^5.61.0
|
||||
"@typescript-eslint/eslint-plugin": ^6.0.0
|
||||
"@typescript-eslint/parser": ^6.0.0
|
||||
"@vitejs/plugin-react-swc": ^3.3.2
|
||||
alova: ^2.9.1
|
||||
async-validator: ^4.2.5
|
||||
@@ -1566,7 +1570,7 @@ __metadata:
|
||||
rollup-plugin-visualizer: ^5.9.2
|
||||
sockette: ^2.0.6
|
||||
terser: ^5.18.2
|
||||
typesafe-i18n: ^5.24.3
|
||||
typesafe-i18n: ^5.24.4
|
||||
typescript: ^5.1.6
|
||||
vite: ^4.4.2
|
||||
vite-plugin-svgr: ^3.2.0
|
||||
@@ -3378,6 +3382,13 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"grapheme-splitter@npm:^1.0.4":
|
||||
version: 1.0.4
|
||||
resolution: "grapheme-splitter@npm:1.0.4"
|
||||
checksum: 108415fb07ac913f17040dc336607772fcea68c7f495ef91887edddb0b0f5ff7bc1d1ab181b125ecb2f0505669ef12c9a178a3bbd2dd8e042d8c5f1d7c90331a
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"graphemer@npm:^1.4.0":
|
||||
version: 1.4.0
|
||||
resolution: "graphemer@npm:1.4.0"
|
||||
@@ -5241,7 +5252,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.5.3":
|
||||
"semver@npm:^7.3.5, semver@npm:^7.5.0, semver@npm:^7.5.3":
|
||||
version: 7.5.4
|
||||
resolution: "semver@npm:7.5.4"
|
||||
dependencies:
|
||||
@@ -5731,6 +5742,15 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"ts-api-utils@npm:^1.0.1":
|
||||
version: 1.0.1
|
||||
resolution: "ts-api-utils@npm:1.0.1"
|
||||
peerDependencies:
|
||||
typescript: ">=4.2.0"
|
||||
checksum: 8e8a54afb44df31c413e6f5b817a305a37780726125db26e85d01d553efc31aacb3ccad111a14844b584776f24e71bcd4db2f2d3e9bce8031a329dc78f3e46e2
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"tsconfck@npm:^2.1.0":
|
||||
version: 2.1.1
|
||||
resolution: "tsconfck@npm:2.1.1"
|
||||
@@ -5757,13 +5777,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"tslib@npm:^1.8.1":
|
||||
version: 1.14.1
|
||||
resolution: "tslib@npm:1.14.1"
|
||||
checksum: 69ae09c49eea644bc5ebe1bca4fa4cc2c82b7b3e02f43b84bd891504edf66dbc6b2ec0eef31a957042de2269139e4acff911e6d186a258fb14069cd7f6febce2
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"tslib@npm:^2.4.0, tslib@npm:^2.5.0, tslib@npm:^2.6.0":
|
||||
version: 2.6.0
|
||||
resolution: "tslib@npm:2.6.0"
|
||||
@@ -5771,17 +5784,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"tsutils@npm:^3.21.0":
|
||||
version: 3.21.0
|
||||
resolution: "tsutils@npm:3.21.0"
|
||||
dependencies:
|
||||
tslib: ^1.8.1
|
||||
peerDependencies:
|
||||
typescript: ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta"
|
||||
checksum: 02f19e458ec78ead8fffbf711f834ad8ecd2cc6ade4ec0320790713dccc0a412b99e7fd907c4cda2a1dc602c75db6f12e0108e87a5afad4b2f9e90a24cabd5a2
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"type-check@npm:^0.4.0, type-check@npm:~0.4.0":
|
||||
version: 0.4.0
|
||||
resolution: "type-check@npm:0.4.0"
|
||||
@@ -5809,14 +5811,14 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"typesafe-i18n@npm:^5.24.3":
|
||||
version: 5.24.3
|
||||
resolution: "typesafe-i18n@npm:5.24.3"
|
||||
"typesafe-i18n@npm:^5.24.4":
|
||||
version: 5.24.4
|
||||
resolution: "typesafe-i18n@npm:5.24.4"
|
||||
peerDependencies:
|
||||
typescript: ">=3.5.1"
|
||||
bin:
|
||||
typesafe-i18n: cli/typesafe-i18n.mjs
|
||||
checksum: 1f887c1c9ec1fbd78fe4ad08e81a10bf3661f81d61337a210b15c99a43ed3f7bee5602351694ac86ab2aabb4c5ef595edc9d2e4fa8dc3c6873ba9eaa8001bfab
|
||||
checksum: d464ddc2b6f1f53e840d0e69a2e5c48bfa487180ce1cff4cd6ca489b016c861ef77242b49d05e2ddc35fc41d0d8d2c9816799dde0f4910ca0159c2f1f1499a2a
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include <FeaturesService.h>
|
||||
#include "../../src/emsesp_stub.hpp" // proddy added
|
||||
|
||||
using namespace std::placeholders; // for `_1` etc
|
||||
using namespace std::placeholders; // for `_1` etc
|
||||
|
||||
FeaturesService::FeaturesService(AsyncWebServer * server) {
|
||||
server->on(FEATURES_SERVICE_PATH, HTTP_GET, std::bind(&FeaturesService::features, this, _1));
|
||||
@@ -9,36 +10,10 @@ FeaturesService::FeaturesService(AsyncWebServer * server) {
|
||||
void FeaturesService::features(AsyncWebServerRequest * request) {
|
||||
AsyncJsonResponse * response = new AsyncJsonResponse(false, MAX_FEATURES_SIZE);
|
||||
JsonObject root = response->getRoot();
|
||||
#if FT_ENABLED(FT_PROJECT)
|
||||
root["project"] = true;
|
||||
#else
|
||||
root["project"] = false;
|
||||
#endif
|
||||
#if FT_ENABLED(FT_SECURITY)
|
||||
root["security"] = true;
|
||||
#else
|
||||
root["security"] = false;
|
||||
#endif
|
||||
#if FT_ENABLED(FT_MQTT)
|
||||
root["mqtt"] = true;
|
||||
#else
|
||||
root["mqtt"] = false;
|
||||
#endif
|
||||
#if FT_ENABLED(FT_NTP)
|
||||
root["ntp"] = true;
|
||||
#else
|
||||
root["ntp"] = false;
|
||||
#endif
|
||||
#if FT_ENABLED(FT_OTA)
|
||||
root["ota"] = true;
|
||||
#else
|
||||
root["ota"] = false;
|
||||
#endif
|
||||
#if FT_ENABLED(FT_UPLOAD_FIRMWARE)
|
||||
root["upload_firmware"] = true;
|
||||
#else
|
||||
root["upload_firmware"] = false;
|
||||
#endif
|
||||
|
||||
root["version"] = EMSESP_APP_VERSION;
|
||||
root["platform"] = EMSESP_PLATFORM;
|
||||
|
||||
response->setLength();
|
||||
request->send(response);
|
||||
}
|
||||
|
||||
@@ -323,12 +323,8 @@ security_settings = {
|
||||
]
|
||||
};
|
||||
const features = {
|
||||
project: true,
|
||||
security: true,
|
||||
mqtt: true,
|
||||
ntp: true,
|
||||
ota: true,
|
||||
upload_firmware: true
|
||||
version: 'v3.6.0-demo',
|
||||
platform: 'ESP32-S3'
|
||||
};
|
||||
const verify_authentication = { access_token: '1234' };
|
||||
const signin = {
|
||||
|
||||
Reference in New Issue
Block a user