Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry-zklcdc committed Jul 11, 2021
2 parents 2bd250e + c7b2b91 commit 1bd590c
Show file tree
Hide file tree
Showing 9 changed files with 206 additions and 15 deletions.
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,33 @@

Install Node.JS **v12.16.1** first.

```
### Linux

```bash
npm install
# we use webpack DllReference to decrease the build time,
# this command only needs execute once unless you upgrade the package in build/webpack.dll.conf.js
NODE_ENV=development npm run build:dll
export NODE_ENV=development
npm run build:dll

# the dev-server will set proxy table to your backend
export TARGET=http://Your-backend

# serve with hot reload at localhost:8080
npm run dev
```
### Windows

```bash
npm install
# we use webpack DllReference to decrease the build time,
# this command only needs execute once unless you upgrade the package in build/webpack.dll.conf.js
set NODE_ENV=development
npm run build:dll

# the dev-server will set proxy table to your backend
set TARGET=http://Your-backend

# serve with hot reload at localhost:8080
npm run dev
```
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/admin/zh-CN.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const m = {
User_Type: '用户类型',
Problem_Permission: '问题权限',
Two_Factor_Auth: '双因素认证',
Is_Disabled: '是否封禁',
Is_Disabled: '是否禁用',
User_Title: '头衔',
User_Title_Color: '头衔颜色',
// Announcement.vue
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/admin/zh-TW.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const m = {
User_Type: '帳號類型',
Problem_Permission: '試題權限',
Two_Factor_Auth: '兩步驟驗證',
Is_Disabled: '是否封禁',
Is_Disabled: '是否禁用',
User_Title: '頭銜',
User_Title_Color: '頭銜',
// Announcement.vue
Expand Down
158 changes: 157 additions & 1 deletion src/i18n/oj/zh-TW.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export const m = {
// 404.vue
Go_Home: '回到首頁',
// Problem.vue
Description: '題目描述',
Input: '輸入',
Expand All @@ -16,7 +18,23 @@ export const m = {
Score: '分數',
Tags: '標籤',
Show: '顯示',
Submit: '提交',
Submitting: '提交中',
Judging: '評分中',
Wrong_Answer: '答案錯誤',
Statistic: '統計',
Close: '關閉',
View_Contest: '查看比賽',
Are_you_sure_you_want_to_reset_your_code: '你確定要重置你的程式碼嗎?',
Code_can_not_be_empty: '你不能提交空的程式碼',
Submit_code_successfully: '成功提交程式碼',
You_have_solved_the_problem: '你已經解決了該試題',
Submitted_successfully: '成功提交',
You_have_submitted_a_solution: '你已經提交了解答.',
Contest_has_ended: '比賽已經結束',
You_have_submission_in_this_problem_sure_to_cover_it: '你已經提交了解答,確定要覆蓋嗎?',
// About.vue
Compiler: '編譯器',
Result_Explanation: '結果說明',
Pending_Judging_Description: '您的答案即將進行評分,請等待結果。',
Compile_Error_Description: '無法編譯您的原始碼,請點選連結以檢視編譯器的輸出。',
Expand All @@ -26,8 +44,70 @@ export const m = {
Time_Limit_Exceeded_Description: '您的程式使用的 CPU 時間已超出限制。',
Memory_Limit_Exceeded_Description: '程式實際使用的記憶體已超出限制。',
System_Error_Description: 'Judge 系統發生錯誤。請回報系統管理員。',
// ACMContestRank.vue
Menu: '選單',
Chart: '圖表',
Auto_Refresh: '自動重新載入',
RealName: '真實名稱',
Force_Update: '強制重新載入',
download_csv: '下載csv檔',
TotalTime: '總時間',
Top_10_Teams: '前10名隊伍',
save_as_image: '保存圖片',
// ACMHelper.vue
ACM_Helper: 'ACM助手',
AC_Time: 'AC 時間',
ProblemID: '題目ID',
First_Blood: '頭香',
Username: '使用者名稱',
Checked: '已檢查',
Not_Checked: '還未檢查',
Check_It: '現在檢查',
// ACMRank.vue
ACM_Ranklist: 'ACM 排名',
mood: '個人狀態',
AC: 'AC',
Rating: '評分',
// Announcements.vue
Contest_Announcements: '比賽公告',
By: '創建者',
// ApplyResetPassword.vue
The_email_doesnt_exist: '此電子郵件並不存在',
Success: '成功',
Password_reset_mail_sent: '已發送重置密碼之電子郵件',
// FAQ.vue
Frequently_Asked_Questions: '常見問題',
Where_is_the_input_and_the_output: '輸入與輸出在哪邊?',
Where_is_the_input_and_the_output_answer_part_1: '你的程式會從',
Standard_Input: '標準輸入',
Where_is_the_input_and_the_output_answer_part_3: '讀取輸入,並且將結果輸出到',
Standard_Output: '標準輸出',
Where_is_the_input_and_the_output_answer_part_5: '例如,你可以在 C 中使用',
Where_is_the_input_and_the_output_answer_part_6: '或在 C++ 中使用',
Where_is_the_input_and_the_output_answer_part_7: '讀取輸入,並在 C 中使用',
Where_is_the_input_and_the_output_answer_part_8: '或在 C++ 中使用',
Where_is_the_input_and_the_output_answer_part_9: '來輸出到stdout。你的程式不被允許讀取或著是寫入檔案,否則你將獲得',
What_is_the_meaning_of_submission_execution_time: '提交執行時間是什麼意思?',
What_is_the_meaning_of_submission_execution_time_answer: '線上解題系統可能會使用不同的輸入檔案來多次測試你的程式碼。如果你的程式碼在每個輸入檔案的時間限制內給出正確的答案,則顯示的執行時間是每個測資所花費的最大時間。否則,執行時間將毫無意義',
How_Can_I_use_CPP_Int64: '我要如何使用 C++ Int64?',
How_Can_I_use_CPP_Int64_answer_part_1: '你應該宣告為',
How_Can_I_use_CPP_Int64_answer_part_2: '並且與',
or: '或',
using: '一起使用,使用',
How_Can_I_use_CPP_Int64_answer_part_3: '將導致',
Java_specifications: 'Java 規範?',
Java_specifications_answer_part_1: '所有的程式都必須以',
Java_specifications_answer_part_2: '類別的靜態main方法開始執行。不要使用public類別:即使',
Java_specifications_answer_part_3: '也必須是非public類別以避免編譯錯誤使用緩衝I/O以避免過度重載而導致超出時間限制',
About_presentation_error: '關於輸出格式錯誤?',
About_presentation_error_answer_part_1: '此OJ中沒有輸出格式錯誤。Judge系統將自動整理輸出然後包裹在輸出的',
last: '最後',
About_presentation_error_answer_part_2: '一行中。如果仍然與正確的輸出不同,則結果將是',
How_to_report_bugs: '如何回報關於此OJ的錯誤?',
How_to_report_bugs_answer_part_1: '此線上解題系統是開源的,你可以到',
How_to_report_bugs_answer_part_2: '提交問題。請提供有關錯誤的詳細訊息(如env,版本...),這將極大地幫助我們解決該錯誤。當然,我們十分樂意合併你的請求',
// Cancel.vue
Cancel: '取消',
// ContestDetail.vue
Problems: '題目',
Announcements: '公告',
Expand All @@ -36,9 +116,34 @@ export const m = {
Rankings: '排名',
Overview: '概要',
Admin_Helper: '管理員助手',
StartAt: '開始時間',
EndAt: '結束時間',
ContestType: '比賽類型',
Creator: '發起人',
Public: '公開',
Password_Protected: '密碼保護',
// ContestList.vue
Rule: '賽制',
OI: 'OI',
ACM: 'ACM',
Underway: '進行中',
Not_Started: '準備中',
Ended: '已結束',
No_contest: '目前無任何比賽',
Please_login_first: '請先登入!',
// ContestProblemList.vue
Problems_List: '試題列表',

No_Problems: '暫無試題',
// CodeMirror.vue
Language: '語言',
Theme: '主題',
Reset_to_default_code_definition: '使用預設程式碼設定',
Upload_file: '上傳文件',
Monokai: 'Monokai',
Solarized_Light: '日光燈',
Material: '材料',
// KatexEditor.vue
Latex_Editor: 'Latex 編輯器',
// NavBar.vue
Home: '首頁',
NavProblems: '試題',
Expand Down Expand Up @@ -81,6 +186,7 @@ export const m = {
Settings: '我的設定',
Management: '後台管理',
Logout: '登出',
Welcome_to: '歡迎來到',
// announcements.vue
Refresh: '重新整理',
Back: '返回',
Expand All @@ -106,6 +212,22 @@ export const m = {
No_Account: '沒有帳號,立即註冊!',
Forget_Password: '忘記密碼',
UserLogin: '登入',
Welcome_back: '歡迎回來',
// OIRank.vue
OI_Ranklist: 'OI 排名',
// OIContestRank.vue
Total_Score: '總分',
// ProblemList.vue
Problem_List: '試題列表',
High: '高級',
Mid: '中級',
Low: '初級',
All: '全部',
Reset: '重置',
Pick_One: '選擇',
Difficulty: '難度',
Total: '總數',
AC_Rate: '通過率',
// Register.vue
RegisterUsername: '用戶名|請使用“k/c+入學年份+真實姓名',
Email_Address: 'E-mail',
Expand All @@ -114,13 +236,47 @@ export const m = {
Captcha: '驗證碼',
UserRegister: '註冊',
Already_Registed: '已經註冊? 現在登入!',
The_username_already_exists: '此使用者名稱已經存在.',
The_email_already_exists: '此電子郵件地址已被註冊',
password_does_not_match: '無密碼相符',
Thanks_for_registering: '感謝你的註冊,現在你可以登入了',
// ResetPassword.vue and ApplyResetPassword.vue
Reset_Password: '重設密碼',
RPassword: '密碼',
RPassword_Again: '確認密碼',
RCaptcha: '驗證碼',
ApplyEmail: 'E-mail',
Send_Password_Reset_Email: '傳送密碼重設 E-mail',
Your_password_has_been_reset: '你的密碼已重置',
// Save.vue
Save: '存檔',
// Simditor.vue
Uploading_is_in_progress: '上傳作業正在執行,你確定要離開當前頁面嗎??',
// SubmissionDetails.vue
Lang: '語言',
Share: '分享',
UnShare: '不分享',
Succeeded: '成功',
Real_Time: '真實時間',
Signal: '訊號',
// SubmissionList.vue
When: '時間',
ID: 'ID',
Time: '時間',
Memory: '記憶體空間',
Author: '作者',
Option: '選項',
Mine: '我的',
Search_Author: '搜尋作者',
Accepted: '答案正確',
Time_Limit_Exceeded: '超出時間限制',
Memory_Limit_Exceeded: '超出記憶體空間限制',
Runtime_Error: 'Runtime Error',
System_Error: 'System Error',
Pending: 'Pending',
Partial_Accepted: 'Partial Accepted',
Compile_Error: 'Compile Error',
Rejudge: 'Rejudge',
// UserHome.vue
UserHomeSolved: '已解題數量',
UserHomeserSubmissions: '提交次數',
Expand Down
6 changes: 4 additions & 2 deletions src/pages/admin/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,10 @@ export default {
data
})
},
getProblemTagList () {
return ajax('problem/tags', 'get')
getProblemTagList (params) {
return ajax('problem/tags', 'get', {
params
})
},
compileSPJ (data) {
return ajax('admin/compile_spj', 'post', {
Expand Down
7 changes: 5 additions & 2 deletions src/pages/admin/views/problem/Problem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@
v-if="inputVisible"
size="mini"
class="input-new-tag"
popper-class="problem-tag-poper"
v-model="tagInput"
:trigger-on-focus="false"
@keyup.enter.native="addTag"
@blur="addTag"
@select="addTag"
:fetch-suggestions="querySearch">
</el-autocomplete>
Expand Down Expand Up @@ -432,7 +432,7 @@
}
},
querySearch (queryString, cb) {
api.getProblemTagList().then(res => {
api.getProblemTagList({ keyword: queryString }).then(res => {
let tagList = []
for (let tag of res.data.data) {
tagList.push({value: tag.name})
Expand Down Expand Up @@ -640,6 +640,9 @@
</style>

<style>
.problem-tag-poper {
width: 200px !important;
}
.dialog-compile-error {
width: auto;
max-width: 80%;
Expand Down
6 changes: 6 additions & 0 deletions src/pages/oj/components/Pagination.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,9 @@
float: right;
}
</style>

<style lang="less">
.ivu-page-options-sizer {
min-width: 85px;
}
</style>
9 changes: 6 additions & 3 deletions src/pages/oj/views/contest/ContestList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
</li>
</ol>
</Panel>
<Pagination :total="total" :pageSize="limit" @on-change="getContestList" :current.sync="page"></Pagination>
<Pagination :total="total" :page-size.sync="limit" @on-change="changeRoute" :current.sync="page" :show-sizer="true" @on-page-size-change="changeRoute"></Pagination>
</Col>
</Row>

Expand All @@ -87,7 +87,7 @@
import time from '@/utils/time'
import { CONTEST_STATUS_REVERSE, CONTEST_TYPE } from '@/utils/constants'
const limit = 8
const limit = 10
export default {
name: 'contest-list',
Expand Down Expand Up @@ -128,7 +128,8 @@
this.query.rule_type = route.rule_type || ''
this.query.keyword = route.keyword || ''
this.page = parseInt(route.page) || 1
this.getContestList()
this.limit = parseInt(route.limit) || 10
this.getContestList(this.page)
},
getContestList (page = 1) {
let offset = (page - 1) * this.limit
Expand All @@ -140,6 +141,8 @@
changeRoute () {
let query = Object.assign({}, this.query)
query.page = this.page
query.limit = this.limit
this.$router.push({
name: 'contest-list',
query: utils.filterEmptyValue(query)
Expand Down
9 changes: 6 additions & 3 deletions src/pages/oj/views/problem/ProblemList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
:loading="loadings.table"
disabled-hover></Table>
</Panel>
<Pagination :total="total" :page-size="limit" @on-change="pushRouter" :current.sync="query.page"></Pagination>
<Pagination
:total="total" :page-size.sync="query.limit" @on-change="pushRouter" @on-page-size-change="pushRouter" :current.sync="query.page" :show-sizer="true"></Pagination>

</Col>

Expand Down Expand Up @@ -170,7 +171,8 @@
keyword: '',
difficulty: '',
tag: '',
page: 1
page: 1,
limit: 10
}
}
},
Expand All @@ -188,6 +190,7 @@
if (this.query.page < 1) {
this.query.page = 1
}
this.query.limit = parseInt(query.limit) || 10
if (!simulate) {
this.getTagList()
}
Expand All @@ -200,7 +203,7 @@
})
},
getProblemList () {
let offset = (this.query.page - 1) * this.limit
let offset = (this.query.page - 1) * this.query.limit
this.loadings.table = true
api.getProblemList(offset, this.limit, this.query).then(res => {
this.loadings.table = false
Expand Down

0 comments on commit 1bd590c

Please sign in to comment.