@eclipse-slm/ui 1.5.0-snapshot.883 → 1.5.0-snapshot.970

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +1 -0
  2. package/package.json +6 -7
  3. package/src/api/ansible-service/ansible-service-client.ts +15 -0
  4. package/src/api/ansible-service/ansible-service-sse.ts +124 -0
  5. package/src/api/resource-management/resource-management-client.ts +0 -2
  6. package/src/app/navigation.ts +14 -0
  7. package/src/app/routes.ts +17 -0
  8. package/src/components/admin/ansible/AnsibleAdminImages.vue +113 -0
  9. package/src/components/admin/ansible/AnsibleAdminJobs.vue +179 -0
  10. package/src/components/admin/ansible/AnsibleAdminOperations.vue +124 -0
  11. package/src/components/capabilities/CapabilitiesTable.vue +3 -3
  12. package/src/components/capabilities/CapabilityActionCard.vue +15 -14
  13. package/src/components/capabilities/CapabilityCreateForm.vue +33 -2
  14. package/src/components/capabilities/CapabilityImportDialog.vue +16 -7
  15. package/src/components/capabilities/capabilityForm.ts +65 -22
  16. package/src/components/jobs/JobDetail.vue +395 -0
  17. package/src/components/jobs/JobStatusChip.vue +16 -0
  18. package/src/components/jobs/JobsOverview.vue +59 -72
  19. package/src/components/profilers/ProfilerDialog.vue +95 -0
  20. package/src/components/profilers/ProfilerForm.vue +102 -0
  21. package/src/components/profilers/ProfilersTable.vue +98 -0
  22. package/src/components/profilers/profilerForm.ts +46 -0
  23. package/src/docker/entrypoint.sh +2 -2
  24. package/src/localisation/en.json +90 -0
  25. package/src/pages/AdminAnsibleServicePage.vue +111 -0
  26. package/src/pages/AdminProfilersPage.vue +73 -0
  27. package/src/pages/DashboardPage.vue +28 -56
  28. package/src/pages/JobDetailPage.vue +7 -0
  29. package/src/stores/ansibleAdminStore.ts +206 -0
  30. package/src/stores/environmentStore.ts +3 -3
  31. package/src/stores/jobsStore.ts +39 -39
  32. package/src/stores/profilersStore.ts +80 -0
  33. package/src/stores/resourceDevicesStore.ts +2 -2
  34. package/src/stores/serviceInstancesStore.ts +0 -1
  35. package/src/stores/serviceOfferingsStore.ts +1 -1
  36. package/src/utils/jobStatus.ts +63 -0
  37. package/vite/dist/apiClients.d.ts +1 -1
  38. package/vite/dist/apiClients.js +1 -0
@@ -0,0 +1,63 @@
1
+ import type {AnsibleJobStatus} from "@/api/ansible-service/client";
2
+
3
+ export const JOB_STATUSES: AnsibleJobStatus[] = [
4
+ 'PENDING', 'PREPARING', 'RUNNING', 'SUCCESSFUL', 'FAILED', 'CANCELED', 'TIMED_OUT',
5
+ ] as AnsibleJobStatus[];
6
+
7
+ const FINAL_STATUSES = ['SUCCESSFUL', 'FAILED', 'CANCELED', 'TIMED_OUT'];
8
+
9
+ export function isFinalJobStatus(status?: string | null): boolean {
10
+ return !!status && FINAL_STATUSES.includes(status);
11
+ }
12
+
13
+ export function jobStatusColor(status?: string | null): string {
14
+ switch (status) {
15
+ case 'PENDING': return 'grey';
16
+ case 'PREPARING': return 'info';
17
+ case 'RUNNING': return 'primary';
18
+ case 'SUCCESSFUL': return 'success';
19
+ case 'FAILED': return 'error';
20
+ case 'CANCELED': return 'warning';
21
+ case 'TIMED_OUT': return 'orange-darken-2';
22
+ default: return 'grey';
23
+ }
24
+ }
25
+
26
+ export function jobStatusIcon(status?: string | null): string {
27
+ switch (status) {
28
+ case 'PENDING': return 'mdi-timer-sand-empty';
29
+ case 'PREPARING': return 'mdi-cog-sync-outline';
30
+ case 'RUNNING': return 'mdi-run-fast';
31
+ case 'SUCCESSFUL': return 'mdi-check-circle-outline';
32
+ case 'FAILED': return 'mdi-alert-circle-outline';
33
+ case 'CANCELED': return 'mdi-cancel';
34
+ case 'TIMED_OUT': return 'mdi-clock-alert-outline';
35
+ default: return 'mdi-help-circle-outline';
36
+ }
37
+ }
38
+
39
+ export function jobStatusLabel(status?: string | null): string {
40
+ return (status ?? '').replace('_', ' ');
41
+ }
42
+
43
+ export function formatJobDate(time?: string | Date | null): string {
44
+ if (!time) return '';
45
+ return new Date(time).toLocaleString('de-DE');
46
+ }
47
+
48
+ /** Duration of a job in ms: started to finished, or started to now while it is still running. */
49
+ export function jobDurationMs(job: {startedAt?: string | Date | null, finishedAt?: string | Date | null}, now = Date.now()): number | null {
50
+ if (!job.startedAt) return null;
51
+ const end = job.finishedAt ? new Date(job.finishedAt).getTime() : now;
52
+ return Math.max(0, end - new Date(job.startedAt).getTime());
53
+ }
54
+
55
+ export function formatDuration(ms: number | null): string {
56
+ if (ms === null) return '';
57
+ const totalSeconds = Math.floor(ms / 1000);
58
+ const hours = Math.floor(totalSeconds / 3600);
59
+ const minutes = Math.floor((totalSeconds / 60) % 60);
60
+ const seconds = totalSeconds % 60;
61
+ if (hours > 0) return `${hours}h ${minutes}m ${seconds}s`;
62
+ return minutes > 0 ? `${minutes}m ${seconds}s` : `${seconds}s`;
63
+ }
@@ -1,5 +1,5 @@
1
1
  import type { Plugin } from 'vite';
2
2
  import { type SlmPathsSource } from './paths.js';
3
- export declare const API_SERVICES: readonly ["resource-management", "platform-management", "service-management", "notification-service"];
3
+ export declare const API_SERVICES: readonly ["resource-management", "platform-management", "service-management", "notification-service", "ansible-service"];
4
4
  /** Redirects the (gitignored, generated) API clients of the package to the consumer's own generated clients. */
5
5
  export declare function apiClientsPlugin(pathsSource: SlmPathsSource): Plugin;
@@ -6,6 +6,7 @@ export const API_SERVICES = [
6
6
  'platform-management',
7
7
  'service-management',
8
8
  'notification-service',
9
+ 'ansible-service',
9
10
  ];
10
11
  function realIfExists(file) {
11
12
  try {