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
1
Merge Requests
1
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
Romain Courteaud
slapos.core
Commits
c128b195
Commit
c128b195
authored
Oct 08, 2021
by
Romain Courteaud
🐙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_jio: status wip
parent
3dc7875f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
52 additions
and
23 deletions
+52
-23
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_compute_node_status_css.css
...page_module/rjs_gadget_slapos_compute_node_status_css.css
+3
-3
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_compute_node_status_css.xml
...page_module/rjs_gadget_slapos_compute_node_status_css.xml
+5
-3
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_status_html.html
...teItem/web_page_module/rjs_gadget_slapos_status_html.html
+1
-0
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_status_html.xml
...ateItem/web_page_module/rjs_gadget_slapos_status_html.xml
+2
-2
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_status_js.js
...mplateItem/web_page_module/rjs_gadget_slapos_status_js.js
+39
-13
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_status_js.xml
...plateItem/web_page_module/rjs_gadget_slapos_status_js.xml
+2
-2
No files found.
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_compute_node_status_css.css
View file @
c128b195
...
...
@@ -37,7 +37,7 @@
.ui-btn-ok
:hover
a
{
color
:
white
!important
;
background
:
green
!important
;
cursor
:
default
;
/*cursor: default;*/
text-align
:
center
;
}
...
...
@@ -64,7 +64,7 @@
cursor
:
default
;
text-align
:
center
;
}
/*
.ui-btn-no-data,
.ui-btn-no-data:active,
.ui-btn-no-data:hover,
...
...
@@ -76,7 +76,7 @@
cursor: default;
text-align: center;
}
*/
.ui-btn-white
,
.ui-btn-white
:active
,
...
...
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_compute_node_status_css.xml
View file @
c128b195
...
...
@@ -71,7 +71,9 @@
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
text/css
</string>
</value>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
...
...
@@ -240,7 +242,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
99
2.39464.63395.50176
</string>
</value>
<value>
<string>
99
5.21673.23359.59187
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -258,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>
16
23147492.18
</float>
<float>
16
33703813.2
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_status_html.html
View file @
c128b195
...
...
@@ -9,6 +9,7 @@
<script
src=
"rsvp.js"
></script>
<script
src=
"renderjs.js"
></script>
<script
src=
"handlebars.js"
></script>
<script
src=
"domsugar.js"
></script>
<script
src=
"gadget_slapos_status.js"
></script>
<link
href=
"gadget_slapos_compute_node_status.css"
rel=
"stylesheet"
type=
"text/css"
/>
...
...
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_status_html.xml
View file @
c128b195
...
...
@@ -277,7 +277,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
995.21
559.35817.38024
</string>
</value>
<value>
<string>
995.21
642.57886.17339
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -295,7 +295,7 @@
</tuple>
<state>
<tuple>
<float>
1633
696788.56
</float>
<float>
1633
701789.47
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_status_js.js
View file @
c128b195
...
...
@@ -66,7 +66,7 @@
return
partition_class
;
}
function
getStatus
(
gadget
,
result
)
{
function
renderStatusxxx
(
result
)
{
var
monitor_url
,
status_class
=
'
ui-btn-no-data
'
,
status_title
=
'
Compute Node
'
,
...
...
@@ -93,7 +93,7 @@
'
?page=ojsm_dispatch&query=portal_type%3A%22Software%20Instance%22%20
'
+
'
AND%20aggregate_reference%3A%22
'
+
result
.
reference
+
'
%22
'
;
gadget
.
element
.
innerHTML
=
inline_status_template
({
return
{
html
:
inline_status_template
({
monitor_url
:
monitor_url
,
status_class
:
status_class
,
status_title
:
status_title
,
...
...
@@ -101,8 +101,24 @@
right_class
:
right_class
,
right_title
:
right_title
,
right_style
:
right_style
});
return
gadget
;
})};
}
function
renderStatus
(
status_dict
)
{
console
.
log
(
status_dict
);
/*
if (status_dict.compute_node) {
status_class = checkComputeNodeStatus({news: status_dict.compute_node});
// Check if we have info related to the partition
}
*/
// By default, display the full parameters,
// as it means the gadget does not support the configuration
// but the parameters may contain usefull stuff for the user
return
[
'
Unsupported
'
,
domsugar
(
'
pre
'
,
{
text
:
JSON
.
stringify
(
status_dict
)})
];
}
gadget_klass
...
...
@@ -112,25 +128,35 @@
return
{};
})
.
declareJob
(
"
getStatus
"
,
function
(
result
)
{
return
getStatus
(
this
,
{
news
:
result
});
})
.
onLoop
(
function
()
{
var
gadget
=
this
;
if
(
gadget
.
state
.
jio_key
)
{
return
gadget
.
jio_get
(
gadget
.
state
.
jio_key
)
.
push
(
function
(
result
)
{
return
gadget
.
changeState
(
result
);
console
.
log
(
'
STATUS.onLoop
'
,
result
);
return
gadget
.
changeState
({
compute_node
:
JSON
.
stringify
(
result
.
news
.
compute_node
),
partition
:
JSON
.
stringify
(
result
.
news
.
partition
)
});
});
}
},
300000
)
.
declareMethod
(
"
render
"
,
function
(
options
)
{
var
state_dict
=
options
.
value
.
result
;
state_dict
.
jio_key
=
options
.
value
.
jio_key
;
return
this
.
changeState
(
state_dict
);
console
.
log
(
'
STATUS.render
'
,
options
);
return
this
.
changeState
({
compute_node
:
JSON
.
stringify
(
options
.
compute_node
),
partition
:
JSON
.
stringify
(
options
.
partition
),
jio_key
:
options
.
value
,
reference
:
options
.
reference
});
})
.
onStateChange
(
function
()
{
return
getStatus
(
this
,
this
.
state
);
.
onStateChange
(
function
(
modification_dict
)
{
console
.
log
(
'
STATUS.onStateChange
'
,
modification_dict
);
domsugar
(
this
.
element
,
renderStatus
({
compute_node
:
JSON
.
parse
(
this
.
state
.
compute_node
),
partition
:
JSON
.
parse
(
this
.
state
.
partition
),
}));
});
}(
window
,
rJS
,
Handlebars
));
\ No newline at end of file
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_status_js.xml
View file @
c128b195
...
...
@@ -273,7 +273,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
995.21
560.19951.23398
</string>
</value>
<value>
<string>
995.21
748.56330.51234
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -291,7 +291,7 @@
</tuple>
<state>
<tuple>
<float>
1633
696832.02
</float>
<float>
1633
708139.98
</float>
<string>
UTC
</string>
</tuple>
</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