diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4051e18b..3a9558a9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,12 +51,6 @@ jobs: - name: Docker setup Buildx uses: docker/setup-buildx-action@v3 - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: gztime - password: ${{ secrets.DOCKER_PASSWORD }} - - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: @@ -70,7 +64,6 @@ jobs: with: images: | ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}/gzctf - gztime/gzctf flavor: | latest=${{ startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-') }} tags: | @@ -87,18 +80,3 @@ jobs: labels: ${{ steps.meta.outputs.labels }} platforms: linux/amd64,linux/arm64 push: true - - - name: Prune old packages - uses: vlaurin/action-ghcr-prune@v0.6.0 - with: - dry-run: false - token: ${{ secrets.PACKAGE_TOKEN }} - container: ${{ github.event.repository.name }}/gzctf - keep-tags-regexes: ^v\d+\.\d+\.\d+$ - prune-tags-regexes: ^[0-9a-f]{6,40} - keep-tags: | - latest - main - develop - keep-last: 20 - prune-untagged: false diff --git a/README.md b/README.md index 235831db..e8b93eb5 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,8 @@ # GZ::CTF +[Upstream repository (GZTimeWalker/GZCTF)](https://github.com/GZTimeWalker/GZCTF) + [![publish](https://github.com/GZTimeWalker/GZCTF/actions/workflows/ci.yml/badge.svg)](https://github.com/GZTimeWalker/GZCTF/actions/workflows/ci.yml) ![version](https://img.shields.io/github/v/release/GZTimeWalker/GZCTF?include_prereleases&label=version) ![license](https://img.shields.io/github/license/GZTimeWalker/GZCTF?color=FF5531) diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 5918c465..c32c5728 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -13,7 +13,7 @@ - + diff --git a/src/GZCTF/ClientApp/.env b/src/GZCTF/ClientApp/.env index c796058a..5761d95c 100644 --- a/src/GZCTF/ClientApp/.env +++ b/src/GZCTF/ClientApp/.env @@ -1 +1 @@ -VITE_BACKEND_URL="http://localhost:55000/" +VITE_BACKEND_URL="https://ctf.sdc.tf/" diff --git a/src/GZCTF/ClientApp/index.html b/src/GZCTF/ClientApp/index.html index 3ddbb8c1..6f02b40c 100644 --- a/src/GZCTF/ClientApp/index.html +++ b/src/GZCTF/ClientApp/index.html @@ -3,10 +3,11 @@ - - - - GZ::CTF + + + + + SDCTF 2024
diff --git a/src/GZCTF/ClientApp/public/favicon.png b/src/GZCTF/ClientApp/public/favicon.png new file mode 100644 index 00000000..bfe839f6 Binary files /dev/null and b/src/GZCTF/ClientApp/public/favicon.png differ diff --git a/src/GZCTF/ClientApp/src/components/AppFooter.tsx b/src/GZCTF/ClientApp/src/components/AppFooter.tsx index b8d2468b..9bc51c22 100644 --- a/src/GZCTF/ClientApp/src/components/AppFooter.tsx +++ b/src/GZCTF/ClientApp/src/components/AppFooter.tsx @@ -35,9 +35,9 @@ const AppFooter: FC = () => {
- + - GZ::CTF + SDCTF diff --git a/src/GZCTF/ClientApp/src/components/AppHeader.tsx b/src/GZCTF/ClientApp/src/components/AppHeader.tsx index cc67d484..110546eb 100644 --- a/src/GZCTF/ClientApp/src/components/AppHeader.tsx +++ b/src/GZCTF/ClientApp/src/components/AppHeader.tsx @@ -3,7 +3,10 @@ import { createStyles } from '@mantine/emotion' import { mdiAccountCircleOutline, mdiAccountGroupOutline, + mdiBullhornOutline, mdiCached, + mdiFlagOutline, + mdiHomeVariantOutline, mdiLogout, mdiTranslate, mdiWeatherNight, @@ -94,6 +97,27 @@ const AppHeader: FC = () => { {user && !error ? ( <> + } + > + {t('common.tab.home')} + + } + > + {t('common.tab.post')} + + } + > + {t('common.tab.game')} + { > {t('common.tab.account.profile')} - } - > - {t('common.tab.account.clean_cache')} - { const items: NavbarItem[] = [ { icon: mdiHomeVariantOutline, label: 'common.tab.home', link: '/' }, - { icon: mdiNoteTextOutline, label: 'common.tab.post', link: '/posts' }, + { icon: mdiBullhornOutline, label: 'common.tab.post', link: '/posts' }, { icon: mdiFlagOutline, label: 'common.tab.game', link: '/games' }, { icon: mdiAccountGroupOutline, label: 'common.tab.team', link: '/teams' }, - { icon: mdiInformationOutline, label: 'common.tab.about', link: '/about' }, + // { icon: mdiInformationOutline, label: 'common.tab.about', link: '/about' }, { icon: mdiWrenchOutline, label: 'common.tab.admin', link: '/admin/games', admin: true }, ] diff --git a/src/GZCTF/ClientApp/src/components/ChallengePanel.tsx b/src/GZCTF/ClientApp/src/components/ChallengePanel.tsx index c25e3a3f..ff8892de 100644 --- a/src/GZCTF/ClientApp/src/components/ChallengePanel.tsx +++ b/src/GZCTF/ClientApp/src/components/ChallengePanel.tsx @@ -25,6 +25,7 @@ import ChallengeDetailModal from '@Components/ChallengeDetailModal' import Empty from '@Components/Empty' import WriteupSubmitModal from '@Components/WriteupSubmitModal' import { useChallengeTagLabelMap, SubmissionTypeIconMap } from '@Utils/Shared' +import { useIsMobile } from '@Utils/ThemeOverride' import { useGame, useGameTeamInfo } from '@Utils/useGame' import { ChallengeInfo, ChallengeTag, SubmissionType } from '@Api' @@ -63,16 +64,12 @@ const ChallengePanel: FC = () => { const challengeTagLabelMap = useChallengeTagLabelMap() const { t } = useTranslation() + const isMobile = useIsMobile(1300) + // skeleton for loading if (!challenges) { return ( - + {Array(10) .fill(null) @@ -88,7 +85,6 @@ const ChallengePanel: FC = () => { pt={0} spacing="sm" pos="relative" - w="calc(100% - 9rem)" cols={{ base: 3, w18: 4, w24: 6, w30: 8, w36: 10, w42: 12, w48: 14 }} > {Array(8) @@ -139,9 +135,9 @@ const ChallengePanel: FC = () => { wrap="nowrap" justify="space-between" align="flex-start" - miw="calc(100% - 20rem)" + style={{ flex: '100% 1' }} > - + {game?.writeupRequired && ( <> )} - {status === ParticipationStatus.Accepted && - started && - !isMobile && - (!finished || game?.practiceMode) && ( - - )} + {status === ParticipationStatus.Accepted && started && (!finished || game?.practiceMode) && ( + + )} ) diff --git a/src/GZCTF/ClientApp/src/pages/posts/[postId]/edit.tsx b/src/GZCTF/ClientApp/src/pages/posts/[postId]/edit.tsx index 59b1ea5d..7892a3cc 100644 --- a/src/GZCTF/ClientApp/src/pages/posts/[postId]/edit.tsx +++ b/src/GZCTF/ClientApp/src/pages/posts/[postId]/edit.tsx @@ -160,17 +160,12 @@ const PostEdit: FC = () => { - {!isMobile && ( - - {`> ${postId === 'new' ? t('post.button.new') : t('post.button.edit')}`} - - )} + + {`> ${postId === 'new' ? t('post.button.new') : t('post.button.edit')}`} + {postId?.length === 8 && ( <> diff --git a/src/GZCTF/ClientApp/src/utils/ThemeOverride.ts b/src/GZCTF/ClientApp/src/utils/ThemeOverride.ts index c8e89f27..fd055299 100644 --- a/src/GZCTF/ClientApp/src/utils/ThemeOverride.ts +++ b/src/GZCTF/ClientApp/src/utils/ThemeOverride.ts @@ -30,16 +30,16 @@ export const CustomTheme: MantineThemeOverride = createTheme({ '#141414', ], brand: [ - '#A7FFEB', - '#64FFDA', - '#25EEBA', - '#1DE9B6', - '#0AD7AF', - '#04CAAB', - '#02BFA5', - '#009985', - '#007F6E', - '#005A4C', + "#FFF4E1", + "#FFE7CE", + "#F9CE9F", + "#F6B46E", + "#F19D43", + "#EF8F28", + "#EF8718", + "#D57308", + "#BE6602", + "#A65700" ], alert: [ '#FFB4B4', diff --git a/src/GZCTF/ClientApp/src/utils/usePageTitle.ts b/src/GZCTF/ClientApp/src/utils/usePageTitle.ts index a57b52ef..bfe439bb 100644 --- a/src/GZCTF/ClientApp/src/utils/usePageTitle.ts +++ b/src/GZCTF/ClientApp/src/utils/usePageTitle.ts @@ -4,7 +4,7 @@ import { useConfig } from '@Utils/useConfig' export const usePageTitle = (title?: string) => { const { config, error } = useConfig() - const platform = error ? 'GZ::CTF' : `${config?.title ?? 'GZ'}::CTF` + const platform = error ? 'GZ::CTF' : `${config?.title ?? 'GZ'}CTF` useDocumentTitle( typeof title === 'string' && title.trim().length > 0 ? `${title} - ${platform}` : platform diff --git a/src/GZCTF/Services/MailSender.cs b/src/GZCTF/Services/MailSender.cs index 0bb20bbe..72174127 100644 --- a/src/GZCTF/Services/MailSender.cs +++ b/src/GZCTF/Services/MailSender.cs @@ -268,5 +268,5 @@ public class MailContent( /// /// 平台名称 /// - public string Platform { get; } = $"{globalConfig.Value.Title}::CTF"; + public string Platform { get; } = $"{globalConfig.Value.Title}CTF"; }