diff --git a/console/workspaces/libs/shared-component/src/components/BuildLogs.tsx b/console/workspaces/libs/shared-component/src/components/BuildLogs.tsx
index 08e4103ff..985f3414d 100644
--- a/console/workspaces/libs/shared-component/src/components/BuildLogs.tsx
+++ b/console/workspaces/libs/shared-component/src/components/BuildLogs.tsx
@@ -16,6 +16,7 @@
* under the License.
*/
+import { useMemo } from "react";
import {
useGetBuild,
useGetBuildLogs,
@@ -78,6 +79,10 @@ export function BuildLogs({
build?.status
);
+ const reversedBuildLogs = useMemo(
+ () => (buildLogs ? [...buildLogs].reverse() : undefined),
+ [buildLogs]
+ );
const getEmptyStateMessage = () => {
if (error) {
return {
@@ -143,7 +148,7 @@ export function BuildLogs({
{isBuildLoading && }
{build && }
{
const envId = data && data.length > 0 ? data[0].name : undefined;
+ const { data: monitorsData } = useListMonitors({
+ orgName: orgId ?? "",
+ projName: projectId ?? "",
+ agentName: agentId ?? "",
+ });
+
const {
mutate: createMonitor,
isPending,
@@ -123,6 +130,11 @@ export const CreateMonitorComponent: React.FC = () => {
[agentId, backHref, createMonitor, envId, navigate, orgId, projectId],
);
+ const existingMonitorNames = useMemo(
+ () => monitorsData?.monitors?.map((m) => m.name) ?? [],
+ [monitorsData],
+ );
+
return (
{
isSubmitting={isPending}
serverError={error}
missingParamsMessage={missingParamsMessage}
+ existingMonitorNames={existingMonitorNames}
/>
);
};
diff --git a/console/workspaces/pages/eval/src/EditMonitor.Component.tsx b/console/workspaces/pages/eval/src/EditMonitor.Component.tsx
index 5c7cce0c4..2fdee4372 100644
--- a/console/workspaces/pages/eval/src/EditMonitor.Component.tsx
+++ b/console/workspaces/pages/eval/src/EditMonitor.Component.tsx
@@ -26,6 +26,7 @@ import {
} from "@agent-management-platform/types";
import {
useGetMonitor,
+ useListMonitors,
useUpdateMonitor,
} from "@agent-management-platform/api-client";
import { MonitorFormWizard } from "./subComponents/MonitorFormWizard";
@@ -40,6 +41,12 @@ export const EditMonitorComponent: React.FC = () => {
}>();
const navigate = useNavigate();
+ const { data: monitorsData } = useListMonitors({
+ orgName: orgId ?? "",
+ projName: projectId ?? "",
+ agentName: agentId ?? "",
+ });
+
const {
data: monitorData,
isLoading,
@@ -114,6 +121,11 @@ export const EditMonitorComponent: React.FC = () => {
};
}, [monitorData]);
+ const existingMonitorNames = useMemo(
+ () => monitorsData?.monitors?.map((m) => m.name) ?? [],
+ [monitorsData],
+ );
+
const handleUpdateMonitor = useCallback(
(values: CreateMonitorFormValues) => {
if (!orgId || !projectId || !agentId || !monitorId) {
@@ -216,6 +228,8 @@ export const EditMonitorComponent: React.FC = () => {
isSubmitting={isUpdating}
serverError={updateError}
isTypeEditable={false}
+ existingMonitorNames={existingMonitorNames}
+ editingMonitorName={monitorData?.name}
/>
);
};
diff --git a/console/workspaces/pages/eval/src/EvalMonitors.Component.tsx b/console/workspaces/pages/eval/src/EvalMonitors.Component.tsx
index aacc48439..9a184f360 100644
--- a/console/workspaces/pages/eval/src/EvalMonitors.Component.tsx
+++ b/console/workspaces/pages/eval/src/EvalMonitors.Component.tsx
@@ -50,7 +50,7 @@ export const EvalMonitorsComponent: React.FC = () => {
envId: envId,
},
)}
- endIcon={}
+ startIcon={}
color="primary"
>
Add monitor
diff --git a/console/workspaces/pages/eval/src/form/schema.ts b/console/workspaces/pages/eval/src/form/schema.ts
index 520fb1f82..606b8f243 100644
--- a/console/workspaces/pages/eval/src/form/schema.ts
+++ b/console/workspaces/pages/eval/src/form/schema.ts
@@ -42,9 +42,9 @@ export const createMonitorSchema = z
displayName: z
.string()
.trim()
- .min(1, "Monitor title is required")
- .min(3, "Monitor title must be at least 3 characters")
- .max(120, "Monitor title must be at most 120 characters"),
+ .min(1, "Name is required")
+ .min(3, "Name must be at least 3 characters")
+ .max(120, "Name must be at most 120 characters"),
name: z
.string()
.trim()
diff --git a/console/workspaces/pages/eval/src/subComponents/CreateMonitorForm.tsx b/console/workspaces/pages/eval/src/subComponents/CreateMonitorForm.tsx
index 1cfa51f1e..273e2e12c 100644
--- a/console/workspaces/pages/eval/src/subComponents/CreateMonitorForm.tsx
+++ b/console/workspaces/pages/eval/src/subComponents/CreateMonitorForm.tsx
@@ -57,7 +57,7 @@ export function CreateMonitorForm({
Basic Details
-
+
@@ -195,8 +195,7 @@ export function CreateMonitorForm({
}
error={!!errors.intervalMinutes}
helperText={
- errors.intervalMinutes ??
- "How often the monitor should execute"
+ errors.intervalMinutes
}
fullWidth
/>
diff --git a/console/workspaces/pages/eval/src/subComponents/EvaluatorLlmProviderSection.tsx b/console/workspaces/pages/eval/src/subComponents/EvaluatorLlmProviderSection.tsx
index 11966abfc..955247b83 100644
--- a/console/workspaces/pages/eval/src/subComponents/EvaluatorLlmProviderSection.tsx
+++ b/console/workspaces/pages/eval/src/subComponents/EvaluatorLlmProviderSection.tsx
@@ -125,10 +125,10 @@ export function EvaluatorLlmProviderSection({
select
size="small"
fullWidth
- value={draftProviderName}
+ value={draftProviderName ? draftProviderName : "_empty"}
onChange={(e) => handleProviderChange(e.target.value)}
>
-
+
{availableProvidersToAdd.map((p) => (