diff --git a/spring-boot-admin-server-ui/src/main/frontend/components/sba-accordion.vue b/spring-boot-admin-server-ui/src/main/frontend/components/sba-accordion.vue
index 597066abeda..a755b0230c5 100644
--- a/spring-boot-admin-server-ui/src/main/frontend/components/sba-accordion.vue
+++ b/spring-boot-admin-server-ui/src/main/frontend/components/sba-accordion.vue
@@ -40,7 +40,7 @@
{
'-rotate-90': !open,
},
- 'mr-2 transition-[transform]',
+ 'mr-2 transition-transform',
)
"
/>
@@ -90,3 +90,11 @@ const handleTitleClick = () => {
open.value = !open.value;
};
+
+
diff --git a/spring-boot-admin-server-ui/src/main/frontend/components/sba-button.spec.ts b/spring-boot-admin-server-ui/src/main/frontend/components/sba-button.spec.ts
new file mode 100644
index 00000000000..4f80d36fd18
--- /dev/null
+++ b/spring-boot-admin-server-ui/src/main/frontend/components/sba-button.spec.ts
@@ -0,0 +1,132 @@
+import userEvent from '@testing-library/user-event';
+import { screen } from '@testing-library/vue';
+import { describe, expect, it } from 'vitest';
+import { defineComponent } from 'vue';
+
+import SbaButton from './sba-button.vue';
+
+import { render } from '@/test-utils';
+
+describe('SbaButton', () => {
+ it('renders as a button element by default', () => {
+ render(SbaButton, { slots: { default: 'Click me' } });
+ expect(
+ screen.getByRole('button', { name: 'Click me' }),
+ ).toBeInTheDocument();
+ });
+
+ it('renders slot content', () => {
+ render(SbaButton, { slots: { default: 'Submit' } });
+ expect(screen.getByText('Submit')).toBeVisible();
+ });
+
+ it('renders as an anchor element when as="a"', () => {
+ render(SbaButton, {
+ props: { as: 'a', href: '#' },
+ slots: { default: 'Link' },
+ });
+ expect(screen.getByRole('link', { name: 'Link' })).toBeInTheDocument();
+ });
+
+ it('sets href on anchor element', () => {
+ render(SbaButton, {
+ props: { as: 'a', href: 'https://example.com' },
+ slots: { default: 'Link' },
+ });
+ expect(screen.getByRole('link', { name: 'Link' })).toHaveAttribute(
+ 'href',
+ 'https://example.com',
+ );
+ });
+
+ it('sets title attribute', () => {
+ render(SbaButton, {
+ props: { title: 'My tooltip' },
+ slots: { default: 'Btn' },
+ });
+ expect(screen.getByRole('button', { name: 'Btn' })).toHaveAttribute(
+ 'title',
+ 'My tooltip',
+ );
+ });
+
+ it('is disabled when disabled prop is true', () => {
+ render(SbaButton, {
+ props: { disabled: true },
+ slots: { default: 'Disabled' },
+ });
+ expect(screen.getByRole('button', { name: 'Disabled' })).toBeDisabled();
+ });
+
+ it('is not disabled by default', () => {
+ render(SbaButton, { slots: { default: 'Active' } });
+ expect(screen.getByRole('button', { name: 'Active' })).not.toBeDisabled();
+ });
+
+ it('emits click event when button is clicked', async () => {
+ const { emitted } = render(SbaButton, { slots: { default: 'Click' } });
+ await userEvent.click(screen.getByRole('button', { name: 'Click' }));
+ expect(emitted().click).toHaveLength(1);
+ });
+
+ it('does not emit click event when rendered as anchor', async () => {
+ const { emitted } = render(SbaButton, {
+ props: { as: 'a', href: '#' },
+ slots: { default: 'Link' },
+ });
+ await userEvent.click(screen.getByRole('link', { name: 'Link' }));
+ expect(emitted().click).toBeUndefined();
+ });
+
+ it('accepts a Vue component as the as prop and emits click', async () => {
+ const StubComponent = defineComponent({
+ template: '',
+ });
+ const { emitted } = render(SbaButton, {
+ props: { as: StubComponent },
+ slots: { default: 'Component' },
+ });
+ await userEvent.click(screen.getByRole('button', { name: 'Component' }));
+ expect(emitted().click).toHaveLength(1);
+ });
+
+ it('passes attrs through to a component passed as the as prop', () => {
+ const StubComponent = defineComponent({
+ template: '
{name} herunterfahren?",
+ "open_details": "Instanzdetails öffnen",
"restart": "Möchten Sie die Instanz {name} neu starten?",
"restarted": "Die Instanz {name} wurde neu gestartet.",
"unregister": "Möchten Sie die Instanz {name} deregistrieren?",
diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/applications/i18n.en.json b/spring-boot-admin-server-ui/src/main/frontend/views/applications/i18n.en.json
index a66d4b421b9..f4c1e81ea6b 100644
--- a/spring-boot-admin-server-ui/src/main/frontend/views/applications/i18n.en.json
+++ b/spring-boot-admin-server-ui/src/main/frontend/views/applications/i18n.en.json
@@ -46,6 +46,7 @@
"shutdown": "Shutdown instance {name}?",
"shutdown_successful": "Successfully shutdown instances {name}.",
"shutdown_failed": "Failed to shutdown instances {name}.",
+ "open_details": "Open instance details",
"restart": "Restart instance {name}?",
"restarted": "Successfully restarted instance {name}.",
"unregister": "Deregister instance {name}?",
diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/applications/i18n.es.json b/spring-boot-admin-server-ui/src/main/frontend/views/applications/i18n.es.json
index 14a79410010..017150be2e2 100644
--- a/spring-boot-admin-server-ui/src/main/frontend/views/applications/i18n.es.json
+++ b/spring-boot-admin-server-ui/src/main/frontend/views/applications/i18n.es.json
@@ -19,6 +19,7 @@
},
"instances": {
"shutdown": "Detener instancia {name}?",
+ "open_details": "Abrir detalles de la instancia",
"restart": "Reinciar instancia {name}?",
"restarted": "Instancia reiniciada exitosamente"
}
diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/applications/i18n.fr.json b/spring-boot-admin-server-ui/src/main/frontend/views/applications/i18n.fr.json
index 3783ba87bb3..44e0e239372 100644
--- a/spring-boot-admin-server-ui/src/main/frontend/views/applications/i18n.fr.json
+++ b/spring-boot-admin-server-ui/src/main/frontend/views/applications/i18n.fr.json
@@ -19,6 +19,7 @@
},
"instances": {
"shutdown": "Shutdown instance {name}?",
+ "open_details": "Ouvrir les détails de l'instance",
"restart": "Restart instance {name}?",
"restarted": "Successfully restarted instance"
}
diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/applications/i18n.is.json b/spring-boot-admin-server-ui/src/main/frontend/views/applications/i18n.is.json
index b45ca29c861..8c7d195593f 100644
--- a/spring-boot-admin-server-ui/src/main/frontend/views/applications/i18n.is.json
+++ b/spring-boot-admin-server-ui/src/main/frontend/views/applications/i18n.is.json
@@ -19,6 +19,7 @@
},
"instances": {
"shutdown": "Shutdown instance {name}?",
+ "open_details": "Opna upplýsingar um eintak",
"restart": "Restart instance {name}?",
"restarted": "Successfully restarted instance"
}
diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/applications/i18n.ko.json b/spring-boot-admin-server-ui/src/main/frontend/views/applications/i18n.ko.json
index 4a8c91cd548..2399361ded0 100644
--- a/spring-boot-admin-server-ui/src/main/frontend/views/applications/i18n.ko.json
+++ b/spring-boot-admin-server-ui/src/main/frontend/views/applications/i18n.ko.json
@@ -43,6 +43,7 @@
"shutdown": "{name} 인스턴스를 종료할까요?",
"shutdown_successful": "{name} 인스턴스를 종료하였습니다.",
"shutdown_failed": "{name} 인스턴스를 종료하지 못하였습니다.",
+ "open_details": "인스턴스 상세 정보 열기",
"restart": "{name} 인스턴스를 재시작할까요?",
"restarted": "{name} 인스턴스를 재시작하였습니다.",
"unregister": "{name} 인스턴스 등록을 해제할까요?",
diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/applications/i18n.pt-BR.json b/spring-boot-admin-server-ui/src/main/frontend/views/applications/i18n.pt-BR.json
index 384b6a46631..68577d780ee 100644
--- a/spring-boot-admin-server-ui/src/main/frontend/views/applications/i18n.pt-BR.json
+++ b/spring-boot-admin-server-ui/src/main/frontend/views/applications/i18n.pt-BR.json
@@ -19,6 +19,7 @@
},
"instances": {
"shutdown": "Shutdown instance {name}?",
+ "open_details": "Abrir detalhes da instância",
"restart": "Restart instance {name}?",
"restarted": "Successfully restarted instance"
}
diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/applications/i18n.ru.json b/spring-boot-admin-server-ui/src/main/frontend/views/applications/i18n.ru.json
index 2f896cef694..6c56a4a309b 100644
--- a/spring-boot-admin-server-ui/src/main/frontend/views/applications/i18n.ru.json
+++ b/spring-boot-admin-server-ui/src/main/frontend/views/applications/i18n.ru.json
@@ -43,6 +43,7 @@
"shutdown": "Остановить экземпляр {name}?",
"shutdown_successful": "Экземпляр {name} успешно остановлен.",
"shutdown_failed": "Ошибка остановки экземпляра {name}.",
+ "open_details": "Открыть сведения об экземпляре",
"restart": "Перезапустить экземпляр {name}?",
"restarted": "Экземпляр {name} успешно перезапущен.",
"unregister": "Удалить регистрацию экземпляра {name}?",
diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/applications/i18n.zh-CN.json b/spring-boot-admin-server-ui/src/main/frontend/views/applications/i18n.zh-CN.json
index 04392146f05..ae1fe5328cd 100644
--- a/spring-boot-admin-server-ui/src/main/frontend/views/applications/i18n.zh-CN.json
+++ b/spring-boot-admin-server-ui/src/main/frontend/views/applications/i18n.zh-CN.json
@@ -19,6 +19,7 @@
},
"instances": {
"shutdown": "Shutdown instance {name}?",
+ "open_details": "打开实例详情",
"restart": "Restart instance {name}?",
"restarted": "Successfully restarted instance"
}
diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/applications/i18n.zh-TW.json b/spring-boot-admin-server-ui/src/main/frontend/views/applications/i18n.zh-TW.json
index 872097562c4..1cb4fdbb7b3 100644
--- a/spring-boot-admin-server-ui/src/main/frontend/views/applications/i18n.zh-TW.json
+++ b/spring-boot-admin-server-ui/src/main/frontend/views/applications/i18n.zh-TW.json
@@ -43,6 +43,7 @@
"shutdown": "確定要關閉執行個體 {name}?",
"shutdown_successful": "執行個體 {name} 已成功關閉。",
"shutdown_failed": "關閉執行個體 {name} 失敗。",
+ "open_details": "開啟執行個體詳細資訊",
"restart": "確定要重新啟動執行個體 {name}?",
"restarted": "執行個體 {name} 已成功重新啟動。",
"unregister": "確定要取消註冊執行個體 {name}?",
diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/applications/index.vue b/spring-boot-admin-server-ui/src/main/frontend/views/applications/index.vue
index 5194257fa9c..4920ea4fc9f 100644
--- a/spring-boot-admin-server-ui/src/main/frontend/views/applications/index.vue
+++ b/spring-boot-admin-server-ui/src/main/frontend/views/applications/index.vue
@@ -19,52 +19,54 @@