-
-
Notifications
You must be signed in to change notification settings - Fork 786
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Innei <[email protected]>
- Loading branch information
Showing
32 changed files
with
201 additions
and
23 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import Link from 'next/link' | ||
|
||
import { NormalContainer } from '~/components/layout/container/Normal' | ||
import { StyledButton } from '~/components/ui/button' | ||
|
||
export default async function PageDeleted() { | ||
return ( | ||
<NormalContainer> | ||
<div className="mt-[250px] flex h-full flex-col items-center justify-center"> | ||
<h1 className="text-4xl font-bold">此页面已被删除</h1> | ||
|
||
<StyledButton className="mt-8"> | ||
<Link href="/">返回首页</Link> | ||
</StyledButton> | ||
</div> | ||
</NormalContainer> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import { Loading } from '~/components/ui/loading' | ||
|
||
export default () => ( | ||
<div className="absolute inset-0 flex h-[120px] center"> | ||
<Loading useDefaultLoadingText /> | ||
</div> | ||
) | ||
export default function Load() { | ||
return ( | ||
<div className="flex h-[240px] w-full center"> | ||
<Loading useDefaultLoadingText /> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
'use client' | ||
|
||
import { useQuery } from '@tanstack/react-query' | ||
import React, { useState } from 'react' | ||
import { m } from 'framer-motion' | ||
import Image from 'next/image' | ||
import type { RequestError } from '@mx-space/api-client' | ||
|
||
import { apiClient } from '~/utils/request' | ||
|
||
// autocorrect: false | ||
const appLabels: { [app: string]: string } = { | ||
Slack: 'slack', | ||
Arc: 'arc', | ||
Code: 'code', | ||
WebStorm: 'webstorm', | ||
Linear: 'linear', | ||
Figma: 'figma', | ||
Telegram: 'telegram', | ||
WeChat: 'wechat', | ||
Discord: 'discord', | ||
Mail: 'mail', | ||
Safari: 'safari', | ||
Music: 'music', | ||
Finder: 'finder', | ||
Messages: 'messages', | ||
QQ: 'qq', | ||
Chrome: 'chrome', | ||
'Chrome Canary': 'chrome_canary', | ||
QQ音乐: 'qq_music', | ||
NeteaseMusic: 'netease', | ||
iTerm2: 'iterm2', | ||
Xcode: 'xcode', | ||
} | ||
// autocorrect: true | ||
export function Activity() { | ||
const [isEnabled, setIsEnabled] = useState(true) | ||
|
||
const { data: processName } = useQuery( | ||
['activity'], | ||
async () => { | ||
return await apiClient.proxy.fn.ps.update | ||
.post<string>() | ||
.catch((err: RequestError) => { | ||
err.status === 404 && setIsEnabled(false) | ||
return '' | ||
}) | ||
}, | ||
{ | ||
refetchInterval: 5000, | ||
retry: false, | ||
enabled: isEnabled, | ||
}, | ||
) | ||
|
||
if (!processName) { | ||
return null | ||
} | ||
if (!appLabels[processName]) { | ||
console.log('Not collected process name: ', processName) | ||
return null | ||
} | ||
|
||
return ( | ||
<div className="pointer-events-auto relative bottom-0 right-[-25px] top-0 flex items-center md:absolute"> | ||
<m.div | ||
className="absolute left-1 top-1 h-6 w-6 select-none rounded-[6px] bg-zinc-500/10 dark:bg-zinc-200/10" | ||
animate={{ opacity: [0, 0.65, 0], scale: [1, 1.4, 1] }} | ||
transition={{ | ||
duration: 1.5, | ||
repeat: Infinity, | ||
}} | ||
/> | ||
<Image | ||
width={32} | ||
height={32} | ||
src={`/apps/${appLabels[processName]}.png`} | ||
alt={processName} | ||
priority | ||
fetchPriority="high" | ||
unoptimized | ||
className="pointer-events-none select-none" | ||
/> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters