Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Eteri
erp5
Commits
964767a1
Commit
964767a1
authored
6 years ago
by
Alain Takoudjou
Committed by
Rafael Monnerat
5 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_monitoring] build hosting subscription portal_type in monitor jio storage
parent
51cfec40
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
20 deletions
+62
-20
bt5/erp5_web_monitoring/PathTemplateItem/web_page_module/monitoring_jio_storage_js.js
...TemplateItem/web_page_module/monitoring_jio_storage_js.js
+62
-20
No files found.
bt5/erp5_web_monitoring/PathTemplateItem/web_page_module/monitoring_jio_storage_js.js
View file @
964767a1
...
@@ -131,13 +131,17 @@
...
@@ -131,13 +131,17 @@
var
remove_id_list
=
[],
var
remove_id_list
=
[],
remove_signature_id_list
=
[];
remove_signature_id_list
=
[];
// remove related hosting subscription
remove_id_list
.
push
(
generateHash
(
id
));
// removed saved opml content
remove_signature_id_list
.
push
({
remove_signature_id_list
.
push
({
id
:
url
,
id
:
url
,
name
:
url
name
:
url
});
});
// remove all related documents
return
storage
.
allDocs
({
return
storage
.
allDocs
({
select_list
:
[
"
xmlUrl
"
,
"
url
"
],
select_list
:
[
"
xmlUrl
"
,
"
url
"
],
query
:
'
(portal_type:"
opml-o
utline") AND (parent_url:"
'
+
url
+
'
")
'
query
:
'
(portal_type:"
Opml O
utline") AND (parent_url:"
'
+
url
+
'
")
'
})
})
.
push
(
function
(
document_result
)
{
.
push
(
function
(
document_result
)
{
var
i
,
var
i
,
...
@@ -370,7 +374,24 @@
...
@@ -370,7 +374,24 @@
});
});
}
}
function
getOpmlTree
(
context
,
opml_url
,
opml_spec
,
basic_login
)
{
function
updateHostingSubscriptionState
(
hosting
,
element
)
{
var
status
=
element
.
status
.
toUpperCase
();
if
(
hosting
.
instance_amount
===
0
)
{
hosting
.
status_date
=
element
.
date
;
}
if
(
hosting
.
status
===
"
ERROR
"
)
{
return
;
}
else
if
(
status
===
"
ERROR
"
)
{
hosting
.
status
=
status
;
}
else
if
(
status
===
"
WARNING
"
)
{
hosting
.
status
=
status
;
}
if
(
status
===
"
OK
"
&&
hosting
.
status
!==
status
)
{
hosting
.
status
=
status
;
}
}
function
getOpmlTree
(
context
,
opml_url
,
opml_spec
,
basic_login
,
opml_title
)
{
var
opml_storage
,
var
opml_storage
,
opml_document_list
=
[],
opml_document_list
=
[],
delete_key_list
=
[],
delete_key_list
=
[],
...
@@ -378,10 +399,21 @@
...
@@ -378,10 +399,21 @@
opml_result_list
,
opml_result_list
,
current_signature_dict
=
{},
current_signature_dict
=
{},
fetch_remote_opml
=
false
,
fetch_remote_opml
=
false
,
hosting_subscription
,
id
;
id
;
id
=
generateHash
(
opml_url
);
id
=
generateHash
(
opml_url
);
opml_storage
=
createStorage
(
context
,
opml_spec
,
id
);
opml_storage
=
createStorage
(
context
,
opml_spec
,
id
);
// Hosting Subscription is build from OPML and it has status
hosting_subscription
=
{
title
:
opml_title
||
""
,
portal_type
:
"
Hosting Subscription
"
,
opml_url
:
opml_url
,
status
:
"
WARNING
"
,
instance_amount
:
0
,
status_date
:
new
Date
()
};
return
getDocumentAsAttachment
(
context
,
opml_url
,
OPML_ATTACHMENT_NAME
)
return
getDocumentAsAttachment
(
context
,
opml_url
,
OPML_ATTACHMENT_NAME
)
.
push
(
function
(
opml_doc
)
{
.
push
(
function
(
opml_doc
)
{
var
current_time
=
new
Date
().
getTime
();
var
current_time
=
new
Date
().
getTime
();
...
@@ -437,12 +469,18 @@
...
@@ -437,12 +469,18 @@
result_list
=
[],
result_list
=
[],
header_dict
=
{};
header_dict
=
{};
if
(
opml_result_list
.
data
.
total_rows
>
0
&&
fetch_remote_opml
)
{
if
(
opml_result_list
.
data
.
total_rows
>
0
)
{
header_dict
=
{
if
(
opml_result_list
.
data
.
rows
[
0
].
doc
.
title
)
{
dateCreated
:
opml_result_list
.
data
.
rows
[
0
].
doc
.
dateCreated
,
hosting_subscription
.
title
=
opml_result_list
.
data
.
rows
[
0
]
dateModified
:
opml_result_list
.
data
.
rows
[
0
].
doc
.
dateModified
,
.
doc
.
title
;
opml_title
:
opml_result_list
.
data
.
rows
[
0
].
doc
.
title
}
};
if
(
fetch_remote_opml
)
{
header_dict
=
{
dateCreated
:
opml_result_list
.
data
.
rows
[
0
].
doc
.
dateCreated
,
dateModified
:
opml_result_list
.
data
.
rows
[
0
].
doc
.
dateModified
,
opml_title
:
opml_result_list
.
data
.
rows
[
0
].
doc
.
title
};
}
}
}
for
(
i
=
1
;
i
<
opml_result_list
.
data
.
total_rows
;
i
+=
1
)
{
for
(
i
=
1
;
i
<
opml_result_list
.
data
.
total_rows
;
i
+=
1
)
{
...
@@ -493,7 +531,7 @@
...
@@ -493,7 +531,7 @@
delete
current_signature_dict
[
id_hash
];
delete
current_signature_dict
[
id_hash
];
}
}
Object
.
assign
(
item
.
doc
,
{
Object
.
assign
(
item
.
doc
,
{
portal_type
:
"
opml-o
utline
"
,
portal_type
:
"
Opml O
utline
"
,
parent_id
:
id
,
parent_id
:
id
,
parent_url
:
opml_url
,
parent_url
:
opml_url
,
reference
:
id_hash
,
reference
:
id_hash
,
...
@@ -534,10 +572,13 @@
...
@@ -534,10 +572,13 @@
item_id
=
item
.
guid
||
item
.
id
,
item_id
=
item
.
guid
||
item
.
id
,
status
=
(
element
.
status
||
element
.
category
);
status
=
(
element
.
status
||
element
.
category
);
if
(
element
.
type
===
'
global
'
&&
if
(
element
.
type
===
'
global
'
)
{
element
.
aggregate_reference
===
undefined
)
{
updateHostingSubscriptionState
(
hosting_subscription
,
element
);
// XXX - document need to be updated to keep compatibility
hosting_subscription
.
instance_amount
+=
1
;
element
=
fixGlobalInstanceDocument
(
element
);
if
(
element
.
aggregate_reference
===
undefined
)
{
// XXX - document need to be updated to keep compatibility
element
=
fixGlobalInstanceDocument
(
element
);
}
}
}
id_hash
=
generateHash
(
item_result
.
parent_id
+
id_hash
=
generateHash
(
item_result
.
parent_id
+
...
@@ -619,6 +660,10 @@
...
@@ -619,6 +660,10 @@
});
});
}
}
}
}
opml_document_list
.
push
({
id
:
id
,
doc
:
hosting_subscription
});
return
[
opml_document_list
,
delete_key_list
,
attachment_document_list
];
return
[
opml_document_list
,
delete_key_list
,
attachment_document_list
];
});
});
}
}
...
@@ -696,7 +741,7 @@
...
@@ -696,7 +741,7 @@
function
syncOpmlStorage
(
context
)
{
function
syncOpmlStorage
(
context
)
{
return
context
.
_local_sub_storage
.
allDocs
({
return
context
.
_local_sub_storage
.
allDocs
({
query
:
'
(portal_type:"opml") AND (active:true) AND (url:"https://%")
'
,
query
:
'
(portal_type:"opml") AND (active:true) AND (url:"https://%")
'
,
select_list
:
[
"
url
"
,
"
basic_login
"
]
select_list
:
[
"
title
"
,
"
url
"
,
"
basic_login
"
]
})
})
.
push
(
function
(
storage_result
)
{
.
push
(
function
(
storage_result
)
{
var
i
,
var
i
,
...
@@ -718,7 +763,8 @@
...
@@ -718,7 +763,8 @@
timeout
:
context
.
_request_timeout
timeout
:
context
.
_request_timeout
}
}
},
},
storage_spec
.
basic_login
storage_spec
.
basic_login
,
storage_spec
.
title
);
);
})
})
.
push
(
function
(
result_list
)
{
.
push
(
function
(
result_list
)
{
...
@@ -731,11 +777,7 @@
...
@@ -731,11 +777,7 @@
});
});
}
}
for
(
i
=
0
;
i
<
storage_result
.
data
.
total_rows
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
storage_result
.
data
.
total_rows
;
i
+=
1
)
{
syncFullOpml
({
syncFullOpml
(
storage_result
.
data
.
rows
[
i
].
value
);
type
:
storage_result
.
data
.
rows
[
i
].
value
.
type
,
url
:
storage_result
.
data
.
rows
[
i
].
value
.
url
,
basic_login
:
storage_result
.
data
.
rows
[
i
].
value
.
basic_login
});
}
}
return
opml_queue
;
return
opml_queue
;
});
});
...
...
This diff is collapsed.
Click to expand it.
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