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
Léo-Paul Géneau
slapos.core
Commits
a298c46e
Commit
a298c46e
authored
Jun 27, 2018
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_jio: Use onLoop instead RSVP.delay for site_status.
parent
96c0b199
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
65 deletions
+51
-65
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_site_status_js.js
...eItem/web_page_module/rjs_gadget_slapos_site_status_js.js
+51
-65
No files found.
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_site_status_js.js
View file @
a298c46e
...
...
@@ -125,45 +125,13 @@
return
status
;
}
gadget_klass
.
ready
(
function
(
gadget
)
{
gadget
.
props
=
{};
return
gadget
.
getSetting
(
"
hateoas_url
"
)
.
push
(
function
(
url
)
{
gadget
.
props
.
hateoas_url
=
url
;
});
})
.
declareAcquiredMethod
(
"
jio_get
"
,
"
jio_get
"
)
.
declareAcquiredMethod
(
"
getSetting
"
,
"
getSetting
"
)
.
declareAcquiredMethod
(
"
translateHtml
"
,
"
translateHtml
"
)
.
declareMethod
(
"
getContent
"
,
function
()
{
return
{};
})
.
declareMethod
(
"
render
"
,
function
(
options
)
{
var
gadget
=
this
,
status_style
,
middle_style
,
queue
=
new
RSVP
.
Queue
();
function
getStatus
(
options
)
{
queue
.
push
(
function
()
{
return
gadget
.
jio_get
(
options
.
value
.
jio_key
);
function
getStatus
(
gadget
)
{
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
gadget
.
jio_get
(
gadget
.
options
.
value
.
jio_key
);
})
.
push
(
function
(
result
)
{
var
project
,
data_supply_line
,
data_supply_line_list
,
count
=
0
,
tmp
,
sum
=
0
,
i
,
no_data
=
true
,
no_data_since_24_hours
=
true
,
value
=
""
,
template
,
monitor_url
,
var
monitor_url
,
status_class
=
'
ui-btn-no-data
'
,
status_title
=
'
Computer
'
,
right_title
=
'
Partitions
'
,
...
...
@@ -171,41 +139,59 @@
status_style
=
"
color: transparent !important;
"
,
right_style
=
'
color: transparent !important;
'
;
if
((
options
.
value
!==
undefined
)
&&
(
options
.
doc
===
undefined
))
{
options
.
doc
=
options
.
value
.
doc
;
}
status_class
=
checkSiteStatus
(
result
);
right_class
=
checkSitePartitionStatus
(
result
);
i
=
options
;
// right_title = value.max? Math.round(value.max * 100 * 10) / 10 + '%': 'nan';
right_style
=
''
;
status_style
=
''
;
template
=
inline_status_template
;
if
(
status_class
===
'
ui-btn-no-data
'
)
{
status_style
=
"
color: transparent !important;
"
;
}
monitor_url
=
gadget
.
props
.
hateoas_url
+
options
.
value
.
jio_key
+
'
/Base_redirectToMonitor
'
;
gadget
.
element
.
innerHTML
=
template
({
monitor_url
=
gadget
.
props
.
hateoas_url
+
gadget
.
options
.
value
.
jio_key
+
'
/Base_redirectToMonitor
'
;
gadget
.
element
.
innerHTML
=
inline_status_
template
({
monitor_url
:
monitor_url
,
status_class
:
status_class
,
status_title
:
status_title
,
status_style
:
status_style
,
middle_style
:
middle_style
,
right_class
:
right_class
,
right_title
:
right_title
,
right_style
:
right_style
});
return
RSVP
.
delay
(
300000
);
})
return
gadget
;
}
);
}
.
push
(
function
()
{
gadget
.
element
.
innerHTML
=
loading_template
();
return
getStatus
(
options
);
gadget_klass
.
ready
(
function
(
gadget
)
{
gadget
.
props
=
{};
return
gadget
.
getSetting
(
"
hateoas_url
"
)
.
push
(
function
(
url
)
{
gadget
.
props
.
hateoas_url
=
url
;
});
}
return
queue
.
push
(
getStatus
(
options
));
})
.
declareAcquiredMethod
(
"
jio_get
"
,
"
jio_get
"
)
.
declareAcquiredMethod
(
"
getSetting
"
,
"
getSetting
"
)
.
declareAcquiredMethod
(
"
translateHtml
"
,
"
translateHtml
"
)
.
declareMethod
(
"
getContent
"
,
function
()
{
return
{};
})
.
declareJob
(
"
getStatus
"
,
function
()
{
var
gadget
=
this
;
return
getStatus
(
gadget
);
})
.
onLoop
(
function
()
{
var
gadget
=
this
;
return
getStatus
(
gadget
);
},
300000
)
.
declareMethod
(
"
render
"
,
function
(
options
)
{
var
gadget
=
this
;
gadget
.
options
=
options
;
gadget
.
flag
=
options
.
value
.
jio_key
;
return
gadget
.
getStatus
();
});
}(
window
,
rJS
,
RSVP
,
Handlebars
));
\ No newline at end of file
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