mirror of https://github.com/langgenius/dify.git
chore: add checks in the url fetch step of the installFromGitHub
This commit is contained in:
parent
eaf1177cd4
commit
a7f0933e55
|
|
@ -86,13 +86,28 @@ const InstallFromGitHub: React.FC<InstallFromGitHubProps> = ({ updatePayload, on
|
|||
})
|
||||
return
|
||||
}
|
||||
await fetchReleases(owner, repo).then((fetchedReleases) => {
|
||||
setState(prevState => ({
|
||||
...prevState,
|
||||
releases: fetchedReleases,
|
||||
step: InstallStepFromGitHub.selectPackage,
|
||||
}))
|
||||
})
|
||||
try {
|
||||
const fetchedReleases = await fetchReleases(owner, repo)
|
||||
if (fetchedReleases.length > 0) {
|
||||
setState(prevState => ({
|
||||
...prevState,
|
||||
releases: fetchedReleases,
|
||||
step: InstallStepFromGitHub.selectPackage,
|
||||
}))
|
||||
}
|
||||
else {
|
||||
Toast.notify({
|
||||
type: 'error',
|
||||
message: t('plugin.error.noReleasesFound'),
|
||||
})
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
Toast.notify({
|
||||
type: 'error',
|
||||
message: t('plugin.error.fetchReleasesError'),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const handleError = (e: any, isInstall: boolean) => {
|
||||
|
|
|
|||
|
|
@ -172,6 +172,8 @@ const translation = {
|
|||
},
|
||||
error: {
|
||||
inValidGitHubUrl: 'Invalid GitHub URL. Please enter a valid URL in the format: https://github.com/owner/repo',
|
||||
fetchReleasesError: 'Unable to retrieve releases. Please try again later.',
|
||||
noReleasesFound: 'No releases found. Please check the GitHub repository or the input URL.',
|
||||
},
|
||||
marketplace: {
|
||||
empower: 'Empower your AI development',
|
||||
|
|
|
|||
|
|
@ -172,6 +172,8 @@ const translation = {
|
|||
},
|
||||
error: {
|
||||
inValidGitHubUrl: '无效的 GitHub URL。请输入格式为 https://github.com/owner/repo 的有效 URL',
|
||||
fetchReleasesError: '无法获取发布版本。请稍后再试。',
|
||||
noReleasesFound: '未找到发布版本。请检查 GitHub 仓库或输入的 URL。',
|
||||
},
|
||||
marketplace: {
|
||||
empower: '助力您的 AI 开发',
|
||||
|
|
|
|||
Loading…
Reference in New Issue