@milabench/bujang 0.0.0-stage → 0.1.2

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 (52) hide show
  1. package/README.md +108 -2
  2. package/dist/api.d.ts +151 -0
  3. package/dist/components/AutocompleteInput.d.ts +15 -0
  4. package/dist/components/MonacoEditor.d.ts +11 -0
  5. package/dist/components/toaster.d.ts +2 -0
  6. package/dist/components/tooltip.d.ts +11 -0
  7. package/dist/constants.d.ts +3 -0
  8. package/dist/context.d.ts +44 -0
  9. package/dist/hooks/useColorMode.d.ts +4 -0
  10. package/dist/hooks/usePageTitle.d.ts +2 -0
  11. package/dist/index.d.ts +26 -0
  12. package/dist/index.js +5036 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/paths.d.ts +26 -0
  15. package/dist/routes.d.ts +22 -0
  16. package/dist/theme.css +72 -0
  17. package/dist/toast.d.ts +18 -0
  18. package/dist/types.d.ts +474 -0
  19. package/dist/views/AgentActivityView.d.ts +8 -0
  20. package/dist/views/JobDetails.d.ts +2 -0
  21. package/dist/views/JobLogs.d.ts +4 -0
  22. package/dist/views/JobSubmit.d.ts +22 -0
  23. package/dist/views/JobSubmitView.d.ts +2 -0
  24. package/dist/views/JobsView.d.ts +4 -0
  25. package/dist/views/LogDisplay.d.ts +11 -0
  26. package/dist/views/PipelinesView.d.ts +2 -0
  27. package/dist/views/ScheduledJobsView.d.ts +2 -0
  28. package/package.json +70 -4
  29. package/src/api.ts +602 -0
  30. package/src/components/AutocompleteInput.tsx +253 -0
  31. package/src/components/MonacoEditor.tsx +163 -0
  32. package/src/components/toaster.tsx +38 -0
  33. package/src/components/tooltip.tsx +52 -0
  34. package/src/constants.ts +3 -0
  35. package/src/context.tsx +106 -0
  36. package/src/hooks/useColorMode.ts +31 -0
  37. package/src/hooks/usePageTitle.ts +21 -0
  38. package/src/index.ts +33 -0
  39. package/src/paths.ts +71 -0
  40. package/src/routes.tsx +55 -0
  41. package/src/theme.css +72 -0
  42. package/src/toast.ts +35 -0
  43. package/src/types.ts +542 -0
  44. package/src/views/AgentActivityView.tsx +262 -0
  45. package/src/views/JobDetails.tsx +675 -0
  46. package/src/views/JobLogs.tsx +987 -0
  47. package/src/views/JobSubmit.tsx +1272 -0
  48. package/src/views/JobSubmitView.tsx +69 -0
  49. package/src/views/JobsView.tsx +736 -0
  50. package/src/views/LogDisplay.tsx +171 -0
  51. package/src/views/PipelinesView.tsx +1318 -0
  52. package/src/views/ScheduledJobsView.tsx +735 -0
@@ -0,0 +1,69 @@
1
+ import React from 'react';
2
+ import { useNavigate } from 'react-router-dom';
3
+ import { useBujangPaths } from '../context';
4
+ import { useQuery } from '@tanstack/react-query';
5
+ import { Box, Spinner, VStack, Text } from '@chakra-ui/react';
6
+ import { JobSubmissionForm } from './JobSubmit';
7
+ import {
8
+ getSlurmTemplates,
9
+ getSlurmProfiles,
10
+ getSlurmJobs,
11
+ getSlurmClusters,
12
+ } from '../api';
13
+
14
+ export const JobSubmitView: React.FC = () => {
15
+ const navigate = useNavigate();
16
+ const paths = useBujangPaths();
17
+
18
+ const { data: templateNames } = useQuery<string[]>({
19
+ queryKey: ['slurm-templates'],
20
+ queryFn: getSlurmTemplates,
21
+ refetchOnWindowFocus: false,
22
+ staleTime: 600000,
23
+ });
24
+
25
+ const { data: profiles } = useQuery({
26
+ queryKey: ['slurm-profiles'],
27
+ queryFn: getSlurmProfiles,
28
+ refetchOnWindowFocus: false,
29
+ // ssh profiles (data movers) only run as pipeline steps
30
+ select: (ps) => ps.filter((p) => p.executor !== 'ssh'),
31
+ staleTime: 300000,
32
+ });
33
+
34
+ const { data: activeJobs } = useQuery({
35
+ queryKey: ['slurm-jobs'],
36
+ queryFn: getSlurmJobs,
37
+ refetchOnWindowFocus: false,
38
+ staleTime: 30000,
39
+ });
40
+
41
+ const { data: clusters } = useQuery({
42
+ queryKey: ['slurm-clusters'],
43
+ queryFn: getSlurmClusters,
44
+ refetchOnWindowFocus: false,
45
+ staleTime: 600000,
46
+ });
47
+
48
+ if (!profiles) {
49
+ return (
50
+ <Box display="flex" justifyContent="center" alignItems="center" height="80vh">
51
+ <VStack gap={4}>
52
+ <Spinner size="xl" />
53
+ <Text color="var(--color-text-muted)">Loading...</Text>
54
+ </VStack>
55
+ </Box>
56
+ );
57
+ }
58
+
59
+ return (
60
+ <JobSubmissionForm
61
+ templates={templateNames || []}
62
+ profiles={profiles || []}
63
+ clusters={clusters || []}
64
+ activeJobs={activeJobs || []}
65
+ onClose={() => navigate(paths.jobs())}
66
+ syncUrl
67
+ />
68
+ );
69
+ };