-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 漏洞类型
-
-
-
-
-
-
-
-
-
- 全部
- 入门
- 初级
- 中级
- 高级
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 漏洞类型
+
+
+
+
+
+
+
+
+
+ 全部
+ 入门
+ 初级
+ 中级
+ 高级
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
- {{item.image_vul_name}}
-
+
+
-
-
- {{i}}
-
+
+
+
+ {{item.image_vul_name}}
-
-
-
-
-
-
-
-
+
+
+
+ {{i}}
+
+
+
+
+
+
+
+
+
-
- 上一步
-
-
-
+
+
+ 上一步
+
+
-
-
-
-
-
-
- {{i}}
-
-
-
-
-
- 删除
-
-
-
diff --git a/vulfocus-frontend/src/views/scene/index.vue b/vulfocus-frontend/src/views/scene/index.vue
index e6827457..ec871efa 100644
--- a/vulfocus-frontend/src/views/scene/index.vue
+++ b/vulfocus-frontend/src/views/scene/index.vue
@@ -88,9 +88,12 @@
环境描述
+ 编辑
-
- {{layout.desc}}
+
+
+
+
访问地址
@@ -101,6 +104,49 @@
+
+
+
+ 评论
+
+
+ 发表
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.username}}
+
+
+
+
+ {{item.create_time}}
+
+
+
+
+ {{item.content}}
+
+ 删除
+
+
+
+
+
+
+
+
@@ -118,7 +164,12 @@
-
+
+
+
+ {{scope.row.username}}
+
+
@@ -134,6 +185,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 确认
+
+
+
+
+
+
@@ -142,9 +229,16 @@
import { mapGetters } from 'vuex'
import {sceneGet, sceneStart, sceneStop,sceneFlag, sceneRank} from '@/api/scene'
+import { commitComment, getComment, CommentDelete } from '@/api/user'
import CountDown from "vue2-countdown";
+import { updateLayoutDesc } from '@/api/layout'
+import verification from "./verification";
+import MarkdownEditor from '@/components/MarkdownEditor'
+import ViewerEditor from '@/components/ViewerEditor'
+
export default {
+ inject: ['reload'],
name: 'timeindex.vue',
data(){
return {
@@ -173,12 +267,21 @@ export default {
incompletePeple:0,
open: [],
rankList:[],
- writeup_date:'',
+ scene_writeup_date:'',
+ scene_update_date:'',
drawer:false,
drawerFlag:false,
derection:"btt",
imgpath:'/images/',
- difvalue: 3.5
+ difvalue: 3.5,
+ contentText:"",
+ contentList:[],
+ dialogVisible:false,
+ verificationCode:"",
+ commentCode:"",
+ loadingData:false,
+ userAuth:"",
+ loadingData:false,
}
},
computed: {
@@ -193,10 +296,20 @@ export default {
if (this.roles.length >0 &&this.roles[0] === "admin"){
this.isAdmin = true
}
+ this.userAuth = this.name
this.initModelInfo()
this.handleRank(1)
+ this.initComment()
+ },
+ components:{
+ 'v-sidentify':verification,
+ MarkdownEditor,
+ ViewerEditor,
},
methods:{
+ identifyCode(data){
+ this.verificationCode = data
+ },
/**
* 初始化模式信息
*/
@@ -221,6 +334,8 @@ export default {
if (status === 200){
this.layout.name = rsp.data["layout"]["name"]
this.layout.desc = rsp.data["layout"]["desc"]
+ this.scene_writeup_date = rsp.data["layout"]["desc"]
+ this.loadingData = true
if (!rsp.data["layout"]["image_name"]){
this.layout.image_name = require("../../assets/modelbg.jpg")
}else {
@@ -402,6 +517,86 @@ export default {
},
computeTableIndex(index){
return (this.page.page - 1) * this.page.size + index + 1
+ },
+ handleText(){
+ this.dialogVisible = true
+ },
+ commitText(){
+ if (this.commentCode===this.verificationCode) {
+ let commentDict = new FormData()
+ commentDict.set("scene_id", this.$route.query.layout_id)
+ commentDict.set("content", this.contentText)
+ commentDict.set("scene_type", "layout")
+ commitComment(commentDict).then(response => {
+ if (response.data.status === 200) {
+ this.$message({
+ message: response.data.message,
+ type: "success",
+ })
+ this.dialogVisible = false
+ this.reload()
+ } else {
+ this.$message({
+ message: response.data.message,
+ type: "error",
+ })
+ }
+ })
+ }else {
+ this.$message({
+ message: '验证码错误',
+ type: "error",
+ })
+ }
+ },
+ initComment(){
+ let sceneId = this.$route.query.layout_id
+ getComment(sceneId).then(response=>{
+ this.contentList = response.data.results
+ })
+ },
+ delComment(id){
+ CommentDelete(id).then(response=>{
+ if (response.data.status === 200){
+ this.$message({
+ message: "删除成功",
+ type: 'success'
+ })
+ this.initComment()
+ }else {
+ this.$message({
+ message: response.data.msg,
+ type: "error",
+ })
+ }
+ })
+ },
+ closeDrawer(){
+ this.drawer=false
+ this.initModelInfo()
+ },
+ openDrawer(){
+ this.scene_update_date = this.scene_writeup_date
+ this.drawer=true
+ },
+ createSceneWriteup(){
+ let sceneId = this.$route.query.layout_id
+ let data = {"data":this.scene_update_date}
+ updateLayoutDesc(sceneId,data).then(response=>{
+ if (response.data.status === 200){
+ this.$message({
+ message: "编辑成功",
+ type: 'success'
+ })
+ this.drawer = false
+ this.reload()
+ }else {
+ this.$message({
+ message: response.data.msg,
+ type: 'error'
+ })
+ }
+ })
}
}
}
@@ -501,4 +696,19 @@ export default {
overflow: hidden;
text-overflow: ellipsis;
}
+.span7{
+ width: 87px;
+ height: 14px;
+ font-size: 16px;
+ color: #303133;
+ line-height: 14px;
+}
+.span8{
+ width: 88px;
+ height: 14px;
+ font-size: 14px;
+ color: #999999;
+ line-height: 14px;
+
+}
diff --git a/vulfocus-frontend/src/views/scene/timeindex.vue b/vulfocus-frontend/src/views/scene/timeindex.vue
index 0c758625..a4dbb11c 100644
--- a/vulfocus-frontend/src/views/scene/timeindex.vue
+++ b/vulfocus-frontend/src/views/scene/timeindex.vue
@@ -101,6 +101,46 @@
+
+
+
+ 评论
+
+
+ 发表
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.username}}
+
+
+
+
+ {{item.create_time}}
+
+
+
+
+ {{item.content}}
+
+
+
+
+
+
+
@@ -118,15 +158,20 @@
-
-
+
+
+
+ {{scope.row.name}}
+
+
+