diff --git a/locale/tr/LC_MESSAGES/django.mo b/locale/tr/LC_MESSAGES/django.mo index a4f64b5c..4736eb82 100644 Binary files a/locale/tr/LC_MESSAGES/django.mo and b/locale/tr/LC_MESSAGES/django.mo differ diff --git a/locale/tr/LC_MESSAGES/django.po b/locale/tr/LC_MESSAGES/django.po index 0a8cf168..2674c57d 100644 --- a/locale/tr/LC_MESSAGES/django.po +++ b/locale/tr/LC_MESSAGES/django.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-11-02 20:06+0000\n" +"POT-Creation-Date: 2026-11-02 20:32+0000\n" "PO-Revision-Date: 2020-11-04 12:00+0000\n" "Last-Translator: catborise , 2020\n" "Language-Team: Turkish (https://www.transifex.com/catborise/teams/110663/" @@ -103,6 +103,7 @@ msgstr "bir yıl içinde" #: admin/templates/admin/user_form.html:16 #: admin/templates/admin/user_list.html:58 #: operations/templates/operations/jobs.html:15 +#: operations/templatetags/operations.py:91 msgid "never" msgstr "hiçbir zaman" @@ -290,6 +291,7 @@ msgstr "Parola Değiştir" #: nwfilters/templates/create_nwfilter_block.html:33 #: nwfilters/templates/nwfilter.html:178 nwfilters/templates/nwfilters.html:93 #: operations/templates/operations/job.html:31 +#: operations/templatetags/operations.py:83 #: storages/templates/create_stg_block.html:183 #: storages/templates/create_stg_vol_block.html:35 #: storages/templates/create_stg_vol_block.html:68 @@ -3596,6 +3598,7 @@ msgid "OS details" msgstr "İşletim sistemi ayrıntıları" #: instances/templates/instance.html:39 +#: operations/templatetags/operations.py:85 msgid "Refresh" msgstr "Yenile" @@ -7435,6 +7438,11 @@ msgstr "" "Harfler, rakamlar, nokta, tire ve alt çizgi. Kopya, filtrenin kurallarını ve " "başvurularını içerir." +#: operations/api/serializers.py:35 +#, python-format +msgid "%(phase)s (over its time limit)" +msgstr "%(phase)s (süre sınırını aştı)" + #: operations/templates/operations/job.html:11 #: operations/templates/operations/jobs.html:7 #: operations/templates/operations/jobs.html:9 @@ -7509,6 +7517,7 @@ msgid "What you checked" msgstr "Neyi kontrol ettiniz" #: operations/templates/operations/jobs.html:14 +#: operations/templatetags/operations.py:90 msgid "Worker unavailable, last seen" msgstr "İşçi kullanılamıyor, son görülme" @@ -7586,6 +7595,36 @@ msgid_plural "%(count)d seconds" msgstr[0] "%(count)d saniye" msgstr[1] "%(count)d saniye" +#: operations/templatetags/operations.py:84 +msgctxt "verb" +msgid "Open" +msgstr "Aç" + +#: operations/templatetags/operations.py:86 +msgid "Dismiss" +msgstr "Kapat" + +#: operations/templatetags/operations.py:87 +msgid "Finishing…" +msgstr "Bitiriliyor…" + +#: operations/templatetags/operations.py:88 +msgid "Files not removed:" +msgstr "Silinmeyen dosyalar:" + +#: operations/templatetags/operations.py:89 +msgid "A short operation is in progress." +msgstr "Kısa bir işlem sürüyor." + +#: operations/templatetags/operations.py:92 +#, python-format +msgid "Cancel failed (HTTP %(status)s)." +msgstr "İptal edilemedi (HTTP %(status)s)." + +#: operations/templatetags/operations.py:93 +msgid "Cancel failed: the server could not be reached." +msgstr "İptal edilemedi: sunucuya ulaşılamadı." + #: operations/utils.py:52 msgid "The host of this virtual machine cannot be reached right now." msgstr "Bu sanal makinenin sunucusuna şu anda ulaşılamıyor." diff --git a/locale/zh/LC_MESSAGES/django.mo b/locale/zh/LC_MESSAGES/django.mo index d403fe8f..b0b09b55 100644 Binary files a/locale/zh/LC_MESSAGES/django.mo and b/locale/zh/LC_MESSAGES/django.mo differ diff --git a/locale/zh/LC_MESSAGES/django.po b/locale/zh/LC_MESSAGES/django.po index 1849d5f1..52be3c82 100644 --- a/locale/zh/LC_MESSAGES/django.po +++ b/locale/zh/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-11-02 20:06+0000\n" +"POT-Creation-Date: 2026-11-02 20:32+0000\n" "PO-Revision-Date: \n" "Last-Translator: \n" "Language-Team: \n" @@ -99,6 +99,7 @@ msgstr "一年后" #: admin/templates/admin/user_form.html:16 #: admin/templates/admin/user_list.html:58 #: operations/templates/operations/jobs.html:15 +#: operations/templatetags/operations.py:91 msgid "never" msgstr "永不" @@ -286,6 +287,7 @@ msgstr "修改密码" #: nwfilters/templates/create_nwfilter_block.html:33 #: nwfilters/templates/nwfilter.html:178 nwfilters/templates/nwfilters.html:93 #: operations/templates/operations/job.html:31 +#: operations/templatetags/operations.py:83 #: storages/templates/create_stg_block.html:183 #: storages/templates/create_stg_vol_block.html:35 #: storages/templates/create_stg_vol_block.html:68 @@ -3498,6 +3500,7 @@ msgid "OS details" msgstr "操作系统详情" #: instances/templates/instance.html:39 +#: operations/templatetags/operations.py:85 msgid "Refresh" msgstr "刷新" @@ -7120,6 +7123,11 @@ msgid "" "rules and references." msgstr "字母、数字、点、短横线和下划线。副本包含该过滤器的规则和引用。" +#: operations/api/serializers.py:35 +#, python-format +msgid "%(phase)s (over its time limit)" +msgstr "%(phase)s(已超出时间限制)" + #: operations/templates/operations/job.html:11 #: operations/templates/operations/jobs.html:7 #: operations/templates/operations/jobs.html:9 @@ -7192,6 +7200,7 @@ msgid "What you checked" msgstr "检查内容" #: operations/templates/operations/jobs.html:14 +#: operations/templatetags/operations.py:90 msgid "Worker unavailable, last seen" msgstr "工作进程不可用,最后在线时间" @@ -7268,6 +7277,36 @@ msgid "%(count)d second" msgid_plural "%(count)d seconds" msgstr[0] "%(count)d 秒" +#: operations/templatetags/operations.py:84 +msgctxt "verb" +msgid "Open" +msgstr "打开" + +#: operations/templatetags/operations.py:86 +msgid "Dismiss" +msgstr "关闭" + +#: operations/templatetags/operations.py:87 +msgid "Finishing…" +msgstr "即将完成…" + +#: operations/templatetags/operations.py:88 +msgid "Files not removed:" +msgstr "未删除的文件:" + +#: operations/templatetags/operations.py:89 +msgid "A short operation is in progress." +msgstr "有一个短操作正在进行。" + +#: operations/templatetags/operations.py:92 +#, python-format +msgid "Cancel failed (HTTP %(status)s)." +msgstr "取消失败(HTTP %(status)s)。" + +#: operations/templatetags/operations.py:93 +msgid "Cancel failed: the server could not be reached." +msgstr "取消失败:无法连接到服务器。" + #: operations/utils.py:52 msgid "The host of this virtual machine cannot be reached right now." msgstr "当前无法连接此虚拟机所在的主机。" diff --git a/operations/api/serializers.py b/operations/api/serializers.py index 39079a92..3e175ea1 100644 --- a/operations/api/serializers.py +++ b/operations/api/serializers.py @@ -1,3 +1,6 @@ +from datetime import timedelta + +from django.utils import timezone from django.utils.translation import gettext as _ from rest_framework import serializers @@ -8,6 +11,7 @@ from operations.utils import shown_label class OperationSerializer(serializers.ModelSerializer): label = serializers.SerializerMethodField() + phase = serializers.SerializerMethodField() resource_label = serializers.SerializerMethodField() cancellable = serializers.SerializerMethodField() in_request = serializers.SerializerMethodField() @@ -22,6 +26,15 @@ class OperationSerializer(serializers.ModelSerializer): def get_label(self, op) -> str: return str(_(label_of(op.kind))) + def get_phase(self, op) -> str: + """The phase in the viewer's language; a job running past its time + limit says so (one that can be cancelled is cancelled instead).""" + phase = _(op.phase) if op.phase else "" + if op.state == Operation.RUNNING and op.time_limit and op.started_at \ + and timezone.now() - op.started_at > timedelta(seconds=op.time_limit): + return (_("%(phase)s (over its time limit)") % {"phase": phase}).strip() + return phase + def get_resource_label(self, op) -> str: return shown_label(op, self.context["request"].user) diff --git a/operations/static/operations/job_panel.js b/operations/static/operations/job_panel.js index 3353d33f..d963c06d 100644 --- a/operations/static/operations/job_panel.js +++ b/operations/static/operations/job_panel.js @@ -10,7 +10,9 @@ var JOB_STATE_COLORS = { failed: "danger", cancelled: "secondary", uncertain: "warning", }; -function jobPanel(element, urls, csrfToken, initialIds) { +// states: the label of each state; text: the panel's own texts, both in the +// page's language (job_panel_script) +function jobPanel(element, urls, csrfToken, initialIds, states, text) { var shown = {}; // id -> job in the last active list var pending = {}; // id -> true: left the list (or just submitted), outcome not fetched yet var inflight = {}; // id -> true: its outcome is being fetched @@ -41,7 +43,7 @@ function jobPanel(element, urls, csrfToken, initialIds) { return '
' + (finishing ? "Finishing\u2026" : pct + "%") + "
"; + + (finishing ? 100 : pct) + '%">' + (finishing ? esc(text.finishing) : pct + "%") + ""; } // label, state badge and muted phase on one line, the buttons on its right @@ -49,7 +51,7 @@ function jobPanel(element, urls, csrfToken, initialIds) { return '
' + esc(label) + "" + '' + esc(state) + "" + + (JOB_STATE_COLORS[state] === "warning" ? " text-dark" : "") + '">' + esc(states[state] || state) + "" + (phase ? '' + esc(phase) + "" : "") + (buttons ? '
' + buttons + "
" : "") + "
"; } @@ -64,7 +66,7 @@ function jobPanel(element, urls, csrfToken, initialIds) { function jobHtml(job) { var cancel = job.cancellable ? '" : ""; + + esc(job.id) + '"' + (cancelling[job.id] ? " disabled" : "") + ">" + esc(text.cancel) + "" : ""; // an uncertain job keeps its claims, so it stays in the list with its error return alertHtml(job.state, header(job.label, job.state, job.phase, cancel) + errorHtml(job) + bar(job)); } @@ -72,26 +74,26 @@ function jobPanel(element, urls, csrfToken, initialIds) { function outcomeHtml(job) { var left = (job.result && job.result.left_behind) || []; var note = job.result && job.result.warning ? '
' + esc(job.result.warning) + "
" : ""; - var warn = note + (left.length ? '
Files not removed: