Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFS Gluon Firmware Selector
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
firmware
FFS Gluon Firmware Selector
Commits
8c36b7ad
Commit
8c36b7ad
authored
Mar 19, 2018
by
codedust
Browse files
Options
Downloads
Patches
Plain Diff
Add support for multiple experimental branches
Closes #49
parent
39945440
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
app.js
+16
-15
16 additions, 15 deletions
app.js
config_template.js
+2
-0
2 additions, 0 deletions
config_template.js
with
18 additions
and
15 deletions
app.js
+
16
−
15
View file @
8c36b7ad
...
@@ -84,7 +84,7 @@ var firmwarewizard = function() {
...
@@ -84,7 +84,7 @@ var firmwarewizard = function() {
// constants
// constants
var
IGNORED_ELEMENTS
=
[
var
IGNORED_ELEMENTS
=
[
'
./
'
,
'
../
'
,
'
experimental.manifest
'
,
'
beta.manifest
'
,
'
stable
.manifest
'
,
'
./
'
,
'
../
'
,
'
.manifest
'
,
'
-tftp
'
,
'
-fat
'
,
'
-loader
'
,
'
-NA
'
,
'
-x2-
'
,
'
-hsv2
'
,
'
-p1020
'
'
-tftp
'
,
'
-fat
'
,
'
-loader
'
,
'
-NA
'
,
'
-x2-
'
,
'
-hsv2
'
,
'
-p1020
'
];
];
var
PANE
=
{
'
MODEL
'
:
0
,
'
IMAGETYPE
'
:
1
,
'
BRANCH
'
:
2
};
var
PANE
=
{
'
MODEL
'
:
0
,
'
IMAGETYPE
'
:
1
,
'
BRANCH
'
:
2
};
...
@@ -114,6 +114,10 @@ var firmwarewizard = function() {
...
@@ -114,6 +114,10 @@ var firmwarewizard = function() {
'
kernel
'
:
"
Kernel-Image
"
'
kernel
'
:
"
Kernel-Image
"
};
};
var
branches
=
ObjectValues
(
config
.
directories
).
filter
(
function
(
e
,
index
,
self
)
{
return
index
===
self
.
indexOf
(
e
);
});
var
reFileExtension
=
new
RegExp
(
/.
(
bin|img.gz|img|tar
)
/
);
var
reFileExtension
=
new
RegExp
(
/.
(
bin|img.gz|img|tar
)
/
);
var
reRemoveDashes
=
new
RegExp
(
/-/g
);
var
reRemoveDashes
=
new
RegExp
(
/-/g
);
var
reSearchable
=
new
RegExp
(
'
[-/
'
+
NON_BREAKING_SPACE
+
'
]
'
,
'
g
'
);
var
reSearchable
=
new
RegExp
(
'
[-/
'
+
NON_BREAKING_SPACE
+
'
]
'
,
'
g
'
);
...
@@ -800,15 +804,15 @@ var firmwarewizard = function() {
...
@@ -800,15 +804,15 @@ var firmwarewizard = function() {
return
;
return
;
}
}
var
revisions
=
images
[
currentVendor
][
currentModel
]
var
revisions
=
images
[
currentVendor
][
currentModel
].
filter
(
function
(
e
)
{
.
filter
(
function
(
e
)
{
return
e
.
revision
==
currentRevision
&&
e
.
type
==
currentImageType
;
return
e
.
revision
==
currentRevision
&&
e
.
type
==
currentImageType
;
}).
sort
(
function
(
a
,
b
)
{
}).
sort
(
function
(
a
,
b
)
{
if
(
a
.
branch
==
'
stable
'
)
return
-
1
;
// non-experimental branches should appear first
if
(
b
.
branch
==
'
stable
'
)
return
1
;
var
a_experimental
=
config
.
experimental_branches
.
indexOf
(
a
.
branch
)
!=
-
1
;
if
(
a
.
branch
==
'
beta
'
)
return
-
1
;
var
b_experimental
=
config
.
experimental_branches
.
indexOf
(
b
.
branch
)
!=
-
1
;
if
(
b
.
branch
==
'
beta
'
)
return
1
;
if
(
a_experimental
&&
!
b_experimental
)
return
1
;
return
0
;
if
(
!
a_experimental
&&
b_experimental
)
return
-
1
;
return
branches
.
indexOf
(
a
.
branch
)
>
branches
.
indexOf
(
b
.
branch
);
});
});
$
(
'
#branchselect
'
).
innerHTML
=
''
;
$
(
'
#branchselect
'
).
innerHTML
=
''
;
...
@@ -828,7 +832,7 @@ var firmwarewizard = function() {
...
@@ -828,7 +832,7 @@ var firmwarewizard = function() {
(
rev
.
size
!==
''
?
'
[
'
+
rev
.
size
+
'
]
'
:
''
)
+
(
rev
.
size
!==
''
?
'
[
'
+
rev
.
size
+
'
]
'
:
''
)
+
'
(
'
+
prettyPrintVersion
(
rev
.
version
)
+
'
)
'
;
'
(
'
+
prettyPrintVersion
(
rev
.
version
)
+
'
)
'
;
if
(
rev
.
branch
==
'
experimental
'
)
{
if
(
config
.
experimental_branches
.
indexOf
(
rev
.
branch
)
!=
-
1
)
{
if
(
$
(
'
#branchselect .dl-experimental
'
)
===
null
)
{
if
(
$
(
'
#branchselect .dl-experimental
'
)
===
null
)
{
var
button
=
document
.
createElement
(
'
button
'
);
var
button
=
document
.
createElement
(
'
button
'
);
button
.
className
=
'
btn dl-experimental
'
;
button
.
className
=
'
btn dl-experimental
'
;
...
@@ -873,9 +877,6 @@ var firmwarewizard = function() {
...
@@ -873,9 +877,6 @@ var firmwarewizard = function() {
updatePanes
(
s
.
vendor
,
s
.
model
,
s
.
revision
,
s
.
imageType
);
updatePanes
(
s
.
vendor
,
s
.
model
,
s
.
revision
,
s
.
imageType
);
function
updateCurrentVersions
()
{
function
updateCurrentVersions
()
{
var
branches
=
ObjectValues
(
config
.
directories
)
.
filter
(
function
(
value
,
index
,
self
)
{
return
self
.
indexOf
(
value
)
===
index
;
});
$
(
'
#currentVersions
'
).
innerText
=
''
;
$
(
'
#currentVersions
'
).
innerText
=
''
;
if
(
config
.
changelog
!==
undefined
)
{
if
(
config
.
changelog
!==
undefined
)
{
var
a
=
document
.
createElement
(
'
a
'
);
var
a
=
document
.
createElement
(
'
a
'
);
...
...
This diff is collapsed.
Click to expand it.
config_template.js
+
2
−
0
View file @
8c36b7ad
...
@@ -28,6 +28,8 @@ var config = {
...
@@ -28,6 +28,8 @@ var config = {
'
./images/gluon-factory-example.html
'
:
'
stable
'
,
'
./images/gluon-factory-example.html
'
:
'
stable
'
,
'
./images/gluon-sysupgrade-example.html
'
:
'
stable
'
'
./images/gluon-sysupgrade-example.html
'
:
'
stable
'
},
},
// experimental branches (show a warning for these branches)
experimental_branches
:
[
'
experimental
'
],
// path to preview pictures directory
// path to preview pictures directory
preview_pictures
:
'
pictures/
'
,
preview_pictures
:
'
pictures/
'
,
// link to changelog
// link to changelog
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment