Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Titouan Soulard
slapos.core
Commits
4d0f2071
Commit
4d0f2071
authored
Nov 02, 2022
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_panel: software.json contains multiple entries with the same software-type
parent
1fec7e13
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
4 deletions
+18
-4
master/bt5/slapos_panel/PathTemplateItem/web_page_module/slapos_master_panel_import_product_js.js
.../web_page_module/slapos_master_panel_import_product_js.js
+16
-2
master/bt5/slapos_panel/PathTemplateItem/web_page_module/slapos_master_panel_import_product_js.xml
...web_page_module/slapos_master_panel_import_product_js.xml
+2
-2
No files found.
master/bt5/slapos_panel/PathTemplateItem/web_page_module/slapos_master_panel_import_product_js.js
View file @
4d0f2071
...
@@ -25,6 +25,10 @@
...
@@ -25,6 +25,10 @@
});
});
}
}
function
filterUnique
(
value
,
index
,
self
)
{
return
self
.
indexOf
(
value
)
===
index
;
}
function
getContentFromSoftwareReleaseURLView
(
gadget
)
{
function
getContentFromSoftwareReleaseURLView
(
gadget
)
{
var
software_url
;
var
software_url
;
return
gadget
.
getDeclaredGadget
(
FIELD_SCOPE
)
return
gadget
.
getDeclaredGadget
(
FIELD_SCOPE
)
...
@@ -46,13 +50,23 @@
...
@@ -46,13 +50,23 @@
console
.
log
(
software_json
);
console
.
log
(
software_json
);
for
(
software_type
in
software_json
[
'
software-type
'
])
{
for
(
software_type
in
software_json
[
'
software-type
'
])
{
if
(
software_json
[
'
software-type
'
].
hasOwnProperty
(
software_type
))
{
if
(
software_json
[
'
software-type
'
].
hasOwnProperty
(
software_type
))
{
software_type_array
.
push
(
software_type
);
// Multiple form can use the same software type
// This is a hack to separate slave/non slave
if
(
software_json
[
'
software-type
'
][
software_type
]
.
hasOwnProperty
(
'
software-type
'
))
{
software_type_array
.
push
(
software_json
[
'
software-type
'
][
software_type
][
'
software-type
'
]
);
}
else
{
software_type_array
.
push
(
software_type
);
}
}
}
}
}
result
[
gadget
.
state
.
title_key
]
=
software_json
.
name
;
result
[
gadget
.
state
.
title_key
]
=
software_json
.
name
;
result
[
gadget
.
state
.
description_key
]
=
software_json
.
description
||
""
;
result
[
gadget
.
state
.
description_key
]
=
software_json
.
description
||
""
;
result
[
gadget
.
state
.
software_release_key
]
=
software_url
;
result
[
gadget
.
state
.
software_release_key
]
=
software_url
;
result
[
gadget
.
state
.
software_type_key
]
=
software_type_array
;
result
[
gadget
.
state
.
software_type_key
]
=
software_type_array
.
filter
(
filterUnique
);
console
.
log
(
result
);
console
.
log
(
result
);
return
result
;
return
result
;
});
});
...
...
master/bt5/slapos_panel/PathTemplateItem/web_page_module/slapos_master_panel_import_product_js.xml
View file @
4d0f2071
...
@@ -240,7 +240,7 @@
...
@@ -240,7 +240,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
1004.
795.25465.61781
</string>
</value>
<value>
<string>
1004.
3478.38769.10274
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -258,7 +258,7 @@
...
@@ -258,7 +258,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
1667
235665.03
</float>
<float>
1667
396728.07
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment