Skip to content

Commit

Permalink
change workflow and build option
Browse files Browse the repository at this point in the history
  • Loading branch information
DongJianHao123 committed Sep 25, 2023
1 parent 5370d12 commit 2d69b46
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 198 deletions.
15 changes: 2 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
name: GitHub Classroom Workflow

on:
schedule:
- cron: '0 */1 * * *'
push:
branches:
- main
workflow_dispatch:
jobs:
build:
name: Autograding
Expand All @@ -26,22 +23,14 @@ jobs:
- name: add pnpm
run: |
npm i pnpm -g
npm i yarn -g
- name: install spider pkg and run
run: |
cd spider && yarn
yarn start
- name: build beta pages
run: |
cd web-beta && pnpm install --no-frozen-lockfile
pnpm run build
pnpm run export
mv out ../build
- name: build pages
run: |
cd web && pnpm install --no-frozen-lockfile
pnpm run build
cp dist ../build/older_version -r
- name: GitHub Pages
uses: crazy-max/[email protected]
with:
Expand Down
2 changes: 1 addition & 1 deletion web-beta/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export const Links: {
[key: string]: MenuLink
} = {
link1: { key: '/link1', url: "https://learningos.github.io/classroom-grading", label: 'rCore内核排行榜', year: '2022春夏季' }, //2022 夏季os
link2: { key: '/link2', url: "https:/os2edu.cn/ranking/rank", label: 'OS训练营排行榜', year: '2022秋冬季' }, //2022 秋冬季os
link2: { key: '/link2', url: "https://os2edu.cn/ranking/rank", label: 'OS训练营排行榜', year: '2022秋冬季' }, //2022 秋冬季os
link3: { key: '/link3', url: "https://learningos.github.io/rust-rustlings-ranking", label: 'Rust编程排行榜', year: '2023春夏季' },//2023春夏季 rust
link4: { key: '/link4', url: "https://learningos.github.io/2023S-OS-uCore-Classroom-Rank-list/", label: 'uCore内核排行榜', year: '2023春夏季' },//2023春夏季 基于C语言的uCore Tutorial ClassRoom排行榜
link5: { key: '/link5', url: "https://learningos.github.io/2023S-OS-rCore-Classroom-Rank-list/", label: 'rCore内核排行榜', year: '2023春夏季' },//2023春夏季 基于Rust语言的rCore Tutorial ClassRoom排行榜
Expand Down
7 changes: 7 additions & 0 deletions web-beta/components/Iframe/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,11 @@
width: 100%;
height:120vh;
border: none;
}
.empty{
width: 100%;
height:80vh;
display: flex;
align-items: center;
justify-content: center;
}
2 changes: 1 addition & 1 deletion web-beta/components/Iframe/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type Iprops = {

const Iframe = (props: Iprops) => {
return <>
{props.src === '/' ? <Empty /> : <iframe id="myIframe" className={style['iframe-container']} src={props.src} onLoad={() => {
{props.src === '/' ?<div className={style['empty']}> <Empty description='抱歉,暂无数据' /></div> : <iframe id="myIframe" className={style['iframe-container']} src={props.src} onLoad={() => {
console.log('onload');
props.setLoading(false)
}} ></iframe>}
Expand Down
3 changes: 2 additions & 1 deletion web-beta/components/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export default function DefaultLayout({ children }: { children: React.ReactNode
setCurrLink(key.split('/')[1] as LinksKey)
} else {
setCurrLink('/')

}
router.push(key)
}
Expand All @@ -80,7 +81,7 @@ export default function DefaultLayout({ children }: { children: React.ReactNode
<Layout
headerProps={{
extra: {
customRender: <Nav />
// customRender: <Nav />
}
}}
style={{
Expand Down
2 changes: 1 addition & 1 deletion web-beta/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
basePath: '/ranking'
basePath: '/standings'
}

module.exports = nextConfig
7 changes: 2 additions & 5 deletions web-beta/pages/[link].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,17 @@ import { useEffect, useState } from "react";
import { Links, LinksKey } from "../common/constants";
import Iframe from "../components/Iframe";
import { Spin } from "antd";
import RankPage from "./rank";

export default function RankIframe() {
const [loading, setLoading] = useState<boolean>(true)
const key = location.pathname.split('/')[2] as LinksKey
useEffect(() => {
setLoading(true)
Links[key].url === '/' && setTimeout(() => setLoading(false), 1000)
}, [location.pathname])
return <div >
<Spin spinning={loading}>
{key === 'link2' ?
<RankPage /> :
<Iframe src={`${Links[key].url}`} setLoading={setLoading}></Iframe>
}
<Iframe src={`${Links[key].url}`} setLoading={setLoading}></Iframe>
</Spin>
</div>

Expand Down
68 changes: 0 additions & 68 deletions web-beta/pages/list.tsx

This file was deleted.

81 changes: 0 additions & 81 deletions web-beta/pages/rank.tsx

This file was deleted.

27 changes: 0 additions & 27 deletions web-beta/requests/index.ts

This file was deleted.

0 comments on commit 2d69b46

Please sign in to comment.