polling
This commit is contained in:
parent
db507fb0df
commit
2ce877a4dd
@ -5,7 +5,7 @@ from SprintLib.BaseView import BaseView, AccessError
|
|||||||
class CheckersView(BaseView):
|
class CheckersView(BaseView):
|
||||||
required_login = True
|
required_login = True
|
||||||
view_file = "checkers.html"
|
view_file = "checkers.html"
|
||||||
endpoint = "admin/checkers"
|
endpoint = "polling/admin/checkers"
|
||||||
set: Set
|
set: Set
|
||||||
|
|
||||||
def pre_handle(self):
|
def pre_handle(self):
|
||||||
|
@ -7,7 +7,7 @@ from SprintLib.BaseView import BaseView, AccessError
|
|||||||
class SolutionsTableView(BaseView):
|
class SolutionsTableView(BaseView):
|
||||||
view_file = "solutions_table.html"
|
view_file = "solutions_table.html"
|
||||||
required_login = True
|
required_login = True
|
||||||
endpoint = "solutions_table"
|
endpoint = "polling/solutions_table"
|
||||||
page_size = 20
|
page_size = 20
|
||||||
page = None
|
page = None
|
||||||
set: Optional[Set] = None
|
set: Optional[Set] = None
|
||||||
|
@ -120,6 +120,23 @@ services:
|
|||||||
parallelism: 1
|
parallelism: 1
|
||||||
order: start-first
|
order: start-first
|
||||||
|
|
||||||
|
polling:
|
||||||
|
image: mathwave/sprint-repo:sprint
|
||||||
|
networks:
|
||||||
|
- net
|
||||||
|
environment:
|
||||||
|
DB_PASSWORD: $DB_PASSWORD
|
||||||
|
DEBUG: $DEBUG
|
||||||
|
TELEGRAM_TOKEN: $TELEGRAM_TOKEN
|
||||||
|
command: ./manage.py runserver 0.0.0.0:7998 --noreload
|
||||||
|
deploy:
|
||||||
|
mode: replicated
|
||||||
|
restart_policy:
|
||||||
|
condition: any
|
||||||
|
update_config:
|
||||||
|
parallelism: 1
|
||||||
|
order: start-first
|
||||||
|
|
||||||
storage:
|
storage:
|
||||||
image: mathwave/sprint-repo:sprint
|
image: mathwave/sprint-repo:sprint
|
||||||
networks:
|
networks:
|
||||||
|
@ -13,6 +13,10 @@ http {
|
|||||||
proxy_pass http://checker:7999/checker/;
|
proxy_pass http://checker:7999/checker/;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
location /polling/ {
|
||||||
|
proxy_pass http://polling:7998/polling/;
|
||||||
|
}
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://web:8000/;
|
proxy_pass http://web:8000/;
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
elem.hidden = !elem.hidden;
|
elem.hidden = !elem.hidden;
|
||||||
}
|
}
|
||||||
function doPoll() {
|
function doPoll() {
|
||||||
jQuery.get('/admin/checkers?set_id={{ set.id }}', function(data) {
|
jQuery.get('/polling/admin/checkers?set_id={{ set.id }}', function(data) {
|
||||||
var e = document.getElementById('checkers');
|
var e = document.getElementById('checkers');
|
||||||
if (saved_data.length != data.length) {
|
if (saved_data.length != data.length) {
|
||||||
saved_data = data;
|
saved_data = data;
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
page = number;
|
page = number;
|
||||||
}
|
}
|
||||||
function doPoll() {
|
function doPoll() {
|
||||||
jQuery.get('/solutions_table?{{ query }}&teacher=true&page=' + page.toString(), function(data) {
|
jQuery.get('/polling/solutions_table?{{ query }}&teacher=true&page=' + page.toString(), function(data) {
|
||||||
var e = document.getElementById('solutions');
|
var e = document.getElementById('solutions');
|
||||||
if (e.innerHTML !== data)
|
if (e.innerHTML !== data)
|
||||||
e.innerHTML = data;
|
e.innerHTML = data;
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
page = number;
|
page = number;
|
||||||
}
|
}
|
||||||
function doPoll() {
|
function doPoll() {
|
||||||
jQuery.get('/solutions_table?{% if in_set %}setTask_id={{ setTask.id }}{% else %}task_id={{ task.id }}{% endif %}&page=' + page.toString(), function(data) {
|
jQuery.get('/polling/solutions_table?{% if in_set %}setTask_id={{ setTask.id }}{% else %}task_id={{ task.id }}{% endif %}&page=' + page.toString(), function(data) {
|
||||||
var e = document.getElementById('solutions');
|
var e = document.getElementById('solutions');
|
||||||
if (e.innerHTML !== data)
|
if (e.innerHTML !== data)
|
||||||
e.innerHTML = data;
|
e.innerHTML = data;
|
||||||
|
Loading…
Reference in New Issue
Block a user