Skip to content

Commit

Permalink
update code
Browse files Browse the repository at this point in the history
  • Loading branch information
Liiuliu committed Nov 5, 2021
1 parent 38b0fbb commit 6167f14
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
1 change: 1 addition & 0 deletions vulfocus-api/dockerapi/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ def statusck(self, obj):
status["host"] = data.vul_host
else:
if HTTP_HOST:
HTTP_HOST = HTTP_HOST.replace("http://", "").replace("https://", "")
origin_host = data.vul_host.split(":")
if len(origin_host) >= 2:
status["host"] = HTTP_HOST[:-1] + ":" + origin_host[1]
Expand Down
16 changes: 10 additions & 6 deletions vulfocus-api/dockerapi/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1802,12 +1802,14 @@ def get_operation_image_api(req):
status = dict()
try:
HTTP_HOST = req.META.get("HTTP_REFERER")
if ':' in HTTP_HOST:
if HTTP_HOST.count(":") == 2:
status["host"] = data_start.vul_host
else:
if HTTP_HOST:
HTTP_HOST = HTTP_HOST[:-1]
status["host"] = HTTP_HOST
HTTP_HOST = HTTP_HOST.replace("http://", "").replace("https://", "")
origin_host = data_start.vul_host.split(":")
if len(origin_host) >= 2:
status["host"] = HTTP_HOST[:-1] + ":" + origin_host[1]
else:
status["host"] = data_start.vul_host
except:
Expand Down Expand Up @@ -1859,12 +1861,14 @@ def get_operation_image_api(req):
if data:
try:
HTTP_HOST = req.META.get("HTTP_REFERER")
if ':' in HTTP_HOST:
if HTTP_HOST.count(":") == 2:
status["host"] = data.vul_host
else:
if HTTP_HOST:
HTTP_HOST = HTTP_HOST[:-1]
status["host"] = HTTP_HOST
HTTP_HOST = HTTP_HOST.replace("http://", "").replace("https://", "")
origin_host = data.vul_host.split(":")
if len(origin_host) >= 2:
status["host"] = HTTP_HOST[:-1] + ":" + origin_host[1]
else:
status["host"] = data.vul_host
except:
Expand Down
1 change: 1 addition & 0 deletions vulfocus-api/tasks/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def get_task(self, request, pk=None):
HTTP_HOST = request.META.get("HTTP_REFERER")
# 判断前端的请求地址是IP形式或者是域名形式
if HTTP_HOST.count(":") < 2:
HTTP_HOST = HTTP_HOST.replace("http://", "").replace("https://", "")
origin_host = msg["data"]["host"].split(":")
if len(origin_host) >= 2 and HTTP_HOST:
msg["data"]["host"] = HTTP_HOST[:-1] + ":" + origin_host[1]
Expand Down
7 changes: 4 additions & 3 deletions vulfocus-frontend/src/views/dashboard/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ export default {
this.current_page = 1;
this.loading = true;
this.listdata = [];
this.startedlistdata = [];
this.page.total = 0;
},
listData() {
Expand Down Expand Up @@ -446,9 +447,9 @@ export default {
this.startedlistdata = response.data.results
this.page.total2 = response.data.count;
for (let i = 0; i <this.startedlistdata.length ; i++) {
this.listdata[i].status.start_flag = false
this.listdata[i].status.stop_flag = false
this.listdata[i].status.delete_flag = false
this.startedlistdata[i].status.start_flag = false
this.startedlistdata[i].status.stop_flag = false
this.startedlistdata[i].status.delete_flag = false
}
}else {
this.listdata = response.data.results
Expand Down

0 comments on commit 6167f14

Please sign in to comment.