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
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
amrani
erp5
Commits
ee6bc18d
Commit
ee6bc18d
authored
Dec 27, 2017
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_monitoring] allow to sorting hosting subscription by status
parent
5c6100c0
Changes
2
Hide 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 @
ee6bc18d
...
@@ -5,10 +5,12 @@
...
@@ -5,10 +5,12 @@
var
gadget_klass
=
rJS
(
window
);
var
gadget_klass
=
rJS
(
window
);
function
getHostingData
(
gadget
,
filter
)
{
function
getHostingData
(
gadget
,
filter
,
status_sort
)
{
// optimized way to fetch hosting subscription list
// optimized way to fetch hosting subscription list
var
hosting_dict
=
{},
var
hosting_dict
=
{},
instance_dict
=
{},
instance_dict
=
{},
sort_status_dict
=
{},
compare_function
,
total_rows
=
0
;
total_rows
=
0
;
return
gadget
.
jio_allDocs
(
filter
)
return
gadget
.
jio_allDocs
(
filter
)
.
push
(
function
(
result
)
{
.
push
(
function
(
result
)
{
...
@@ -78,6 +80,20 @@
...
@@ -78,6 +80,20 @@
row_list
.
push
(
hosting_dict
[
key
]);
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
}};
return
{
data
:
{
total_rows
:
total_rows
,
rows
:
row_list
}};
});
});
}
}
...
@@ -101,8 +117,15 @@
...
@@ -101,8 +117,15 @@
})
})
.
allowPublicAcquisition
(
"
jio_allDocs
"
,
function
(
param_list
)
{
.
allowPublicAcquisition
(
"
jio_allDocs
"
,
function
(
param_list
)
{
var
gadget
=
this
;
var
gadget
=
this
,
return
getHostingData
(
gadget
,
param_list
[
0
])
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
)
{
.
push
(
function
(
result
)
{
var
i
,
var
i
,
len
=
result
.
data
.
total_rows
;
len
=
result
.
data
.
total_rows
;
...
@@ -202,9 +225,9 @@
...
@@ -202,9 +225,9 @@
"
opml
"
+
"
%22%29AND%28active%3A%22
"
+
"
opml
"
+
"
%22%29AND%28active%3A%22
"
+
"
true
"
+
"
%22%29
"
,
"
true
"
+
"
%22%29
"
,
"
portal_type
"
:
[],
"
portal_type
"
:
[],
"
search_column_list
"
:
[[
'
title
'
,
'
Hosting Subscription
'
]],
"
search_column_list
"
:
[[
'
status
'
,
'
Status
'
],
[
'
title
'
,
'
Hosting Subscription
'
]],
"
sort_column_list
"
:
[[
'
title
'
,
'
Hosting Subscription
'
]],
"
sort_column_list
"
:
[[
'
status
'
,
'
Status
'
],
[
'
title
'
,
'
Hosting Subscription
'
]],
"
sort
"
:
[[
"
title
"
,
"
ascending
"
]],
"
sort
"
:
[[
'
status
'
,
'
ascending
'
]],
"
title
"
:
"
Hosting Subscriptions
"
,
"
title
"
:
"
Hosting Subscriptions
"
,
"
command
"
:
"
index
"
,
"
command
"
:
"
index
"
,
"
type
"
:
"
ListBox
"
"
type
"
:
"
ListBox
"
...
...
bt5/erp5_web_monitoring/PathTemplateItem/web_page_module/gadget_erp5_page_ojsm_hosting_subscription_list_js.xml
View file @
ee6bc18d
...
@@ -239,7 +239,7 @@
...
@@ -239,7 +239,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<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>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -257,7 +257,7 @@
...
@@ -257,7 +257,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
151
3620564.42
</float>
<float>
151
4376211.14
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</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