From b419650604cba5111681e83190af6a886e8ade90 Mon Sep 17 00:00:00 2001
From: John Wu <524306184@qq.com>
Date: Sat, 8 Aug 2020 02:26:48 +0800
Subject: [PATCH 1/7] feat: submit flag
---
src/components/SubmitFlag.vue | 31 +++++++++++++++++++++++++++++--
1 file changed, 29 insertions(+), 2 deletions(-)
diff --git a/src/components/SubmitFlag.vue b/src/components/SubmitFlag.vue
index e3739d6..05634a9 100644
--- a/src/components/SubmitFlag.vue
+++ b/src/components/SubmitFlag.vue
@@ -1,6 +1,16 @@
- {{$t('flag.submit')}}
+ {{ message }}
+
+
+ {{$t('flag.submit')}}
+
+ 提交
+
POST /flag
Content-Type: application/json
@@ -15,7 +25,8 @@
curl
- -X POST {{baseURL}}/api/flag -H 'Authorization: {{info.Token}}' -d '{ "flag": "your_flag_here" }'
+ -X POST {{baseURL}}/api/flag -H 'Authorization: {{info.Token}}' -d '{ "flag": "your_flag_here"
+ }'
@@ -27,7 +38,11 @@
data: () => ({
info: null,
+ inputFlag: '',
baseURL: window.location.origin,
+
+ message: '',
+ snackBarVisible: false,
}),
mounted() {
@@ -39,6 +54,18 @@
this.utils.GET("/team/info").then(res => {
this.info = res
})
+ },
+ submitFlag() {
+ this.utils.POST('/flag', {
+ 'flag': this.inputFlag
+ }).then(res => {
+ this.inputFlag = ''
+ this.message = res
+ this.snackBarVisible = true
+ }).catch(err => {
+ this.message = err.response.data.msg
+ this.snackBarVisible = true
+ })
}
}
}
From a2758bb4beffea65cdb97e9e3784f21c35a9fbb6 Mon Sep 17 00:00:00 2001
From: John Wu <524306184@qq.com>
Date: Sat, 8 Aug 2020 02:30:33 +0800
Subject: [PATCH 2/7] i18n: submit flag
---
src/assets/languages/en-US.json | 4 +++-
src/assets/languages/zh-CN.json | 4 +++-
src/components/SubmitFlag.vue | 6 +++---
3 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/assets/languages/en-US.json b/src/assets/languages/en-US.json
index 92d1404..e230a0f 100644
--- a/src/assets/languages/en-US.json
+++ b/src/assets/languages/en-US.json
@@ -19,7 +19,9 @@
"empty": "No Challenge for Now"
},
"flag": {
- "submit": "Submit Flag"
+ "submit_flag": "Submit Flag",
+ "submit": "Submit",
+ "input_your_flag": "Please input your flag here..."
},
"timer": {
"not_begin": "The Game is not ready",
diff --git a/src/assets/languages/zh-CN.json b/src/assets/languages/zh-CN.json
index d13ab72..e7e29a7 100644
--- a/src/assets/languages/zh-CN.json
+++ b/src/assets/languages/zh-CN.json
@@ -19,7 +19,9 @@
"empty": "暂时还没有题目哟~"
},
"flag": {
- "submit": "提交 Flag"
+ "submit_flag": "提交 Flag",
+ "submit": "提交",
+ "input_your_flag": "请输入你的 Flag"
},
"timer": {
"not_begin": "比赛未开始",
diff --git a/src/components/SubmitFlag.vue b/src/components/SubmitFlag.vue
index 05634a9..6e78643 100644
--- a/src/components/SubmitFlag.vue
+++ b/src/components/SubmitFlag.vue
@@ -3,13 +3,13 @@
{{ message }}
- {{$t('flag.submit')}}
+ {{$t('flag.submit_flag')}}
- 提交
+ {{$t('flag.submit')}}
POST /flag
From 4f1fe411d93b35822035250a89c33e7d44f8bd3a Mon Sep 17 00:00:00 2001
From: John Wu <524306184@qq.com>
Date: Mon, 10 Aug 2020 01:08:32 +0800
Subject: [PATCH 3/7] feat: live event log
---
package.json | 4 +-
src/assets/languages/en-US.json | 4 ++
src/assets/languages/zh-CN.json | 4 ++
src/components/Copyrights.vue | 22 ++++++++++
src/components/LiveLog.vue | 72 +++++++++++++++++++++++++++++++++
src/components/SubmitFlag.vue | 32 ++++++++++-----
src/views/Main.vue | 11 ++---
7 files changed, 133 insertions(+), 16 deletions(-)
create mode 100644 src/components/Copyrights.vue
create mode 100644 src/components/LiveLog.vue
diff --git a/package.json b/package.json
index 2502489..3ccc006 100644
--- a/package.json
+++ b/package.json
@@ -39,7 +39,9 @@
"plugin:vue/essential",
"eslint:recommended"
],
- "rules": {},
+ "rules": {
+ "no-console": "off"
+ },
"parserOptions": {
"parser": "babel-eslint"
}
diff --git a/src/assets/languages/en-US.json b/src/assets/languages/en-US.json
index e230a0f..29b022f 100644
--- a/src/assets/languages/en-US.json
+++ b/src/assets/languages/en-US.json
@@ -23,6 +23,10 @@
"submit": "Submit",
"input_your_flag": "Please input your flag here..."
},
+ "log": {
+ "submit_flag": "{to} [ {challenge} ] was attacked by {from}",
+ "check_down": "{team} [ {challenge} ] down"
+ },
"timer": {
"not_begin": "The Game is not ready",
"pause": "The Game is pause",
diff --git a/src/assets/languages/zh-CN.json b/src/assets/languages/zh-CN.json
index e7e29a7..e660393 100644
--- a/src/assets/languages/zh-CN.json
+++ b/src/assets/languages/zh-CN.json
@@ -23,6 +23,10 @@
"submit": "提交",
"input_your_flag": "请输入你的 Flag"
},
+ "log": {
+ "submit_flag": "{from} 攻陷了 {to} [ {challenge} ]",
+ "check_down": "{team} [ {challenge} ] 服务宕机"
+ },
"timer": {
"not_begin": "比赛未开始",
"pause": "比赛已暂停",
diff --git a/src/components/Copyrights.vue b/src/components/Copyrights.vue
new file mode 100644
index 0000000..41b83d4
--- /dev/null
+++ b/src/components/Copyrights.vue
@@ -0,0 +1,22 @@
+
+
+
+
+ {{ new Date().getFullYear() }} — Powered by
+ Cardinal
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/LiveLog.vue b/src/components/LiveLog.vue
new file mode 100644
index 0000000..f47f8d4
--- /dev/null
+++ b/src/components/LiveLog.vue
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+ {{ item.message }} |
+ {{ new Date(item.time * 1000).toLocaleString() }} |
+
+
+
+
+
+ 暂无动态
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/SubmitFlag.vue b/src/components/SubmitFlag.vue
index 6e78643..5d5a199 100644
--- a/src/components/SubmitFlag.vue
+++ b/src/components/SubmitFlag.vue
@@ -1,23 +1,26 @@
- {{ message }}
+ {{ message }}
+
{{$t('flag.submit_flag')}}
- {{$t('flag.submit')}}
+
+ {{$t('flag.submit')}}
+
POST /flag
- Content-Type: application/json
- Header:
-
Authorization: {{info.Token}}
-
- Body:
+ Header
+ Content-Type: application/json
+ Authorization: {{info.Token}}
+ Body
{"flag":
"your_flag_here"}
@@ -33,6 +36,8 @@
From 4d7cbf743873239c33f15c74a0ab7bf6933dae7b Mon Sep 17 00:00:00 2001
From: E99p1ant
Date: Thu, 13 Aug 2020 19:06:43 +0800
Subject: [PATCH 4/7] i18n: live log
---
src/assets/languages/en-US.json | 2 ++
src/assets/languages/zh-CN.json | 2 ++
src/components/LiveLog.vue | 2 +-
src/views/Main.vue | 2 +-
4 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/assets/languages/en-US.json b/src/assets/languages/en-US.json
index 29b022f..d816e93 100644
--- a/src/assets/languages/en-US.json
+++ b/src/assets/languages/en-US.json
@@ -24,6 +24,8 @@
"input_your_flag": "Please input your flag here..."
},
"log": {
+ "live_log": "Live Log",
+ "no_data": "No Data",
"submit_flag": "{to} [ {challenge} ] was attacked by {from}",
"check_down": "{team} [ {challenge} ] down"
},
diff --git a/src/assets/languages/zh-CN.json b/src/assets/languages/zh-CN.json
index e660393..eb1418a 100644
--- a/src/assets/languages/zh-CN.json
+++ b/src/assets/languages/zh-CN.json
@@ -24,6 +24,8 @@
"input_your_flag": "请输入你的 Flag"
},
"log": {
+ "live_log": "实时动态",
+ "no_data": "暂无动态",
"submit_flag": "{from} 攻陷了 {to} [ {challenge} ]",
"check_down": "{team} [ {challenge} ] 服务宕机"
},
diff --git a/src/components/LiveLog.vue b/src/components/LiveLog.vue
index f47f8d4..591c340 100644
--- a/src/components/LiveLog.vue
+++ b/src/components/LiveLog.vue
@@ -11,7 +11,7 @@
- 暂无动态
+ {{$t('log.no_data')}}
diff --git a/src/views/Main.vue b/src/views/Main.vue
index 86bd887..9b98d04 100644
--- a/src/views/Main.vue
+++ b/src/views/Main.vue
@@ -13,7 +13,7 @@
- 实时动态
+ {{$t('log.live_log')}}
From 2ea37d9ef866bd782f1cbb8e3a7478871bdec269 Mon Sep 17 00:00:00 2001
From: E99p1ant
Date: Thu, 13 Aug 2020 19:21:03 +0800
Subject: [PATCH 5/7] feat: curl command in different os
---
src/components/SubmitFlag.vue | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/components/SubmitFlag.vue b/src/components/SubmitFlag.vue
index 5d5a199..548f753 100644
--- a/src/components/SubmitFlag.vue
+++ b/src/components/SubmitFlag.vue
@@ -27,9 +27,7 @@
- curl
- -X POST {{baseURL}}/api/flag -H 'Authorization: {{info.Token}}' -d '{ "flag": "your_flag_here"
- }'
+ {{getCurlCommand()}}
@@ -44,7 +42,6 @@
data: () => ({
info: null,
inputFlag: '',
- baseURL: window.location.origin,
message: '',
snackBarVisible: false,
@@ -78,6 +75,13 @@
this.snackBarColor = 'error'
this.snackBarVisible = true
});
+ },
+ getCurlCommand() {
+ // The curl command is different in windows and *nix os.
+ if ((navigator.platform === "Win32") || (navigator.platform === "Windows")) {
+ return `curl -X POST ${window.location.origin}/api/flag -H "Authorization: ${this.info.Token}" -d "{ \\"flag\\": \\"your_flag_here\\" }"`
+ }
+ return `curl -X POST ${window.location.origin}/api/flag -H 'Authorization: ${this.info.Token}' -d '{ "flag": "your_flag_here" }'`
}
}
}
From 5e32579db1dff4e197ab81739aa35655a5e99fc0 Mon Sep 17 00:00:00 2001
From: E99p1ant
Date: Thu, 13 Aug 2020 21:21:53 +0800
Subject: [PATCH 6/7] feat: show other teams' gamebox
---
src/assets/languages/en-US.json | 6 +-
src/assets/languages/zh-CN.json | 6 +-
src/components/Info.vue | 122 +++++++++++++++++++++++++-------
3 files changed, 105 insertions(+), 29 deletions(-)
diff --git a/src/assets/languages/en-US.json b/src/assets/languages/en-US.json
index d816e93..731cd7e 100644
--- a/src/assets/languages/en-US.json
+++ b/src/assets/languages/en-US.json
@@ -16,7 +16,11 @@
"password_empty": "Please input your password"
},
"gamebox": {
- "empty": "No Challenge for Now"
+ "empty": "No Challenge for Now",
+ "list": "GameBox List",
+ "team": "Team",
+ "challenge": "Challenge",
+ "address": "Address"
},
"flag": {
"submit_flag": "Submit Flag",
diff --git a/src/assets/languages/zh-CN.json b/src/assets/languages/zh-CN.json
index eb1418a..6aa3487 100644
--- a/src/assets/languages/zh-CN.json
+++ b/src/assets/languages/zh-CN.json
@@ -16,7 +16,11 @@
"password_empty": "请输入密码"
},
"gamebox": {
- "empty": "暂时还没有题目哟~"
+ "empty": "暂时还没有题目哟~",
+ "list": "所有靶机",
+ "team": "所属队伍",
+ "challenge": "所属题目",
+ "address": "地址"
},
"flag": {
"submit_flag": "提交 Flag",
diff --git a/src/components/Info.vue b/src/components/Info.vue
index ecc7c06..0e63b41 100644
--- a/src/components/Info.vue
+++ b/src/components/Info.vue
@@ -1,28 +1,72 @@
-
-
-
-
-
- {{info.Name}}
-
- Token {{ info.Token }}
-
-
-
-
-
-
-
-
-
-
-
- #{{ info.Rank }} / {{ utils.FormatFloat(info.Score) }} {{$t('general.score')}}
+
+
+
+
+ {{$t('gamebox.list')}}
+
+
+
+
+
+
+
+ {{$t('gamebox.team')}} |
+ {{$t('gamebox.challenge')}} |
+ {{$t('gamebox.address')}} |
+
+
+
+
+ {{ item.TeamName }} |
+ {{ item.ChallengeName }} |
+ {{ item.IP }}:{{ item.Port }} |
+
+
+
+
+
+
+
+
+
+
+
+ {{$t('general.close')}}
+
+
+
+
+
+
+
+
+
+
+ {{info.Name}}
+
+ Token {{ info.Token }}
+
+
+
-
-
-
+
+
+
+
+
+
+
+ #{{ info.Rank }} / {{ utils.FormatFloat(info.Score) }} {{$t('general.score')}}
+
+ 靶机列表
+
+
+