Skip to content

Commit

Permalink
feat: version pages check
Browse files Browse the repository at this point in the history
Signed-off-by: uiuing <uiuing@foxmail.com>
  • Loading branch information
uiuing committed Aug 29, 2022
1 parent 891613f commit 62902ab
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 1 deletion.
1 change: 1 addition & 0 deletions ingop/renderer/locales/data/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
},
"error": {
"network": "Network error, please check your network connection and try again.",
"version": "Golang version must be greater than or equal to 1.16, Please uninstall your Golang yourself and click Retry afterwards, InGop will automatically install the appropriate environment for you.",
"again": "Try again"
}
}
1 change: 1 addition & 0 deletions ingop/renderer/locales/data/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
},
"error": {
"network": "网络错误,请检查您的网络连接并重试。",
"version": "Golang 版本必须大于或等于 1.16,请自行卸载你的 Golang,之后点击重试,InGop 会自动为你安装合适的环境。",
"again": "重试"
}
}
47 changes: 46 additions & 1 deletion ingop/renderer/pages/error/version.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,48 @@
import {
IllustrationNoAccess,
IllustrationNoAccessDark
} from '@douyinfe/semi-illustrations'
import { Button, Empty, Typography } from '@douyinfe/semi-ui'
import { useTranslation } from 'react-i18next'
import { useRecoilValue } from 'recoil'

import { IsNetErrorStore } from '../../store'
import styles from './style.module.scss'

export default function Version() {
return <div></div>
const { t } = useTranslation()
function again() {
if (typeof global !== 'undefined') {
global.location.reload()
}
}
return (
<>
<div className={styles.wrapper}>
<div className={styles.empty}>
<Empty
image={<IllustrationNoAccess style={{ width: '50vw' }} />}
darkModeImage={
<IllustrationNoAccessDark style={{ width: '50vw' }} />
}
description={t('error.version')}
/>
<div style={{ marginTop: '2vh' }}>{ErrorTips()}</div>
</div>
<Button theme="light" type="primary" onClick={again}>
{t('error.again')}
</Button>
</div>
</>
)
}

function ErrorTips() {
const { Text } = Typography
const isNetError = useRecoilValue(IsNetErrorStore)
return isNetError !== null ? (
<Text type="tertiary">url - {isNetError.config.url}</Text>
) : (
<></>
)
}

0 comments on commit 62902ab

Please sign in to comment.