Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
webssh
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
郑天保
webssh
Commits
bd4182c9
Commit
bd4182c9
authored
7 years ago
by
Sheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable button for a short time after submission
parent
c5c4f570
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
main.js
static/js/main.js
+10
-1
index.html
templates/index.html
+1
-1
No files found.
static/js/main.js
View file @
bd4182c9
jQuery
(
function
(
$
){
var
status
=
$
(
'#status'
),
btn
=
$
(
'.btn-primary'
);
$
(
'form#connect'
).
submit
(
function
(
event
)
{
event
.
preventDefault
();
status
.
text
(
''
);
btn
.
prop
(
'disabled'
,
true
);
var
form
=
$
(
this
),
url
=
form
.
attr
(
'action'
),
...
...
@@ -22,7 +28,10 @@ jQuery(function($){
function
callback
(
msg
)
{
// console.log(msg);
if
(
msg
.
status
)
{
$
(
'#status'
).
text
(
msg
.
status
);
status
.
text
(
msg
.
status
);
setTimeout
(
function
(){
btn
.
prop
(
'disabled'
,
false
);
},
3000
);
return
;
}
...
...
templates/index.html
View file @
bd4182c9
...
...
@@ -58,7 +58,7 @@
</div>
<div
class=
"container"
>
<div
id=
"status"
></div>
<div
id=
"status"
style=
"color: red;"
></div>
<div
id=
"terminal"
></div>
</div>
...
...
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