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
Tatuya Kamada
erp5
Commits
63383559
Commit
63383559
authored
Dec 27, 2017
by
Alain Takoudjou
Committed by
Rafael Monnerat
Sep 21, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_monitoring] allow to sorting hosting subscription by status
parent
883ba373
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
8 deletions
+31
-8
bt5/erp5_web_monitoring/PathTemplateItem/web_page_module/gadget_erp5_page_ojsm_hosting_subscription_list_js.js
...ule/gadget_erp5_page_ojsm_hosting_subscription_list_js.js
+29
-6
bt5/erp5_web_monitoring/PathTemplateItem/web_page_module/gadget_erp5_page_ojsm_hosting_subscription_list_js.xml
...le/gadget_erp5_page_ojsm_hosting_subscription_list_js.xml
+2
-2
No files found.
bt5/erp5_web_monitoring/PathTemplateItem/web_page_module/gadget_erp5_page_ojsm_hosting_subscription_list_js.js
View file @
63383559
...
...
@@ -5,10 +5,12 @@
var
gadget_klass
=
rJS
(
window
);
function
getHostingData
(
gadget
,
filter
)
{
function
getHostingData
(
gadget
,
filter
,
status_sort
)
{
// optimized way to fetch hosting subscription list
var
hosting_dict
=
{},
instance_dict
=
{},
sort_status_dict
=
{},
compare_function
,
total_rows
=
0
;
return
gadget
.
jio_allDocs
(
filter
)
.
push
(
function
(
result
)
{
...
...
@@ -78,6 +80,20 @@
row_list
.
push
(
hosting_dict
[
key
]);
}
}
if
(
status_sort
!==
undefined
)
{
if
(
status_sort
===
"
ascending
"
)
{
compare_function
=
function
(
first
,
second
)
{
return
first
>
second
;
};
}
else
{
compare_function
=
function
(
first
,
second
)
{
return
first
<=
second
;
};
}
row_list
.
sort
(
function
(
a
,
b
)
{
return
compare_function
(
a
.
value
.
status
,
b
.
value
.
status
);
});
}
return
{
data
:
{
total_rows
:
total_rows
,
rows
:
row_list
}};
});
}
...
...
@@ -101,8 +117,15 @@
})
.
allowPublicAcquisition
(
"
jio_allDocs
"
,
function
(
param_list
)
{
var
gadget
=
this
;
return
getHostingData
(
gadget
,
param_list
[
0
])
var
gadget
=
this
,
status_sort
,
i
;
for
(
i
=
0
;
i
<
param_list
[
0
].
sort_on
.
length
;
i
+=
1
)
{
if
(
param_list
[
0
].
sort_on
[
i
][
0
]
===
'
status
'
)
{
status_sort
=
param_list
[
0
].
sort_on
[
i
][
1
];
}
}
return
getHostingData
(
gadget
,
param_list
[
0
],
status_sort
)
.
push
(
function
(
result
)
{
var
i
,
len
=
result
.
data
.
total_rows
;
...
...
@@ -202,9 +225,9 @@
"
opml
"
+
"
%22%29AND%28active%3A%22
"
+
"
true
"
+
"
%22%29
"
,
"
portal_type
"
:
[],
"
search_column_list
"
:
[[
'
title
'
,
'
Hosting Subscription
'
]],
"
sort_column_list
"
:
[[
'
title
'
,
'
Hosting Subscription
'
]],
"
sort
"
:
[[
"
title
"
,
"
ascending
"
]],
"
search_column_list
"
:
[[
'
status
'
,
'
Status
'
],
[
'
title
'
,
'
Hosting Subscription
'
]],
"
sort_column_list
"
:
[[
'
status
'
,
'
Status
'
],
[
'
title
'
,
'
Hosting Subscription
'
]],
"
sort
"
:
[[
'
status
'
,
'
ascending
'
]],
"
title
"
:
"
Hosting Subscriptions
"
,
"
command
"
:
"
index
"
,
"
type
"
:
"
ListBox
"
...
...
bt5/erp5_web_monitoring/PathTemplateItem/web_page_module/gadget_erp5_page_ojsm_hosting_subscription_list_js.xml
View file @
63383559
...
...
@@ -239,7 +239,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
96
3.38011.16179.25053
</string>
</value>
<value>
<string>
96
4.27055.25870.4130
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -257,7 +257,7 @@
</tuple>
<state>
<tuple>
<float>
151
3620564.42
</float>
<float>
151
4376211.14
</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