add a message about dns/vpn

some ISPs are very dumb
This commit is contained in:
Cloudburst 2022-10-01 20:16:34 +02:00 committed by GitHub
parent 6890abcc33
commit dc86942144
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 32 additions and 3 deletions

View File

@ -6,14 +6,22 @@ import AdbConnect from "../components/adbconnect"
import bgImage from "../media/phones.png"
import { TiWarning } from "react-icons/ti";
import { BiErrorAlt } from "react-icons/bi";
import { GoVerified } from "react-icons/go";
import { IconContext } from "react-icons";
const IndexPage = () => {
const [repos, setRepos] = useState([]);
const [repos, setRepos] = useState(null);
const [afterTimeout, setAfterTimeout] = useState(false);
useEffect(() => {
setTimeout(() => {
setAfterTimeout(true)
}, 5000);
fetch("https://raw.githubusercontent.com/recloudstream/cs-repos/master/repos-db.json")
.catch(err => {
setAfterTimeout(true)
})
.then(r => r.json())
.then(data => {
setRepos(data)
@ -39,9 +47,30 @@ const IndexPage = () => {
</div>
</div>
</div>
<AdbConnect />
{(!repos && !afterTimeout) &&
<div class="alert shadow-lg">
<div>
<span>Fetching data...</span>
<progress class="progress progress-primary w-1/3"></progress>
</div>
</div>
}
{repos &&
repos.map((it, index) => <RepoCard repoData={it} key={index} isFirst={index===0}/>)
<>
<AdbConnect />
{repos.map((it, index) => <RepoCard repoData={it} key={index} isFirst={index===0}/>)}
</>
}
{(!repos && afterTimeout) &&
<div class="alert alert-error shadow-lg">
<div>
<BiErrorAlt />
<div>
<h3 class="font-bold">Failed to connect with GitHub servers.</h3>
<div class="text-xs">GitHub has been a target of <a href="https://en.wikipedia.org/wiki/Censorship_of_GitHub" className="link" target="_blank">censorship</a> in some countries. <br/> Please try changing your <a href="https://1.1.1.1/dns/" className="link" target="_blank">DNS server</a> or try using a VPN.</div>
</div>
</div>
</div>
}
</div>
</Layout>