Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
8781cdcb
Commit
8781cdcb
authored
11 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
More optimizations and cleanup. The paging thing is still a bit off since
the offset is in user number, not in number of users.
parent
e292e0e4
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
web/root/ecwebv3/pages/003-userlist.xjs
+9
-17
9 additions, 17 deletions
web/root/ecwebv3/pages/003-userlist.xjs
with
9 additions
and
17 deletions
web/root/ecwebv3/pages/003-userlist.xjs
+
9
−
17
View file @
8781cdcb
...
@@ -18,19 +18,15 @@
...
@@ -18,19 +18,15 @@
};
};
var pageSize = 500;
var pageSize = 500;
var offset = 1;
// Most people won't need to edit below this line
// Most people won't need to edit below this line
load("sbbsdefs.js");
load("sbbsdefs.js");
if( typeof http_request.query.offset == "undefined"
if(typeof http_request.query.offset != "undefined") {
||
offset = parseInt(http_request.query.offset[0]);
isNaN(parseInt(http_request.query.offset[0]))
if(isNaN(offset) || offset < 1)
||
offset = 1;
http_request.query.offset[0] < 1
) {
var offset = 1;
} else {
var offset = parseInt(http_request.query.offset[0]);
}
}
var previousOffset = Math.max(1, offset - pageSize);
var previousOffset = Math.max(1, offset - pageSize);
var nextOffset = Math.min(offset + pageSize, offset + (system.lastuser - offset));
var nextOffset = Math.min(offset + pageSize, offset + (system.lastuser - offset));
...
@@ -50,11 +46,6 @@
...
@@ -50,11 +46,6 @@
||
||
typeof http_request.query.sortorder == "undefined"
typeof http_request.query.sortorder == "undefined"
||
||
( http_request.query.sortorder != "ascending"
&&
http_request.query.sortorder != "descending"
)
||
columns[http_request.query.sortby[0].toLowerCase()] == undefined
columns[http_request.query.sortby[0].toLowerCase()] == undefined
||
||
columns[http_request.query.sortby[0].toLowerCase()].type == undefined
columns[http_request.query.sortby[0].toLowerCase()].type == undefined
...
@@ -114,6 +105,8 @@
...
@@ -114,6 +105,8 @@
var copyProperties = function(source, dest) {
var copyProperties = function(source, dest) {
for(var property in source) {
for(var property in source) {
if(columns[property] == undefined)
continue;
if(typeof source[property] == "string" || typeof source[property] == "number")
if(typeof source[property] == "string" || typeof source[property] == "number")
dest[property] = source[property];
dest[property] = source[property];
}
}
...
@@ -128,8 +121,7 @@
...
@@ -128,8 +121,7 @@
if(usr1.settings&USER_DELETED || usr1.compare_ars("REST Q"))
if(usr1.settings&USER_DELETED || usr1.compare_ars("REST Q"))
continue;
continue;
var usr2 = copyProperties(usr1, {});
var usr2 = copyProperties(usr1, {});
usr2 = copyProperties(usr1.stats, usr2);
users.push(copyProperties(usr1.stats, usr2));
users.push(usr2);
}
}
users.sort(sortUsers);
users.sort(sortUsers);
...
@@ -146,7 +138,7 @@
...
@@ -146,7 +138,7 @@
<?xjs
<?xjs
for(var u
= 0; u < users.length; u++
) {
for(var u
in users
) {
print(format("<tr class='%s'>", (u % 2 == 0) ? "row1" : "row2"));
print(format("<tr class='%s'>", (u % 2 == 0) ? "row1" : "row2"));
for(var c in columns) {
for(var c in columns) {
print(
print(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment