Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
srvpro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
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
MyCard
srvpro
Commits
d18c374f
Commit
d18c374f
authored
Mar 03, 2019
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add username by paniuncle
parent
274abb39
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
58 additions
and
29 deletions
+58
-29
dashboard-en.html
dashboard-en.html
+5
-2
dashboard-script.js
dashboard-script.js
+17
-13
dashboard.html
dashboard.html
+5
-2
deck-dashboard.html
deck-dashboard.html
+8
-4
pre-dashboard.html
pre-dashboard.html
+7
-2
replay-dashboard.html
replay-dashboard.html
+8
-4
update-dashboard.html
update-dashboard.html
+8
-2
No files found.
dashboard-en.html
View file @
d18c374f
...
@@ -15,13 +15,16 @@
...
@@ -15,13 +15,16 @@
<div
class=
"col-lg-1"
>
<div
class=
"col-lg-1"
>
<input
type=
"text"
class=
"form-control"
id=
"http"
value=
"http"
placeholder=
"http"
>
<input
type=
"text"
class=
"form-control"
id=
"http"
value=
"http"
placeholder=
"http"
>
</div>
</div>
<div
class=
"col-lg-
3
"
>
<div
class=
"col-lg-
2
"
>
<input
type=
"text"
class=
"form-control"
id=
"ip"
value=
""
placeholder=
"IP"
>
<input
type=
"text"
class=
"form-control"
id=
"ip"
value=
""
placeholder=
"IP"
>
</div>
</div>
<div
class=
"col-lg-1"
>
<div
class=
"col-lg-1"
>
<input
type=
"text"
class=
"form-control"
id=
"port"
value=
""
placeholder=
"port"
>
<input
type=
"text"
class=
"form-control"
id=
"port"
value=
""
placeholder=
"port"
>
</div>
</div>
<div
class=
"col-lg-3"
>
<div
class=
"col-lg-2"
>
<input
type=
"text"
class=
"form-control"
id=
"username"
value=
""
placeholder=
"username"
>
</div>
<div
class=
"col-lg-2"
>
<input
type=
"password"
class=
"form-control"
id=
"password"
value=
""
placeholder=
"password"
>
<input
type=
"password"
class=
"form-control"
id=
"password"
value=
""
placeholder=
"password"
>
</div>
</div>
<div
class=
"col-lg-4"
>
<div
class=
"col-lg-4"
>
...
...
dashboard-script.js
View file @
d18c374f
...
@@ -15,6 +15,7 @@ $(function(){
...
@@ -15,6 +15,7 @@ $(function(){
$
(
"
#ip
"
).
val
(
params
[
"
ip
"
]);
$
(
"
#ip
"
).
val
(
params
[
"
ip
"
]);
$
(
"
#port
"
).
val
(
params
[
"
port
"
]);
$
(
"
#port
"
).
val
(
params
[
"
port
"
]);
$
(
"
#password
"
).
val
(
params
[
"
password
"
]);
$
(
"
#password
"
).
val
(
params
[
"
password
"
]);
$
(
"
#username
"
).
val
(
params
[
"
username
"
]);
});
});
function
parseQueryString
()
{
function
parseQueryString
()
{
...
@@ -31,7 +32,10 @@ function parseQueryString() {
...
@@ -31,7 +32,10 @@ function parseQueryString() {
}
}
function
loadrooms
()
{
function
loadrooms
()
{
var
url
=
$
(
"
#http
"
).
val
()
+
"
://
"
+
$
(
"
#ip
"
).
val
()
+
"
:
"
+
$
(
"
#port
"
).
val
()
+
"
/api/getrooms?callback=?
"
+
(
$
(
"
#password
"
).
val
()
?
"
&pass=
"
+
$
(
"
#password
"
).
val
()
:
""
);
var
url
=
$
(
"
#http
"
).
val
()
+
"
://
"
+
$
(
"
#ip
"
).
val
()
+
"
:
"
+
$
(
"
#port
"
).
val
()
+
"
/api/getrooms?callback=?
"
+
(
$
(
"
#username
"
).
val
()
?
"
&username=
"
+
$
(
"
#username
"
).
val
()
:
""
)
+
(
$
(
"
#password
"
).
val
()
?
"
&pass=
"
+
$
(
"
#password
"
).
val
()
:
""
);
alert
(
url
);
$
.
getJSON
(
url
,
listroom
);
$
.
getJSON
(
url
,
listroom
);
$
(
"
#open_button
"
).
removeClass
(
"
btn-success
"
);
$
(
"
#open_button
"
).
removeClass
(
"
btn-success
"
);
}
}
...
@@ -123,49 +127,49 @@ function listroom(data) {
...
@@ -123,49 +127,49 @@ function listroom(data) {
function
shout
()
{
function
shout
()
{
$
(
"
#message_callback
"
).
text
(
'
...
'
);
$
(
"
#message_callback
"
).
text
(
'
...
'
);
var
url
=
$
(
"
#http
"
).
val
()
+
"
://
"
+
$
(
"
#ip
"
).
val
()
+
"
:
"
+
$
(
"
#port
"
).
val
()
+
"
/api/message?shout=
"
+
$
(
"
#shout
"
).
val
()
+
"
&pass=
"
+
$
(
"
#password
"
).
val
()
+
"
&callback=?
"
;
var
url
=
$
(
"
#http
"
).
val
()
+
"
://
"
+
$
(
"
#ip
"
).
val
()
+
"
:
"
+
$
(
"
#port
"
).
val
()
+
"
/api/message?shout=
"
+
$
(
"
#shout
"
).
val
()
+
"
&
username=
"
+
$
(
"
#username
"
).
val
()
+
"
&
pass=
"
+
$
(
"
#password
"
).
val
()
+
"
&callback=?
"
;
$
.
getJSON
(
url
,
shoutcallback
);
$
.
getJSON
(
url
,
shoutcallback
);
}
}
function
stop
()
{
function
stop
()
{
if
(
confirm
(
"
Are you sure to stop the server?
"
))
{
if
(
confirm
(
"
Are you sure to stop the server?
"
))
{
$
(
"
#message_callback
"
).
text
(
'
...
'
);
$
(
"
#message_callback
"
).
text
(
'
...
'
);
var
url
=
$
(
"
#http
"
).
val
()
+
"
://
"
+
$
(
"
#ip
"
).
val
()
+
"
:
"
+
$
(
"
#port
"
).
val
()
+
"
/api/message?stop=
"
+
$
(
"
#shout
"
).
val
()
+
"
&pass=
"
+
$
(
"
#password
"
).
val
()
+
"
&callback=?
"
;
var
url
=
$
(
"
#http
"
).
val
()
+
"
://
"
+
$
(
"
#ip
"
).
val
()
+
"
:
"
+
$
(
"
#port
"
).
val
()
+
"
/api/message?stop=
"
+
$
(
"
#shout
"
).
val
()
+
"
&username=
"
+
$
(
"
#username
"
).
val
()
+
"
&pass=
"
+
$
(
"
#password
"
).
val
()
+
"
&callback=?
"
;
$
.
getJSON
(
url
,
shoutcallback
);
$
.
getJSON
(
url
,
shoutcallback
);
}
}
}
}
function
welcome
()
{
function
welcome
()
{
if
(
$
(
"
#shout
"
).
val
().
length
)
{
if
(
$
(
"
#shout
"
).
val
().
length
)
{
$
(
"
#message_callback
"
).
text
(
'
...
'
);
$
(
"
#message_callback
"
).
text
(
'
...
'
);
var
url
=
$
(
"
#http
"
).
val
()
+
"
://
"
+
$
(
"
#ip
"
).
val
()
+
"
:
"
+
$
(
"
#port
"
).
val
()
+
"
/api/message?welcome=
"
+
$
(
"
#shout
"
).
val
()
+
"
&pass=
"
+
$
(
"
#password
"
).
val
()
+
"
&callback=?
"
;
var
url
=
$
(
"
#http
"
).
val
()
+
"
://
"
+
$
(
"
#ip
"
).
val
()
+
"
:
"
+
$
(
"
#port
"
).
val
()
+
"
/api/message?welcome=
"
+
$
(
"
#shout
"
).
val
()
+
"
&
username=
"
+
$
(
"
#username
"
).
val
()
+
"
&
pass=
"
+
$
(
"
#password
"
).
val
()
+
"
&callback=?
"
;
$
.
getJSON
(
url
,
shoutcallback
);
$
.
getJSON
(
url
,
shoutcallback
);
}
}
else
{
else
{
$
(
"
#message_callback
"
).
text
(
'
...
'
);
$
(
"
#message_callback
"
).
text
(
'
...
'
);
var
url
=
$
(
"
#http
"
).
val
()
+
"
://
"
+
$
(
"
#ip
"
).
val
()
+
"
:
"
+
$
(
"
#port
"
).
val
()
+
"
/api/message?getwelcome=1&pass=
"
+
$
(
"
#password
"
).
val
()
+
"
&callback=?
"
;
var
url
=
$
(
"
#http
"
).
val
()
+
"
://
"
+
$
(
"
#ip
"
).
val
()
+
"
:
"
+
$
(
"
#port
"
).
val
()
+
"
/api/message?getwelcome=1&pass=
"
+
$
(
"
#password
"
).
val
()
+
"
&
username=
"
+
$
(
"
#username
"
).
val
()
+
"
&
callback=?
"
;
$
.
getJSON
(
url
,
shoutcallback
);
$
.
getJSON
(
url
,
shoutcallback
);
}
}
}
}
function
load_tips
()
{
function
load_tips
()
{
$
(
"
#message_callback
"
).
text
(
'
...
'
);
$
(
"
#message_callback
"
).
text
(
'
...
'
);
var
url
=
$
(
"
#http
"
).
val
()
+
"
://
"
+
$
(
"
#ip
"
).
val
()
+
"
:
"
+
$
(
"
#port
"
).
val
()
+
"
/api/message?loadtips=1&pass=
"
+
$
(
"
#password
"
).
val
()
+
"
&callback=?
"
;
var
url
=
$
(
"
#http
"
).
val
()
+
"
://
"
+
$
(
"
#ip
"
).
val
()
+
"
:
"
+
$
(
"
#port
"
).
val
()
+
"
/api/message?loadtips=1&pass=
"
+
$
(
"
#password
"
).
val
()
+
"
&
username=
"
+
$
(
"
#username
"
).
val
()
+
"
&
callback=?
"
;
$
.
getJSON
(
url
,
shoutcallback
);
$
.
getJSON
(
url
,
shoutcallback
);
}
}
function
load_dialogues
()
{
function
load_dialogues
()
{
$
(
"
#message_callback
"
).
text
(
'
...
'
);
$
(
"
#message_callback
"
).
text
(
'
...
'
);
var
url
=
$
(
"
#http
"
).
val
()
+
"
://
"
+
$
(
"
#ip
"
).
val
()
+
"
:
"
+
$
(
"
#port
"
).
val
()
+
"
/api/message?loaddialogues=1&pass=
"
+
$
(
"
#password
"
).
val
()
+
"
&callback=?
"
;
var
url
=
$
(
"
#http
"
).
val
()
+
"
://
"
+
$
(
"
#ip
"
).
val
()
+
"
:
"
+
$
(
"
#port
"
).
val
()
+
"
/api/message?loaddialogues=1&pass=
"
+
$
(
"
#password
"
).
val
()
+
"
&username=
"
+
$
(
"
#username
"
).
val
()
+
"
&callback=?
"
;
$
.
getJSON
(
url
,
shoutcallback
);
$
.
getJSON
(
url
,
shoutcallback
);
}
}
function
ban_player
()
{
function
ban_player
()
{
if
(
confirm
(
"
Are you sure to ban this player?
"
))
{
if
(
confirm
(
"
Are you sure to ban this player?
"
))
{
$
(
"
#message_callback
"
).
text
(
'
...
'
);
$
(
"
#message_callback
"
).
text
(
'
...
'
);
var
url
=
$
(
"
#http
"
).
val
()
+
"
://
"
+
$
(
"
#ip
"
).
val
()
+
"
:
"
+
$
(
"
#port
"
).
val
()
+
"
/api/message?ban=
"
+
$
(
"
#shout
"
).
val
()
+
"
&pass=
"
+
$
(
"
#password
"
).
val
()
+
"
&callback=?
"
;
var
url
=
$
(
"
#http
"
).
val
()
+
"
://
"
+
$
(
"
#ip
"
).
val
()
+
"
:
"
+
$
(
"
#port
"
).
val
()
+
"
/api/message?ban=
"
+
$
(
"
#shout
"
).
val
()
+
"
&pass=
"
+
$
(
"
#password
"
).
val
()
+
"
&username=
"
+
$
(
"
#username
"
).
val
()
+
"
&callback=?
"
;
$
.
getJSON
(
url
,
shoutcallback
);
$
.
getJSON
(
url
,
shoutcallback
);
}
}
}
}
function
kick_room
()
{
function
kick_room
()
{
if
(
confirm
(
"
Are you sure to terminate this duel?
"
))
{
if
(
confirm
(
"
Are you sure to terminate this duel?
"
))
{
$
(
"
#message_callback
"
).
text
(
'
...
'
);
$
(
"
#message_callback
"
).
text
(
'
...
'
);
var
url
=
$
(
"
#http
"
).
val
()
+
"
://
"
+
$
(
"
#ip
"
).
val
()
+
"
:
"
+
$
(
"
#port
"
).
val
()
+
"
/api/message?kick=
"
+
$
(
"
#shout
"
).
val
()
+
"
&pass=
"
+
$
(
"
#password
"
).
val
()
+
"
&callback=?
"
;
var
url
=
$
(
"
#http
"
).
val
()
+
"
://
"
+
$
(
"
#ip
"
).
val
()
+
"
:
"
+
$
(
"
#port
"
).
val
()
+
"
/api/message?kick=
"
+
$
(
"
#shout
"
).
val
()
+
"
&pass=
"
+
$
(
"
#password
"
).
val
()
+
"
&
username=
"
+
$
(
"
#username
"
).
val
()
+
"
&
callback=?
"
;
$
.
getJSON
(
url
,
shoutcallback
);
$
.
getJSON
(
url
,
shoutcallback
);
}
}
}
}
...
@@ -173,12 +177,12 @@ function start_death() {
...
@@ -173,12 +177,12 @@ function start_death() {
if
(
confirm
(
"
Are you sure to start Extra Duel?
"
))
{
if
(
confirm
(
"
Are you sure to start Extra Duel?
"
))
{
if
(
$
(
"
#shout
"
).
val
().
length
)
{
if
(
$
(
"
#shout
"
).
val
().
length
)
{
$
(
"
#message_callback
"
).
text
(
'
...
'
);
$
(
"
#message_callback
"
).
text
(
'
...
'
);
var
url
=
$
(
"
#http
"
).
val
()
+
"
://
"
+
$
(
"
#ip
"
).
val
()
+
"
:
"
+
$
(
"
#port
"
).
val
()
+
"
/api/message?death=
"
+
$
(
"
#shout
"
).
val
()
+
"
&pass=
"
+
$
(
"
#password
"
).
val
()
+
"
&callback=?
"
;
var
url
=
$
(
"
#http
"
).
val
()
+
"
://
"
+
$
(
"
#ip
"
).
val
()
+
"
:
"
+
$
(
"
#port
"
).
val
()
+
"
/api/message?death=
"
+
$
(
"
#shout
"
).
val
()
+
"
&pass=
"
+
$
(
"
#password
"
).
val
()
+
"
&username=
"
+
$
(
"
#username
"
).
val
()
+
"
&callback=?
"
;
$
.
getJSON
(
url
,
shoutcallback
);
$
.
getJSON
(
url
,
shoutcallback
);
}
}
else
{
else
{
$
(
"
#message_callback
"
).
text
(
'
...
'
);
$
(
"
#message_callback
"
).
text
(
'
...
'
);
var
url
=
$
(
"
#http
"
).
val
()
+
"
://
"
+
$
(
"
#ip
"
).
val
()
+
"
:
"
+
$
(
"
#port
"
).
val
()
+
"
/api/message?death=all&pass=
"
+
$
(
"
#password
"
).
val
()
+
"
&callback=?
"
;
var
url
=
$
(
"
#http
"
).
val
()
+
"
://
"
+
$
(
"
#ip
"
).
val
()
+
"
:
"
+
$
(
"
#port
"
).
val
()
+
"
/api/message?death=all&pass=
"
+
$
(
"
#password
"
).
val
()
+
"
&
username=
"
+
$
(
"
#username
"
).
val
()
+
"
&
callback=?
"
;
$
.
getJSON
(
url
,
shoutcallback
);
$
.
getJSON
(
url
,
shoutcallback
);
}
}
}
}
...
@@ -187,12 +191,12 @@ function cancel_death() {
...
@@ -187,12 +191,12 @@ function cancel_death() {
if
(
confirm
(
"
Are you sure to cancel Extra Duel?
"
))
{
if
(
confirm
(
"
Are you sure to cancel Extra Duel?
"
))
{
if
(
$
(
"
#shout
"
).
val
().
length
)
{
if
(
$
(
"
#shout
"
).
val
().
length
)
{
$
(
"
#message_callback
"
).
text
(
'
...
'
);
$
(
"
#message_callback
"
).
text
(
'
...
'
);
var
url
=
$
(
"
#http
"
).
val
()
+
"
://
"
+
$
(
"
#ip
"
).
val
()
+
"
:
"
+
$
(
"
#port
"
).
val
()
+
"
/api/message?deathcancel=
"
+
$
(
"
#shout
"
).
val
()
+
"
&pass=
"
+
$
(
"
#password
"
).
val
()
+
"
&callback=?
"
;
var
url
=
$
(
"
#http
"
).
val
()
+
"
://
"
+
$
(
"
#ip
"
).
val
()
+
"
:
"
+
$
(
"
#port
"
).
val
()
+
"
/api/message?deathcancel=
"
+
$
(
"
#shout
"
).
val
()
+
"
&pass=
"
+
$
(
"
#password
"
).
val
()
+
"
&
username=
"
+
$
(
"
#username
"
).
val
()
+
"
&
callback=?
"
;
$
.
getJSON
(
url
,
shoutcallback
);
$
.
getJSON
(
url
,
shoutcallback
);
}
}
else
{
else
{
$
(
"
#message_callback
"
).
text
(
'
...
'
);
$
(
"
#message_callback
"
).
text
(
'
...
'
);
var
url
=
$
(
"
#http
"
).
val
()
+
"
://
"
+
$
(
"
#ip
"
).
val
()
+
"
:
"
+
$
(
"
#port
"
).
val
()
+
"
/api/message?deathcancel=all&pass=
"
+
$
(
"
#password
"
).
val
()
+
"
&callback=?
"
;
var
url
=
$
(
"
#http
"
).
val
()
+
"
://
"
+
$
(
"
#ip
"
).
val
()
+
"
:
"
+
$
(
"
#port
"
).
val
()
+
"
/api/message?deathcancel=all&pass=
"
+
$
(
"
#password
"
).
val
()
+
"
&
username=
"
+
$
(
"
#username
"
).
val
()
+
"
&
callback=?
"
;
$
.
getJSON
(
url
,
shoutcallback
);
$
.
getJSON
(
url
,
shoutcallback
);
}
}
}
}
...
...
dashboard.html
View file @
d18c374f
...
@@ -15,13 +15,16 @@
...
@@ -15,13 +15,16 @@
<div
class=
"col-lg-1"
>
<div
class=
"col-lg-1"
>
<input
type=
"text"
class=
"form-control"
id=
"http"
value=
"http"
placeholder=
"http"
>
<input
type=
"text"
class=
"form-control"
id=
"http"
value=
"http"
placeholder=
"http"
>
</div>
</div>
<div
class=
"col-lg-
3
"
>
<div
class=
"col-lg-
2
"
>
<input
type=
"text"
class=
"form-control"
id=
"ip"
value=
""
placeholder=
"IP"
>
<input
type=
"text"
class=
"form-control"
id=
"ip"
value=
""
placeholder=
"IP"
>
</div>
</div>
<div
class=
"col-lg-1"
>
<div
class=
"col-lg-1"
>
<input
type=
"text"
class=
"form-control"
id=
"port"
value=
""
placeholder=
"port"
>
<input
type=
"text"
class=
"form-control"
id=
"port"
value=
""
placeholder=
"port"
>
</div>
</div>
<div
class=
"col-lg-3"
>
<div
class=
"col-lg-2"
>
<input
type=
"text"
class=
"form-control"
id=
"username"
value=
""
placeholder=
"username"
>
</div>
<div
class=
"col-lg-2"
>
<input
type=
"password"
class=
"form-control"
id=
"password"
value=
""
placeholder=
"password"
>
<input
type=
"password"
class=
"form-control"
id=
"password"
value=
""
placeholder=
"password"
>
</div>
</div>
<div
class=
"col-lg-4"
>
<div
class=
"col-lg-4"
>
...
...
deck-dashboard.html
View file @
d18c374f
...
@@ -18,6 +18,9 @@
...
@@ -18,6 +18,9 @@
<div
class=
"col-lg-2"
>
<div
class=
"col-lg-2"
>
<input
type=
"text"
class=
"form-control"
id=
"port"
value=
""
placeholder=
"Port"
>
<input
type=
"text"
class=
"form-control"
id=
"port"
value=
""
placeholder=
"Port"
>
</div>
</div>
<div
class=
"col-lg-2"
>
<input
type=
"text"
class=
"form-control"
id=
"username"
value=
""
placeholder=
"Username"
>
</div>
<div
class=
"col-lg-2"
>
<div
class=
"col-lg-2"
>
<input
type=
"password"
class=
"form-control"
id=
"password"
value=
""
placeholder=
"Password"
>
<input
type=
"password"
class=
"form-control"
id=
"password"
value=
""
placeholder=
"Password"
>
</div>
</div>
...
@@ -89,7 +92,7 @@ $(function(){
...
@@ -89,7 +92,7 @@ $(function(){
$
(
"
#ip
"
).
val
(
params
[
"
ip
"
]);
$
(
"
#ip
"
).
val
(
params
[
"
ip
"
]);
$
(
"
#port
"
).
val
(
params
[
"
port
"
]);
$
(
"
#port
"
).
val
(
params
[
"
port
"
]);
$
(
"
#password
"
).
val
(
params
[
"
password
"
]);
$
(
"
#password
"
).
val
(
params
[
"
password
"
]);
$
(
"
#username
"
).
val
(
params
[
"
username
"
]);
$
(
"
#filesel
"
).
change
(
function
()
{
$
(
"
#filesel
"
).
change
(
function
()
{
upload_decks
();
upload_decks
();
});
});
...
@@ -122,7 +125,8 @@ function login() {
...
@@ -122,7 +125,8 @@ function login() {
ip
=
$
(
"
#ip
"
).
val
();
ip
=
$
(
"
#ip
"
).
val
();
port
=
$
(
"
#port
"
).
val
();
port
=
$
(
"
#port
"
).
val
();
password
=
$
(
"
#password
"
).
val
();
password
=
$
(
"
#password
"
).
val
();
var
es
=
new
EventSource
(
"
http://
"
+
ip
+
"
:
"
+
port
+
"
/api/msg?password=
"
+
password
);
username
=
$
(
"
#username
"
).
val
();
var
es
=
new
EventSource
(
"
http://
"
+
ip
+
"
:
"
+
port
+
"
/api/msg?username=
"
+
username
+
"
&password=
"
+
password
);
es
.
onmessage
=
function
(
e
)
{
es
.
onmessage
=
function
(
e
)
{
output
(
e
.
data
);
output
(
e
.
data
);
...
@@ -230,7 +234,7 @@ function openapi(api, msg, confirm2) {
...
@@ -230,7 +234,7 @@ function openapi(api, msg, confirm2) {
$
(
"
#filesel
"
).
click
();
$
(
"
#filesel
"
).
click
();
}
}
else
if
(
!
confirm2
||
confirm
(
confirm2
))
{
else
if
(
!
confirm2
||
confirm
(
confirm2
))
{
$
.
getJSON
(
"
http://
"
+
ip
+
"
:
"
+
port
+
"
/api/
"
+
api
+
"
?password=
"
+
password
+
(
msg
?
"
&msg=
"
+
encodeURIComponent
(
msg
)
:
""
)
+
"
&callback=?
"
,
function
(
data
)
{
$
.
getJSON
(
"
http://
"
+
ip
+
"
:
"
+
port
+
"
/api/
"
+
api
+
"
?
username=
"
+
username
+
"
&
password=
"
+
password
+
(
msg
?
"
&msg=
"
+
encodeURIComponent
(
msg
)
:
""
)
+
"
&callback=?
"
,
function
(
data
)
{
if
(
apis
[
api
])
{
if
(
apis
[
api
])
{
apis
[
api
].
callback
(
data
);
apis
[
api
].
callback
(
data
);
}
}
...
@@ -249,7 +253,7 @@ function upload_decks() {
...
@@ -249,7 +253,7 @@ function upload_decks() {
formData
.
append
(
'
upload[
'
+
i
+
'
]
'
,
filesel
.
files
[
i
]);
formData
.
append
(
'
upload[
'
+
i
+
'
]
'
,
filesel
.
files
[
i
]);
}
}
$
.
ajax
({
$
.
ajax
({
url
:
"
http://
"
+
ip
+
"
:
"
+
port
+
"
/api/upload_decks?password=
"
+
password
,
url
:
"
http://
"
+
ip
+
"
:
"
+
port
+
"
/api/upload_decks?
username=
"
+
username
+
"
password=
"
+
password
,
type
:
'
POST
'
,
type
:
'
POST
'
,
cache
:
false
,
cache
:
false
,
data
:
formData
,
data
:
formData
,
...
...
pre-dashboard.html
View file @
d18c374f
...
@@ -17,6 +17,9 @@
...
@@ -17,6 +17,9 @@
</div>
</div>
<div
class=
"col-lg-2"
>
<div
class=
"col-lg-2"
>
<input
type=
"text"
class=
"form-control"
id=
"port"
value=
""
placeholder=
"Port"
>
<input
type=
"text"
class=
"form-control"
id=
"port"
value=
""
placeholder=
"Port"
>
</div>
<div
class=
"col-lg-2"
>
<input
type=
"text"
class=
"form-control"
id=
"username"
value=
""
placeholder=
"Username"
>
</div>
</div>
<div
class=
"col-lg-2"
>
<div
class=
"col-lg-2"
>
<input
type=
"password"
class=
"form-control"
id=
"password"
value=
""
placeholder=
"Password"
>
<input
type=
"password"
class=
"form-control"
id=
"password"
value=
""
placeholder=
"Password"
>
...
@@ -82,6 +85,7 @@ $(function(){
...
@@ -82,6 +85,7 @@ $(function(){
$
(
"
#ip
"
).
val
(
params
[
"
ip
"
]);
$
(
"
#ip
"
).
val
(
params
[
"
ip
"
]);
$
(
"
#port
"
).
val
(
params
[
"
port
"
]);
$
(
"
#port
"
).
val
(
params
[
"
port
"
]);
$
(
"
#password
"
).
val
(
params
[
"
password
"
]);
$
(
"
#password
"
).
val
(
params
[
"
password
"
]);
$
(
"
#username
"
).
val
(
params
[
"
username
"
]);
});
});
function
parseQueryString
()
{
function
parseQueryString
()
{
...
@@ -101,7 +105,8 @@ function login() {
...
@@ -101,7 +105,8 @@ function login() {
ip
=
$
(
"
#ip
"
).
val
();
ip
=
$
(
"
#ip
"
).
val
();
port
=
$
(
"
#port
"
).
val
();
port
=
$
(
"
#port
"
).
val
();
password
=
$
(
"
#password
"
).
val
();
password
=
$
(
"
#password
"
).
val
();
var
es
=
new
EventSource
(
"
http://
"
+
ip
+
"
:
"
+
port
+
"
/api/msg?password=
"
+
password
);
username
=
$
(
"
#username
"
).
val
();
var
es
=
new
EventSource
(
"
http://
"
+
ip
+
"
:
"
+
port
+
"
/api/msg?username=
"
+
username
+
"
password=
"
+
password
);
es
.
onmessage
=
function
(
e
)
{
es
.
onmessage
=
function
(
e
)
{
var
data_li
=
$
(
'
<li>
'
+
e
.
data
+
'
</li>
'
);
var
data_li
=
$
(
'
<li>
'
+
e
.
data
+
'
</li>
'
);
data_li
.
appendTo
(
$
(
"
#output
"
));
data_li
.
appendTo
(
$
(
"
#output
"
));
...
@@ -124,7 +129,7 @@ function clear() {
...
@@ -124,7 +129,7 @@ function clear() {
}
}
function
openapi
(
api
)
{
function
openapi
(
api
)
{
$
.
getJSON
(
"
http://
"
+
ip
+
"
:
"
+
port
+
"
/api/
"
+
api
+
"
?password=
"
+
password
+
"
&message=
"
+
$
(
"
#message
"
).
val
().
replace
(
/
\n
/g
,
"
!换行符!
"
)
+
"
&callback=?
"
,
function
(
data
)
{
$
.
getJSON
(
"
http://
"
+
ip
+
"
:
"
+
port
+
"
/api/
"
+
api
+
"
?
username=
"
+
username
+
"
&
password=
"
+
password
+
"
&message=
"
+
$
(
"
#message
"
).
val
().
replace
(
/
\n
/g
,
"
!换行符!
"
)
+
"
&callback=?
"
,
function
(
data
)
{
var
data_li
=
$
(
'
<li>
'
+
data
.
message
+
'
</li>
'
);
var
data_li
=
$
(
'
<li>
'
+
data
.
message
+
'
</li>
'
);
data_li
.
appendTo
(
$
(
"
#output
"
));
data_li
.
appendTo
(
$
(
"
#output
"
));
});
});
...
...
replay-dashboard.html
View file @
d18c374f
...
@@ -21,6 +21,9 @@
...
@@ -21,6 +21,9 @@
<div
class=
"col-lg-1"
>
<div
class=
"col-lg-1"
>
<input
type=
"text"
class=
"form-control"
id=
"port"
value=
""
placeholder=
"port"
>
<input
type=
"text"
class=
"form-control"
id=
"port"
value=
""
placeholder=
"port"
>
</div>
</div>
<div
class=
"col-lg-3"
>
<input
type=
"text"
class=
"form-control"
id=
"username"
value=
""
placeholder=
"username"
>
</div>
<div
class=
"col-lg-3"
>
<div
class=
"col-lg-3"
>
<input
type=
"password"
class=
"form-control"
id=
"password"
value=
""
placeholder=
"password"
>
<input
type=
"password"
class=
"form-control"
id=
"password"
value=
""
placeholder=
"password"
>
</div>
</div>
...
@@ -75,6 +78,7 @@ $(function(){
...
@@ -75,6 +78,7 @@ $(function(){
$
(
"
#ip
"
).
val
(
params
[
"
ip
"
]);
$
(
"
#ip
"
).
val
(
params
[
"
ip
"
]);
$
(
"
#port
"
).
val
(
params
[
"
port
"
]);
$
(
"
#port
"
).
val
(
params
[
"
port
"
]);
$
(
"
#password
"
).
val
(
params
[
"
password
"
]);
$
(
"
#password
"
).
val
(
params
[
"
password
"
]);
$
(
"
#username
"
).
val
(
params
[
"
username
"
]);
});
});
function
parseQueryString
()
{
function
parseQueryString
()
{
...
@@ -91,21 +95,21 @@ function parseQueryString() {
...
@@ -91,21 +95,21 @@ function parseQueryString() {
}
}
function
loadreplays
()
{
function
loadreplays
()
{
var
url
=
$
(
"
#http
"
).
val
()
+
"
://
"
+
$
(
"
#ip
"
).
val
()
+
"
:
"
+
$
(
"
#port
"
).
val
()
+
"
/api/duellog?callback=?
"
+
(
$
(
"
#password
"
).
val
()
?
"
&pass=
"
+
$
(
"
#password
"
).
val
()
:
""
);
var
url
=
$
(
"
#http
"
).
val
()
+
"
://
"
+
$
(
"
#ip
"
).
val
()
+
"
:
"
+
$
(
"
#port
"
).
val
()
+
"
/api/duellog?callback=?
"
+
(
$
(
"
#
username
"
).
val
()
?
"
&username=
"
+
$
(
"
#username
"
).
val
()
:
""
)
+
(
$
(
"
#
password
"
).
val
()
?
"
&pass=
"
+
$
(
"
#password
"
).
val
()
:
""
);
$
.
getJSON
(
url
,
listreplay
);
$
.
getJSON
(
url
,
listreplay
);
$
(
"
#open_button
"
).
removeClass
(
"
btn-success
"
);
$
(
"
#open_button
"
).
removeClass
(
"
btn-success
"
);
}
}
function
clearreplays
()
{
function
clearreplays
()
{
if
(
confirm
(
"
确实要清空记录吗?
"
))
{
if
(
confirm
(
"
确实要清空记录吗?
"
))
{
var
url
=
$
(
"
#http
"
).
val
()
+
"
://
"
+
$
(
"
#ip
"
).
val
()
+
"
:
"
+
$
(
"
#port
"
).
val
()
+
"
/api/clearlog?callback=?
"
+
(
$
(
"
#password
"
).
val
()
?
"
&pass=
"
+
$
(
"
#password
"
).
val
()
:
""
);
var
url
=
$
(
"
#http
"
).
val
()
+
"
://
"
+
$
(
"
#ip
"
).
val
()
+
"
:
"
+
$
(
"
#port
"
).
val
()
+
"
/api/clearlog?callback=?
"
+
(
$
(
"
#
username
"
).
val
()
?
"
&username=
"
+
$
(
"
#username
"
).
val
()
:
""
)
+
(
$
(
"
#
password
"
).
val
()
?
"
&pass=
"
+
$
(
"
#password
"
).
val
()
:
""
);
$
.
getJSON
(
url
,
clearreplays_success
);
$
.
getJSON
(
url
,
clearreplays_success
);
$
(
"
#empty_button
"
).
removeClass
(
"
btn-success
"
);
$
(
"
#empty_button
"
).
removeClass
(
"
btn-success
"
);
}
}
}
}
function
packreplays
()
{
function
packreplays
()
{
window
.
open
(
$
(
"
#http
"
).
val
()
+
"
://
"
+
$
(
"
#ip
"
).
val
()
+
"
:
"
+
$
(
"
#port
"
).
val
()
+
"
/api/archive.zip?pass=
"
+
$
(
"
#password
"
).
val
());
window
.
open
(
$
(
"
#http
"
).
val
()
+
"
://
"
+
$
(
"
#ip
"
).
val
()
+
"
:
"
+
$
(
"
#port
"
).
val
()
+
"
/api/archive.zip?
username=
"
+
$
(
"
#username
"
).
val
()
+
"
&
pass=
"
+
$
(
"
#password
"
).
val
());
}
}
function
clearreplays_success
()
{
function
clearreplays_success
()
{
...
@@ -135,7 +139,7 @@ function listreplay(data) {
...
@@ -135,7 +139,7 @@ function listreplay(data) {
tr
.
append
(
$
(
"
<td>
"
+
((
duellog
.
players
)
?
(
duellog
.
players
[
2
].
winner
?
"
<span class='glyphicon glyphicon-bookmark'></span>
"
:
""
)
+
duellog
.
players
[
2
].
name
+
"
<br>
"
+
duellog
.
players
[
3
].
name
:
""
)
+
"
</td>
"
));
tr
.
append
(
$
(
"
<td>
"
+
((
duellog
.
players
)
?
(
duellog
.
players
[
2
].
winner
?
"
<span class='glyphicon glyphicon-bookmark'></span>
"
:
""
)
+
duellog
.
players
[
2
].
name
+
"
<br>
"
+
duellog
.
players
[
3
].
name
:
""
)
+
"
</td>
"
));
}
}
tr
.
append
(
$
(
"
<td>
"
+
duellog
.
cloud_replay_id
+
"
</td>
"
));
tr
.
append
(
$
(
"
<td>
"
+
duellog
.
cloud_replay_id
+
"
</td>
"
));
tr
.
append
(
$
(
"
<td><a href='
"
+
$
(
"
#http
"
).
val
()
+
"
://
"
+
$
(
"
#ip
"
).
val
()
+
"
:
"
+
$
(
"
#port
"
).
val
()
+
"
/api/replay/
"
+
duellog
.
replay_filename
+
"
?pass=
"
+
$
(
"
#password
"
).
val
()
+
"
' download><span class='glyphicon glyphicon-download-alt'></span></a></td>
"
));
tr
.
append
(
$
(
"
<td><a href='
"
+
$
(
"
#http
"
).
val
()
+
"
://
"
+
$
(
"
#ip
"
).
val
()
+
"
:
"
+
$
(
"
#port
"
).
val
()
+
"
/api/replay/
"
+
duellog
.
replay_filename
+
"
?
username=
"
+
$
(
"
#username
"
).
val
()
+
"
&
pass=
"
+
$
(
"
#password
"
).
val
()
+
"
' download><span class='glyphicon glyphicon-download-alt'></span></a></td>
"
));
tbody
.
append
(
tr
);
tbody
.
append
(
tr
);
...
...
update-dashboard.html
View file @
d18c374f
...
@@ -18,6 +18,9 @@
...
@@ -18,6 +18,9 @@
<div
class=
"col-lg-2"
>
<div
class=
"col-lg-2"
>
<input
type=
"text"
class=
"form-control"
id=
"port"
value=
""
placeholder=
"Port"
>
<input
type=
"text"
class=
"form-control"
id=
"port"
value=
""
placeholder=
"Port"
>
</div>
</div>
<div
class=
"col-lg-2"
>
<input
type=
"username"
class=
"form-control"
id=
"username"
value=
""
placeholder=
"Username"
>
</div>
<div
class=
"col-lg-2"
>
<div
class=
"col-lg-2"
>
<input
type=
"password"
class=
"form-control"
id=
"password"
value=
""
placeholder=
"Password"
>
<input
type=
"password"
class=
"form-control"
id=
"password"
value=
""
placeholder=
"Password"
>
</div>
</div>
...
@@ -113,6 +116,8 @@ $(function(){
...
@@ -113,6 +116,8 @@ $(function(){
$
(
"
#ip
"
).
val
(
params
[
"
ip
"
]);
$
(
"
#ip
"
).
val
(
params
[
"
ip
"
]);
$
(
"
#port
"
).
val
(
params
[
"
port
"
]);
$
(
"
#port
"
).
val
(
params
[
"
port
"
]);
$
(
"
#password
"
).
val
(
params
[
"
password
"
]);
$
(
"
#password
"
).
val
(
params
[
"
password
"
]);
$
(
"
#username
"
).
val
(
params
[
"
username
"
]);
$
(
"
#message
"
).
val
(
$
(
"
#message-head
"
).
val
()
+
$
(
"
#message-body
"
).
val
()
+
$
(
"
#message-other
"
).
val
());
$
(
"
#message
"
).
val
(
$
(
"
#message-head
"
).
val
()
+
$
(
"
#message-body
"
).
val
()
+
$
(
"
#message-other
"
).
val
());
});
});
...
@@ -134,7 +139,8 @@ function login() {
...
@@ -134,7 +139,8 @@ function login() {
ip
=
$
(
"
#ip
"
).
val
();
ip
=
$
(
"
#ip
"
).
val
();
port
=
$
(
"
#port
"
).
val
();
port
=
$
(
"
#port
"
).
val
();
password
=
$
(
"
#password
"
).
val
();
password
=
$
(
"
#password
"
).
val
();
var
es
=
new
EventSource
(
"
http://
"
+
ip
+
"
:
"
+
port
+
"
/api/msg?password=
"
+
password
);
username
=
$
(
"
#username
"
).
val
();
var
es
=
new
EventSource
(
"
http://
"
+
ip
+
"
:
"
+
port
+
"
/api/msg?username=
"
+
username
+
"
&password=
"
+
password
);
es
.
onmessage
=
function
(
e
)
{
es
.
onmessage
=
function
(
e
)
{
var
data_li
=
$
(
'
<li>
'
+
e
.
data
+
'
</li>
'
);
var
data_li
=
$
(
'
<li>
'
+
e
.
data
+
'
</li>
'
);
data_li
.
appendTo
(
$
(
"
#output
"
));
data_li
.
appendTo
(
$
(
"
#output
"
));
...
@@ -168,7 +174,7 @@ function clear() {
...
@@ -168,7 +174,7 @@ function clear() {
}
}
function
openapi
(
api
)
{
function
openapi
(
api
)
{
$
.
getJSON
(
"
http://
"
+
ip
+
"
:
"
+
port
+
"
/api/
"
+
api
+
"
?password=
"
+
password
+
"
&message=
"
+
$
(
"
#message
"
).
val
().
replace
(
/
\n
/g
,
"
!换行符!
"
)
+
"
&callback=?
"
,
function
(
data
)
{
$
.
getJSON
(
"
http://
"
+
ip
+
"
:
"
+
port
+
"
/api/
"
+
api
+
"
?
username=
"
+
username
+
"
&
password=
"
+
password
+
"
&message=
"
+
$
(
"
#message
"
).
val
().
replace
(
/
\n
/g
,
"
!换行符!
"
)
+
"
&callback=?
"
,
function
(
data
)
{
var
data_li
=
$
(
'
<li>
'
+
data
.
message
+
'
</li>
'
);
var
data_li
=
$
(
'
<li>
'
+
data
.
message
+
'
</li>
'
);
data_li
.
appendTo
(
$
(
"
#output
"
));
data_li
.
appendTo
(
$
(
"
#output
"
));
});
});
...
...
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