diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/i18n.de.json b/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/i18n.de.json index 5a6ffbde7b7..0c27f46af50 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/i18n.de.json +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/i18n.de.json @@ -3,6 +3,10 @@ "scheduledtasks": { "label": "Geplante Tasks", "no_scheduledtasks": "Keine geplanten Aufgaben.", + "custom": { + "title": "Benutzerdefinierte Trigger", + "trigger": "Trigger" + }, "cron": { "expression": "Expression", "runnable": "Runnable", diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/i18n.en.json b/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/i18n.en.json index 9f6d3ff51f5..c3b437c11ae 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/i18n.en.json +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/i18n.en.json @@ -6,6 +6,10 @@ "last_execution": "Last Execution", "last_execution_status": "Last Execution State", "next_execution": "Next Execution", + "custom": { + "title": "Custom Triggers", + "trigger": "Trigger" + }, "cron": { "expression": "Expression", "runnable": "Runnable", diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/i18n.es.json b/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/i18n.es.json index 56c6648ebbe..5cc28b71da6 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/i18n.es.json +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/i18n.es.json @@ -3,6 +3,10 @@ "scheduledtasks": { "label": "Tareas programadas", "no_scheduledtasks": "No se encontraron tareas programadas.", + "custom": { + "title": "Disparadores personalizados", + "trigger": "Disparador" + }, "cron": { "expression": "Expresión", "runnable": "Ejecutable", diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/i18n.fr.json b/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/i18n.fr.json index c1db32fd0ec..9416337e4af 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/i18n.fr.json +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/i18n.fr.json @@ -3,6 +3,10 @@ "scheduledtasks": { "label": "Tâches programmées", "no_scheduledtasks": "Aucune tâches présente.", + "custom": { + "title": "Déclencheurs personnalisés", + "trigger": "Déclencheur" + }, "cron": { "expression": "Expression", "runnable": "Exécutable", diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/i18n.is.json b/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/i18n.is.json index 05fa0ce2779..c2cdf7424f7 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/i18n.is.json +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/i18n.is.json @@ -3,6 +3,10 @@ "scheduledtasks": { "label": "Fastsett verkefni", "no_scheduledtasks": "Engin fastsett verkefni", + "custom": { + "title": "Sérsniðnir kveikjar", + "trigger": "Kveikja" + }, "cron": { "expression": "Expression", "runnable": "Runnable", diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/i18n.ko.json b/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/i18n.ko.json index 4b9c72782c0..76f602f64ca 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/i18n.ko.json +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/i18n.ko.json @@ -3,6 +3,10 @@ "scheduledtasks": { "label": "스케쥴 작업", "no_scheduledtasks": "스케쥴 작업이 없습니다.", + "custom": { + "title": "사용자 정의 트리거", + "trigger": "트리거" + }, "cron": { "expression": "표현식", "runnable": "실행가능", diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/i18n.pt-BR.json b/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/i18n.pt-BR.json index 9dd7df20ab8..733cb53893f 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/i18n.pt-BR.json +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/i18n.pt-BR.json @@ -3,6 +3,10 @@ "scheduledtasks": { "label": "Tarefas Agendados", "no_scheduledtasks": "Nenhuma tarefa agendada presente.", + "custom": { + "title": "Gatilhos personalizados", + "trigger": "Gatilho" + }, "cron": { "expression": "Expressão", "runnable": "Executável", diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/i18n.ru.json b/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/i18n.ru.json index c53bb16855b..88e535c4436 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/i18n.ru.json +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/i18n.ru.json @@ -3,6 +3,10 @@ "scheduledtasks": { "label": "Планировщик заданий", "no_scheduledtasks": "Нет запланированных заданий.", + "custom": { + "title": "Пользовательские триггеры", + "trigger": "Триггер" + }, "cron": { "expression": "Выражение", "runnable": "Выполняемый объект", diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/i18n.zh-CN.json b/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/i18n.zh-CN.json index 0e24173197f..29382155ff5 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/i18n.zh-CN.json +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/i18n.zh-CN.json @@ -3,6 +3,10 @@ "scheduledtasks": { "label": "计划任务", "no_scheduledtasks": "没有计划任务。", + "custom": { + "title": "自定义触发器", + "trigger": "触发器" + }, "cron": { "expression": "表达式", "runnable": "可运行", diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/i18n.zh-TW.json b/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/i18n.zh-TW.json index 3fd412f6393..3807856a691 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/i18n.zh-TW.json +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/i18n.zh-TW.json @@ -6,6 +6,10 @@ "last_execution": "上次執行", "last_execution_status": "上次執行狀態", "next_execution": "下次執行", + "custom": { + "title": "自訂觸發器", + "trigger": "觸發器" + }, "cron": { "expression": "表達式", "runnable": "可執行項目", diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/index.spec.ts b/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/index.spec.ts new file mode 100644 index 00000000000..aacfc333614 --- /dev/null +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/index.spec.ts @@ -0,0 +1,56 @@ +import { screen } from '@testing-library/vue'; +import { HttpResponse, http } from 'msw'; +import { expect, it } from 'vitest'; + +import ScheduledTasks from './index.vue'; + +import { applications } from '@/mocks/applications/data'; +import { scheduledtasksResponse } from '@/mocks/instance/scheduledtasks/data'; +import { server } from '@/mocks/server'; +import Application from '@/services/application'; +import { render } from '@/test-utils'; + +it('shows a task registered with a custom trigger when there are no periodic tasks', async () => { + server.use( + http.get('*/actuator/scheduledtasks', () => + HttpResponse.json({ + cron: [], + fixedRate: [], + fixedDelay: [], + custom: [ + { + runnable: { target: 'com.example.RefreshCatalog' }, + trigger: 'CatalogTrigger', + lastExecution: { status: 'SUCCESS', time: '2025-03-04T10:15:00Z' }, + }, + ], + }), + ), + ); + render(ScheduledTasks, { + props: { instance: new Application(applications[0]).instances[0] }, + }); + expect(await screen.findByText('CatalogTrigger')).toBeVisible(); + expect(screen.getByTitle('com.example.RefreshCatalog')).toBeVisible(); + expect(screen.getByRole('status')).toHaveTextContent('SUCCESS'); + expect( + screen.queryByText('instances.scheduledtasks.no_scheduledtasks'), + ).not.toBeInTheDocument(); +}); + +it('shows cron and custom triggers together', async () => { + server.use( + http.get('*/actuator/scheduledtasks', () => + HttpResponse.json(scheduledtasksResponse), + ), + ); + render(ScheduledTasks, { + props: { instance: new Application(applications[0]).instances[0] }, + }); + expect( + await screen.findByTitle(scheduledtasksResponse.cron[0].expression), + ).toBeVisible(); + expect( + screen.getByText(scheduledtasksResponse.custom[0].trigger), + ).toBeVisible(); +}); diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/index.vue b/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/index.vue index c70f15edec8..6364b017ccc 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/index.vue +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/scheduledtasks/index.vue @@ -24,13 +24,16 @@
| - | + | ||||
|---|---|---|---|---|---|