mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2025-01-01 18:11:50 +00:00
完善后台admin对时间和内存设定的提示并调整admin布局
This commit is contained in:
parent
847c82a500
commit
b1d191eda9
@ -25,8 +25,8 @@ class CreateProblemSerializer(serializers.Serializer):
|
||||
# [{"input": "1 1", "output": "2"}]
|
||||
samples = ProblemSampleSerializer()
|
||||
test_case_id = serializers.CharField(max_length=40)
|
||||
time_limit = serializers.IntegerField(min_value=1)
|
||||
memory_limit = serializers.IntegerField(min_value=1)
|
||||
time_limit = serializers.IntegerField(min_value=1, max_value=10000)
|
||||
memory_limit = serializers.IntegerField(min_value=16)
|
||||
difficulty = serializers.IntegerField()
|
||||
tags = serializers.ListField(child=serializers.CharField(max_length=10))
|
||||
hint = serializers.CharField(max_length=3000, allow_blank=True)
|
||||
|
@ -16,8 +16,12 @@ require(["jquery", "avalon", "editor", "uploader", "bsAlert",
|
||||
bsAlert("题目描述不能为空!");
|
||||
return false;
|
||||
}
|
||||
if (vm.timeLimit < 30 || vm.timeLimit > 5000) {
|
||||
bsAlert("保证时间限制是一个30-5000的合法整数");
|
||||
if (vm.timeLimit < 1 || vm.timeLimit > 10000) {
|
||||
bsAlert("保证时间限制是一个1-10000的整数");
|
||||
return false;
|
||||
}
|
||||
if (vm.memoryLimit < 16) {
|
||||
bsAlert("最低内存不能低于16M(注意:Java最低需要内存32M)");
|
||||
return false;
|
||||
}
|
||||
if (vm.samples.length == 0) {
|
||||
@ -91,7 +95,7 @@ require(["jquery", "avalon", "editor", "uploader", "bsAlert",
|
||||
description: "",
|
||||
timeLimit: 1000,
|
||||
memoryLimit: 128,
|
||||
samples: [],
|
||||
samples: [{input: "", output: "", "visible": true}],
|
||||
hint: "",
|
||||
sortIndex: "",
|
||||
visible: true,
|
||||
|
@ -14,8 +14,12 @@ require(["jquery", "avalon", "editor", "uploader", "bsAlert",
|
||||
bsAlert("题目描述不能为空!");
|
||||
return false;
|
||||
}
|
||||
if (vm.timeLimit < 30 || vm.timeLimit > 5000) {
|
||||
bsAlert("保证时间限制是一个30-5000的合法整数");
|
||||
if (vm.timeLimit < 1 || vm.timeLimit > 10000) {
|
||||
bsAlert("保证时间限制是一个1-10000的整数");
|
||||
return false;
|
||||
}
|
||||
if (vm.memoryLimit < 16) {
|
||||
bsAlert("最低内存不能低于16M(注意:Java最低需要内存32M)");
|
||||
return false;
|
||||
}
|
||||
if (vm.samples.length == 0) {
|
||||
|
@ -15,8 +15,12 @@ require(["jquery", "avalon", "editor", "uploader", "bsAlert",
|
||||
bsAlert("题目描述不能为空!");
|
||||
return false;
|
||||
}
|
||||
if (vm.timeLimit < 100 || vm.timeLimit > 5000) {
|
||||
bsAlert("保证时间限制是一个100-5000的合法整数");
|
||||
if (vm.timeLimit < 1 || vm.timeLimit > 10000) {
|
||||
bsAlert("保证时间限制是一个1-10000的整数");
|
||||
return false;
|
||||
}
|
||||
if (vm.memoryLimit < 16) {
|
||||
bsAlert("最低内存不能低于16M(注意:Java最低需要内存32M)");
|
||||
return false;
|
||||
}
|
||||
if (vm.samples.length == 0) {
|
||||
|
@ -26,17 +26,17 @@
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group"><label>时间限制(ms)</label>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group"><label>时间限制(ms, 范围1-10000ms)</label>
|
||||
<input type="number" name="timeLimit" class="form-control" ms-duplex="timeLimit"
|
||||
data-error="请输入时间限制(保证是一个30-5000的合法整数)" required>
|
||||
data-error="请输入时间限制" required>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group"><label>内存限制(MB)</label>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group"><label>请输入内存限制(MB, 最低16M, Java不能低于32M)</label>
|
||||
<input type="number" name="memory" class="form-control" ms-duplex="memoryLimit"
|
||||
data-error="请输入内存限制(保证是一个合法整数)" required>
|
||||
data-error="请输入内存限制" required>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -14,17 +14,17 @@
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group"><label>时间限制(ms)</label>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group"><label>时间限制(ms, 范围1-10000ms)</label>
|
||||
<input type="number" name="timeLimit" class="form-control" ms-duplex="timeLimit"
|
||||
data-error="请输入时间限制(保证是一个100-5000的合法整数)" required>
|
||||
data-error="请输入时间限制" required>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group"><label>内存限制(MB)</label>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group"><label>内存限制(MB, 最低16M, Java不能低于32M)</label>
|
||||
<input type="number" name="memoryLimit" class="form-control" ms-duplex="memoryLimit"
|
||||
data-error="请输入内存限制(保证是一个合法整数)" required>
|
||||
data-error="请输入内存限制(Java不能低于32M)" required>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
@ -45,8 +45,8 @@
|
||||
<small> 可见</small>
|
||||
</label>
|
||||
</div>
|
||||
<div id="tag" class="col-md-12">
|
||||
<label>标签</label><br>
|
||||
<div id="tag" class="col-md-6">
|
||||
<label>标签(按回车创建)</label><br>
|
||||
<input type="text" id="tags">
|
||||
</div>
|
||||
<div class="col-md-12 form-group">
|
||||
|
@ -20,17 +20,17 @@
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group"><label>时间限制(ms)</label>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group"><label>时间限制(ms, 范围1-10000ms)</label>
|
||||
<input type="number" name="timeLimit" class="form-control" ms-duplex="timeLimit"
|
||||
data-error="请输入时间限制(保证是一个100-5000的合法整数)" required>
|
||||
data-error="请输入时间限制" required>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group"><label>内存限制(MB)</label>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group"><label>内存限制(MB, 最低16M, Java不能低于32M)</label>
|
||||
<input type="number" name="memory" class="form-control" ms-duplex="memoryLimit"
|
||||
data-error="请输入内存限制(保证是一个合法整数)" required>
|
||||
data-error="请输入内存限制" required>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
@ -51,7 +51,7 @@
|
||||
<small> 可见</small>
|
||||
</label>
|
||||
</div>
|
||||
<div id="tag" class="col-md-12">
|
||||
<div id="tag" class="col-md-6">
|
||||
<label>标签</label><br>
|
||||
<input type="text" id="tags">
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user