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
Lisa Casino
slapos.core
Commits
9144223c
Commit
9144223c
authored
Jun 29, 2016
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_monitoring: improve data sync, add retry sync of failed urls
parent
71182a2a
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
59 additions
and
10 deletions
+59
-10
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_hosting_subscription_list_js.html
...odule/gadget_monitoring_hosting_subscription_list_js.html
+2
-1
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_hosting_subscription_view_js.html
...odule/gadget_monitoring_hosting_subscription_view_js.html
+3
-0
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_jio_js.js
...hTemplateItem/web_page_module/gadget_monitoring_jio_js.js
+4
-4
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_promise_interface_js.js
...web_page_module/gadget_monitoring_promise_interface_js.js
+1
-1
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_static_js.html
...lateItem/web_page_module/gadget_monitoring_static_js.html
+3
-1
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_sync_js.html
...mplateItem/web_page_module/gadget_monitoring_sync_js.html
+46
-3
No files found.
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_hosting_subscription_list_js.html
View file @
9144223c
...
@@ -139,6 +139,7 @@
...
@@ -139,6 +139,7 @@
date =
''
;
date =
''
;
for
(j =
0;
j
<
document_list
[
i
].
length
;
j
+=
1
)
{
for
(j =
0;
j
<
document_list
[
i
].
length
;
j
+=
1
)
{
if
(document_list[i][j] =
==
undefined
)
{
if
(document_list[i][j] =
==
undefined
)
{
status =
'ERROR'
;
continue
;
continue
;
}
}
hosting_dict
.
amount
+=
1
;
hosting_dict
.
amount
+=
1
;
...
@@ -173,7 +174,7 @@
...
@@ -173,7 +174,7 @@
hosting_dict.status =
'ERROR'
;
hosting_dict.status =
'ERROR'
;
hosting_dict.title =
gadget.props.opml_dict[
hosting_dict.title =
gadget.props.opml_dict[
gadget
.
props
.
opml_key_list
[
i
]].
title
;
gadget
.
props
.
opml_key_list
[
i
]].
title
;
hosting_dict.date =
'Not
available
'
;
hosting_dict.date =
'Not
Synchronized
'
;
//
Redirect
to
configurator
to
sync
data
//
Redirect
to
configurator
to
sync
data
hosting_dict.href =
'#page=settings_configurator&tab=manage'
;
hosting_dict.href =
'#page=settings_configurator&tab=manage'
;
}
else
{
}
else
{
...
...
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_hosting_subscription_view_js.html
View file @
9144223c
...
@@ -160,6 +160,9 @@
...
@@ -160,6 +160,9 @@
.innerHTML =
gadget.props.hosting.title;
//
+
'<
span
class=
"label label-{{status}}"
>
{{status}}
</span>
';
.innerHTML =
gadget.props.hosting.title;
//
+
'<
span
class=
"label label-{{status}}"
>
{{status}}
</span>
';
for (i = 0; i
<
document
_list
.
length
;
i
+=
1
)
{
for (i = 0; i
<
document
_list
.
length
;
i
+=
1
)
{
if
(!
document_list
[
i
])
{
continue
;
}
instance_list
.
push
(
instance_list
.
push
(
getInstanceDict
(
document_list
[
i
])
getInstanceDict
(
document_list
[
i
])
);
);
...
...
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_jio_js.js
View file @
9144223c
...
@@ -166,7 +166,7 @@
...
@@ -166,7 +166,7 @@
});
});
}
}
function
clearDeletedMonitorUrl
(
opml_title
)
{
function
clearDeletedMonitorUrl
(
opml_
url
,
opml_
title
)
{
var
jio_options
=
{
var
jio_options
=
{
type
:
"
query
"
,
type
:
"
query
"
,
sub_storage
:
{
sub_storage
:
{
...
@@ -177,7 +177,7 @@
...
@@ -177,7 +177,7 @@
}
}
}
}
},
},
jio_storage
=
jIO
.
createJIO
(
jio_options
);
jio_storage
=
createOPMLReplicatedJio
(
opml_url
);
return
jio_storage
.
allDocs
({
include_docs
:
true
})
return
jio_storage
.
allDocs
({
include_docs
:
true
})
.
push
(
function
(
document_list
)
{
.
push
(
function
(
document_list
)
{
var
i
,
var
i
,
...
@@ -307,8 +307,8 @@
...
@@ -307,8 +307,8 @@
.
declareMethod
(
'
getMonitorUrlList
'
,
function
(
query
,
opml_title
)
{
.
declareMethod
(
'
getMonitorUrlList
'
,
function
(
query
,
opml_title
)
{
return
getMonitorUrlList
(
query
,
opml_title
);
return
getMonitorUrlList
(
query
,
opml_title
);
})
})
.
declareMethod
(
'
clearDeletedMonitorUrl
'
,
function
(
opml_title
)
{
.
declareMethod
(
'
clearDeletedMonitorUrl
'
,
function
(
opml_
url
,
opml_
title
)
{
return
clearDeletedMonitorUrl
(
opml_title
);
return
clearDeletedMonitorUrl
(
opml_
url
,
opml_
title
);
})
})
.
declareMethod
(
'
allDocs
'
,
function
()
{
.
declareMethod
(
'
allDocs
'
,
function
()
{
var
storage
=
this
.
state_parameter_dict
.
jio_storage
;
var
storage
=
this
.
state_parameter_dict
.
jio_storage
;
...
...
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_promise_interface_js.js
View file @
9144223c
...
@@ -212,7 +212,7 @@
...
@@ -212,7 +212,7 @@
}
}
}
}
};
};
gadget
.
property_dict
.
jio_gadget
.
createJio
(
jio_options
,
false
);
gadget
.
property_dict
.
jio_gadget
.
createJio
(
jio_options
);
return
gadget
.
property_dict
.
jio_gadget
.
get
(
title
+
'
.history
'
)
return
gadget
.
property_dict
.
jio_gadget
.
get
(
title
+
'
.history
'
)
.
push
(
undefined
,
function
(
error
)
{
.
push
(
undefined
,
function
(
error
)
{
console
.
log
(
error
);
console
.
log
(
error
);
...
...
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_static_js.html
View file @
9144223c
...
@@ -569,7 +569,9 @@
...
@@ -569,7 +569,9 @@
gadget
.
props
.
login_gadget
.
clearSettingFromParentUrl
(
url_description_dict
[
key_list
[
i
]].
href
)
gadget
.
props
.
login_gadget
.
clearSettingFromParentUrl
(
url_description_dict
[
key_list
[
i
]].
href
)
);
);
delete_promise_list
.
push
(
delete_promise_list
.
push
(
gadget
.
props
.
jio_gadget
.
clearDeletedMonitorUrl
(
url_description_dict
[
key_list
[
i
]].
title
)
gadget
.
props
.
jio_gadget
.
clearDeletedMonitorUrl
(
url_description_dict
[
key_list
[
i
]].
href
,
url_description_dict
[
key_list
[
i
]].
title
)
);
);
delete
url_description_dict
[
key_list
[
i
]];
delete
url_description_dict
[
key_list
[
i
]];
}
}
...
...
master/bt5/slapos_monitoring/PathTemplateItem/web_page_module/gadget_monitoring_sync_js.html
View file @
9144223c
...
@@ -43,6 +43,10 @@
...
@@ -43,6 +43,10 @@
gadget
.
props
.
jio_gadget
.
createJio
(
storage_dict
,
true
,
query
);
gadget
.
props
.
jio_gadget
.
createJio
(
storage_dict
,
true
,
query
);
return
gadget
.
props
.
jio_gadget
.
repair
()
return
gadget
.
props
.
jio_gadget
.
repair
()
.
push
(
undefined
,
function
(
error
)
{
.
push
(
undefined
,
function
(
error
)
{
gadget
.
props
.
error_list
.
push
({
storage_dict:
storage_dict
,
query:
query
});
console
.
log
(
error
);
console
.
log
(
error
);
});
});
}
}
...
@@ -143,6 +147,7 @@
...
@@ -143,6 +147,7 @@
var
i
,
var
i
,
promise_list =
[];
promise_list =
[];
monitor_storage_list =
getMonitoringStorageList(url_list);
monitor_storage_list =
getMonitoringStorageList(url_list);
gadget.props.error_list =
[];
for
(i =
0;
i
<
monitor_storage_list
.
length
;
i
+=
1
)
{
for
(i =
0;
i
<
monitor_storage_list
.
length
;
i
+=
1
)
{
promise_list
.
push
(
syncStorage
(
promise_list
.
push
(
syncStorage
(
gadget
,
gadget
,
...
@@ -152,20 +157,58 @@
...
@@ -152,20 +157,58 @@
console
.
log
("
Sync
monitoring
data
...");
console
.
log
("
Sync
monitoring
data
...");
return
RSVP
.
all
(
promise_list
);
return
RSVP
.
all
(
promise_list
);
})
})
.
push
(
function
()
{
//
Check
if
there
was
errors
and
retry
them
if
possible
var
error_size =
gadget.props.error_list.length,
error_list =
gadget.props.error_list.slice(0),
promise_list =
[],
i
;
if
(
error_size
>
0) {
// Reset list of errors
gadget.props.error_list = [];
$(".notifyjs-wrapper").remove();
promise_list.push($.notify(
"Retry Previous Failure(s)...",
{
position:"bottom right",
autoHide: false,
className: "info"
}
));
for (i = 0; i
<
error
_size
;
i
+=
1
)
{
promise_list
.
push
(
syncStorage
(
gadget
,
error_list
[
i
].
storage_dict
,
error_list
[
i
].
query
));
}
}
return
RSVP
.
all
(
promise_list
);
})
.
push
(
function
()
{
.
push
(
function
()
{
last_sync_time =
new
Date
().
getTime
();
last_sync_time =
new
Date
().
getTime
();
sync_lock =
false;
sync_lock =
false;
return
gadget
.
setSetting
('
latest_sync_time
',
last_sync_time
);
return
gadget
.
setSetting
('
latest_sync_time
',
last_sync_time
);
})
})
.
push
(
function
()
{
.
push
(
function
()
{
var
time =
3000,
classname =
"info"
,
error_amount =
gadget.props.error_list.length,
message =
"Synchronisation finished."
;
if
(
error_amount
>
0) {
classname = "warning";
time = 5000;
message = "Synchronisation finished with " + error_amount + "error(s). \n" +
"You can retry with manual sync.";
}
$(".notifyjs-wrapper").remove();
$(".notifyjs-wrapper").remove();
return $.notify(
return $.notify(
"
Synchronisation
finished
.",
message,
{
{
position:"bottom right",
position:"bottom right",
autoHide: true,
autoHide: true,
className:
"
info
"
,
className:
classname
,
autoHideDelay:
3000
autoHideDelay:
time
}
}
);
);
})
})
...
...
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