Update index.tsx

This commit is contained in:
Stefan Pejcic 2025-02-18 20:03:14 +01:00 committed by GitHub
parent 0fb2e0acc7
commit baaa6664ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -37,21 +37,6 @@ const defaultOptions: InstallOptions = {
const Install: React.FC = () => { const Install: React.FC = () => {
const [installOptions, setInstallOptions] = useState<InstallOptions>(defaultOptions); const [installOptions, setInstallOptions] = useState<InstallOptions>(defaultOptions);
const [latestVersion, setLatestVersion] = useState<string>("");
useEffect(() => {
fetch("https://raw.githubusercontent.com/stefanpejcic/OpenPanel/refs/heads/main/version/latest")
.then(response => response.text())
.then(data => {
const version = data.trim();
setLatestVersion(version);
setInstallOptions(prevState => ({
...prevState,
version: { ...prevState.version, value: version },
}));
})
.catch(error => console.error("Error fetching latest version:", error));
}, []);
const handleInputChange = (e: ChangeEvent<HTMLInputElement | HTMLSelectElement>) => { const handleInputChange = (e: ChangeEvent<HTMLInputElement | HTMLSelectElement>) => {
const { name, value, type, checked } = e.target; const { name, value, type, checked } = e.target;