Skip to content
This repository was archived by the owner on Mar 6, 2025. It is now read-only.

Commit 84fd44a

Browse files
committed
show branchname in header in case of manual uploading firmware
1 parent 8c444c3 commit 84fd44a

File tree

4 files changed

+23
-10
lines changed

4 files changed

+23
-10
lines changed

.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
.pio
2-
.vscode/.browse.c_cpp.db*
3-
.vscode/c_cpp_properties.json
4-
.vscode/launch.json
5-
.vscode/ipch
2+
.vscode
63
data/web/esp

data/web/Javascript.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,18 @@ function CreateSelectionListFromInputField(querySelector, jsonLists, blacklist)
219219
for ( k = 0; k < jsonLists.length; k += 1 ) {
220220
for ( i = 0; i < jsonLists[k].length; i += 1 ) {
221221
_option = document.createElement( 'option' );
222-
_option.value = jsonLists[k][i].port;
223-
_option.text = jsonLists[k][i].name;
224-
if(objects[j].value == jsonLists[k][i].port) { _option.selected = true;}
225-
if(blacklist && blacklist.indexOf(jsonLists[k][i].port)>=0) {
226-
_option.disabled = true;
222+
var p,v;
223+
if (jsonLists[k][i] instanceof Object) {
224+
p = jsonLists[k][i].port;
225+
v = jsonLists[k][i].name;
226+
} else {
227+
p = v = jsonLists[k][i];
228+
}
229+
_option.value = p;
230+
_option.text = v;
231+
if(objects[j].value == p) { _option.selected = true;}
232+
if(blacklist && blacklist.indexOf(p)>=0) {
233+
_option.disabled = true;
227234
}
228235
_select.add( _option );
229236
}

src/updater.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ String updater::Stage2String(stage_t s) {
4343
return "UNDEF";
4444
}
4545

46+
stage_t updater::Branch2Stage() {
47+
if (GIT_BRANCH == "master") return (stage_t)PROD;
48+
if (GIT_BRANCH == "prelive") return (stage_t)PRE;
49+
if (GIT_BRANCH == "development") return (stage_t)DEV;
50+
return (stage_t)UNDEF;
51+
}
52+
4653
String updater::GetUpdateErrorString() {
4754
return httpUpdate->getLastErrorString() + "(" + httpUpdate->getLastError() + ")";
4855
}
@@ -201,8 +208,9 @@ void updater::LoadJsonConfig() {
201208
r.version = Release;
202209
r.subversion = 0;
203210
r.number = 0;
204-
r.stage = (stage_t)PROD;
211+
r.stage = Branch2Stage();
205212
r.downloadURL = "";
213+
206214
this->currentRelease = r;
207215
loadDefaultConfig = false; //set back
208216
}

src/updater.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ class updater {
7474
String GetUpdateErrorString();
7575
stage_t String2Stage(String s);
7676
String Stage2String(stage_t s);
77+
stage_t Branch2Stage();
7778
void SetDebugLevel(uint8_t value);
7879
};
7980

0 commit comments

Comments
 (0)