Skip to content

Commit

Permalink
Merge branch 'drhideg-boards'
Browse files Browse the repository at this point in the history
  • Loading branch information
benzino77 committed May 26, 2021
2 parents 0271291 + 55b52d2 commit 42af0ca
Show file tree
Hide file tree
Showing 14 changed files with 100 additions and 58 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tasmocompiler",
"version": "5.3.0",
"version": "5.3.1",
"private": true,
"proxy": "http://localhost:3001/",
"dependencies": {
Expand Down
7 changes: 1 addition & 6 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,7 @@ class App extends Component {
<MessageBox {...this.props} compileMessages={compileMessages} />
)}
{showDownloadLinks && (
<DownloadLinks
{...this.props}
isEsp8266={
other.features.board.name.includes('esp32') ? false : true
}
/>
<DownloadLinks {...this.props} features={other.features} />
)}
</div>
</IntlProvider>
Expand Down
33 changes: 23 additions & 10 deletions src/components/AppStepper/FeaturesStep/AvailableBoards.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
const availableBoardChipTypes = [
{ name: 'esp8266', description: '', tooltip: '' },
{ name: 'esp32', description: '', tooltip: '' },
];

const availableBoards = [
{
name: 'esp8266',
description: 'ESP8266 Generic',
name: 'esp8266generic',
chip_type: 'esp8266',
description: 'Generic',
default: true,
show: true,
platformio_entries: {},
Expand All @@ -12,7 +18,8 @@ const availableBoards = [
},
{
name: 'esp82664M',
description: ' ESP8266 Wemos/NodeMCU',
chip_type: 'esp8266',
description: 'Wemos/NodeMCU',
default: true,
show: true,
platformio_entries: {
Expand All @@ -26,6 +33,7 @@ const availableBoards = [
// zbbridge
{
name: 'zbbridge',
chip_type: 'esp8266',
description: 'SonOff Zigbee Bridge',
default: false,
show: true,
Expand Down Expand Up @@ -54,8 +62,9 @@ const availableBoards = [
},
// esp32
{
name: 'esp32',
description: 'ESP32 Generic',
name: 'esp32generic',
chip_type: 'esp32',
description: 'Generic',
default: false,
show: true,
platformio_entries: {
Expand All @@ -69,7 +78,8 @@ const availableBoards = [
// esp32webcam
{
name: 'esp32webcam',
description: 'ESP32 webcam',
chip_type: 'esp32',
description: 'Webcam',
default: false,
show: true,
platformio_entries: {
Expand All @@ -88,7 +98,8 @@ const availableBoards = [
// esp32odroid-go
{
name: 'esp32odroid-go',
description: 'ESP32 odroid-go',
chip_type: 'esp32',
description: 'Odroid-Go',
default: false,
show: true,
platformio_entries: {
Expand All @@ -113,7 +124,8 @@ const availableBoards = [
// esp32m5
{
name: 'esp32m5',
description: 'ESP32 M5Stack Core2',
chip_type: 'esp32',
description: 'M5Stack Core2',
default: false,
show: true,
platformio_entries: {
Expand Down Expand Up @@ -150,7 +162,8 @@ const availableBoards = [
// solo1
{
name: 'esp32solo1',
description: 'ESP32 Solo1',
chip_type: 'esp32',
description: 'Solo1',
default: false,
show: true,
platformio_entries: {
Expand All @@ -166,4 +179,4 @@ const availableBoards = [
},
];

export default availableBoards;
export { availableBoardChipTypes, availableBoards };
92 changes: 55 additions & 37 deletions src/components/AppStepper/FeaturesStep/FeaturesStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ import Typography from '@material-ui/core/Typography';
import Tooltip from '@material-ui/core/Tooltip';
import Radio from '@material-ui/core/Radio';
import RadioGroup from '@material-ui/core/RadioGroup';
import FormControl from '@material-ui/core/FormControl';
import FormControlLabel from '@material-ui/core/FormControlLabel';
import FormHelperText from '@material-ui/core/FormHelperText';
import Divider from '@material-ui/core/Divider';

import availableFeatures from './AvailableFeatures';
import availableBoards from './AvailableBoards';
import { availableBoards, availableBoardChipTypes } from './AvailableBoards';
import FeaturesSelector from './FeaturesSelector';
import NextButton from '../NextButton';
import BackButton from '../BackButton';
Expand Down Expand Up @@ -207,46 +208,63 @@ class FeaturesStep extends Component {
<Typography>
<FormattedMessage id="stepFeaturesBoardDesc" />
</Typography>

<div className={classes.actionsContainer}>
<RadioGroup
row
aria-label="board"
name="board"
value={board.name}
onChange={this.handleRadioChange}
>
{availableBoards.map((item, index) => {
const { name, description, tooltip, show } = item;
<FormControl>
{availableBoardChipTypes.map((chipType, idx) => {
return (
show && (
// tooltips workaround
<Wire
value={name}
key={index}
className={classes.radioContainer}
<div
className={classes.chipTypesContainer}
key={chipType.name}
>
<Typography>{chipType.name.toUpperCase()}</Typography>
<RadioGroup
row
aria-label="board"
name="board"
value={board.name}
onChange={this.handleRadioChange}
>
{(props) => (
<Tooltip
title={
tooltip ? <FormattedMessage id={tooltip} /> : ''
}
>
<FormControlLabel
control={<Radio />}
label={description}
labelPlacement="end"
{...props}
/>
</Tooltip>
)}
</Wire>
)
{availableBoards.map((item) => {
const { name, description, tooltip, show, chip_type } =
item;
return (
chip_type === chipType.name &&
show && (
// tooltips workaround
<Wire value={name} key={item.name}>
{(props) => (
<Tooltip
title={
tooltip ? (
<FormattedMessage id={tooltip} />
) : (
''
)
}
>
<div className={classes.radioContainer}>
<FormControlLabel
control={<Radio />}
label={description}
labelPlacement="end"
{...props}
/>
</div>
</Tooltip>
)}
</Wire>
)
);
})}
</RadioGroup>
{idx < availableBoardChipTypes.length - 1 && (
<Divider className={classes.boardsDivider} />
)}
</div>
);
})}
</RadioGroup>
<FormHelperText>
{/* <FormattedMessage id="stepFeatures..." /> */}
</FormHelperText>
</FormControl>
</div>

<Typography>
Expand Down
5 changes: 3 additions & 2 deletions src/components/DownloadLinks/DownloadLinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ class DownloadLinks extends Component {
}

render() {
const { classes, isEsp8266 } = this.props;
const { classes, features } = this.props;
const isEsp8266 = features.board.chip_type === 'esp8266';

return (
<div ref={this.downloadLinksElement}>
Expand Down Expand Up @@ -75,7 +76,7 @@ class DownloadLinks extends Component {

DownloadLinks.propTypes = {
classes: PropTypes.oneOfType([PropTypes.object]).isRequired,
isEsp8266: PropTypes.bool.isRequired,
features: PropTypes.oneOfType([PropTypes.object]).isRequired,
};

export default DownloadLinks;
1 change: 1 addition & 0 deletions src/locales/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

"stepFeaturesTitle": "Výběr funkcí",
"stepFeaturesBoardDesc": "Select board your project is based on",
"stepFeaturesBoardGeneric": "Generic",
"stepFeaturesBoard8266Tooltip": "This is probably board you should choose",
"stepFeaturesBoard82664MTooltip": "4MB ESP8266 boards like Wemos D1 Mini, NodeMCU, etc..",
"stepFeaturesDesc": "Jaké funkce chcete zahrnout do výsledného binárního FW?",
Expand Down
1 change: 1 addition & 0 deletions src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

"stepFeaturesTitle": "Wähle die Features",
"stepFeaturesBoardDesc": "Wähle die Hardware auf dem dein Projekt basiert",
"stepFeaturesBoardGeneric": "Generic",
"stepFeaturesBoard8266Tooltip": "This is probably board you should choose",
"stepFeaturesBoard82664MTooltip": "4MB ESP8266 Board z.B. Wemos D1 Mini, NodeMCU, etc.",
"stepFeaturesDesc": "Welche Features sollen in der endgültigen Firmenware enthalten sein?",
Expand Down
1 change: 1 addition & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

"stepFeaturesTitle": "Select features",
"stepFeaturesBoardDesc": "Select board your project is based on",
"stepFeaturesBoardGeneric": "Generic",
"stepFeaturesBoard8266Tooltip": "This is probably board you should choose",
"stepFeaturesBoard82664MTooltip": "4MB ESP8266 boards like Wemos D1 Mini, NodeMCU, etc.",
"stepFeaturesDesc": "Which features should be included in final binary firmware?",
Expand Down
1 change: 1 addition & 0 deletions src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

"stepFeaturesTitle": "Selecionar Características",
"stepFeaturesBoardDesc": "Seleccionar el tipo de hardware a usar",
"stepFeaturesBoardGeneric": "Generic",
"stepFeaturesBoard8266Tooltip": "Recomendado para todos los dispositivos con ESP8266.",
"stepFeaturesBoard82664MTooltip": "Solo para uso avanzado y solo para dispositivos con ESP8266 y 4MB como Wemos D1 Mini, NodeMCU, etc.",
"stepFeaturesDesc": "¿Qué características desea que se incluyan en el firmware personalizado?",
Expand Down
1 change: 1 addition & 0 deletions src/locales/hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

"stepFeaturesTitle": "Jellemzők kiválasztás",
"stepFeaturesBoardDesc": "Válassza ki a alaplapot, amelyre a projekt épül",
"stepFeaturesBoardGeneric": "Általános",
"stepFeaturesBoard8266Tooltip": "Ez valószínűleg az az alaplap, amelyet választania kell",
"stepFeaturesBoard82664MTooltip": "4MB ESP8266 alaplapok, például Wemos D1 Mini, NodeMCU stb.",
"stepFeaturesDesc": "Mely tulajdonságokat kell tartalmaznia a végleges bináris firmware-nek?",
Expand Down
1 change: 1 addition & 0 deletions src/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

"stepFeaturesTitle": "Selezione funzionalità",
"stepFeaturesBoardDesc": "Seleziona il tipo di scheda su cui è basato il progetto",
"stepFeaturesBoardGeneric": "Generic",
"stepFeaturesBoard8266Tooltip": "Questa è molto probabilmente la scheda che dovresti scegliere",
"stepFeaturesBoard82664MTooltip": "Scheda ESP8266 4MB come Wemos D1 Mini, NodeMCU, ecc..",
"stepFeaturesDesc": "Quali funzionalità vuoi includere nel firmware?",
Expand Down
1 change: 1 addition & 0 deletions src/locales/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

"stepFeaturesTitle": "Wybór funkcjonalności",
"stepFeaturesBoardDesc": "Wybierz płytkę na której bazuje Twój projekt",
"stepFeaturesBoardGeneric": "Generic",
"stepFeaturesBoard8266Tooltip": "To jest płytka, którą najprawdopodobniej powinieneś wybrać",
"stepFeaturesBoard82664MTooltip": "Płytki ESP8266 4MB takie jak Wemos D1 Mini, NodeMCU, itd..",
"stepFeaturesDesc": "Jakie funkcjonalności zostaną zawarte w wynikowym firmware?",
Expand Down
1 change: 1 addition & 0 deletions src/locales/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

"stepFeaturesTitle": "selecione Características",
"stepFeaturesBoardDesc": "Selecione o tipo de hardware a ser usado",
"stepFeaturesBoardGeneric": "Generic",
"stepFeaturesBoard8266Tooltip": "Recomendado para todos os dispositivos com ESP8266.",
"stepFeaturesBoard82664MTooltip": "Apenas para uso avançado e apenas para dispositivos com ESP8266 e 4 MB como Wemos D1 Mini, NodeMCU, etc.",
"stepFeaturesDesc": "Quais recursos devem ser incluídos no firmware final?",
Expand Down
11 changes: 9 additions & 2 deletions src/styles/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,17 @@ const styles = (theme) => ({
checkboxContainer: {
marginBottom: 0,
marginLeft: theme.spacing.unit,
minWidth: 200,
maxWidth: 200,
minWidth: 230,
maxWidth: 230,
},
radioContainer: {
marginBottom: 0,
marginLeft: theme.spacing.unit,
minWidth: 230,
maxWidth: 230,
},
chipTypesContainer: {
},
links: {
marginLeft: theme.spacing.unit * 3,
},
Expand All @@ -115,6 +118,10 @@ const styles = (theme) => ({
marginBottom: theme.spacing.unit,
position: 'relative',
},
boardsDivider: {
marginTop: theme.spacing.unit,
marginBottom: theme.spacing.unit,
},
});

export default styles;

0 comments on commit 42af0ca

Please sign in to comment.