Skip to content

Commit

Permalink
webvm
Browse files Browse the repository at this point in the history
  • Loading branch information
szweibel committed Nov 6, 2023
1 parent c525f9b commit 74c08ca
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 24 deletions.
22 changes: 10 additions & 12 deletions components/WorkshopPieces/WorkshopHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Sidebar from './ToC';
import { useState, useEffect } from 'react';
import { useRouter } from 'next/router';
import Link from 'next/link';
import { Breadcrumbs } from '@mui/material';


export default function WorkshopHeader({ currentPage, setCurrentPage, pageTitles, pages, workshopTitle,
Expand Down Expand Up @@ -48,6 +49,10 @@ export default function WorkshopHeader({ currentPage, setCurrentPage, pageTitles
</Link>
}
<div className='workshop-header-breadcrumbs'>
<Breadcrumbs
className='breadcrumbs'
separator="›"
aria-label="breadcrumb">
{pages && instUser && instRepo &&
<Link href={instURL}>
<HomeIcon
Expand All @@ -58,38 +63,31 @@ export default function WorkshopHeader({ currentPage, setCurrentPage, pageTitles
/>
</Link>
}
<p>/</p>
{workshopTitle &&
<p className='crumb'>
<Link href={firstPageLink}
onClick={() => {
setCurrentPage(1);
}}
>
{workshopTitle}
</Link>
</p>
}
<p>/</p>
{currentPageParent &&
<>
<p className='crumb'>
<Link href={parentLink}
onClick={() => {
setCurrentPage(currentPageParentPage);
}}
>
{currentPageParent}
</Link>
</p>
<p>/</p>
</>
}
{pageTitles[currentPage - 1] &&
<p className='crumb'>
{pageTitles[currentPage - 1].title}
</p>
// {pageTitles[currentPage - 1].title}
<div>
{pageTitles[currentPage - 1].title}
</div>
}
</Breadcrumbs>
</div>
</div>
<div className={drawerOpen ? 'workshop-header-right drawer-open' : 'workshop-header-right'}>
Expand Down
1 change: 0 additions & 1 deletion pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ function MyApp({ Component, pageProps }) {
cache.clear()
}


useEffect(() => {
const urlParams = new URLSearchParams(window.location.search);
setInstGitUser(urlParams.get('instUser'));
Expand Down
20 changes: 10 additions & 10 deletions pages/dynamic/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ export default function WorkshopPage({
const [currentPage, setCurrentPage] = useState(1);
const [pages, setPages] = useState([]);

const gitUser = props.gitUser
const setGitUser = props.setGitUser
const gitRepo = props.gitRepo
const setGitRepo = props.setGitRepo
const instUser = props.instGitUser
const setInstUser = props.setInstGitUser
const instRepo = props.instGitRepo
const setInstRepo = props.setInstGitRepo
const gitUser = props.gitUser
const setGitUser = props.setGitUser
const gitRepo = props.gitRepo
const setGitRepo = props.setGitRepo
const instUser = props.instGitUser
const setInstUser = props.setInstGitUser
const instRepo = props.instGitRepo
const setInstRepo = props.setInstGitRepo

const [gitFile, setGitFile] = useState(null);
const [builtURL, setBuiltURL] = useState(null);
Expand Down Expand Up @@ -166,8 +166,8 @@ const setInstRepo = props.setInstGitRepo
const [secondPageLink, setSecondPageLink] = useState('');
useEffect(() => {
const urlParams = new URLSearchParams(window.location.search);
urlParams.set('page', 2);
setSecondPageLink(`${window.location.pathname}?${urlParams}`);
urlParams.set('page', 2);
setSecondPageLink(`${window.location.pathname}?${urlParams}`);
if (currentFile != null && content != '') {
const frontMatterContent = Frontmatter(currentFile, setCurrentPage, setCurrentContent, pages, instUser, instRepo, workshopTitle, pageTitles, currentPage, router, secondPageLink);
setPages([frontMatterContent, ...convertContenttoHTML(content)]);
Expand Down
2 changes: 1 addition & 1 deletion public/webvm/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
// h.textContent = "\u{1F7E0}";
}
// The device url and type are replaced by Github Actions.
CheerpXApp.create({ devices: [{ type: "split", url: "https://dhri-curriculum.github.io/webvm/debian_mini_20231103_6746580872.ext2", name: "block1" }], mounts: [{ type: "ext2", dev: "block1", path: "/" }, { type: "cheerpOS", dev: "/app", path: "/app" }, { type: "cheerpOS", dev: "/str", path: "/data" }, { type: "devs", dev: "", path: "/dev" }], activityInterface: { cpu: cpuCallback, dev: devCallback } }).then(runTest, failCallback);
CheerpXApp.create({ devices: [{ type: "split", url: "https://dhri-curriculum.github.io/webvm/debian_mini_20231106_6774628565.ext2", name: "block1" }], mounts: [{ type: "ext2", dev: "block1", path: "/" }, { type: "cheerpOS", dev: "/app", path: "/app" }, { type: "cheerpOS", dev: "/str", path: "/data" }, { type: "devs", dev: "", path: "/dev" }], activityInterface: { cpu: cpuCallback, dev: devCallback } }).then(runTest, failCallback);
}
function initialMessage() {
printOnTerm.printMessage(printOnTerm.getAsciiText());
Expand Down

0 comments on commit 74c08ca

Please sign in to comment.