Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
jio
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
Guillaume Royer
jio
Commits
0f223c59
Commit
0f223c59
authored
Mar 26, 2014
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard scripts supports more than 1000 times
parent
025d3217
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
11 deletions
+15
-11
examples/jio_dashboard.html
examples/jio_dashboard.html
+15
-11
No files found.
examples/jio_dashboard.html
View file @
0f223c59
...
@@ -319,8 +319,9 @@ function command(method, num) {
...
@@ -319,8 +319,9 @@ function command(method, num) {
}
}
}
}
function
doCommandNTimes
(
method
)
{
function
doCommandNTimes
(
method
,
i
)
{
var
i
=
-
1
,
n
=
0
,
lock
,
promise_list
=
[];
var
n
=
0
,
lock
,
promise_list
=
[];
i
=
i
>
0
?
i
:
0
;
n
=
parseInt
(
select
(
"
#times
"
).
value
,
10
);
n
=
parseInt
(
select
(
"
#times
"
).
value
,
10
);
lock
=
select
(
"
#times-lock
"
).
checked
;
lock
=
select
(
"
#times-lock
"
).
checked
;
if
(
!
lock
)
{
if
(
!
lock
)
{
...
@@ -329,10 +330,13 @@ function doCommandNTimes(method) {
...
@@ -329,10 +330,13 @@ function doCommandNTimes(method) {
if
(
!
isFinite
(
n
))
{
if
(
!
isFinite
(
n
))
{
n
=
1
;
n
=
1
;
}
}
while
(
++
i
<
n
)
{
return
command
(
method
,
++
i
).
promise_list
.
push
(
command
(
method
,
i
));
then
(
function
(
answer
)
{
if
(
i
<
n
)
{
return
doCommandNTimes
(
method
,
i
);
}
}
return
RSVP
.
all
(
promise_list
);
return
answer
;
});
}
}
function
post
()
{
function
post
()
{
...
@@ -376,24 +380,24 @@ function scriptLogLocalStorage() {
...
@@ -376,24 +380,24 @@ function scriptLogLocalStorage() {
function
scriptRemoveAllDocs
()
{
function
scriptRemoveAllDocs
()
{
var
original_metadata_value
=
select
(
'
#metadata
'
).
value
;
var
original_metadata_value
=
select
(
'
#metadata
'
).
value
;
return
command
(
"
allDocs
"
).
then
(
function
(
answer
)
{
return
command
(
"
allDocs
"
).
then
(
function
(
answer
)
{
return
RSVP
.
all
(
answer
.
data
.
rows
.
map
(
function
(
row
)
{
return
jIO
.
util
.
forEach
(
answer
.
data
.
rows
,
function
(
row
)
{
select
(
"
#metadata
"
).
value
=
JSON
.
stringify
({
"
_id
"
:
row
.
id
});
select
(
"
#metadata
"
).
value
=
JSON
.
stringify
({
"
_id
"
:
row
.
id
});
var
ret
=
command
(
"
remove
"
);
var
ret
=
command
(
"
remove
"
);
select
(
'
#metadata
'
).
value
=
original_metadata_value
;
select
(
'
#metadata
'
).
value
=
original_metadata_value
;
return
ret
;
return
ret
;
})
)
;
});
});
});
}
}
function
scriptRepairAllDocs
()
{
function
scriptRepairAllDocs
()
{
var
original_metadata_value
=
select
(
'
#metadata
'
).
value
;
var
original_metadata_value
=
select
(
'
#metadata
'
).
value
;
return
command
(
"
allDocs
"
).
then
(
function
(
answer
)
{
return
command
(
"
allDocs
"
).
then
(
function
(
answer
)
{
return
RSVP
.
all
(
answer
.
data
.
rows
.
map
(
function
(
row
)
{
return
jIO
.
util
.
forEach
(
answer
.
data
.
rows
,
function
(
row
)
{
select
(
"
#metadata
"
).
value
=
JSON
.
stringify
({
"
_id
"
:
row
.
id
});
select
(
"
#metadata
"
).
value
=
JSON
.
stringify
({
"
_id
"
:
row
.
id
});
var
ret
=
command
(
"
repair
"
);
var
ret
=
command
(
"
repair
"
);
select
(
'
#metadata
'
).
value
=
original_metadata_value
;
select
(
"
#metadata
"
).
value
=
original_metadata_value
;
return
ret
;
return
ret
;
})
)
;
});
});
});
}
}
//-->
//-->
...
...
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