mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 21:46:11 +05:00
Update index.jsx
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import { useState } from 'react'
|
import axios from 'axios'
|
||||||
|
import { useEffect, useState } from 'react'
|
||||||
import Button from '@material-ui/core/Button'
|
import Button from '@material-ui/core/Button'
|
||||||
import Dialog from '@material-ui/core/Dialog'
|
import Dialog from '@material-ui/core/Dialog'
|
||||||
import InfoIcon from '@material-ui/icons/Info'
|
import InfoIcon from '@material-ui/icons/Info'
|
||||||
@@ -7,6 +8,7 @@ import ListItemIcon from '@material-ui/core/ListItemIcon'
|
|||||||
import ListItemText from '@material-ui/core/ListItemText'
|
import ListItemText from '@material-ui/core/ListItemText'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { useMediaQuery } from '@material-ui/core'
|
import { useMediaQuery } from '@material-ui/core'
|
||||||
|
import { echoHost } from 'utils/Hosts'
|
||||||
|
|
||||||
import LinkComponent from './LinkComponent'
|
import LinkComponent from './LinkComponent'
|
||||||
import { DialogWrapper, HeaderSection, ThanksSection, Section, FooterSection } from './style'
|
import { DialogWrapper, HeaderSection, ThanksSection, Section, FooterSection } from './style'
|
||||||
@@ -14,7 +16,11 @@ import { DialogWrapper, HeaderSection, ThanksSection, Section, FooterSection } f
|
|||||||
export default function AboutDialog() {
|
export default function AboutDialog() {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
const [open, setOpen] = useState(false)
|
const [open, setOpen] = useState(false)
|
||||||
|
const [torrServerVersion, setTorrServerVersion] = useState('')
|
||||||
const fullScreen = useMediaQuery('@media (max-width:930px)')
|
const fullScreen = useMediaQuery('@media (max-width:930px)')
|
||||||
|
useEffect(() => {
|
||||||
|
axios.get(echoHost()).then(({ data }) => setTorrServerVersion(data))
|
||||||
|
}, [])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -35,7 +41,8 @@ export default function AboutDialog() {
|
|||||||
<DialogWrapper>
|
<DialogWrapper>
|
||||||
<HeaderSection>
|
<HeaderSection>
|
||||||
<div>{t('About')}</div>
|
<div>{t('About')}</div>
|
||||||
<img src='/android-chrome-192x192.png' alt='ts-icon' />
|
{torrServerVersion}
|
||||||
|
<img src='/apple-touch-icon.png' alt='ts-icon' />
|
||||||
</HeaderSection>
|
</HeaderSection>
|
||||||
|
|
||||||
<div style={{ overflow: 'auto' }}>
|
<div style={{ overflow: 'auto' }}>
|
||||||
@@ -64,7 +71,7 @@ export default function AboutDialog() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<FooterSection>
|
<FooterSection>
|
||||||
<Button onClick={() => setOpen(false)} color='primary' variant='contained' autoFocus>
|
<Button onClick={() => setOpen(false)} color='primary' variant='contained'>
|
||||||
{t('Close')}
|
{t('Close')}
|
||||||
</Button>
|
</Button>
|
||||||
</FooterSection>
|
</FooterSection>
|
||||||
|
|||||||
Reference in New Issue
Block a user