mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2024-09-21 16:33:22 +00:00
Merge branch 'dev' into virusdefender-dev
* dev: 修改主页部分字词 修改部分设置,为上线做准备 [修复]后台比赛管理编辑,后端传来的是utc时间,因为开始,结束时间跟创建,修改时间的处理方法是不同的,我通过修改前端代码解决了该问题.但是比较繁琐,因为在前端这个日期使用字符串来存储的.而后端虽是datetime类型,但返回的是比赛的数组,若要处理也较繁琐,且暂没找到简洁的写法.于是还是选择了改前端,其实实质上是手工给时间加了8小时.....[CI SKIP] Conflicts: oj/server_settings.py
This commit is contained in:
commit
2033daf46f
@ -18,7 +18,7 @@ DATABASES = {
|
|||||||
'NAME': 'oj_submission',
|
'NAME': 'oj_submission',
|
||||||
'ENGINE': 'django.db.backends.mysql',
|
'ENGINE': 'django.db.backends.mysql',
|
||||||
'HOST': "121.42.32.129",
|
'HOST': "121.42.32.129",
|
||||||
'POST': 3306,
|
'PORT': 3306,
|
||||||
'USER': 'root',
|
'USER': 'root',
|
||||||
'PASSWORD': 'mypwd',
|
'PASSWORD': 'mypwd',
|
||||||
'CONN_MAX_AGE': 0.1,
|
'CONN_MAX_AGE': 0.1,
|
||||||
@ -30,7 +30,7 @@ DEBUG = True
|
|||||||
# 同理 这是 web 服务器的上传路径
|
# 同理 这是 web 服务器的上传路径
|
||||||
TEST_CASE_DIR = os.path.join(BASE_DIR, 'test_case/')
|
TEST_CASE_DIR = os.path.join(BASE_DIR, 'test_case/')
|
||||||
|
|
||||||
DATABASE_ROUTERS = ['oj.db_router.DBRouter']
|
ALLOWED_HOSTS = []
|
||||||
|
|
||||||
|
|
||||||
ALLOWED_HOSTS = []
|
ALLOWED_HOSTS = []
|
||||||
|
@ -5,31 +5,33 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|||||||
|
|
||||||
|
|
||||||
# 下面是需要自己修改的
|
# 下面是需要自己修改的
|
||||||
LOG_PATH = "log/"
|
LOG_PATH = "/var/log/oj/"
|
||||||
|
|
||||||
# 注意这是web 服务器访问的地址,判题端访问的地址不一定一样,因为可能不在一台机器上
|
# 注意这是web 服务器访问的地址,判题端访问的地址不一定一样,因为可能不在一台机器上
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
'default': {
|
'default': {
|
||||||
'ENGINE': 'django.db.backends.sqlite3',
|
'ENGINE': 'django.db.backends.mysql',
|
||||||
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
|
'NAME': "oj",
|
||||||
|
'CONN_MAX_AGE': 0.1,
|
||||||
|
'HOST': '127.0.0.1',
|
||||||
|
'PORT': 3306,
|
||||||
|
'USER': 'root',
|
||||||
|
'PASSWORD': 'mypwd'
|
||||||
},
|
},
|
||||||
# submission 的 name 和 engine 请勿修改,其他代码会用到
|
|
||||||
'submission': {
|
'submission': {
|
||||||
'NAME': 'oj_submission',
|
'NAME': 'oj_submission',
|
||||||
'ENGINE': 'django.db.backends.mysql',
|
'ENGINE': 'django.db.backends.mysql',
|
||||||
'HOST': "121.42.32.129",
|
|
||||||
'POST': 3306,
|
|
||||||
'USER': 'root',
|
|
||||||
'PASSWORD': 'mypwd',
|
|
||||||
'CONN_MAX_AGE': 0.1,
|
'CONN_MAX_AGE': 0.1,
|
||||||
|
'HOST': "127.0.0.1",
|
||||||
|
'PORT': 3306,
|
||||||
|
'USER': 'root',
|
||||||
|
'PASSWORD': 'mypwd'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG = False
|
DEBUG = True
|
||||||
|
|
||||||
# 同理 这是 web 服务器的上传路径
|
# 同理 这是 web 服务器的上传路径
|
||||||
TEST_CASE_DIR = os.path.join(BASE_DIR, 'test_case/')
|
TEST_CASE_DIR = '/root/test_case/'
|
||||||
|
|
||||||
DATABASE_ROUTERS = ['oj.db_router.DBRouter']
|
|
||||||
|
|
||||||
ALLOWED_HOSTS = ['*']
|
ALLOWED_HOSTS = ['*']
|
@ -165,3 +165,5 @@ LOGGING = {
|
|||||||
REST_FRAMEWORK = {
|
REST_FRAMEWORK = {
|
||||||
'TEST_REQUEST_DEFAULT_FORMAT': 'json'
|
'TEST_REQUEST_DEFAULT_FORMAT': 'json'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DATABASE_ROUTERS = ['oj.db_router.DBRouter']
|
@ -149,8 +149,16 @@ require(["jquery", "avalon", "csrfToken", "bsAlert", "editor", "datetimePicker",
|
|||||||
vm.editingContestId = contestId;
|
vm.editingContestId = contestId;
|
||||||
vm.editTitle = vm.contestList[contestId-1].title;
|
vm.editTitle = vm.contestList[contestId-1].title;
|
||||||
vm.editPassword = vm.contestList[contestId-1].password;
|
vm.editPassword = vm.contestList[contestId-1].password;
|
||||||
vm.editStartTime = vm.contestList[contestId-1].start_time.substring(0,16).replace("T"," ");
|
//var startTime = new Date(), endTime = new Date();
|
||||||
vm.editEndTime = vm.contestList[contestId-1].end_time.substring(0,16).replace("T"," ");
|
//startTime.setFullYear(parseInt(vm.contestList[contestId-1].start_time.substring(0,4)))
|
||||||
|
//startTime.setMonth(parseInt(vm.contestList[contestId-1].start_time.substring(5,7)))
|
||||||
|
//startTime.setDate(parseInt(vm.contestList[contestId-1].start_time.substring(8,10)))
|
||||||
|
//startTime.setHours(parseInt(vm.contestList[contestId-1].start_time.substring(11,13)))
|
||||||
|
//startTime.setMinutes(parseInt(vm.contestList[contestId-1].start_time.substring(14,16)))
|
||||||
|
//startTime = new Date(startTime + 8 * 60 * 60 * 1000)
|
||||||
|
|
||||||
|
vm.editStartTime = add8Hours(vm.contestList[contestId-1].start_time);
|
||||||
|
vm.editEndTime = add8Hours(vm.contestList[contestId-1].end_time);//.substring(0,16).replace("T"," ");
|
||||||
vm.editMode = vm.contestList[contestId-1].mode;
|
vm.editMode = vm.contestList[contestId-1].mode;
|
||||||
vm.editVisible = vm.contestList[contestId-1].visible;
|
vm.editVisible = vm.contestList[contestId-1].visible;
|
||||||
if (vm.contestList[contestId-1].contest_type == 0) { //contest type == 0, contest in group
|
if (vm.contestList[contestId-1].contest_type == 0) { //contest type == 0, contest in group
|
||||||
@ -291,6 +299,40 @@ require(["jquery", "avalon", "csrfToken", "bsAlert", "editor", "datetimePicker",
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function add8Hours(UtcString) {
|
||||||
|
console.log(UtcString);
|
||||||
|
var M = [31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
||||||
|
/*time.setFullYear(parseInt(UtcString.substring(0,4)))
|
||||||
|
time.setMonth(parseInt(UtcString.substring(5,7)))
|
||||||
|
time.setDate(parseInt(UtcString.substring(8,10)))
|
||||||
|
time.setHours(parseInt(UtcString.substring(11,13)))
|
||||||
|
time.setMinutes(parseInt(UtcString.substring(14,16)))
|
||||||
|
time = new Date(time + 8 * 60 * 60 * 1000)*/
|
||||||
|
var year =UtcString.substring(0,4);
|
||||||
|
var month =UtcString.substring(5,7);
|
||||||
|
var day =UtcString.substring(8,10);
|
||||||
|
var hour =parseInt(UtcString.substring(11,13)) + 8;
|
||||||
|
var minute = UtcString.substring(14,16);
|
||||||
|
if (hour > 23) {
|
||||||
|
hour -= 24; day = parseInt(day)+1; month = parseInt(month);
|
||||||
|
if (month == 2) if (!(year%400)||(!(year%4)&&year%100)) M[2] = 29;
|
||||||
|
if (day > M[month]) {
|
||||||
|
day = 1;
|
||||||
|
month = parseInt(month)+1;
|
||||||
|
if (month > 12) {
|
||||||
|
year=parseInt(year)+1; month = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
month = month.toString();
|
||||||
|
day = day.toString();
|
||||||
|
if (month.length==1) month = "0"+month;
|
||||||
|
if (day.length==1) day = "0"+day;
|
||||||
|
}
|
||||||
|
hour = hour.toString();
|
||||||
|
if (hour.length==1) hour="0"+hour;
|
||||||
|
return year+"-"+month+"-"+day+" "+hour+":"+minute;
|
||||||
|
}
|
||||||
// Get group list
|
// Get group list
|
||||||
$.ajax({ // Get current user type
|
$.ajax({ // Get current user type
|
||||||
url: "/api/user/",
|
url: "/api/user/",
|
||||||
|
@ -33,12 +33,6 @@
|
|||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#nav-left{
|
|
||||||
display: inline;
|
|
||||||
position:relative;
|
|
||||||
float: right;
|
|
||||||
margin-right: 28px;
|
|
||||||
}
|
|
||||||
.section {
|
.section {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
@ -103,20 +97,7 @@
|
|||||||
<a href="/submissions/">提交</a>
|
<a href="/submissions/">提交</a>
|
||||||
<a href="/contests/">比赛</a>
|
<a href="/contests/">比赛</a>
|
||||||
<a href="/groups/">小组</a>
|
<a href="/groups/">小组</a>
|
||||||
<a href="/about/">关于</a>
|
<a href="/about/">关于</a>
|
||||||
<div id="nav-left">
|
|
||||||
{% if request.user.is_authenticated %}
|
|
||||||
<a href="#">{{ request.user.username }}</a>
|
|
||||||
<a href="/logout/">退出</a>
|
|
||||||
{% else %}
|
|
||||||
<a href="/login/">
|
|
||||||
登录
|
|
||||||
</a>
|
|
||||||
<a href="/register/">
|
|
||||||
注册
|
|
||||||
</a>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@ -124,9 +105,9 @@
|
|||||||
<div id="fullpage">
|
<div id="fullpage">
|
||||||
<div class="section" id="section0">
|
<div class="section" id="section0">
|
||||||
<div class="index-section-text animated bounceInUp">
|
<div class="index-section-text animated bounceInUp">
|
||||||
<h1>青岛大学在线评测平台</h1>
|
<h1>青岛大学 Online Judge</h1>
|
||||||
|
|
||||||
<h3>全新面貌,新的开始~</h3>
|
<h3>新的面貌,新的开始~</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="bottom-pointer">↓继续滚动~</div>
|
<div class="bottom-pointer">↓继续滚动~</div>
|
||||||
</div>
|
</div>
|
||||||
@ -156,7 +137,7 @@
|
|||||||
<div class="section-text">
|
<div class="section-text">
|
||||||
<img class="icon" id="img3" src="/static/img/index/m.png">
|
<img class="icon" id="img3" src="/static/img/index/m.png">
|
||||||
|
|
||||||
<h1>自由举办小组赛</h1>
|
<h1>自由举办小组赛(10月上线)</h1>
|
||||||
|
|
||||||
<h3>内部比赛,日常作业,期末考试,通通搞定</h3>
|
<h3>内部比赛,日常作业,期末考试,通通搞定</h3>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user