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
Łukasz Nowak
slapos.core
Commits
0aef70a5
Commit
0aef70a5
authored
Aug 05, 2016
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_monitoring: Change status of instance to WARNING if cannot sync data
parent
b2b8c1e9
Changes
29
Hide whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
276 additions
and
122 deletions
+276
-122
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_custom_css.css
...lateItem/web_page_module/gadget_monitoring_custom_css.css
+8
-4
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_custom_css.xml
...lateItem/web_page_module/gadget_monitoring_custom_css.xml
+2
-2
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_hosting_subscription_list_js.html
...odule/gadget_monitoring_hosting_subscription_list_js.html
+34
-1
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_hosting_subscription_list_js.xml
...module/gadget_monitoring_hosting_subscription_list_js.xml
+2
-2
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_hosting_subscription_view_html.html
...ule/gadget_monitoring_hosting_subscription_view_html.html
+3
-0
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_hosting_subscription_view_html.xml
...dule/gadget_monitoring_hosting_subscription_view_html.xml
+2
-2
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_hosting_subscription_view_js.html
...odule/gadget_monitoring_hosting_subscription_view_js.html
+2
-1
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_hosting_subscription_view_js.xml
...module/gadget_monitoring_hosting_subscription_view_js.xml
+2
-2
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_jio_js.xml
...TemplateItem/web_page_module/gadget_monitoring_jio_js.xml
+2
-2
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_promise_interface_html.html
...page_module/gadget_monitoring_promise_interface_html.html
+7
-4
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_promise_interface_html.xml
..._page_module/gadget_monitoring_promise_interface_html.xml
+2
-2
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_promise_interface_js.js
...web_page_module/gadget_monitoring_promise_interface_js.js
+2
-1
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_promise_interface_js.xml
...eb_page_module/gadget_monitoring_promise_interface_js.xml
+2
-2
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_settings_configurator_html.html
..._module/gadget_monitoring_settings_configurator_html.html
+61
-64
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_settings_configurator_html.xml
...e_module/gadget_monitoring_settings_configurator_html.xml
+2
-2
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_software_instance_list_js.html
...e_module/gadget_monitoring_software_instance_list_js.html
+41
-1
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_software_instance_list_js.xml
...ge_module/gadget_monitoring_software_instance_list_js.xml
+2
-2
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_software_instance_view_html.html
...module/gadget_monitoring_software_instance_view_html.html
+3
-0
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_software_instance_view_html.xml
..._module/gadget_monitoring_software_instance_view_html.xml
+2
-2
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_software_instance_view_js.js
...age_module/gadget_monitoring_software_instance_view_js.js
+5
-1
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_software_instance_view_js.xml
...ge_module/gadget_monitoring_software_instance_view_js.xml
+2
-2
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_status_list_js.html
...tem/web_page_module/gadget_monitoring_status_list_js.html
+1
-1
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_status_list_js.xml
...Item/web_page_module/gadget_monitoring_status_list_js.xml
+2
-2
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_sync_js.html
...mplateItem/web_page_module/gadget_monitoring_sync_js.html
+67
-3
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_sync_js.xml
...emplateItem/web_page_module/gadget_monitoring_sync_js.xml
+2
-2
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_widget_listbox_html.xml
...web_page_module/gadget_monitoring_widget_listbox_html.xml
+2
-2
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_widget_listbox_js.js
...em/web_page_module/gadget_monitoring_widget_listbox_js.js
+10
-9
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_widget_listbox_js.xml
...m/web_page_module/gadget_monitoring_widget_listbox_js.xml
+2
-2
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_widget_overview_js.xml
.../web_page_module/gadget_monitoring_widget_overview_js.xml
+2
-2
No files found.
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_custom_css.css
View file @
0aef70a5
...
...
@@ -93,6 +93,10 @@ html.ui-mobile .ui-grid-container.ui-responsive > ul > li, html.ui-mobile .ui-gr
.ui-text-OK
,
.ui-text-ok
{
color
:
green
;
}
.ui-text-WARNING
,
.ui-text-warning
{
color
:
#cea813
;
text-shadow
:
1px
0px
0px
rgb
(
224
,
224
,
116
);
}
.ui-text-desabled
{
color
:
rgba
(
128
,
128
,
128
,
0.66
);
...
...
@@ -293,7 +297,7 @@ html head + body .ui-panel-overview > h2 {
background
:
#DC4343
;
}
.ui-status-warning
:before
,
.ui-status-WARNING
:before
{
background
:
#f
aebcc
;
background
:
#f
0ad4e
;
}
.status-text-ok
:before
,
.status-text-OK
:before
{
color
:
green
;
...
...
@@ -302,7 +306,7 @@ html head + body .ui-panel-overview > h2 {
color
:
#DC4343
;
}
.status-text-warning
:before
,
.status-text-WARNING
:before
{
color
:
#f
aebcc
;
color
:
#f
0ad4e
;
}
.label-warning
,
.label-WARNING
{
...
...
@@ -507,7 +511,7 @@ html .custom-grid-wrap table thead tr th {
font-weight
:
normal
;
}
.hosting-block
{
.hosting-block
,
.content-medium
{
width
:
80%
;
}
...
...
@@ -916,7 +920,7 @@ html body div.loadbox .loadwait > a {
.graph-full
{
margin
:
0
10px
;
}
.hosting-block
{
.hosting-block
,
.content-medium
{
width
:
100%
;
}
html
table
:not
(
.ui-responsive
)
tbody
tr
td
:first-child
a
,
html
table
:not
(
ui-responsive
)
tbody
tr
th
:first-child
a
{
...
...
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_custom_css.xml
View file @
0aef70a5
...
...
@@ -239,7 +239,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
952.
27190.36100.52957
</string>
</value>
<value>
<string>
952.
63103.15334.28893
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -257,7 +257,7 @@
</tuple>
<state>
<tuple>
<float>
14
67987759.3
3
</float>
<float>
14
70133968.9
3
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_hosting_subscription_list_js.html
View file @
0aef70a5
...
...
@@ -84,6 +84,7 @@
.
declareAcquiredMethod
("
getSetting
",
"
getSetting
")
.
declareAcquiredMethod
("
setSetting
",
"
setSetting
")
.
declareAcquiredMethod
("
updateHeader
",
"
updateHeader
")
.
declareAcquiredMethod
("
renderApplication
",
"
renderApplication
")
.
declareMethod
("
render
",
function
(
options
)
{
var
gadget =
this,
opml_tmp_key_list
,
...
...
@@ -213,7 +214,39 @@
.declareService(function () {
var gadget = this;
var gadget = this,
current_sync_date;
return gadget.getSetting('latest_sync_time')
.push(function (sync_time) {
current_sync_date = sync_time;
return gadget.getSetting('status_list_refresh_id');
})
.push(function (timer_id) {
var new_timer_id;
if (timer_id) {
clearInterval(timer_id);
}
new_timer_id = setInterval(function(){
var hash = window.location.toString().split('#')[1],
scroll_position,
doc = document.documentElement;
if (hash.indexOf('page=hosting_subscription_list') >= 0) {
return gadget.getSetting('latest_sync_time')
.push(function (sync_time) {
if (sync_time > current_sync_date) {
scroll_position = (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0);
current_sync_date = sync_time;
return gadget.renderApplication({args: gadget.props.options})
.push(function () {
$(document).scrollTop(scroll_position);
});
}
});
}
}, 60000);
return gadget.setSetting('status_list_refresh_id', new_timer_id);
});
});
...
...
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_hosting_subscription_list_js.xml
View file @
0aef70a5
...
...
@@ -239,7 +239,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
952.
44518.58996.28689
</string>
</value>
<value>
<string>
952.
63323.60264.39816
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -257,7 +257,7 @@
</tuple>
<state>
<tuple>
<float>
14
69016261.62
</float>
<float>
14
70144009.09
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_hosting_subscription_view_html.html
View file @
0aef70a5
...
...
@@ -83,6 +83,9 @@
<
/tr
>
{{
/
with
}}
<
/table
>
{{
#
if
warning
}}
<
p
class
=
"
ui-text-error
"
><
i
class
=
"
fa fa-info-circle
"
aria
-
hidden
=
"
true
"
><
/i> Status was changed to WARNING as last sync of this instance failed.</
p
>
{{
/
if
}}
<
/fieldset
>
<
/div
>
<
/li
>
...
...
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_hosting_subscription_view_html.xml
View file @
0aef70a5
...
...
@@ -246,7 +246,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
952.
2622.43851.4191
5
</string>
</value>
<value>
<string>
952.
63310.6946.4703
5
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -264,7 +264,7 @@
</tuple>
<state>
<tuple>
<float>
14
66588186.09
</float>
<float>
14
70143285.47
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_hosting_subscription_view_js.html
View file @
0aef70a5
...
...
@@ -80,7 +80,8 @@
private_url: monitor_dict._links.hasOwnProperty('private_url') ? monitor_dict._links.private_url.href : '',
rss_url: monitor_dict._links.hasOwnProperty('rss_url') ? monitor_dict._links.rss_url.href : '',
resource_url: tmp_url,
process_url: tmp_process_url
process_url: tmp_process_url,
warning: (monitor_dict.status.toUpperCase() === "
WARNING
")
?
true
:
false
};
return
instance_dict
;
}
...
...
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_hosting_subscription_view_js.xml
View file @
0aef70a5
...
...
@@ -242,7 +242,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
952.
2606.28566.7014
</string>
</value>
<value>
<string>
952.
12669.21894.52428
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>
14
67190880.03
</float>
<float>
14
70143020.16
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_jio_js.xml
View file @
0aef70a5
...
...
@@ -235,7 +235,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
952.
27460.59642.13687
</string>
</value>
<value>
<string>
952.
63450.59087.19609
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -253,7 +253,7 @@
</tuple>
<state>
<tuple>
<float>
14
67993818.78
</float>
<float>
14
70151746.42
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_promise_interface_html.html
View file @
0aef70a5
...
...
@@ -15,6 +15,9 @@
<script
id=
"promise-widget-template"
type=
"text/x-handlebars-template"
>
{{
#
with
element
}}
{{
#
if
warning
}}
<
p
class
=
"
ui-text-error
"
><
i
class
=
"
fa fa-info-circle
"
aria
-
hidden
=
"
true
"
><
/i> Status was changed to WARNING as last sync of this instance failed.</
p
>
{{
/
if
}}
<
table
data
-
role
=
"
table
"
data
-
mode
=
"
columntoggle
"
class
=
"
table-stroke
"
>
<
tr
>
<
th
><
i
class
=
"
fa fa-tachometer
"
><
/i> Status</
th
>
...
...
@@ -48,7 +51,7 @@
</script>
<script
id=
"pinstance-widget-template"
type=
"text/x-handlebars-template"
>
<
h2
><
i
class
=
"
fa fa-
cubes
"
><
/i><strong> Software Instance Overview
</
strong
><
/h2
>
<
h2
><
i
class
=
"
fa fa-
area-chart
"
aria
-
hidden
=
"
true
"
><
/i><strong> Resources Usage
</
strong
><
/h2
>
<
div
class
=
"
ui-field-contain
"
>
<
fieldset
data
-
role
=
"
controlgroup
"
data
-
type
=
"
horizontal
"
>
{{
#
if
resource_url
}}
...
...
@@ -59,18 +62,18 @@
{{
/
if
}}
<
/fieldset
>
<
/div
>
<
h2
>
Software
Instance
status
<
/h2
>
<
h2
>
<
i
class
=
"
fa fa-cubes
"
><
/i><strong> Software Instance Overview</
strong
>
<
/h2
>
<
table
data
-
role
=
"
table
"
data
-
mode
=
"
columntoggle
"
class
=
"
table-stroke
"
>
<
tr
title
=
"
Hosting Subscription
"
>
<
th
><
i
class
=
"
fa fa-puzzle-piece
"
><
/i> H. Subscription</
th
>
<
td
title
=
"
Hosting Subscription title
"
>
{{
root_title
}}
<
/td
>
<
/tr
>
<
tr
>
<
th
><
i
class
=
"
fa fa-cube
"
><
/i> Instance</
th
>
<
th
><
i
class
=
"
fa fa-cube
"
><
/i> Instance
Name
</
th
>
<
td
title
=
"
Software Instance title
"
>
{{
title
}}
<
/td
>
<
/tr
>
<
tr
>
<
th
><
i
class
=
"
fa fa-tachometer
"
><
/i> Status</
th
>
<
th
><
i
class
=
"
fa fa-tachometer
"
><
/i>
Instance
Status</
th
>
<
td
><
span
class
=
"
label label-{{status}}
"
>
{{
status
}}
<
/span></
td
>
<
/tr
>
<
tr
>
...
...
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_promise_interface_html.xml
View file @
0aef70a5
...
...
@@ -243,7 +243,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
952.
41717.43788.11008
</string>
</value>
<value>
<string>
952.
63137.49260.64000
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -261,7 +261,7 @@
</tuple>
<state>
<tuple>
<float>
14
68847455.64
</float>
<float>
14
70132847.51
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_promise_interface_js.js
View file @
0aef70a5
...
...
@@ -124,7 +124,8 @@
instance
:
feed
.
siteTitle
,
public_url
:
feed
.
sourceUrl
,
message
:
feed
.
comments
,
type
:
'
status
'
type
:
'
status
'
,
warning
:
(
feed
.
category
===
"
WARNING
"
)
?
true
:
false
};
gadget
.
property_dict
.
promise_dict
=
element
;
...
...
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_promise_interface_js.xml
View file @
0aef70a5
...
...
@@ -239,7 +239,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
952.
41708.59200.61013
</string>
</value>
<value>
<string>
952.
63405.63756.16076
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -257,7 +257,7 @@
</tuple>
<state>
<tuple>
<float>
14
68846875.97
</float>
<float>
14
70148845.94
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_settings_configurator_html.html
View file @
0aef70a5
...
...
@@ -124,75 +124,72 @@
</article>
</div>
<div
id=
"config-manage"
>
<div
class=
"ui-grid-a ui-responsive custom-listbox"
>
<div
class=
"ui-block-a"
>
<div
class=
"ui-panel-overview"
style=
"min-height: 450px;"
>
<div
class=
"overview-header"
>
<div
class=
'content-title ui-instance-title'
>
<div
class=
"overview-title"
>
<i
class=
"fa fa-link"
></i><span>
Monitoring OPML List
</span>
</div>
<div
class=
"commands"
>
</div>
</div>
</div>
<div
class=
"overview-content"
>
<div
class=
"ui-listview-container"
>
<table
class=
"ui-responsive ui-body-c ui-table-inset opml-tablelinks"
>
<thead
class=
"ui-bar-inherit"
>
<tr>
<th
class=
"padding-10"
><input
type=
"checkbox"
name=
"opml-all"
value=
"all"
></th>
<th>
OPML URL
</th>
<th>
Title
</th>
</tr>
</thead>
<tbody>
</tbody>
<tfoot
class=
"ui-bar-inherit"
></tfoot>
</table>
<div
class=
"ui-responsive content-medium"
>
<div
class=
"ui-panel-overview"
style=
"min-height: 450px;"
>
<div
class=
"overview-header"
>
<div
class=
'content-title ui-instance-title'
>
<div
class=
"overview-title"
>
<i
class=
"fa fa-link"
></i><span>
Monitoring OPML List
</span>
</div>
<div
class=
"padding-10 msgtext-box"
></div>
<div
class=
""
>
<a
href=
"#"
class=
"ui-btn ui-corner-all ui-btn-inline opml-delete"
><i
class=
"fa fa-trash"
></i>
Delete Selection
</a>
<a
href=
"#"
class=
"ui-btn ui-corner-all ui-btn-inline opml-test"
><i
class=
"fa fa-check-square-o"
></i>
Availability Test
</a>
<span
class=
"ui-content-hidden padding-10 loadspinner"
>
<i
class=
"fa fa-spinner fa-2x fa-spin"
></i>
</span>
</div>
<div
class=
"padding-5"
>
<fieldset
class=
"sync-interval-controlgroup"
data-role=
"controlgroup"
data-type=
"horizontal"
>
<legend><strong>
Auto Sync Interval:
</strong></legend>
<input
type=
"radio"
name=
"sync-data-timer"
id=
"sync-data-5m"
value=
"300000"
checked=
"checked"
>
<label
for=
"sync-data-5m"
>
5 min
</label>
<input
type=
"radio"
name=
"sync-data-timer"
id=
"sync-data-10m"
value=
"600000"
>
<label
for=
"sync-data-10m"
>
10 min
</label>
<input
type=
"radio"
name=
"sync-data-timer"
id=
"sync-data-20m"
value=
"1200000"
>
<label
for=
"sync-data-20m"
>
20 min
</label>
<input
type=
"radio"
name=
"sync-data-timer"
id=
"sync-data-30m"
value=
"1800000"
>
<label
for=
"sync-data-30m"
>
30 min
</label>
<input
type=
"radio"
name=
"sync-data-timer"
id=
"sync-data-1h"
value=
"3600000"
>
<label
for=
"sync-data-1h"
>
1 h
</label>
</fieldset>
<p>
Last sync date:
<span
class=
"last-sync"
></span></p>
<h2><strong>
Manual Sync:
</strong></h2>
<button
class=
"ui-btn ui-corner-all ui-btn-inline sync-all"
><i
class=
"fa fa-download"
></i>
Sync Data Now
</button>
<p
style=
"margin: 0; font-style: italic;"
class=
"ui-text-ERROR"
>
<i
class=
"fa fa-info"
aria-hidden=
"true"
></i>
If you just registered a new monitor, you can sync data now!
</p>
</div>
<div
class=
"padding-5"
>
<h2><strong>
Access links:
</strong></h2>
<a
href=
"#page=hosting_subscription_list"
>
Access Hosting Subscriptions
</a>
<a
href=
"#page=import_export"
>
Export Settings
</a>
<div
class=
"commands"
>
</div>
</div>
</div>
</div>
<div
class=
"ui-block-b"
>
<div
class=
"overview-content"
>
<div
class=
"ui-listview-container"
>
<table
class=
"ui-responsive ui-body-c ui-table-inset opml-tablelinks"
>
<thead
class=
"ui-bar-inherit"
>
<tr>
<th
class=
"padding-10"
><input
type=
"checkbox"
name=
"opml-all"
value=
"all"
></th>
<th>
OPML URL
</th>
<th>
Hosting Subscription Name
</th>
</tr>
</thead>
<tbody>
</tbody>
<tfoot
class=
"ui-bar-inherit"
></tfoot>
</table>
</div>
<div
class=
"padding-10 msgtext-box"
></div>
<div
class=
""
>
<a
href=
"#"
class=
"ui-btn ui-corner-all ui-btn-inline opml-delete"
><i
class=
"fa fa-trash"
></i>
Delete Selection
</a>
<a
href=
"#"
class=
"ui-btn ui-corner-all ui-btn-inline opml-test"
><i
class=
"fa fa-check-square-o"
></i>
Availability Test
</a>
<span
class=
"ui-content-hidden padding-10 loadspinner"
>
<i
class=
"fa fa-spinner fa-2x fa-spin"
></i>
</span>
</div>
<div
class=
"padding-5"
>
<fieldset
class=
"sync-interval-controlgroup"
data-role=
"controlgroup"
data-type=
"horizontal"
>
<legend><strong>
Auto Sync Interval:
</strong></legend>
<input
type=
"radio"
name=
"sync-data-timer"
id=
"sync-data-5m"
value=
"300000"
checked=
"checked"
>
<label
for=
"sync-data-5m"
>
5 min
</label>
<input
type=
"radio"
name=
"sync-data-timer"
id=
"sync-data-10m"
value=
"600000"
>
<label
for=
"sync-data-10m"
>
10 min
</label>
<input
type=
"radio"
name=
"sync-data-timer"
id=
"sync-data-20m"
value=
"1200000"
>
<label
for=
"sync-data-20m"
>
20 min
</label>
<input
type=
"radio"
name=
"sync-data-timer"
id=
"sync-data-30m"
value=
"1800000"
>
<label
for=
"sync-data-30m"
>
30 min
</label>
<input
type=
"radio"
name=
"sync-data-timer"
id=
"sync-data-1h"
value=
"3600000"
>
<label
for=
"sync-data-1h"
>
1 h
</label>
</fieldset>
<p>
Last sync date:
<span
class=
"last-sync"
></span></p>
<h2><strong>
Manual Sync:
</strong></h2>
<button
class=
"ui-btn ui-corner-all ui-btn-inline sync-all"
><i
class=
"fa fa-download"
></i>
Sync Data Now
</button>
<p
style=
"margin: 0; font-style: italic;"
class=
"ui-text-ERROR"
>
<i
class=
"fa fa-info"
aria-hidden=
"true"
></i>
If you just registered a new monitor, you can sync data now!
</p>
</div>
<div
class=
"padding-5"
>
<h2><strong>
Access links:
</strong></h2>
<a
href=
"#page=hosting_subscription_list"
class=
"ui-btn ui-corner-all ui-btn-inline ui-mini"
title=
"Access Hosting Subscriptions"
>
<i
class=
"fa fa-tachometer"
aria-hidden=
"true"
></i>
Applications Monitoring
</a>
<a
href=
"#page=import_export"
class=
"ui-btn ui-corner-all ui-btn-inline ui-mini"
title=
"Export Settings"
>
<i
class=
"fa fa-location-arrow"
aria-hidden=
"true"
></i>
Export Settings
</a>
</div>
</div>
</div>
</div>
</div>
...
...
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_settings_configurator_html.xml
View file @
0aef70a5
...
...
@@ -239,7 +239,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
95
2.47292.33739.26555
</string>
</value>
<value>
<string>
95
3.429.29685.31488
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -257,7 +257,7 @@
</tuple>
<state>
<tuple>
<float>
14
69181889.59
</float>
<float>
14
70386058.3
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_software_instance_list_js.html
View file @
0aef70a5
...
...
@@ -48,12 +48,52 @@
}
};
gadget.property_dict.options = options;
return gadget.updateHeader(header)
.push(function () {
return gadget.property_dict.listview.render(listview_options);
});
})
.declareAcquiredMethod("updateHeader", "updateHeader");
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("renderApplication", "renderApplication")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("setSetting", "setSetting")
.declareService(function () {
var gadget = this,
current_sync_date;
return gadget.getSetting('latest_sync_time')
.push(function (sync_time) {
current_sync_date = sync_time;
return gadget.getSetting('status_list_refresh_id');
})
.push(function (timer_id) {
var new_timer_id;
if (timer_id) {
clearInterval(timer_id);
}
new_timer_id = setInterval(function(){
var hash = window.location.toString().split('#')[1],
scroll_position,
doc = document.documentElement;
if (hash.indexOf('page=software_instance_list') >= 0) {
return gadget.getSetting('latest_sync_time')
.push(function (sync_time) {
if (sync_time > current_sync_date) {
scroll_position = (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0);
current_sync_date = sync_time;
return gadget.renderApplication({args: gadget.property_dict.options})
.push(function () {
$(document).scrollTop(scroll_position);
});
}
});
}
}, 60000);
return gadget.setSetting('status_list_refresh_id', new_timer_id);
});
});
}(window, rJS, $));
\ No newline at end of file
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_software_instance_list_js.xml
View file @
0aef70a5
...
...
@@ -239,7 +239,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
95
1.29297.41836.
68
</string>
</value>
<value>
<string>
95
2.63337.55665.626
68
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -257,7 +257,7 @@
</tuple>
<state>
<tuple>
<float>
14
64256864.93
</float>
<float>
14
70144630.71
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_software_instance_view_html.html
View file @
0aef70a5
...
...
@@ -55,6 +55,9 @@
<
/div
>
<
div
class
=
"
ui-grid-a ui-responsive
"
>
{{
#
if
warning
}}
<
p
class
=
"
ui-text-error
"
><
i
class
=
"
fa fa-info-circle
"
aria
-
hidden
=
"
true
"
><
/i> Status was changed to WARNING as last sync of this instance failed.</
p
>
{{
/
if
}}
{{
#
with
instance
}}
<
div
class
=
"
ui-block-a
"
>
<
table
data
-
role
=
"
table
"
data
-
mode
=
"
columntoggle
"
class
=
"
table-stroke
"
>
...
...
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_software_instance_view_html.xml
View file @
0aef70a5
...
...
@@ -246,7 +246,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
952.
2645.30987.35874
</string>
</value>
<value>
<string>
952.
63149.38315.18602
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -264,7 +264,7 @@
</tuple>
<state>
<tuple>
<float>
14
67987678.83
</float>
<float>
14
70133520.45
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_software_instance_view_js.js
View file @
0aef70a5
...
...
@@ -135,7 +135,8 @@
private_url
:
current_document
.
_links
.
hasOwnProperty
(
'
private_url
'
)
?
current_document
.
_links
.
private_url
.
href
:
''
,
rss_url
:
current_document
.
_links
.
hasOwnProperty
(
'
rss_url
'
)
?
current_document
.
_links
.
rss_url
.
href
:
''
,
resource_url
:
tmp_url
,
process_url
:
tmp_process_url
process_url
:
tmp_process_url
,
warning
:
(
current_document
.
status
.
toUpperCase
()
===
"
WARNING
"
)
?
true
:
false
});
if
(
current_document
.
_embedded
.
promises
!==
undefined
)
{
...
...
@@ -144,6 +145,9 @@
promise_list
[
i
].
href
=
"
#page=view&jio_key=false&jio_name=
"
+
promise_list
[
i
].
title
+
"
&jio_for=
"
+
current_document
.
_links
.
rss_url
.
href
;
if
(
current_document
.
status
===
"
WARNING
"
)
{
promise_list
[
i
].
status
=
current_document
.
status
;
}
}
}
promise_content
=
promise_list_template
({
...
...
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_software_instance_view_js.xml
View file @
0aef70a5
...
...
@@ -242,7 +242,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
952.
27413.56408.50005
</string>
</value>
<value>
<string>
952.
63151.36187.19404
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>
14
67989745.98
</float>
<float>
14
70385950.65
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_status_list_js.html
View file @
0aef70a5
...
...
@@ -37,7 +37,7 @@
title: 'Promise',
select: 'source'
}, {
title: 'Instance',
title: '
Software
Instance',
select: 'siteTitle'
}, {
title: 'Hosting Subscription',
...
...
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_status_list_js.xml
View file @
0aef70a5
...
...
@@ -239,7 +239,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
952.
27207.37497.3130
0
</string>
</value>
<value>
<string>
952.
61937.37298.2321
0
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -257,7 +257,7 @@
</tuple>
<state>
<tuple>
<float>
14
67976809.38
</float>
<float>
14
70144737.52
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_sync_js.html
View file @
0aef70a5
...
...
@@ -79,6 +79,55 @@
});
}
function updateStatus(gadget, storage_dict, status) {
var promise_list = [],
jio_gadget,
i;
return gadget.declareGadget("gadget_monitoring_jio.html")
.push(function (jio_declared_gadget) {
jio_gadget = jio_declared_gadget;
jio_gadget.createJio(storage_dict);
return jio_gadget.allDocs({include_docs: true});
})
.push(undefined, function (error) {
console.log(error);
return {
data: {
total_rows: 0
}
};
})
.push(function (jio_docs) {
var tmp;
for (i = 0; i
<
jio
_docs
.
data
.
total_rows
;
i
+=
1
)
{
if
(
jio_docs
.
data
.
rows
[
i
].
id
.
startsWith
('
_replicate_
'))
{
continue
;
}
tmp =
jio_docs.data.rows[i].doc;
if
(storage_dict.storage_type =
==
"
rss
")
{
if
(tmp.category =
==
"
WARNING
")
{
continue
;
}
tmp.category =
"WARNING"
;
}
else
if
(storage_dict.storage_type =
==
"
webdav
")
{
if
(tmp.status =
==
"
WARNING
")
{
continue
;
}
tmp.status =
"WARNING"
;
}
promise_list
.
push
(
jio_gadget
.
put
(
jio_docs
.
data
.
rows
[
i
].
id
,
tmp
));
}
return
RSVP
.
all
(
promise_list
);
})
.
push
(
undefined
,
function
(
error
)
{
console
.
log
("
ERROR:
update
status
to
WARNING
");
console
.
log
(
error
);
});
}
function
getMonitoringStorageList
(
feed_url_list
)
{
var
base_url
,
base_url_hash
,
...
...
@@ -118,6 +167,7 @@
//
put
Monitor
instance
name
,
usefull
to
track
error
feed_config.title =
feed_url_list[i].title;
feed_config.hosting =
feed_url_list[i].opml_title;
feed_config.storage_type =
"rss"
;
monitor_storage_list
.
push
({
storage:
feed_config
,
...
...
@@ -137,13 +187,14 @@
if
(
monitor_cred_dict
.
hasOwnProperty
(
base_url_hash
))
{
dav_config.sub_storage.sub_storage.basic_login =
monitor_cred_dict[base_url_hash].hash;
}
else
{
console
.
log
("
skipping
"
+
dav_config
.
sub_storage
.
sub_storage
.
url
+
"
...");
console
.
log
("
NotFound:
skipping
"
+
dav_config
.
sub_storage
.
sub_storage
.
url
+
"
...");
continue
;
}
}
//
put
Monitor
instance
name
,
usefull
to
track
error
dav_config.title =
feed_url_list[i].title;
dav_config.hosting =
feed_url_list[i].opml_title;
dav_config.storage_type =
"webdav"
;
monitor_storage_list
.
push
({
storage:
dav_config
,
...
...
@@ -267,7 +318,7 @@
message = log_title + "\nYou can retry with manual sync.";
}
$(".notifyjs-wrapper").remove();
return
new
RSVP.all([$.notify(
return RSVP.all([$.notify(
message,
{
position:"bottom right",
...
...
@@ -283,6 +334,19 @@
method: 'Monitoring Sync'
})]);
})
.push(function () {
var promise_list = [],
i;
// Update all failures monitoring status to Warning
for (i = 0; i
<
gadget
.
props
.
error_list
.
length
;
i
+=
1
)
{
promise_list
.
push
(
updateStatus
(
gadget
,
gadget
.
props
.
error_list
[
i
].
storage_dict
,
'
WARNING
'
));
}
return
RSVP
.
all
(
promise_list
);
})
.
push
(
function
()
{
return
$.
notify
(
"
Last
Sync:
"
+
formatDate
(
new
Date
(
last_sync_time
)),
...
...
@@ -295,7 +359,7 @@
);
});
}
function
syncDataTimer
()
{
if
(
gadget
.
props
.
timer
)
{
clearTimeout
(
gadget
.
props
.
timer
);
...
...
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_sync_js.xml
View file @
0aef70a5
...
...
@@ -242,7 +242,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
952.
44569.39820.5913
6
</string>
</value>
<value>
<string>
952.
63467.50835.5744
6
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>
14
69018537.19
</float>
<float>
14
70152500.12
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_widget_listbox_html.xml
View file @
0aef70a5
...
...
@@ -243,7 +243,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
48.47458.38099.21964
</string>
</value>
<value>
<string>
9
52.61801.40672.26333
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -261,7 +261,7 @@
</tuple>
<state>
<tuple>
<float>
14
53808948.3
7
</float>
<float>
14
70385580.6
7
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_widget_listbox_js.js
View file @
0aef70a5
...
...
@@ -33,6 +33,16 @@
});
}
var
formatDate
=
function
(
d
){
function
addZero
(
n
){
return
n
<
10
?
'
0
'
+
n
:
''
+
n
;
}
return
d
.
getFullYear
()
+
"
-
"
+
addZero
(
d
.
getMonth
()
+
1
)
+
"
-
"
+
addZero
(
d
.
getDate
())
+
"
"
+
addZero
(
d
.
getHours
())
+
"
:
"
+
addZero
(
d
.
getMinutes
())
+
"
:
"
+
addZero
(
d
.
getSeconds
());
};
gadget_klass
/////////////////////////////////////////////////////////////////
...
...
@@ -201,15 +211,6 @@
j
,
k
;
function
formatDate
(
d
){
function
addZero
(
n
){
return
n
<
10
?
'
0
'
+
n
:
''
+
n
;
}
return
d
.
getFullYear
()
+
"
-
"
+
addZero
(
d
.
getMonth
()
+
1
)
+
"
-
"
+
addZero
(
d
.
getDate
())
+
"
"
+
addZero
(
d
.
getHours
())
+
"
:
"
+
addZero
(
d
.
getMinutes
())
+
"
:
"
+
addZero
(
d
.
getSeconds
());
}
gadget
.
property_dict
.
data_result
=
[];
// build handlebars object
...
...
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_widget_listbox_js.xml
View file @
0aef70a5
...
...
@@ -239,7 +239,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
95
1.28152.13474.61457
</string>
</value>
<value>
<string>
95
3.1817.61265.49698
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -257,7 +257,7 @@
</tuple>
<state>
<tuple>
<float>
14
68600739.56
</float>
<float>
14
70386082.24
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_widget_overview_js.xml
View file @
0aef70a5
...
...
@@ -239,7 +239,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
952.445
39.57216.52360
</string>
</value>
<value>
<string>
952.445
40.700.10871
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -257,7 +257,7 @@
</tuple>
<state>
<tuple>
<float>
14
69016720.5
8
</float>
<float>
14
70065840.6
8
</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