diff --git a/@vates/types/src/common.mts b/@vates/types/src/common.mts index 88c96c0978..acefa352a4 100644 --- a/@vates/types/src/common.mts +++ b/@vates/types/src/common.mts @@ -772,6 +772,7 @@ export type RawTrafficRule = { ipRange: string direction: TrafficRuleDirection port?: string + priority?: number } type BaseTrafficRule = RawTrafficRule & { diff --git a/@xen-orchestra/web-core/lib/i18n.ts b/@xen-orchestra/web-core/lib/i18n.ts index 8b7ae989a4..f07c35b16f 100644 --- a/@xen-orchestra/web-core/lib/i18n.ts +++ b/@xen-orchestra/web-core/lib/i18n.ts @@ -103,9 +103,11 @@ export const locales: Locales = { }, } +export const FALLBACK_LOCALE = 'en' + export default createI18n({ locale: localStorage.getItem('lang') ?? 'en', - fallbackLocale: 'en', + fallbackLocale: FALLBACK_LOCALE, messages, missing: (locale, key, vm) => { if (!import.meta.env.DEV) { diff --git a/@xen-orchestra/web-core/lib/locales/ar.json b/@xen-orchestra/web-core/lib/locales/ar.json index 41c813788c..4893023c22 100644 --- a/@xen-orchestra/web-core/lib/locales/ar.json +++ b/@xen-orchestra/web-core/lib/locales/ar.json @@ -1241,7 +1241,6 @@ "traffic-rules:error-plugin:check-doc": "وثائق وحدة تحكم SDN", "traffic-rules:format-warning": "خطأ في التكوين: قواعد حركة المرور ليست بالتنسيق المتوقع. يرجى {check-doc} حول كيفية ترحيلها.", "traffic-rules:format-warning:check-doc": "مراجعة أحدث الوثائق", - "traffic-rules:info-message": "ترتيب قواعد حركة المرور قيد التنفيذ. قد يكون السلوك غير مضمون.", "traffic-rules:no-traffic-rules-detected": "لم يتم اكتشاف أي قواعد حركة مرور", "traffic-rules:target-on": "@.capitalize:direction-on", "traffic-rules:xapi-plugin-required": "يتطلب وضع إضافة XAPI", diff --git a/@xen-orchestra/web-core/lib/locales/cs.json b/@xen-orchestra/web-core/lib/locales/cs.json index 903633c410..bbc9235b32 100644 --- a/@xen-orchestra/web-core/lib/locales/cs.json +++ b/@xen-orchestra/web-core/lib/locales/cs.json @@ -1204,7 +1204,6 @@ "traffic-rules:error-plugin:check-doc": "dokumentace k řadiči SDN sítě", "traffic-rules:format-warning": "Chyba nastavení: Pravidla pro provoz nejsou v očekávaném formátu. {check-doc} ohledně toho, jak je převést.", "traffic-rules:format-warning:check-doc": "Podívejte se do neaktuálnější dokumentace", - "traffic-rules:info-message": "Implementování pořadí pravidel pro provoz teprve probíhá. Chování může být nebezpečné.", "traffic-rules:no-traffic-rules-detected": "Nezjištěna žádná pravidla pro provoz", "traffic-rules:xapi-plugin-required": "Vyžaduje režim XAPI zásuvného modulu", "translation-tool": "Nástroj pro překládání", diff --git a/@xen-orchestra/web-core/lib/locales/da.json b/@xen-orchestra/web-core/lib/locales/da.json index af8dddf631..3ae53d53ec 100644 --- a/@xen-orchestra/web-core/lib/locales/da.json +++ b/@xen-orchestra/web-core/lib/locales/da.json @@ -1241,7 +1241,6 @@ "traffic-rules:error-plugin:check-doc": "dokumentationen til SDN-controlleren", "traffic-rules:format-warning": "Konfigurationsfejl: Trafikreglerne er ikke i det forventede format. Du bedes {check-doc} for, hvordan de migreres.", "traffic-rules:format-warning:check-doc": "tjekke den seneste dokumentation", - "traffic-rules:info-message": "Rækkefølge for trafikregler er under implementering. Adfærden kan være uforudsigelig.", "traffic-rules:no-traffic-rules-detected": "Ingen trafikregler registreret", "traffic-rules:target-on": "@.capitalize:direction-on", "traffic-rules:xapi-plugin-required": "Kræver XAPI-plugin-tilstand", diff --git a/@xen-orchestra/web-core/lib/locales/de.json b/@xen-orchestra/web-core/lib/locales/de.json index 611fbbb910..ede76c55ea 100644 --- a/@xen-orchestra/web-core/lib/locales/de.json +++ b/@xen-orchestra/web-core/lib/locales/de.json @@ -887,7 +887,6 @@ "total-used:": "Gesamt genutzt:", "traffic-rule": "Traffic Regel", "traffic-rules": "Traffic Regeln", - "traffic-rules:info-message": "Reihenfolge der Traffic Regeln wird implementiert. Es kann zu unvorgesehenen Verhalten führen.", "traffic-rules:no-traffic-rules-detected": "Keine Traffic Regeln erkannt", "translation-tool": "Übersetzungstool", "trigger": "Trigger", diff --git a/@xen-orchestra/web-core/lib/locales/en.json b/@xen-orchestra/web-core/lib/locales/en.json index e2ad7236a2..1582ae6d31 100644 --- a/@xen-orchestra/web-core/lib/locales/en.json +++ b/@xen-orchestra/web-core/lib/locales/en.json @@ -1131,6 +1131,8 @@ "power-on-mode": "Power on mode", "power-on-vm-for-console": "Power on your VM to access its console", "power-state": "Power state", + "priority": "Priority", + "priority-within": "Priority within {name}", "pro-support": "{name} pro support", "professional-support": "Professional support", "progress": "Progress", @@ -1368,6 +1370,7 @@ "theme-solarized-description": "Precision colors for reduced eye strain", "third-parties": "Third party apps", "this-host": "This host", + "this-rule": "This rule", "this-vm-cant-be-migrated": "This VM can't be migrated", "timeout": "Timeout", "timezone": "Timezone", @@ -1395,8 +1398,9 @@ "traffic-rules:error-plugin:check-doc": "the SDN controller documentation", "traffic-rules:format-warning": "Configuration error: Traffic rules are not in the expected format. Please {check-doc} on how to migrate them.", "traffic-rules:format-warning:check-doc": "check the latest documentation", - "traffic-rules:info-message": "Traffic rules order is being implemented. Behavior may be hazardous.", "traffic-rules:no-traffic-rules-detected": "No traffic rules detected", + "traffic-rules:position-on-network": "{position} rule on this network.", + "traffic-rules:rule-ordinal-suffixes": "one:st, two:nd, few:rd, other:th", "traffic-rules:target-on": "@.capitalize:direction-on", "traffic-rules:xapi-plugin-required": "Requires XAPI plugin mode", "translation-tool": "Translation tool", diff --git a/@xen-orchestra/web-core/lib/locales/fa.json b/@xen-orchestra/web-core/lib/locales/fa.json index 8950fa4e8c..8019c0138d 100644 --- a/@xen-orchestra/web-core/lib/locales/fa.json +++ b/@xen-orchestra/web-core/lib/locales/fa.json @@ -1241,7 +1241,6 @@ "traffic-rules:error-plugin:check-doc": "مستندات کنترلر SDN", "traffic-rules:format-warning": "خطای پیکربندی: قوانین ترافیک در قالب مورد انتظار نیستند. لطفاً برای نحوه مهاجرت آن‌ها {check-doc}.", "traffic-rules:format-warning:check-doc": "آخرین مستندات را بررسی کنید", - "traffic-rules:info-message": "ترتیب قوانین ترافیک در حال پیاده‌سازی است. رفتار ممکن است مخاطره‌آمیز باشد.", "traffic-rules:no-traffic-rules-detected": "هیچ قانون ترافیکی شناسایی نشد", "traffic-rules:target-on": "@.capitalize:direction-on", "traffic-rules:xapi-plugin-required": "نیازمند حالت افزونه XAPI", diff --git a/@xen-orchestra/web-core/lib/locales/fi.json b/@xen-orchestra/web-core/lib/locales/fi.json index 8384257db5..39b917f5d5 100644 --- a/@xen-orchestra/web-core/lib/locales/fi.json +++ b/@xen-orchestra/web-core/lib/locales/fi.json @@ -1241,7 +1241,6 @@ "traffic-rules:error-plugin:check-doc": "SDN-ohjaimen dokumentaatio", "traffic-rules:format-warning": "Määritysvirhe: liikennesäännöt eivät ole odotetussa muodossa. {check-doc}, miten ne siirretään.", "traffic-rules:format-warning:check-doc": "Tarkista uusimmasta dokumentaatiosta", - "traffic-rules:info-message": "Liikennesääntöjen järjestystä ollaan toteuttamassa. Toiminta voi olla arvaamatonta.", "traffic-rules:no-traffic-rules-detected": "Liikennesääntöjä ei havaittu", "traffic-rules:target-on": "@.capitalize:direction-on", "traffic-rules:xapi-plugin-required": "Vaatii XAPI-lisäosatilan", diff --git a/@xen-orchestra/web-core/lib/locales/fr.json b/@xen-orchestra/web-core/lib/locales/fr.json index e3cfd9b191..89a197041b 100644 --- a/@xen-orchestra/web-core/lib/locales/fr.json +++ b/@xen-orchestra/web-core/lib/locales/fr.json @@ -1131,6 +1131,8 @@ "power-on-mode": "Mode d'alimentation", "power-on-vm-for-console": "Allumez votre VM pour accéder à sa console", "power-state": "État d'alimentation", + "priority": "Priorité", + "priority-within": "Priorité dans {name}", "pro-support": "Support pro {name}", "professional-support": "Support professionnel", "progress": "Progression", @@ -1368,6 +1370,7 @@ "theme-solarized-description": "Couleurs précises pour réduire la fatigue oculaire", "third-parties": "Apps tierces", "this-host": "Cet hôte", + "this-rule": "Cette règle", "this-vm-cant-be-migrated": "Cette VM ne peut pas être migrée", "timeout": "Délai d'attente", "timezone": "Fuseau horaire", @@ -1395,8 +1398,9 @@ "traffic-rules:error-plugin:check-doc": "la documentation du contrôleur SDN", "traffic-rules:format-warning": "Erreur de configuration : les règles de trafic ne sont pas au format attendu. Veuillez {check-doc} la plus récente pour savoir comment les migrer.", "traffic-rules:format-warning:check-doc": "consulter la documentation", - "traffic-rules:info-message": "Les règles de trafic sont en cours d'application. Certains comportements peuvent être hasardeux.", "traffic-rules:no-traffic-rules-detected": "Aucune règle de trafic détectée", + "traffic-rules:position-on-network": "{position} règle sur ce réseau.", + "traffic-rules:rule-ordinal-suffixes": "one:re, other:e", "traffic-rules:target-on": "@.capitalize:direction-on", "traffic-rules:xapi-plugin-required": "Nécessite le mode plugin XAPI", "translation-tool": "Outil de traduction", diff --git a/@xen-orchestra/web-core/lib/locales/it.json b/@xen-orchestra/web-core/lib/locales/it.json index ffdc0b39f5..c6a3f760fd 100644 --- a/@xen-orchestra/web-core/lib/locales/it.json +++ b/@xen-orchestra/web-core/lib/locales/it.json @@ -1241,7 +1241,6 @@ "traffic-rules:error-plugin:check-doc": "la documentazione del controller SDN", "traffic-rules:format-warning": "Errore di configurazione: le regole di traffico non sono nel formato previsto. {check-doc} su come migrarle.", "traffic-rules:format-warning:check-doc": "Consulta la documentazione più recente", - "traffic-rules:info-message": "L'ordine delle regole di traffico è in fase di implementazione. Il comportamento potrebbe essere imprevedibile.", "traffic-rules:no-traffic-rules-detected": "Nessuna regola di traffico rilevata", "traffic-rules:target-on": "@.capitalize:direction-on", "traffic-rules:xapi-plugin-required": "Richiede la modalità plugin XAPI", diff --git a/@xen-orchestra/web-core/lib/locales/ja.json b/@xen-orchestra/web-core/lib/locales/ja.json index bf97319226..e3c020cba8 100644 --- a/@xen-orchestra/web-core/lib/locales/ja.json +++ b/@xen-orchestra/web-core/lib/locales/ja.json @@ -1241,7 +1241,6 @@ "traffic-rules:error-plugin:check-doc": "SDN コントローラーのドキュメント", "traffic-rules:format-warning": "設定エラー: トラフィックルールが想定された形式ではありません。移行方法については{check-doc}。", "traffic-rules:format-warning:check-doc": "最新のドキュメントを確認してください", - "traffic-rules:info-message": "トラフィックルールの順序は実装中です。動作が不安定な場合があります。", "traffic-rules:no-traffic-rules-detected": "トラフィックルールは検出されませんでした", "traffic-rules:target-on": "@.capitalize:direction-on", "traffic-rules:xapi-plugin-required": "XAPI プラグインモードが必要です", diff --git a/@xen-orchestra/web-core/lib/locales/ko.json b/@xen-orchestra/web-core/lib/locales/ko.json index 87afb1e916..94c7dd371a 100644 --- a/@xen-orchestra/web-core/lib/locales/ko.json +++ b/@xen-orchestra/web-core/lib/locales/ko.json @@ -1241,7 +1241,6 @@ "traffic-rules:error-plugin:check-doc": "SDN 컨트롤러 문서", "traffic-rules:format-warning": "구성 오류: 트래픽 규칙이 예상된 형식이 아닙니다. 마이그레이션 방법은 {check-doc}.", "traffic-rules:format-warning:check-doc": "최신 문서를 확인하세요", - "traffic-rules:info-message": "트래픽 규칙 순서 기능을 구현 중입니다. 동작이 불안정할 수 있습니다.", "traffic-rules:no-traffic-rules-detected": "감지된 트래픽 규칙 없음", "traffic-rules:target-on": "@.capitalize:direction-on", "traffic-rules:xapi-plugin-required": "XAPI 플러그인 모드 필요", diff --git a/@xen-orchestra/web-core/lib/locales/nb-NO.json b/@xen-orchestra/web-core/lib/locales/nb-NO.json index bba5a3bf96..ede91a7006 100644 --- a/@xen-orchestra/web-core/lib/locales/nb-NO.json +++ b/@xen-orchestra/web-core/lib/locales/nb-NO.json @@ -1241,7 +1241,6 @@ "traffic-rules:error-plugin:check-doc": "dokumentasjonen for SDN-kontrolleren", "traffic-rules:format-warning": "Konfigurasjonsfeil: Trafikkreglene har ikke forventet format. Vennligst {check-doc} om hvordan du migrerer dem.", "traffic-rules:format-warning:check-doc": "se den nyeste dokumentasjonen", - "traffic-rules:info-message": "Rekkefølge for trafikkregler er under implementering. Oppførselen kan være uforutsigbar.", "traffic-rules:no-traffic-rules-detected": "Ingen trafikkregler oppdaget", "traffic-rules:target-on": "@.capitalize:direction-on", "traffic-rules:xapi-plugin-required": "Krever XAPI-plugin-modus", diff --git a/@xen-orchestra/web-core/lib/locales/nl.json b/@xen-orchestra/web-core/lib/locales/nl.json index b3bdb7c02f..7506d1a7d9 100644 --- a/@xen-orchestra/web-core/lib/locales/nl.json +++ b/@xen-orchestra/web-core/lib/locales/nl.json @@ -1171,7 +1171,6 @@ "traffic-rules:error-plugin:check-doc": "de documentatie van de SDN-controller", "traffic-rules:format-warning": "Configuratiefout: De verkeersregels hebben niet de verwachte indeling. Raadpleeg {check-doc} voor informatie over hoe je ze kunt migreren.", "traffic-rules:format-warning:check-doc": "raadpleeg de meest recente documentatie", - "traffic-rules:info-message": "De verkeersregels worden gehandhaafd. Het gedrag kan gevaarlijk zijn.", "traffic-rules:no-traffic-rules-detected": "Er zijn geen verkeersregels gevonden", "traffic-rules:xapi-plugin-required": "Vereist de XAPI-plug-in modus", "translation-tool": "Vertaalprogramma", diff --git a/@xen-orchestra/web-core/lib/locales/pl.json b/@xen-orchestra/web-core/lib/locales/pl.json index 67ea88581f..8bf13c45a2 100644 --- a/@xen-orchestra/web-core/lib/locales/pl.json +++ b/@xen-orchestra/web-core/lib/locales/pl.json @@ -1241,7 +1241,6 @@ "traffic-rules:error-plugin:check-doc": "dokumentację kontrolera SDN", "traffic-rules:format-warning": "Błąd konfiguracji: reguły ruchu nie są w oczekiwanym formacie. {check-doc}, jak je zmigrować.", "traffic-rules:format-warning:check-doc": "Sprawdź w najnowszej dokumentacji", - "traffic-rules:info-message": "Kolejność reguł ruchu jest w trakcie implementacji. Działanie może być nieprzewidywalne.", "traffic-rules:no-traffic-rules-detected": "Nie wykryto reguł ruchu", "traffic-rules:target-on": "@.capitalize:direction-on", "traffic-rules:xapi-plugin-required": "Wymaga trybu wtyczki XAPI", diff --git a/@xen-orchestra/web-core/lib/locales/pt-BR.json b/@xen-orchestra/web-core/lib/locales/pt-BR.json index 3e65907097..a3f81aaf89 100644 --- a/@xen-orchestra/web-core/lib/locales/pt-BR.json +++ b/@xen-orchestra/web-core/lib/locales/pt-BR.json @@ -1241,7 +1241,6 @@ "traffic-rules:error-plugin:check-doc": "a documentação do controlador SDN", "traffic-rules:format-warning": "Erro de configuração: as regras de tráfego não estão no formato esperado. Por favor, {check-doc} sobre como migrá-las.", "traffic-rules:format-warning:check-doc": "consulte a documentação mais recente", - "traffic-rules:info-message": "A ordem das regras de tráfego está sendo implementada. O comportamento pode ser imprevisível.", "traffic-rules:no-traffic-rules-detected": "Nenhuma regra de tráfego detectada", "traffic-rules:target-on": "@.capitalize:direction-on", "traffic-rules:xapi-plugin-required": "Requer o modo de plugin XAPI", diff --git a/@xen-orchestra/web-core/lib/locales/ru.json b/@xen-orchestra/web-core/lib/locales/ru.json index 9be34aac00..5e46e4de8e 100644 --- a/@xen-orchestra/web-core/lib/locales/ru.json +++ b/@xen-orchestra/web-core/lib/locales/ru.json @@ -1241,7 +1241,6 @@ "traffic-rules:error-plugin:check-doc": "документацию SDN-контроллера", "traffic-rules:format-warning": "Ошибка конфигурации: правила для трафика имеют неожиданный формат. Пожалуйста, {check-doc} о том, как их мигрировать.", "traffic-rules:format-warning:check-doc": "ознакомьтесь с последней документацией", - "traffic-rules:info-message": "Порядок правил для трафика находится в разработке. Поведение может быть непредсказуемым.", "traffic-rules:no-traffic-rules-detected": "Правила для трафика не обнаружены", "traffic-rules:target-on": "@.capitalize:direction-on", "traffic-rules:xapi-plugin-required": "Требуется режим плагина XAPI", diff --git a/@xen-orchestra/web-core/lib/locales/sk.json b/@xen-orchestra/web-core/lib/locales/sk.json index 7ee6122bc9..056536a63a 100644 --- a/@xen-orchestra/web-core/lib/locales/sk.json +++ b/@xen-orchestra/web-core/lib/locales/sk.json @@ -1171,7 +1171,6 @@ "traffic-rules:error-plugin:check-doc": "dokumentácia k radiču SDN siete", "traffic-rules:format-warning": "Chyba nastavenia: Pravidlá pre prevádzku nie sú v očakávanom formáte. {check-doc} ohľadom toho, ako ich previesť.", "traffic-rules:format-warning:check-doc": "Pozrite sa do najaktuálnejšej dokumentácie", - "traffic-rules:info-message": "Implementácia poradia pravidiel pre prevádzku ešte prebieha. Chovanie môže byť nebezpečné.", "traffic-rules:no-traffic-rules-detected": "Nezjištěná žiadna pravidla pre prevádzku", "traffic-rules:xapi-plugin-required": "Vyžaduje režim XAPI zásuvného modulu", "translation-tool": "Prekladový nástroj", diff --git a/@xen-orchestra/web-core/lib/locales/sv.json b/@xen-orchestra/web-core/lib/locales/sv.json index 2362804040..5a6481e0d6 100644 --- a/@xen-orchestra/web-core/lib/locales/sv.json +++ b/@xen-orchestra/web-core/lib/locales/sv.json @@ -1090,7 +1090,6 @@ "total-used:": "Totalt använt:", "traffic-rule": "Trafikregel", "traffic-rules": "Trafikregler", - "traffic-rules:info-message": "Trafikreglernas ordning införs. Beteendet kan vara farligt.", "traffic-rules:no-traffic-rules-detected": "Inga trafikregler upptäckta", "translation-tool": "Översättningsverktyg", "trigger": "Utlösare", diff --git a/@xen-orchestra/web-core/lib/locales/tr.json b/@xen-orchestra/web-core/lib/locales/tr.json index e4926c7125..b03001fe82 100644 --- a/@xen-orchestra/web-core/lib/locales/tr.json +++ b/@xen-orchestra/web-core/lib/locales/tr.json @@ -1161,7 +1161,6 @@ "traffic-rules:error-plugin:check-doc": "SDN denetleyicisi belgelerine", "traffic-rules:format-warning": "Yapılandırma hatası: Trafik kuralları beklenen biçimde değil. Bunları nasıl taşıyacağınızı öğrenmek için lütfen {check-doc}.", "traffic-rules:format-warning:check-doc": "en son belgelere bakın", - "traffic-rules:info-message": "Trafik kurallarının sırası henüz uygulanıyor. Davranış riskli olabilir.", "traffic-rules:no-traffic-rules-detected": "Trafik kuralı bulunamadı", "traffic-rules:xapi-plugin-required": "XAPI eklenti modu gerekir", "translation-tool": "Çeviri aracı", diff --git a/@xen-orchestra/web-core/lib/locales/uk.json b/@xen-orchestra/web-core/lib/locales/uk.json index b65092ca03..7af7eacc54 100644 --- a/@xen-orchestra/web-core/lib/locales/uk.json +++ b/@xen-orchestra/web-core/lib/locales/uk.json @@ -1241,7 +1241,6 @@ "traffic-rules:error-plugin:check-doc": "документацію контролера SDN", "traffic-rules:format-warning": "Помилка конфігурації: правила трафіку мають неочікуваний формат. Будь ласка, {check-doc}, щоб дізнатися, як їх мігрувати.", "traffic-rules:format-warning:check-doc": "перегляньте найновішу документацію", - "traffic-rules:info-message": "Порядок правил трафіку ще впроваджується. Поведінка може бути непередбачуваною.", "traffic-rules:no-traffic-rules-detected": "Правил трафіку не виявлено", "traffic-rules:target-on": "@.capitalize:direction-on", "traffic-rules:xapi-plugin-required": "Потрібен режим плагіна XAPI", diff --git a/@xen-orchestra/web-core/lib/locales/zh-Hans.json b/@xen-orchestra/web-core/lib/locales/zh-Hans.json index 0baac46873..724be75854 100644 --- a/@xen-orchestra/web-core/lib/locales/zh-Hans.json +++ b/@xen-orchestra/web-core/lib/locales/zh-Hans.json @@ -1171,7 +1171,6 @@ "traffic-rules:error-plugin:check-doc": "SDN控制器文档", "traffic-rules:format-warning": "配置错误:流量规则格式异常,请参考{check-doc}完成迁移。", "traffic-rules:format-warning:check-doc": "最新文档", - "traffic-rules:info-message": "流量规则顺序正在生效,行为可能存在异常。", "traffic-rules:no-traffic-rules-detected": "未检测到流量规则", "traffic-rules:xapi-plugin-required": "需要XAPI插件模式", "translation-tool": "翻译工具", diff --git a/@xen-orchestra/web-core/lib/tables/column-sets/traffic-rules-columns.ts b/@xen-orchestra/web-core/lib/tables/column-sets/traffic-rules-columns.ts index 01ec4f6771..6301439bc8 100644 --- a/@xen-orchestra/web-core/lib/tables/column-sets/traffic-rules-columns.ts +++ b/@xen-orchestra/web-core/lib/tables/column-sets/traffic-rules-columns.ts @@ -1,7 +1,7 @@ import { defineColumns } from '@core/packages/table/define-columns.ts' import { useActionColumn } from '@core/tables/column-definitions/action-column.ts' import { useDoubleLinkColumn } from '@core/tables/column-definitions/double-link-column.ts' -import { useNumberColumn } from '@core/tables/column-definitions/number-column.ts' +import { useLinkColumn } from '@core/tables/column-definitions/link-column.ts' import { useTagColumn } from '@core/tables/column-definitions/tag-column.ts' import { useTextColumn } from '@core/tables/column-definitions/text-column.ts' import { useTruncatedTextColumn } from '@core/tables/column-definitions/truncated-text-column.ts' @@ -11,7 +11,8 @@ export const useTrafficRulesColumns = defineColumns(() => { const { t } = useI18n() return { - order: useNumberColumn(), + network: useLinkColumn({ headerLabel: () => t('network') }), + priority: useTextColumn({ headerLabel: () => t('priority') }), policy: useTagColumn({ headerLabel: () => t('policy') }), protocol: useTextColumn({ headerLabel: () => t('protocol:port'), diff --git a/@xen-orchestra/web/src/modules/traffic-rules/components/TrafficRulesTable.vue b/@xen-orchestra/web/src/modules/traffic-rules/components/TrafficRulesTable.vue index 009d4a2d11..e123d254c0 100644 --- a/@xen-orchestra/web/src/modules/traffic-rules/components/TrafficRulesTable.vue +++ b/@xen-orchestra/web/src/modules/traffic-rules/components/TrafficRulesTable.vue @@ -6,11 +6,10 @@ - {{ t('traffic-rules:info-message') }} @@ -19,7 +18,7 @@ @@ -27,18 +26,14 @@
- + - + @@ -47,13 +42,16 @@
- - diff --git a/@xen-orchestra/web/src/modules/traffic-rules/components/list/panel/cards/TrafficRuleSummaryCard.vue b/@xen-orchestra/web/src/modules/traffic-rules/components/list/panel/cards/TrafficRuleSummaryCard.vue index c20c0e6a11..cecd8db9a5 100644 --- a/@xen-orchestra/web/src/modules/traffic-rules/components/list/panel/cards/TrafficRuleSummaryCard.vue +++ b/@xen-orchestra/web/src/modules/traffic-rules/components/list/panel/cards/TrafficRuleSummaryCard.vue @@ -17,7 +17,7 @@ - + @@ -19,6 +19,7 @@ import { useXoPoolCollection } from '@/modules/pool/remote-resources/use-xo-pool import TrafficRulesSidePanel from '@/modules/traffic-rules/components/list/panel/TrafficRulesSidePanel.vue' import TrafficRulesTable from '@/modules/traffic-rules/components/TrafficRulesTable.vue' import { useTrafficRules } from '@/modules/traffic-rules/composables/traffic-rules.composable.ts' +import type { RankedTrafficRule } from '@/modules/traffic-rules/types.ts' import { type FrontXoVif } from '@/modules/vif/remote-resources/use-xo-vif-collection.ts' import { useXoVmCollection } from '@/modules/vm/remote-resources/use-xo-vm-collection.ts' import VtsContentSidePanel from '@core/components/layout/VtsContentSidePanel.vue' @@ -26,7 +27,6 @@ import VtsStateHero from '@core/components/state-hero/VtsStateHero.vue' import UiCard from '@core/components/ui/card/UiCard.vue' import UiLink from '@core/components/ui/link/UiLink.vue' import { useRouteQuery } from '@core/composables/route-query.composable.ts' -import type { TrafficRule } from '@vates/types' import { useI18n } from 'vue-i18n' const { vif } = defineProps<{ vif: FrontXoVif }>() @@ -40,7 +40,7 @@ const { areVmsReady } = useXoVmCollection() const { trafficRules } = useTrafficRules(() => [vif], []) -const selectedRule = useRouteQuery('id', { +const selectedRule = useRouteQuery('id', { toData: id => trafficRules.value.find(rule => rule.id === id), toQuery: rule => rule?.id ?? '', }) diff --git a/@xen-orchestra/web/src/test/create-traffic-rule.ts b/@xen-orchestra/web/src/test/create-traffic-rule.ts new file mode 100644 index 0000000000..62b3aac6f8 --- /dev/null +++ b/@xen-orchestra/web/src/test/create-traffic-rule.ts @@ -0,0 +1,19 @@ +import type { TrafficRule, XoNetwork } from '@vates/types' + +/** + * Builds a fully-populated network `TrafficRule` for use in tests. Pass `overrides` to + * tweak only the fields relevant to the case under test. + */ +export function createTrafficRule(overrides: Partial = {}): TrafficRule { + return { + id: 'network:network-1:0', + type: 'network', + sourceId: 'network-1' as XoNetwork['id'], + networkId: 'network-1' as XoNetwork['id'], + allow: true, + protocol: 'TCP', + ipRange: '192.168.1.0/24', + direction: 'from/to', + ...overrides, + } as TrafficRule +} diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index 1e834df945..a12fc3c409 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -15,12 +15,13 @@ - [Side panels] Values stay next to their label when they fit and move below it otherwise, fields with several values (IP addresses, report recipients…) get a copy button per value and a "Copy all" action, and rows, links and statuses are more evenly spaced and sized (PR [#10733](https://github.com/vatesfr/xen-orchestra/pull/10733)) - [Treeview] A more compact tree, so that names get more room: lower rows running edge to edge and a smaller indent per level; hovering a quick actions button no longer highlights its whole row (PR [#10727](https://github.com/vatesfr/xen-orchestra/pull/10727)) - [Pool/Network] Add network dedicated page, with General and PIFs tabs (PR [#10704](https://github.com/vatesfr/xen-orchestra/pull/10704)) +- [Pool/Traffic rules] Display traffic rules by priority within their network (PR [#10688](https://github.com/vatesfr/xen-orchestra/pull/10688)) ### Bug fixes > Users must be able to say: "I had this issue, happy to know it's fixed" -- [XO6/Pools] Pool side panel now shows the same pool name, UUID and icon as the pools table, and keeps the pool card when the pool is disconnected or unreachable (PR [#10714](https://github.com/vatesfr/xen-orchestra/pull/10714)) +- [Pools] Pool side panel now shows the same pool name, UUID and icon as the pools table, and keeps the pool card when the pool is disconnected or unreachable (PR [#10714](https://github.com/vatesfr/xen-orchestra/pull/10714)) ### Packages to release