Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: change logs endpoint #298

Merged
merged 1 commit into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- LogsModal now use a key so we can use logs not linked with a compute task (#270)
- Replace `function.function` by `function.archive` (#296)
- Update task statuses to reflect the updates in the backend (#297)
- LogsModel now use the latest endpoint (#298)

## [0.46.0] - 2023-10-18

Expand Down
2 changes: 1 addition & 1 deletion src/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const API_PATHS = {
INFO: '/info/',
LOGIN: '/me/login/?format=json',
LOGOUT: '/me/logout/',
LOGS: '/logs/:key/file/',
LOGS: '/task/:key/logs/',
METADATA: '/compute_plan_metadata/',
NEWS_FEED: '/news_feed/',
ORGANIZATIONS: '/organization/',
Expand Down
4 changes: 2 additions & 2 deletions src/routes/tasks/components/ErrorAlert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const ErrorAlert = ({ task }: { task: TaskT }): JSX.Element | null => {
<LogsModal
isOpen={isOpen}
onClose={onClose}
reportKey={task.function.key}
taskKey={task.key}
/>
</>
);
Expand Down Expand Up @@ -146,7 +146,7 @@ const ErrorAlert = ({ task }: { task: TaskT }): JSX.Element | null => {
<LogsModal
isOpen={isOpen}
onClose={onClose}
reportKey={task.key}
taskKey={task.key}
/>
</>
);
Expand Down
12 changes: 6 additions & 6 deletions src/routes/tasks/components/LogsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ const CodeHighlighter = React.lazy(
type LogsModalProps = {
isOpen: boolean;
onClose: () => void;
reportKey: string;
taskKey: string;
};
const LogsModal = ({ isOpen, onClose, reportKey }: LogsModalProps) => {
const LogsModal = ({ isOpen, onClose, taskKey }: LogsModalProps) => {
const initialFocusRef = useRef(null);

const { logs, fetchingLogs, fetchLogs } = useTaskStore();

useEffect(() => {
fetchLogs(reportKey);
}, [fetchLogs, reportKey]);
fetchLogs(taskKey);
}, [fetchLogs, taskKey]);

return (
<Modal
Expand Down Expand Up @@ -72,9 +72,9 @@ const LogsModal = ({ isOpen, onClose, reportKey }: LogsModalProps) => {
/>
<DownloadIconButton
storageAddress={compilePath(API_PATHS.LOGS, {
key: reportKey,
key: taskKey,
})}
filename={`logs_${reportKey}`}
filename={`logs_${taskKey}`}
aria-label="Download logs"
variant="ghost"
/>
Expand Down
Loading