Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gsper
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
tools
gsper
Commits
3424adbd
Commit
3424adbd
authored
6 years ago
by
Millicent Billette
Browse files
Options
Downloads
Patches
Plain Diff
FIX: button qui restaait rouge quand c'est fini
parent
98ee9932
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
public/main.js
+13
-4
13 additions, 4 deletions
public/main.js
with
13 additions
and
4 deletions
public/main.js
+
13
−
4
View file @
3424adbd
...
...
@@ -29,7 +29,10 @@ function combiTested(event){
document
.
getElementById
(
"
resSeed
"
).
innerText
=
event
.
data
.
seed
;
stopNow
();
}
if
(
tested
===
combi
)
document
.
getElementById
(
"
percent
"
).
innerHTML
=
"
Fini sans résultats
"
;
if
(
tested
===
combi
)
{
document
.
getElementById
(
"
percent
"
).
innerHTML
=
"
Fini sans résultats
"
;
idleStateBtn
();
}
}
...
...
@@ -58,9 +61,16 @@ function updateEstimate(){
document
.
getElementById
(
"
combi
"
).
innerHTML
=
idSecList
.
length
*
passList
.
length
;
document
.
getElementById
(
"
temps
"
).
innerHTML
=
"
<
"
+
(
idSecList
.
length
*
passList
.
length
/
10
)
+
"
s
"
;
}
function
stopNow
(){
function
idleStateBtn
(){
document
.
getElementById
(
"
compute
"
).
innerText
=
"
Gsper !
"
;
document
.
getElementById
(
"
compute
"
).
classList
.
remove
(
"
abort
"
);
}
function
workingStateBtn
()
{
document
.
getElementById
(
"
compute
"
).
innerText
=
"
Stop !
"
;
document
.
getElementById
(
"
compute
"
).
classList
.
add
(
"
abort
"
);
}
function
stopNow
(){
idleStateBtn
();
for
(
let
i
=
0
;
i
<
navigator
.
hardwareConcurrency
;
i
++
)
workers
[
i
].
terminate
();
setTimeout
(
startWorkers
,
0
);
tested
=
0
;
...
...
@@ -71,8 +81,7 @@ document.getElementById("compute").addEventListener("click", e=>{
const
passList
=
multiLineString2cleanArray
(
document
.
getElementById
(
"
pass
"
).
value
);
combi
=
idSecList
.
length
*
passList
.
length
;
if
(
tested
<
combi
&&
tested
>
0
)
return
stopNow
();
document
.
getElementById
(
"
compute
"
).
innerText
=
"
Stop !
"
;
document
.
getElementById
(
"
compute
"
).
classList
.
add
(
"
abort
"
);
workingStateBtn
();
departTime
=
Date
.
now
();
updateEstimate
();
document
.
getElementById
(
"
percent
"
).
innerHTML
=
"
0%
"
;
...
...
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