Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
D
dashboard
Project
Project
Details
Activity
Releases
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
shangbj
dashboard
Commits
e511e3d9
Commit
e511e3d9
authored
Jul 14, 2017
by
zhiyan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
40f2242a
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
193 additions
and
287 deletions
+193
-287
.editorconfig
.editorconfig
+0
-10
.gitignore
.gitignore
+13
-116
app.js
app.js
+4
-0
index.html
index.html
+7
-160
package.json
package.json
+1
-1
usepage.html
usepage.html
+168
-0
No files found.
.editorconfig
deleted
100644 → 0
View file @
40f2242a
# editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
.gitignore
View file @
e511e3d9
################################################
############### .gitignore ##################
################################################
#
# This file is only relevant if you are using git.
#
# Files which match the splat patterns below will
# be ignored by git. This keeps random crap and
# sensitive credentials from being uploaded to
# your repository. It allows you to configure your
# app for your machine without accidentally
# committing settings which will smash the local
# settings of other developers on your team.
#
# Some reasonable defaults are included below,
# but, of course, you should modify/extend/prune
# to fit your needs!
################################################
################################################
# Local Configuration
#
# Explicitly ignore files which contain:
#
# 1. Sensitive information you'd rather not push to
# your git repository.
# e.g., your personal API keys or passwords.
#
# 2. Environment-specific configuration
# Basically, anything that would be annoying
# to have to change every time you do a
# `git pull`
# e.g., your local development database, or
# the S3 bucket you're using for file uploads
# development.
#
################################################
config/local.js
################################################
# Dependencies
#
# When releasing a production app, you may
# consider including your node_modules and
# bower_components directory in your git repo,
# but during development, its best to exclude it,
# since different developers may be working on
# different kernels, where dependencies would
# need to be recompiled anyway.
#
# More on that here about node_modules dir:
# http://www.futurealoof.com/posts/nodemodules-in-git.html
# (credit Mikeal Rogers, @mikeal)
#
# About bower_components dir, you can see this:
# http://addyosmani.com/blog/checking-in-front-end-dependencies/
# (credit Addy Osmani, @addyosmani)
#
################################################
node_modules
bower_components
################################################
# Sails.js / Waterline / Grunt
#
# Files generated by Sails and Grunt, or related
# tasks and adapters.
################################################
.tmp
dump.rdb
################################################
# Node.js / NPM
#
# Common files generated by Node, NPM, and the
# related ecosystem.
################################################
lib-cov
*.seed
*.log
*.out
*.pid
/.idea
/node_modules
npm-debug.log
################################################
# Miscellaneous
#
# Common files generated by text editors,
# operating systems, file systems, etc.
################################################
*~
*#
.DS_STORE
.netbeans
nbproject
.DS_Store
/dist
/mock/test
/release
.devconfig
/src/test
/src/test.m
/Web
/MWeb
yarn-error.log
.idea
.node_history
*.map
app.js
View file @
e511e3d9
...
...
@@ -8,6 +8,10 @@ const app = express()
app
.
use
(
bodyParser
.
json
())
app
.
use
(
bodyParser
.
urlencoded
({
extended
:
true
}))
app
.
get
(
'/usepage'
,
function
(
req
,
res
)
{
res
.
sendFile
(
'./usepage.html'
,
{
root
:
__dirname
})
})
app
.
get
(
'/'
,
function
(
req
,
res
)
{
res
.
sendFile
(
'./index.html'
,
{
root
:
__dirname
})
})
...
...
index.html
View file @
e511e3d9
<!DOCTYPE html>
<html
lang=
"
en
"
>
<html
lang=
"
zh-CN
"
>
<head>
<meta
charset=
"UTF-8"
>
<title>
静态资源开发机占用系统
</title>
<link
href=
"//cdn.bootcss.com/pure/0.6.2/pure-min.css"
rel=
"stylesheet"
>
<link
rel=
"stylesheet"
href=
"https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css"
>
<link
rel=
"stylesheet"
href=
"//cdn.bootcss.com/sweetalert/1.1.3/sweetalert.min.css"
>
<style>
h1
{
text-align
:
center
;
color
:
#333
;
padding
:
20px
0
;
font-size
:
30px
;
}
form
,
table
{
width
:
800px
;
margin
:
0
auto
;
}
.inline
{
display
:
inline
!important
;
}
.pure-g
>
div
{
margin-bottom
:
10px
;
}
table
p
{
padding
:
0
;
margin
:
0
;
}
.button-error
{
background
:
rgb
(
202
,
60
,
60
);
color
:
#fff
;
}
.button-secondary
{
background
:
rgb
(
66
,
184
,
221
);
color
:
#fff
;
}
</style>
</head>
<body>
<h1>
前端测试机占用系统
</h1>
<form
class=
"pure-form pure-form-stacked"
>
<fieldset>
<div
class=
"pure-g"
>
<div
class=
"pure-u-1 pure-u-md-1-3"
>
<label
for=
"branch"
>
分支
</label>
<input
id=
"branch"
class=
"pure-u-23-24"
type=
"text"
placeholder=
"master"
>
</div>
<div
class=
"pure-u-1 pure-u-md-1-3"
>
<label
for=
"project"
>
编译项目
</label>
<input
id=
"project"
class=
"pure-u-23-24"
type=
"text"
placeholder=
"common+xinche"
>
</div>
<div
id=
"app"
></div>
<div
class=
"pure-u-1 pure-u-md-1-3"
>
<label>
测试机
</label>
<label
for=
"dev1"
class=
"inline"
>
<input
id=
"dev1"
type=
"checkbox"
name=
"dev1"
class=
"machine"
>
dev1
</label>
<label
for=
"dev2"
class=
"inline"
>
<input
id=
"dev2"
type=
"checkbox"
name=
"dev2"
class=
"machine"
>
dev2
</label>
<label
for=
"beta1"
class=
"inline"
>
<input
id=
"beta1"
type=
"checkbox"
name=
"beta1"
class=
"machine"
>
beta1
</label>
<label
for=
"beta2"
class=
"inline"
>
<input
id=
"beta2"
type=
"checkbox"
name=
"beta2"
class=
"machine"
>
beta2
</label>
</div>
</div>
<br>
<button
type=
"submit"
class=
"pure-button pure-button-primary"
id=
"submit"
>
提交
</button>
<button
class=
"button-error pure-button"
id=
"cancel"
>
不再使用
</button>
</fieldset>
</form>
<table
class=
"pure-table"
>
<thead>
<tr>
<th
width=
"100"
>
测试机
</th>
<th
width=
"200"
>
分支
</th>
<th>
项目
</th>
</tr>
</thead>
<tbody
id=
"list"
>
</tbody>
</table>
<script
src=
"//cdn.bootcss.com/ramda/0.23.0/ramda.min.js"
></script>
<script
src=
"//cdn.bootcss.com/jquery/3.2.1/jquery.min.js"
></script>
<script
src=
"//cdn.bootcss.com/sweetalert/1.1.3/sweetalert.min.js"
></script>
<script>
const
getList
=
()
=>
{
$
.
getJSON
(
'/usage'
,
res
=>
{
let
html
=
''
const
format
=
R
.
reduce
((
res
,
value
)
=>
`
${
res
}
<p>
${
value
}
</p>`
,
''
)
const
getBranches
=
R
.
pipe
(
R
.
map
(
item
=>
item
.
branch
),
format
)
const
getProjects
=
R
.
pipe
(
R
.
map
(
item
=>
item
.
project
),
R
.
reduce
((
res
,
value
)
=>
res
.
concat
(
value
),[]),
R
.
uniq
,
format
)
res
.
machine
.
map
((
item
,
key
)
=>
{
html
+=
`
<tr class="
${
key
%
2
===
0
?
'pure-table-odd'
:
''
}
">
<td>
${
item
.
name
}
</td>
<td>
${
getBranches
(
item
.
inUse
)}
</td>
<td>
${
getProjects
(
item
.
inUse
)}
</td>
</tr>
`
})
$
(
'#list'
).
html
(
html
)
})
}
getList
()
const
getParams
=
()
=>
{
return
{
branch
:
$
(
'#branch'
).
val
(),
project
:
(
$
(
'#project'
).
val
()
||
''
).
split
(
'+'
),
machine
:
R
.
reduce
((
res
,
input
)
=>
res
.
concat
(
input
.
name
),[])(
$
(
'.machine:checked'
))
}
}
$
(
'#submit'
).
on
(
'click'
,
()
=>
{
const
params
=
getParams
()
if
(
!
params
.
branch
||
!
params
.
project
.
length
||
!
params
.
machine
.
length
){
return
false
}
$
.
post
(
'/register'
,
params
,
res
=>
{
if
(
res
.
ret
){
swal
(
'注册使用成功'
,
`分支:
${
params
.
branch
}
\n项目:
${
$
(
'#project'
).
val
()
||
''
}
`
)
getList
()
}
})
return
false
})
$
(
'#cancel'
).
on
(
'click'
,
()
=>
{
const
params
=
getParams
()
if
(
!
params
.
branch
){
return
false
}
$
.
post
(
'/unregister'
,
params
,
res
=>
{
if
(
res
.
ret
){
swal
(
'解除使用成功'
,
`分支:
${
params
.
branch
}
`
)
getList
()
}
})
return
false
})
</script>
<script
src=
"{{htmlWebpackPlugin.options.dll.vue}}"
></script>
<script
src=
"{{htmlWebpackPlugin.options.script}}"
></script>
</body>
</html>
\ No newline at end of file
package.json
View file @
e511e3d9
{
"name"
:
"
resource-usage
"
,
"name"
:
"
dashboard
"
,
"version"
:
"1.0.0"
,
"description"
:
""
,
"main"
:
"app.js"
,
...
...
usepage.html
0 → 100644
View file @
e511e3d9
<!DOCTYPE html>
<html
lang=
"zh-CN"
>
<head>
<meta
charset=
"UTF-8"
>
<title>
静态资源开发机占用系统
</title>
<link
href=
"//cdn.bootcss.com/pure/0.6.2/pure-min.css"
rel=
"stylesheet"
>
<link
rel=
"stylesheet"
href=
"//cdn.bootcss.com/sweetalert/1.1.3/sweetalert.min.css"
>
<style>
h1
{
text-align
:
center
;
color
:
#333
;
padding
:
20px
0
;
font-size
:
30px
;
}
form
,
table
{
width
:
800px
;
margin
:
0
auto
;
}
.inline
{
display
:
inline
!important
;
}
.pure-g
>
div
{
margin-bottom
:
10px
;
}
table
p
{
padding
:
0
;
margin
:
0
;
}
.button-error
{
background
:
rgb
(
202
,
60
,
60
);
color
:
#fff
;
}
.button-secondary
{
background
:
rgb
(
66
,
184
,
221
);
color
:
#fff
;
}
</style>
</head>
<body>
<form
class=
"pure-form pure-form-stacked"
>
<fieldset>
<div
class=
"pure-g"
>
<div
class=
"pure-u-1 pure-u-md-1-3"
>
<label
for=
"branch"
>
分支
</label>
<input
id=
"branch"
class=
"pure-u-23-24"
type=
"text"
placeholder=
"master"
>
</div>
<div
class=
"pure-u-1 pure-u-md-1-3"
>
<label
for=
"project"
>
编译项目
</label>
<input
id=
"project"
class=
"pure-u-23-24"
type=
"text"
placeholder=
"common+xinche"
>
</div>
<div
class=
"pure-u-1 pure-u-md-1-3"
>
<label>
测试机
</label>
<label
for=
"dev1"
class=
"inline"
>
<input
id=
"dev1"
type=
"checkbox"
name=
"dev1"
class=
"machine"
>
dev1
</label>
<label
for=
"dev2"
class=
"inline"
>
<input
id=
"dev2"
type=
"checkbox"
name=
"dev2"
class=
"machine"
>
dev2
</label>
<label
for=
"beta1"
class=
"inline"
>
<input
id=
"beta1"
type=
"checkbox"
name=
"beta1"
class=
"machine"
>
beta1
</label>
<label
for=
"beta2"
class=
"inline"
>
<input
id=
"beta2"
type=
"checkbox"
name=
"beta2"
class=
"machine"
>
beta2
</label>
</div>
</div>
<br>
<button
type=
"submit"
class=
"pure-button pure-button-primary"
id=
"submit"
>
提交
</button>
<button
class=
"button-error pure-button"
id=
"cancel"
>
不再使用
</button>
</fieldset>
</form>
<table
class=
"pure-table"
>
<thead>
<tr>
<th
width=
"100"
>
测试机
</th>
<th
width=
"200"
>
分支
</th>
<th>
项目
</th>
</tr>
</thead>
<tbody
id=
"list"
>
</tbody>
</table>
<script
src=
"//cdn.bootcss.com/ramda/0.23.0/ramda.min.js"
></script>
<script
src=
"//cdn.bootcss.com/jquery/3.2.1/jquery.min.js"
></script>
<script
src=
"//cdn.bootcss.com/sweetalert/1.1.3/sweetalert.min.js"
></script>
<script>
const
getList
=
()
=>
{
$
.
getJSON
(
'/usage'
,
res
=>
{
let
html
=
''
const
format
=
R
.
reduce
((
res
,
value
)
=>
`
${
res
}
<p>
${
value
}
</p>`
,
''
)
const
getBranches
=
R
.
pipe
(
R
.
map
(
item
=>
item
.
branch
),
format
)
const
getProjects
=
R
.
pipe
(
R
.
map
(
item
=>
item
.
project
),
R
.
reduce
((
res
,
value
)
=>
res
.
concat
(
value
),[]),
R
.
uniq
,
format
)
res
.
machine
.
map
((
item
,
key
)
=>
{
html
+=
`
<tr class="
${
key
%
2
===
0
?
'pure-table-odd'
:
''
}
">
<td>
${
item
.
name
}
</td>
<td>
${
getBranches
(
item
.
inUse
)}
</td>
<td>
${
getProjects
(
item
.
inUse
)}
</td>
</tr>
`
})
$
(
'#list'
).
html
(
html
)
})
}
getList
()
const
getParams
=
()
=>
{
return
{
branch
:
$
(
'#branch'
).
val
(),
project
:
(
$
(
'#project'
).
val
()
||
''
).
split
(
'+'
),
machine
:
R
.
reduce
((
res
,
input
)
=>
res
.
concat
(
input
.
name
),[])(
$
(
'.machine:checked'
))
}
}
$
(
'#submit'
).
on
(
'click'
,
()
=>
{
const
params
=
getParams
()
if
(
!
params
.
branch
||
!
params
.
project
.
length
||
!
params
.
machine
.
length
){
return
false
}
$
.
post
(
'/register'
,
params
,
res
=>
{
if
(
res
.
ret
){
swal
(
'注册使用成功'
,
`分支:
${
params
.
branch
}
\n项目:
${
$
(
'#project'
).
val
()
||
''
}
`
)
getList
()
}
})
return
false
})
$
(
'#cancel'
).
on
(
'click'
,
()
=>
{
const
params
=
getParams
()
if
(
!
params
.
branch
){
return
false
}
$
.
post
(
'/unregister'
,
params
,
res
=>
{
if
(
res
.
ret
){
swal
(
'解除使用成功'
,
`分支:
${
params
.
branch
}
`
)
getList
()
}
})
return
false
})
</script>
</body>
</html>
\ No newline at end of file
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