Commit 58fce367 authored by Roque's avatar Roque

erp5_web_monitoring: truncate

parent ca12f168
...@@ -53,6 +53,9 @@ ...@@ -53,6 +53,9 @@
return date_string + "+0000"; return date_string + "+0000";
} }
function truncate(str, n) {
return (str.length > n) ? str.slice(0, n - 1) + '...' : str;
}
if (status_history && status_history.hasOwnProperty('data')) { if (status_history && status_history.hasOwnProperty('data')) {
// the status history list is reversed ([old, ...., newest]) // the status history list is reversed ([old, ...., newest])
len = status_history.data.length; len = status_history.data.length;
...@@ -115,7 +118,7 @@ ...@@ -115,7 +118,7 @@
type: "DateTimeField" type: "DateTimeField"
} }
}, },
message: status_history.data[i].message, message: truncate(status_history.data[i].message, 100),
"listbox_uid:list": { "listbox_uid:list": {
key: "listbox_uid:list", key: "listbox_uid:list",
value: 2713 value: 2713
......
...@@ -250,7 +250,7 @@ ...@@ -250,7 +250,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1015.43186.34401.32273</string> </value> <value> <string>1016.16323.2199.4113</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -270,7 +270,7 @@ ...@@ -270,7 +270,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1712168806.42</float> <float>1714489175.63</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment