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
1
Issues
1
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
Roque
erp5
Commits
2018dd50
Commit
2018dd50
authored
Mar 26, 2024
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[WIP][DEBUG] erp5_web_monitoring: fix jio storage
parent
9a84f1f3
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
112 additions
and
61 deletions
+112
-61
bt5/erp5_web_monitoring/PathTemplateItem/web_page_module/gadget_officejs_monitoring_jio_js.js
...Item/web_page_module/gadget_officejs_monitoring_jio_js.js
+101
-55
bt5/erp5_web_monitoring/PathTemplateItem/web_page_module/gadget_officejs_monitoring_jio_js.xml
...tem/web_page_module/gadget_officejs_monitoring_jio_js.xml
+2
-2
bt5/erp5_web_monitoring/PathTemplateItem/web_page_module/monitoring_jio_storage_js.js
...TemplateItem/web_page_module/monitoring_jio_storage_js.js
+7
-2
bt5/erp5_web_monitoring/PathTemplateItem/web_page_module/monitoring_jio_storage_js.xml
...emplateItem/web_page_module/monitoring_jio_storage_js.xml
+2
-2
No files found.
bt5/erp5_web_monitoring/PathTemplateItem/web_page_module/gadget_officejs_monitoring_jio_js.js
View file @
2018dd50
...
...
@@ -70,13 +70,26 @@
return
appcache_storage
.
repair
(
current_version
);
})
.
push
(
function
()
{
console
.
log
(
"
appcache repaired.
"
);
return
jio_storage
.
repair
();
})
.
push
(
function
()
{
console
.
log
(
"
jio repaired.
"
);
return
gadget
.
setSetting
(
"
migration_version
"
,
current_version
);
});
})
.
declareMethod
(
'
createStorage
'
,
function
(
options
,
monitoring_jio
)
{
var
gadget
=
this
;
if
(
options
!==
undefined
)
{
gadget
.
props
.
jio_storage
=
jIO
.
createJIO
(
options
);
console
.
log
(
"
jio options created!
"
);
}
else
{
gadget
.
props
.
jio_storage
=
jIO
.
createJIO
(
monitoring_jio
);
console
.
log
(
"
monitoring_jio created!
"
);
}
})
.
declareMethod
(
'
createJio
'
,
function
(
options
)
{
var
gadget
=
this
,
current_version
,
index
,
appcache_storage
,
monitoring_jio
,
appcache_jio
,
migration_version
,
manifest
,
...
...
@@ -88,16 +101,12 @@
migration_version
=
result_list
[
1
];
current_version
=
window
.
location
.
href
.
replace
(
window
.
location
.
hash
,
""
);
index
=
current_version
.
indexOf
(
window
.
location
.
host
)
+
window
.
location
.
host
.
length
;
current_version
=
current_version
.
substr
(
index
);
if
(
migration_version
!==
current_version
)
{
//XXX is this a dirty hack?
indexedDB
.
deleteDatabase
(
'
monitoring-configuration-hash
'
);
indexedDB
.
deleteDatabase
(
'
monitoring_local.db
'
);
}
current_version
=
current_version
.
substr
(
index
);
/*
return;
})
.push(function () {
*/
manifest
=
"
gadget_officejs_monitoring.configuration
"
;
if
(
options
!==
undefined
)
{
gadget
.
props
.
jio_storage
=
jIO
.
createJIO
(
options
);
}
else
{
monitoring_jio
=
{
type
:
"
replicatedopml
"
,
remote_storage_unreachable_status
:
"
WARNING
"
,
...
...
@@ -150,10 +159,47 @@
}
}
};
gadget
.
props
.
jio_storage
=
jIO
.
createJIO
(
monitoring_jio
);
return
gadget
.
createStorage
(
options
,
monitoring_jio
);
})
.
push
(
function
()
{
if
(
migration_version
!==
current_version
)
{
console
.
log
(
"
NEW APP VERSION! gadget.props.jio_storage:
"
,
gadget
.
props
.
jio_storage
);
if
(
gadget
.
props
.
jio_storage
)
{
console
.
log
(
"
call jio_allDocs!
"
);
return
gadget
.
props
.
jio_storage
.
allDocs
();
}
}
})
.
push
(
function
(
all_docs
)
{
console
.
log
(
"
all_docs:
"
,
all_docs
);
if
(
all_docs
&&
all_docs
.
data
.
total_rows
)
{
//iterate all docs, jio_remove, and recreate
//for gadget.jio_remove(options.jio_key);
var
remove_queue
=
new
RSVP
.
Queue
(),
i
;
function
remove_doc
(
id
)
{
remove_queue
.
push
(
function
()
{
return
gadget
.
props
.
jio_storage
.
remove
(
id
);
});
}
for
(
i
=
0
;
i
<
all_docs
.
data
.
total_rows
;
i
+=
1
)
{
remove_doc
(
all_docs
.
data
.
rows
[
i
].
id
);
}
return
RSVP
.
all
([
remove_queue
,
gadget
.
createStorage
(
options
,
monitoring_jio
),
gadget
.
setSetting
(
"
latest_import_date
"
,
undefined
)
]);
}
else
{
console
.
log
(
"
no new version, no delete
"
);
}
})
.
push
(
function
()
{
console
.
log
(
"
remove part done
"
);
if
(
migration_version
!==
current_version
)
{
console
.
log
(
"
new app version! recreate appcache and force repair
"
);
appcache_storage
=
jIO
.
createJIO
(
appcache_jio
);
console
.
log
(
"
appcache_jio created
"
);
return
gadget
.
updateConfiguration
(
appcache_storage
,
migration_version
,
current_version
,
gadget
.
props
.
jio_storage
);
}
})
...
...
bt5/erp5_web_monitoring/PathTemplateItem/web_page_module/gadget_officejs_monitoring_jio_js.xml
View file @
2018dd50
...
...
@@ -249,7 +249,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
1015.31
731.39115.52974
</string>
</value>
<value>
<string>
1015.31
834.14596.52957
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -269,7 +269,7 @@
</tuple>
<state>
<tuple>
<float>
17114
81527.41
</float>
<float>
17114
94540.44
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_monitoring/PathTemplateItem/web_page_module/monitoring_jio_storage_js.js
View file @
2018dd50
...
...
@@ -154,11 +154,16 @@
var
storage
=
this
.
_local_sub_storage
;
return
storage
.
get
(
id
)
.
push
(
function
(
doc
)
{
console
.
log
(
"
monitoring jio storage REMOVE. id:
"
,
id
);
console
.
log
(
"
with portal_type:
"
,
doc
.
portal_type
);
if
(
doc
.
portal_type
!==
'
opml
'
)
{
throw
new
TypeError
(
"
Object with portal_type
"
+
doc
.
portal_type
+
"
is frozen, cannot remove it.
"
);
console
.
log
(
"
portal_type !== 'opml'! just jio remove
"
);
return
storage
.
remove
(
id
);
/*throw new TypeError("Object with portal_type" + doc.portal_type +
"is frozen, cannot remove it.");*/
}
function
removeOPMLTree
(
url
)
{
console
.
log
(
"
portal_type 'opml'! complex opml remove
"
);
var
remove_id_list
=
[],
remove_signature_id_list
=
[];
...
...
bt5/erp5_web_monitoring/PathTemplateItem/web_page_module/monitoring_jio_storage_js.xml
View file @
2018dd50
...
...
@@ -249,7 +249,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
101
4.13769.50435.48776
</string>
</value>
<value>
<string>
101
5.31816.24445.1945
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -269,7 +269,7 @@
</tuple>
<state>
<tuple>
<float>
17
06644494.36
</float>
<float>
17
11486812.33
</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