diff --git a/comm/server/main.py b/comm/server/main.py index 274b61f16819c1b71f54435d811c04842ca49609..4caed053b1ba2ad0a249991d042d43c93c86d0bc 100644 --- a/comm/server/main.py +++ b/comm/server/main.py @@ -114,6 +114,9 @@ def update_answer_list(qname): with open(v2, "r") as fp: answer_log = json.load(fp) questions[qname]['answers'][json_name] = answer_log + + if answer_log['solved'] == "True": + is_solved = True if questions[qname]['answer'] == answer_log['answer']: questions[qname]['best_json'] = json_name @@ -122,7 +125,6 @@ def update_answer_list(qname): if answer_log['solver'] in questions[qname]['solver']: if answer_log['solved'] == "True": questions[qname]['solver'][answer_log['solver']] = "Solved" - is_solved = True else: questions[qname]['solver'][answer_log['solver']] = "DNS" @@ -133,7 +135,10 @@ def update_answer_list(qname): def before_request(): global app_args - g.local_mode = (request.remote_addr == "127.0.0.1") + if app_args["force_local_mode"]: + g.local_mode = True + else: + g.local_mode = (request.remote_addr in ["127.0.0.1", "::1"]) @app.route("/post", methods=["POST"]) def post(): @@ -586,7 +591,7 @@ def question_status(): update_answer_list(qname) qdata = questions[qname] - return render_template("part_question_status.html", qname=qname, qdata=qdata, solvers=clients["solver"]) + return render_template("part_question_status.html", qname=qname, qdata=qdata, solvers=clients["solver"], localmode=g.local_mode) @app.route('/ws') def ws(): @@ -658,6 +663,7 @@ if __name__ == "__main__": parser.add_argument("-a", "--adccli", action="store", type=str, default="./adccli.json", help="Path to the ADCCLI configuration json file.") parser.add_argument("-q", "--question", action="store", type=str, default="./problems", help="Path to the question folder.") parser.add_argument("-o", "--out", action="store", type=str, default="./answers", help="Path to the output folder.") + parser.add_argument("--force-local-mode", action="store_true", default=False, help="Apply local mode view to all clients.") parser.add_argument("--debug", action="store_true", default=False, help="Debug mode.") args = vars(parser.parse_args()) app_args = args diff --git a/comm/server/static/css/pynq-manager.css b/comm/server/static/css/pynq-manager.css index 72f5dc78a1e14d5d59bb69adf29bb5575b154148..d4e326cc6b9b50057c44888b7d02978af3e84dbb 100644 --- a/comm/server/static/css/pynq-manager.css +++ b/comm/server/static/css/pynq-manager.css @@ -1,6 +1,4 @@ html, body{ - /*width: 800px;*/ - /*height: 500px;*/ font-size: 11px; overflow: hidden; } @@ -10,7 +8,7 @@ body{ /* scrollbar settings */ ::-webkit-scrollbar{ - width: 25px; + width: 20px; border: 1px solid rgba(0, 0, 50, .2); } ::-webkit-scrollbar-thumb{ @@ -18,7 +16,7 @@ body{ } #question-table-wrapper{ - height: 300px; + height: calc(100vh - 50px); overflow-y: scroll; overflow-x: hidden; } @@ -45,7 +43,7 @@ body{ } #client-control-pane{ - height: 330px; + height: calc(100vh - 20px); overflow-y: scroll; } diff --git a/comm/server/templates/index.html b/comm/server/templates/index.html index bb8456d24c04405086c733e5a005ff0416e2a4f1..112c8f068492203682a5264cde94944aec386875 100644 --- a/comm/server/templates/index.html +++ b/comm/server/templates/index.html @@ -15,9 +15,9 @@
-
+
-
+

問題一覧

  システム状況 diff --git a/comm/server/templates/part_client_table.html b/comm/server/templates/part_client_table.html index 7386b49fabcd3f66e5f4b18208e50f950b937557..d71fe09a53bce6ddf94d3da84b0e2e6db5dff858 100644 --- a/comm/server/templates/part_client_table.html +++ b/comm/server/templates/part_client_table.html @@ -9,12 +9,13 @@ Viewer Mode {% endif %}

+{% if local_mode %}

自動運営システム

- -
+ +{% endif %}

クライアント

diff --git a/comm/server/templates/part_question_status.html b/comm/server/templates/part_question_status.html index 997194f385e4ae1742d98838e35dfbe722e325b8..738df97e1d249021ae7c1ff1978b472d6ecfe8c4 100644 --- a/comm/server/templates/part_question_status.html +++ b/comm/server/templates/part_question_status.html @@ -1,6 +1,7 @@

【{{qname}}】

+ {% if localmode %}

@@ -9,6 +10,9 @@

+ {% else %} + [View Only] + {% endif %}

処理結果

@@ -44,20 +48,22 @@
{% for k, v in qdata.answers.items() %} - {% if qdata.best_json == k %} + {% if (qdata.best_json == k) and (v.answer != "") %} {% else %} {% endif %} - + {% endfor %}
Score
{{v.timestamp}} {{v.solver}}{{v.nlcheck}} + {% if v.nlcheck == -1 %} + Not solved + {% else %} + {{v.nlcheck}} + {% endif %} +
-

状況:{{qdata.status}}

-

結果

-

クライアント:{{qdata.answer.client}}

-
{{qdata.answer.answer}}