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 update page title #11

Merged
merged 1 commit into from
Sep 25, 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
6 changes: 4 additions & 2 deletions frontend/src/components/Breadcrumbs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@ export const Breadcrumbs = () => {
}

setBreadcrumbLabels(labels);
const modelName = Object.values(labels)[0];
const instanceName = Object.values(labels).pop();
document.title = `${instanceName} - ${modelName} - Model Explorer`;
};

updateLabels();
}, [location]);
}, [location, document.title]);

const visible_pathnames = [
breadcrumbLabels['/'],
Expand Down
1 change: 1 addition & 0 deletions frontend/src/views/HomeView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const HomeView = () => {
const response = await fetch(API_BASE_URL + '/model-info');
const data = await response.json();
setModelInfo(data);
document.title = `${data.title} - Model Explorer`;
} catch (err) {
setError('Failed to fetch model info: ' + err.message);
}
Expand Down
Loading