RSSHub/lib/views/error.tsx

151 lines
7.6 KiB
TypeScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import type { FC } from 'hono/jsx';
import { gitDate, gitHash } from '@/utils/git-hash';
import { Layout } from '@/views/layout';
const Index: FC<{
requestPath: string;
message: string;
errorRoute: string;
nodeVersion: string;
}> = ({ requestPath, message, errorRoute, nodeVersion }) => (
<Layout>
<div
className="pointer-events-none absolute w-full min-h-screen"
style={{
backgroundImage: `url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCAzMiAzMicgd2lkdGg9JzMyJyBoZWlnaHQ9JzMyJyBmaWxsPSdub25lJyBzdHJva2U9J3JnYigxNSAyMyA0MiAvIDAuMDQpJz48cGF0aCBkPSdNMCAuNUgzMS41VjMyJy8+PC9zdmc+')`,
maskImage: 'linear-gradient(transparent, black, transparent)',
}}
></div>
<div className="w-full grow shrink-0 py-8 flex items-center justify-center flex-col space-y-4">
<img className="grayscale" src="/logo.png" alt="RSSHub" width="100" loading="lazy" />
<h1 className="text-4xl font-bold">Looks like something went wrong</h1>
<div className="text-left w-[800px] space-y-6 !mt-10">
<div className="space-y-2">
<p className="mb-2 font-bold">Helpful Information</p>
<p className="message">
Error Message:
<br />
<code className="mt-2 block max-h-28 overflow-auto bg-zinc-100 dark:bg-zinc-800 align-bottom w-fit details whitespace-pre-line">{message}</code>
</p>
<p className="message">
Route: <code className="ml-2 bg-zinc-100 dark:bg-zinc-800">{errorRoute}</code>
</p>
<p className="message">
Full Route: <code className="ml-2 bg-zinc-100 dark:bg-zinc-800">{requestPath}</code>
</p>
<p className="message">
Node Version: <code className="ml-2 bg-zinc-100 dark:bg-zinc-800">{nodeVersion}</code>
</p>
<p className="message">
Git Hash: <code className="ml-2 bg-zinc-100 dark:bg-zinc-800">{gitHash}</code>
</p>
<p className="message">
Git Date: <code className="ml-2 bg-zinc-100 dark:bg-zinc-800">{gitDate?.toUTCString()}</code>
</p>
</div>
<div>
<p className="mb-2 font-bold">Report</p>
<p>
After carefully reading the{' '}
<a className="text-[#F5712C]" href="https://docs.rsshub.app/" target="_blank">
document
</a>
, if you think this is a bug of RSSHub, please{' '}
<a className="text-[#F5712C]" href="https://github.com/DIYgod/RSSHub/issues/new?assignees=&labels=RSS+bug&template=bug_report_en.yml" target="_blank">
submit an issue
</a>{' '}
on GitHub.
</p>
<p>
<a className="text-[#F5712C]" href="https://docs.rsshub.app/zh/" target="_blank">
</a>
RSSHub bug GitHub{' '}
<a className="text-[#F5712C]" href="https://github.com/DIYgod/RSSHub/issues/new?assignees=&labels=RSS+bug&template=bug_report_zh.yml" target="_blank">
issue
</a>
</p>
</div>
<div>
<p className="mb-2 font-bold">Community</p>
<p>
You can also join our{' '}
<a className="text-[#F5712C]" target="_blank" href="https://t.me/rsshub">
Telegram group
</a>
, or follow our{' '}
<a className="text-[#F5712C]" target="_blank" href="https://t.me/awesomeRSSHub">
Telegram channel
</a>{' '}
and{' '}
<a target="_blank" href="https://x.com/intent/follow?screen_name=_RSSHub" className="text-[#F5712C]">
Twitter
</a>{' '}
to get community support and news.
</p>
<p>
{' '}
<a className="text-[#F5712C]" target="_blank" href="https://t.me/rsshub">
Telegram
</a>
{' '}
<a className="text-[#F5712C]" target="_blank" href="https://t.me/awesomeRSSHub">
Telegram
</a>
{' '}
<a target="_blank" href="https://x.com/intent/follow?screen_name=_RSSHub" className="text-[#F5712C]">
Twitter
</a>{' '}
</p>
</div>
</div>
</div>
<div className="mt-4 pb-8 text-center w-full text-sm font-medium space-y-2">
<p className="space-x-4">
<a target="_blank" href="https://github.com/DIYgod/RSSHub">
<picture>
<source srcset="https://icons.ly/github/_/fff" media="(prefers-color-scheme: dark)" />
<img className="inline" src="https://icons.ly/github" alt="github" width="20" height="20" />
</picture>
</a>
<a target="_blank" href="https://t.me/rsshub">
<img className="inline" src="https://icons.ly/telegram" alt="telegram group" width="20" height="20" />
</a>
<a target="_blank" href="https://t.me/awesomeRSSHub">
<img className="inline" src="https://icons.ly/telegram" alt="telegram channel" width="20" height="20" />
</a>
<a target="_blank" href="https://x.com/intent/follow?screen_name=_RSSHub" className="text-[#F5712C]">
<picture>
<source srcset="https://icons.ly/x/_/fff" media="(prefers-color-scheme: dark)" />
<img className="inline" src="https://icons.ly/x" alt="X" width="20" height="20" />
</picture>
</a>
</p>
<p className="!mt-6">
Please consider{' '}
<a target="_blank" href="https://docs.rsshub.app/sponsor" className="text-[#F5712C]">
sponsoring
</a>{' '}
to help keep this open source project alive.
</p>
<p>
Made with by{' '}
<a target="_blank" href="https://diygod.cc" className="text-[#F5712C]">
DIYgod
</a>{' '}
and{' '}
<a target="_blank" href="https://github.com/DIYgod/RSSHub/graphs/contributors" className="text-[#F5712C]">
Contributors
</a>{' '}
under AGPL-3.0 License.
</p>
</div>
</Layout>
);
export default Index;