diff --git a/Main/views/CheckersView.py b/Main/views/CheckersView.py index e2e5217..f022bd6 100644 --- a/Main/views/CheckersView.py +++ b/Main/views/CheckersView.py @@ -5,7 +5,7 @@ from SprintLib.BaseView import BaseView, AccessError class CheckersView(BaseView): required_login = True view_file = "checkers.html" - endpoint = "admin/checkers" + endpoint = "polling/admin/checkers" set: Set def pre_handle(self): diff --git a/Main/views/SolutionsTableView.py b/Main/views/SolutionsTableView.py index 90b3a73..3f2d247 100644 --- a/Main/views/SolutionsTableView.py +++ b/Main/views/SolutionsTableView.py @@ -7,7 +7,7 @@ from SprintLib.BaseView import BaseView, AccessError class SolutionsTableView(BaseView): view_file = "solutions_table.html" required_login = True - endpoint = "solutions_table" + endpoint = "polling/solutions_table" page_size = 20 page = None set: Optional[Set] = None diff --git a/docker-compose-deploy.yaml b/docker-compose-deploy.yaml index ac3abde..b00b0fb 100644 --- a/docker-compose-deploy.yaml +++ b/docker-compose-deploy.yaml @@ -120,6 +120,23 @@ services: parallelism: 1 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: image: mathwave/sprint-repo:sprint networks: diff --git a/nginx/nginx.conf b/nginx/nginx.conf index df6c686..3e89ac9 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -13,6 +13,10 @@ http { proxy_pass http://checker:7999/checker/; } + location /polling/ { + proxy_pass http://polling:7998/polling/; + } + location / { proxy_pass http://web:8000/; } diff --git a/templates/set_settings.html b/templates/set_settings.html index 124ea74..0b4152d 100644 --- a/templates/set_settings.html +++ b/templates/set_settings.html @@ -9,7 +9,7 @@ elem.hidden = !elem.hidden; } 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'); if (saved_data.length != data.length) { saved_data = data; diff --git a/templates/solutions.html b/templates/solutions.html index 560de2a..bd8e30e 100644 --- a/templates/solutions.html +++ b/templates/solutions.html @@ -6,7 +6,7 @@ page = number; } 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'); if (e.innerHTML !== data) e.innerHTML = data; diff --git a/templates/task.html b/templates/task.html index e040993..a79a8b5 100644 --- a/templates/task.html +++ b/templates/task.html @@ -26,7 +26,7 @@ page = number; } 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'); if (e.innerHTML !== data) e.innerHTML = data;