Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hunter-ht.cn
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
刘莹莹
hunter-ht.cn
Commits
c19f67f1
Commit
c19f67f1
authored
May 07, 2020
by
liuyingying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CVE可修改
parent
a4f83734
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
96 additions
and
6 deletions
+96
-6
edit.png
Hunter_ht/hunter/static/hunter/images/edit.png
+0
-0
style.css
Hunter_ht/hunter/static/hunter/style.css
+7
-1
user.html
Hunter_ht/hunter/templates/hunter/user.html
+70
-5
urls.py
Hunter_ht/hunter/urls.py
+2
-0
views.py
Hunter_ht/hunter/views.py
+17
-0
No files found.
Hunter_ht/hunter/static/hunter/images/edit.png
0 → 100644
View file @
c19f67f1
423 Bytes
Hunter_ht/hunter/static/hunter/style.css
View file @
c19f67f1
...
@@ -494,6 +494,7 @@ ul:after{
...
@@ -494,6 +494,7 @@ ul:after{
.li_right
{
.li_right
{
float
:
right
!important
;
float
:
right
!important
;
font-size
:
14px
;
font-size
:
14px
;
margin-left
:
10px
;
}
}
.middle_text
{
.middle_text
{
font-size
:
14px
;
font-size
:
14px
;
...
@@ -720,7 +721,12 @@ li svg{
...
@@ -720,7 +721,12 @@ li svg{
height
:
20px
;
height
:
20px
;
margin
:
5px
0
;
margin
:
5px
0
;
background-image
:
url("/static/hunter/images/delete.png")
;
background-image
:
url("/static/hunter/images/delete.png")
;
}
.edit_img
{
width
:
20px
;
height
:
20px
;
margin
:
5px
0
;
background-image
:
url("/static/hunter/images/edit.png")
;
}
}
.add_one
button
svg
{
.add_one
button
svg
{
margin
:
8px
5px
;
margin
:
8px
5px
;
...
...
Hunter_ht/hunter/templates/hunter/user.html
View file @
c19f67f1
...
@@ -55,7 +55,7 @@
...
@@ -55,7 +55,7 @@
</div>
</div>
</nav>
</nav>
<section
id=
"publish"
style=
"padding-top:1
0
0px;"
>
<section
id=
"publish"
style=
"padding-top:1
9
0px;"
>
<div
class=
"smaller_box"
></div>
<div
class=
"smaller_box"
></div>
<div
class=
"left-bar smaller_bar"
>
<div
class=
"left-bar smaller_bar"
>
<span>
<span>
...
@@ -122,9 +122,10 @@
...
@@ -122,9 +122,10 @@
<ul
id=
"cveid{{ cve.identifier }}"
>
<ul
id=
"cveid{{ cve.identifier }}"
>
<li
class=
"cve_big_text"
><a
href=
"{{ cve.url }}"
target=
"_blank"
>
{{ cve.identifier }}
</a></li>
<li
class=
"cve_big_text"
><a
href=
"{{ cve.url }}"
target=
"_blank"
>
{{ cve.identifier }}
</a></li>
<li
class=
"li_right"
><button
class=
"dele_img"
onclick=
"deleCVE({{ cve.identifier }})"
></button></li>
<li
class=
"li_right"
><button
class=
"dele_img"
onclick=
"deleCVE({{ cve.identifier }})"
></button></li>
<li
class=
"li_right"
><button
class=
"edit_img"
onclick=
"create_cve_edit_html(this)"
></button></li>
<li
class=
"li_right"
>
{{ cve.datetime }}
</li>
<li
class=
"li_right"
>
{{ cve.datetime }}
</li>
<li
class=
"li_right"
>
{{ cve.software }}
</li>
<li
class=
"li_right"
>
{{ cve.bugType }}
</li>
<li
class=
"li_right"
>
{{ cve.bugType }}
</li>
<li
class=
"li_right"
>
{{ cve.software }}
</li>
<li
class=
"li_long li_small_text"
>
{{ cve.description }}
</li>
<li
class=
"li_long li_small_text"
>
{{ cve.description }}
</li>
</ul>
</ul>
{% endfor %}
{% endfor %}
...
@@ -166,9 +167,8 @@
...
@@ -166,9 +167,8 @@
<li>
{{ art.author }}
</li>
<li>
{{ art.author }}
</li>
<li
class=
"right"
><button
onclick=
"deleArt({{ art.articleID }})"
><svg
t=
"1587713476030"
class=
"icon"
viewBox=
"0 0 1024 1024"
version=
"1.1"
xmlns=
"http://www.w3.org/2000/svg"
p-id=
"4730"
width=
"20"
height=
"20"
><path
d=
"M864 128H544v-16a32 32 0 0 0-64 0v16H160a32 32 0 0 0 0 64h704a32 32 0 0 0 0-64z m-64 128a32 32 0 0 0-32 32v592H256V288a32 32 0 0 0-64 0v624a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V288a32 32 0 0 0-32-32zM416 784V304a32 32 0 0 0-64 0v480a32 32 0 0 0 64 0z m128 0V304a32 32 0 0 0-64 0v480a32 32 0 0 0 64 0z m128 0V304a32 32 0 0 0-64 0v480a32 32 0 0 0 64 0z"
fill=
"#b34340"
p-id=
"4731"
></path></svg>
<li
class=
"right"
><button
onclick=
"deleArt({{ art.articleID }})"
><svg
t=
"1587713476030"
class=
"icon"
viewBox=
"0 0 1024 1024"
version=
"1.1"
xmlns=
"http://www.w3.org/2000/svg"
p-id=
"4730"
width=
"20"
height=
"20"
><path
d=
"M864 128H544v-16a32 32 0 0 0-64 0v16H160a32 32 0 0 0 0 64h704a32 32 0 0 0 0-64z m-64 128a32 32 0 0 0-32 32v592H256V288a32 32 0 0 0-64 0v624a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V288a32 32 0 0 0-32-32zM416 784V304a32 32 0 0 0-64 0v480a32 32 0 0 0 64 0z m128 0V304a32 32 0 0 0-64 0v480a32 32 0 0 0 64 0z m128 0V304a32 32 0 0 0-64 0v480a32 32 0 0 0 64 0z"
fill=
"#b34340"
p-id=
"4731"
></path></svg>
</button></li>
</button></li>
<li
class=
"right"
><a
href=
"{% url 'hunter:edit_art' art.articleID %}"
target=
"_blank"
>
编辑
</a></li>
<li
class=
"right"
><a
href=
"{% url 'hunter:edit_art' art.articleID %}"
target=
"_blank"
class=
"edit_img"
style=
"display:block"
>
</a></li>
<li
class=
"middle_text right"
>
{{ art.editDateTime }}
</li>
<li
class=
"middle_text right"
>
{{ art.editDateTime }}
</li>
<li
class=
"small_text right"
>
{{ art.authorID }}
</li>
<li
class=
"small_text right"
><a
target=
"_blank"
download=
"{{ art.attachment }}"
href=
"{% static 'hunter/articles/' %}{{ art.attachment }}"
>
{{ art.attachment }}
</a></li>
<li
class=
"small_text right"
><a
target=
"_blank"
download=
"{{ art.attachment }}"
href=
"{% static 'hunter/articles/' %}{{ art.attachment }}"
>
{{ art.attachment }}
</a></li>
</ul>
</ul>
{% endfor %}
{% endfor %}
...
@@ -405,7 +405,7 @@
...
@@ -405,7 +405,7 @@
let
bugtype
=
$
(
'input[name="bugtype"]'
).
val
();
let
bugtype
=
$
(
'input[name="bugtype"]'
).
val
();
let
date
=
$
(
'#date_input'
).
val
();
let
date
=
$
(
'#date_input'
).
val
();
let
software
=
$
(
"input[name='software']"
).
val
();
let
software
=
$
(
"input[name='software']"
).
val
();
let
url_cve
=
$
(
"input[name='url_cve]"
).
val
();
let
url_cve
=
$
(
"input[name='url_cve
'
]"
).
val
();
let
formatData
=
new
FormData
();
let
formatData
=
new
FormData
();
formatData
.
append
(
"owner"
,
owner
);
formatData
.
append
(
"owner"
,
owner
);
formatData
.
append
(
"cve_id"
,
cve_id
);
formatData
.
append
(
"cve_id"
,
cve_id
);
...
@@ -546,7 +546,72 @@
...
@@ -546,7 +546,72 @@
' </div>
\
n'
;
' </div>
\
n'
;
$
(
'#edit_content'
).
append
(
input_html
);
$
(
'#edit_content'
).
append
(
input_html
);
}
function
create_cve_edit_html
(
thisBtn
){
show_edit
();
let
html
=
' <button id="cancel_btn" onclick="hide_edit()">
\
n'
+
' 取消
\
n'
+
' </button>
\
n'
+
' <button id="submit_btn" onclick="submit_edit_cve()">
\
n'
+
' 提交
\
n'
+
' </button>
\
n'
;
$
(
'#btn_edit'
).
empty
();
$
(
'#btn_edit'
).
append
(
html
);
$
(
'#edit_content'
).
empty
();
let
input_html
=
'<div>
\
n'
+
' <label for="identifier">编号:</label>
\
n'
+
' <input type="text" placeholder="" name="identifier">
\
n'
+
' </div>
\
n'
+
' <div>
\
n'
+
' <label for="url_cve">链接:</label>
\
n'
+
' <input type="text" placeholder="http://xx.xx.xx" name="url_cve" required>
\
n'
+
' </div>
\
n'
+
' <div>
\
n'
+
' <label for="softwore">存在于</label>
\
n'
+
' <input type="text" name="software" placeholder="xx软件/系统/..." required>
\
n'
+
' </div>
\
n'
+
' <div>
\
n'
+
' <label for="bugtype">漏洞类型</label>
\
n'
+
' <input type="text" name="bugtype" placeholder="内存泄漏/溢出/..." required>
\
n'
+
' </div>
\
n'
;
$
(
'#edit_content'
).
append
(
input_html
);
$
(
'input[name="identifier"]'
).
val
(
thisBtn
.
parentElement
.
parentElement
.
children
[
0
].
children
[
0
].
innerText
);
console
.
log
(
$
(
thisBtn
.
parentElement
.
parentElement
.
children
[
0
].
children
[
0
]));
console
.
log
(
thisBtn
.
parentElement
.
parentElement
.
children
[
2
].
innerHTML
);
console
.
log
(
thisBtn
.
parentElement
.
parentElement
.
children
[
1
].
innerText
);
$
(
'input[name="identifier"]'
).
prop
(
'disabled'
,
true
);
$
(
'input[name="bugtype"]'
).
val
(
thisBtn
.
parentElement
.
parentElement
.
children
[
4
].
innerText
);
$
(
"input[name='software']"
).
val
(
thisBtn
.
parentElement
.
parentElement
.
children
[
5
].
innerText
);
$
(
"input[name='url_cve']"
).
val
(
$
(
thisBtn
.
parentElement
.
parentElement
.
children
[
0
].
children
[
0
]).
attr
(
'href'
));
}
function
submit_edit_cve
(){
let
cve_id
=
$
(
'input[name="identifier"]'
).
val
();
let
bugtype
=
$
(
'input[name="bugtype"]'
).
val
();
let
software
=
$
(
"input[name='software']"
).
val
();
let
url_cve
=
$
(
"input[name='url_cve']"
).
val
();
let
formatData
=
new
FormData
();
formatData
.
append
(
"cve_id"
,
cve_id
);
formatData
.
append
(
"bugType"
,
bugtype
);
formatData
.
append
(
"software"
,
software
);
formatData
.
append
(
"url"
,
url_cve
);
$
.
ajax
({
url
:
"{% url 'hunter:edit_cve' %} "
,
type
:
'post'
,
data
:
formatData
,
contentType
:
false
,
processData
:
false
,
success
:
function
(
response
){
if
(
response
[
'message'
]){
hide_edit
();
window
.
location
.
reload
();
}
else
{
$
(
'#error_log'
).
append
(
response
[
'error'
]);
}
}
});
}
}
function
create_publication_html
(){
function
create_publication_html
(){
$
(
'#edit_content'
).
empty
();
$
(
'#edit_content'
).
empty
();
...
...
Hunter_ht/hunter/urls.py
View file @
c19f67f1
...
@@ -26,5 +26,6 @@ urlpatterns = [
...
@@ -26,5 +26,6 @@ urlpatterns = [
path
(
'delete/article/'
,
views
.
delete_article
,
name
=
'delete_article'
),
path
(
'delete/article/'
,
views
.
delete_article
,
name
=
'delete_article'
),
path
(
'add/publication/'
,
views
.
add_publication
,
name
=
'add_publication'
),
path
(
'add/publication/'
,
views
.
add_publication
,
name
=
'add_publication'
),
path
(
'add/cve/'
,
views
.
add_cve
,
name
=
'add_cve'
),
path
(
'add/cve/'
,
views
.
add_cve
,
name
=
'add_cve'
),
path
(
'edit/cve/'
,
views
.
edit_cve
,
name
=
'edit_cve'
),
path
(
'add/article/'
,
views
.
add_article
,
name
=
'add_article'
),
path
(
'add/article/'
,
views
.
add_article
,
name
=
'add_article'
),
]
]
\ No newline at end of file
Hunter_ht/hunter/views.py
View file @
c19f67f1
...
@@ -526,6 +526,23 @@ def add_cve(request):
...
@@ -526,6 +526,23 @@ def add_cve(request):
@csrf_exempt
@csrf_exempt
def
edit_cve
(
request
):
bugType
=
request
.
POST
[
'bugType'
]
identifier
=
request
.
POST
[
'cve_id'
]
software
=
request
.
POST
[
'software'
]
url
=
request
.
POST
[
'url'
]
if
Bugs
.
objects
.
filter
(
identifier
=
identifier
)
.
count
()
<=
0
:
return
JsonResponse
({
'message'
:
0
,
"error"
:
"CVE不存在"
})
try
:
Bugs
.
objects
.
filter
(
identifier
=
identifier
)
.
update
(
bugType
=
bugType
,
software
=
software
,
url
=
url
)
response
=
JsonResponse
({
"message"
:
1
})
return
response
except
ProgrammingError
as
e
:
response
=
JsonResponse
({
"message"
:
0
})
return
response
@csrf_exempt
def
add_article
(
request
):
def
add_article
(
request
):
return
0
return
0
...
...
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