|
|
@ -61,18 +61,35 @@ const InfoModal: FC<{
|
|
|
|
<Typography id="modal-modal-title" variant="h4">
|
|
|
|
<Typography id="modal-modal-title" variant="h4">
|
|
|
|
Stats for {settings.invidiousServer}
|
|
|
|
Stats for {settings.invidiousServer}
|
|
|
|
</Typography>
|
|
|
|
</Typography>
|
|
|
|
<Typography id="modal-modal-description" sx={{ mt: 2 }}>
|
|
|
|
<Typography
|
|
|
|
|
|
|
|
id="modal-modal-description"
|
|
|
|
|
|
|
|
sx={{ mt: 2 }}
|
|
|
|
|
|
|
|
>
|
|
|
|
Version: {data.version} <br /> <br />
|
|
|
|
Version: {data.version} <br /> <br />
|
|
|
|
Software name: {data.software.name} <br />
|
|
|
|
Software name: {data.software.name}{" "}
|
|
|
|
Software version: {data.software.version} <br />
|
|
|
|
<br />
|
|
|
|
Software branch: {data.software.branch} <br /> <br />
|
|
|
|
Software version:{" "}
|
|
|
|
Is accepting registrations: {data.openRegistrations ? "Yes" : "No"}
|
|
|
|
{data.software.version} <br />
|
|
|
|
|
|
|
|
Software branch: {
|
|
|
|
|
|
|
|
data.software.branch
|
|
|
|
|
|
|
|
}{" "}
|
|
|
|
<br /> <br />
|
|
|
|
<br /> <br />
|
|
|
|
Total users: {data.usage.users.total} <br />
|
|
|
|
Is accepting registrations:{" "}
|
|
|
|
Active in the past half year: {data.usage.users.activeHalfyear}
|
|
|
|
{data.openRegistrations ? "Yes" : "No"}
|
|
|
|
|
|
|
|
<br /> <br />
|
|
|
|
|
|
|
|
Total users: {
|
|
|
|
|
|
|
|
data.usage.users.total
|
|
|
|
|
|
|
|
}{" "}
|
|
|
|
|
|
|
|
<br />
|
|
|
|
|
|
|
|
Active in the past half year:{" "}
|
|
|
|
|
|
|
|
{data.usage.users.activeHalfyear}
|
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
Active in the past month: {data.usage.users.activeMonth} <br /> <br />
|
|
|
|
Active in the past month:{" "}
|
|
|
|
Stats updated at: {lastUpdated.toLocaleDateString()} -{" "}
|
|
|
|
{
|
|
|
|
|
|
|
|
data.usage.users.activeMonth
|
|
|
|
|
|
|
|
} <br /> <br />
|
|
|
|
|
|
|
|
Stats updated at:{" "}
|
|
|
|
|
|
|
|
{lastUpdated.toLocaleDateString()} -{" "}
|
|
|
|
{lastUpdated.toLocaleTimeString()}
|
|
|
|
{lastUpdated.toLocaleTimeString()}
|
|
|
|
</Typography>
|
|
|
|
</Typography>
|
|
|
|
</ModalBox>
|
|
|
|
</ModalBox>
|
|
|
@ -92,7 +109,13 @@ const Setting: FC<{ title: string; description?: string }> = ({
|
|
|
|
<Box sx={{ flexGrow: 1 }}>
|
|
|
|
<Box sx={{ flexGrow: 1 }}>
|
|
|
|
<Typography variant="h5">{title}</Typography>
|
|
|
|
<Typography variant="h5">{title}</Typography>
|
|
|
|
{description && (
|
|
|
|
{description && (
|
|
|
|
<Typography variant="subtitle1" color={theme.palette.text.secondary}>
|
|
|
|
<Typography
|
|
|
|
|
|
|
|
variant="subtitle1"
|
|
|
|
|
|
|
|
color={
|
|
|
|
|
|
|
|
theme.palette.text
|
|
|
|
|
|
|
|
.secondary
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
>
|
|
|
|
{description}
|
|
|
|
{description}
|
|
|
|
</Typography>
|
|
|
|
</Typography>
|
|
|
|
)}
|
|
|
|
)}
|
|
|
@ -127,10 +150,13 @@ const Settings: NextPage = () => {
|
|
|
|
const invidiousServerResponse = useMutation<Stats, unknown, string>(
|
|
|
|
const invidiousServerResponse = useMutation<Stats, unknown, string>(
|
|
|
|
"invidiousInstance",
|
|
|
|
"invidiousInstance",
|
|
|
|
(server) =>
|
|
|
|
(server) =>
|
|
|
|
axios.get(`https://${server}/api/v1/stats`).then((res) => res.data)
|
|
|
|
axios
|
|
|
|
|
|
|
|
.get(`https://${server}/api/v1/stats`)
|
|
|
|
|
|
|
|
.then((res) => res.data)
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
const allowsRegistrations = invidiousServerResponse.data?.openRegistrations;
|
|
|
|
const allowsRegistrations =
|
|
|
|
|
|
|
|
invidiousServerResponse.data?.openRegistrations;
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<>
|
|
|
@ -146,7 +172,9 @@ const Settings: NextPage = () => {
|
|
|
|
|
|
|
|
|
|
|
|
<Divider sx={{ mb: 4 }} />
|
|
|
|
<Divider sx={{ mb: 4 }} />
|
|
|
|
|
|
|
|
|
|
|
|
<Typography variant="h4">Theme</Typography>
|
|
|
|
<Typography variant="h4">
|
|
|
|
|
|
|
|
Theme
|
|
|
|
|
|
|
|
</Typography>
|
|
|
|
|
|
|
|
|
|
|
|
<Setting
|
|
|
|
<Setting
|
|
|
|
title="General Theme"
|
|
|
|
title="General Theme"
|
|
|
@ -157,58 +185,129 @@ const Settings: NextPage = () => {
|
|
|
|
color="primary"
|
|
|
|
color="primary"
|
|
|
|
aria-label="outlined default button group"
|
|
|
|
aria-label="outlined default button group"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<Button onClick={() => setSetting("theme", "light")}>
|
|
|
|
<Button
|
|
|
|
|
|
|
|
onClick={() =>
|
|
|
|
|
|
|
|
setSetting(
|
|
|
|
|
|
|
|
"theme",
|
|
|
|
|
|
|
|
"light"
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
>
|
|
|
|
Light
|
|
|
|
Light
|
|
|
|
</Button>
|
|
|
|
</Button>
|
|
|
|
<Button onClick={() => setSetting("theme")}>System</Button>
|
|
|
|
<Button
|
|
|
|
<Button onClick={() => setSetting("theme", "dark")}>Dark</Button>
|
|
|
|
onClick={() =>
|
|
|
|
|
|
|
|
setSetting(
|
|
|
|
|
|
|
|
"theme"
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
System
|
|
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
<Button
|
|
|
|
|
|
|
|
onClick={() =>
|
|
|
|
|
|
|
|
setSetting(
|
|
|
|
|
|
|
|
"theme",
|
|
|
|
|
|
|
|
"dark"
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
Dark
|
|
|
|
|
|
|
|
</Button>
|
|
|
|
</ButtonGroup>
|
|
|
|
</ButtonGroup>
|
|
|
|
</Setting>
|
|
|
|
</Setting>
|
|
|
|
|
|
|
|
|
|
|
|
<Setting title="Primary Color">
|
|
|
|
<Setting title="Primary Color">
|
|
|
|
<ColorBox marginRight={1} color={settings.primaryColor} />
|
|
|
|
<ColorBox
|
|
|
|
|
|
|
|
marginRight={1}
|
|
|
|
|
|
|
|
color={
|
|
|
|
|
|
|
|
settings.primaryColor
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/>
|
|
|
|
<Button
|
|
|
|
<Button
|
|
|
|
onClick={() => setPrimaryColorModal(true)}
|
|
|
|
onClick={() =>
|
|
|
|
|
|
|
|
setPrimaryColorModal(
|
|
|
|
|
|
|
|
true
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
variant="contained"
|
|
|
|
variant="contained"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
Pick Color
|
|
|
|
Pick Color
|
|
|
|
</Button>
|
|
|
|
</Button>
|
|
|
|
<MaterialColorPicker
|
|
|
|
<MaterialColorPicker
|
|
|
|
setState={setPrimaryColorModal}
|
|
|
|
setState={
|
|
|
|
isOpen={primaryColorModalIsOpen}
|
|
|
|
setPrimaryColorModal
|
|
|
|
setColor={(color) => setSetting("primaryColor", color)}
|
|
|
|
}
|
|
|
|
selectedColor={settings.primaryColor}
|
|
|
|
isOpen={
|
|
|
|
|
|
|
|
primaryColorModalIsOpen
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
setColor={(color) =>
|
|
|
|
|
|
|
|
setSetting(
|
|
|
|
|
|
|
|
"primaryColor",
|
|
|
|
|
|
|
|
color
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
selectedColor={
|
|
|
|
|
|
|
|
settings.primaryColor
|
|
|
|
|
|
|
|
}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</Setting>
|
|
|
|
</Setting>
|
|
|
|
|
|
|
|
|
|
|
|
<Setting title="Accent Color">
|
|
|
|
<Setting title="Accent Color">
|
|
|
|
<ColorBox marginRight={1} color={settings.accentColor} />
|
|
|
|
<ColorBox
|
|
|
|
|
|
|
|
marginRight={1}
|
|
|
|
|
|
|
|
color={
|
|
|
|
|
|
|
|
settings.accentColor
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/>
|
|
|
|
<Button
|
|
|
|
<Button
|
|
|
|
onClick={() => setAccentColorModal(true)}
|
|
|
|
onClick={() =>
|
|
|
|
|
|
|
|
setAccentColorModal(
|
|
|
|
|
|
|
|
true
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
variant="contained"
|
|
|
|
variant="contained"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
Pick Color
|
|
|
|
Pick Color
|
|
|
|
</Button>
|
|
|
|
</Button>
|
|
|
|
<MaterialColorPicker
|
|
|
|
<MaterialColorPicker
|
|
|
|
setState={setAccentColorModal}
|
|
|
|
setState={
|
|
|
|
isOpen={accentColorModalIsOpen}
|
|
|
|
setAccentColorModal
|
|
|
|
setColor={(color) => setSetting("accentColor", color)}
|
|
|
|
}
|
|
|
|
selectedColor={settings.accentColor}
|
|
|
|
isOpen={
|
|
|
|
|
|
|
|
accentColorModalIsOpen
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
setColor={(color) =>
|
|
|
|
|
|
|
|
setSetting(
|
|
|
|
|
|
|
|
"accentColor",
|
|
|
|
|
|
|
|
color
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
selectedColor={
|
|
|
|
|
|
|
|
settings.accentColor
|
|
|
|
|
|
|
|
}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</Setting>
|
|
|
|
</Setting>
|
|
|
|
|
|
|
|
|
|
|
|
<Divider sx={{ my: 4 }} />
|
|
|
|
<Divider sx={{ my: 4 }} />
|
|
|
|
|
|
|
|
|
|
|
|
<Typography variant="h4">Player</Typography>
|
|
|
|
<Typography variant="h4">
|
|
|
|
|
|
|
|
Player
|
|
|
|
|
|
|
|
</Typography>
|
|
|
|
|
|
|
|
|
|
|
|
<Divider sx={{ my: 4 }} />
|
|
|
|
<Divider sx={{ my: 4 }} />
|
|
|
|
|
|
|
|
|
|
|
|
<Typography variant="h4">Data</Typography>
|
|
|
|
<Typography variant="h4">
|
|
|
|
|
|
|
|
Data
|
|
|
|
|
|
|
|
</Typography>
|
|
|
|
|
|
|
|
|
|
|
|
<Setting
|
|
|
|
<Setting
|
|
|
|
title="Invidious Server"
|
|
|
|
title="Invidious Server"
|
|
|
|
description={`Where to fetch data from ${
|
|
|
|
description={`Where to fetch data from ${
|
|
|
|
settings.storageType == "invidious" ? "and login into" : ""
|
|
|
|
settings.storageType ==
|
|
|
|
|
|
|
|
"invidious"
|
|
|
|
|
|
|
|
? "and login into"
|
|
|
|
|
|
|
|
: ""
|
|
|
|
}`}
|
|
|
|
}`}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<Box sx={{ mr: 2 }}>
|
|
|
|
<Box sx={{ mr: 2 }}>
|
|
|
@ -218,10 +317,15 @@ const Settings: NextPage = () => {
|
|
|
|
<Refresh
|
|
|
|
<Refresh
|
|
|
|
sx={{
|
|
|
|
sx={{
|
|
|
|
cursor: "pointer",
|
|
|
|
cursor: "pointer",
|
|
|
|
color: theme.palette.text.secondary
|
|
|
|
color: theme
|
|
|
|
|
|
|
|
.palette
|
|
|
|
|
|
|
|
.text
|
|
|
|
|
|
|
|
.secondary
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
onClick={() =>
|
|
|
|
onClick={() =>
|
|
|
|
invidiousServerResponse.mutate(settings.invidiousServer)
|
|
|
|
invidiousServerResponse.mutate(
|
|
|
|
|
|
|
|
settings.invidiousServer
|
|
|
|
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
)}
|
|
|
|
)}
|
|
|
@ -229,50 +333,111 @@ const Settings: NextPage = () => {
|
|
|
|
!invidiousServerResponse.isLoading && (
|
|
|
|
!invidiousServerResponse.isLoading && (
|
|
|
|
<>
|
|
|
|
<>
|
|
|
|
<Done
|
|
|
|
<Done
|
|
|
|
onClick={() => setModalState(true)}
|
|
|
|
onClick={() =>
|
|
|
|
sx={{ color: green[800], cursor: "pointer" }}
|
|
|
|
setModalState(
|
|
|
|
|
|
|
|
true
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
sx={{
|
|
|
|
|
|
|
|
color: green[800],
|
|
|
|
|
|
|
|
cursor: "pointer"
|
|
|
|
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<InfoModal
|
|
|
|
<InfoModal
|
|
|
|
modalIsOpen={modalIsOpen}
|
|
|
|
modalIsOpen={
|
|
|
|
setModalState={setModalState}
|
|
|
|
modalIsOpen
|
|
|
|
data={invidiousServerResponse.data!}
|
|
|
|
}
|
|
|
|
|
|
|
|
setModalState={
|
|
|
|
|
|
|
|
setModalState
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
data={
|
|
|
|
|
|
|
|
invidiousServerResponse.data!
|
|
|
|
|
|
|
|
}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</>
|
|
|
|
</>
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
|
|
{invidiousServerResponse.error && (
|
|
|
|
{invidiousServerResponse.error && (
|
|
|
|
<Error sx={{ color: red[800] }} />
|
|
|
|
<Error
|
|
|
|
|
|
|
|
sx={{
|
|
|
|
|
|
|
|
color: red[800]
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
{invidiousServerResponse.isLoading && (
|
|
|
|
|
|
|
|
<CircularProgress />
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
{invidiousServerResponse.isLoading && <CircularProgress />}
|
|
|
|
|
|
|
|
</Box>
|
|
|
|
</Box>
|
|
|
|
<FormControl sx={{ minWidth: 200 }}>
|
|
|
|
<FormControl
|
|
|
|
<InputLabel id="server-select-label">Server</InputLabel>
|
|
|
|
sx={{ minWidth: 200 }}
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<InputLabel id="server-select-label">
|
|
|
|
|
|
|
|
Server
|
|
|
|
|
|
|
|
</InputLabel>
|
|
|
|
<Select
|
|
|
|
<Select
|
|
|
|
labelId="server-select-label"
|
|
|
|
labelId="server-select-label"
|
|
|
|
id="server-select"
|
|
|
|
id="server-select"
|
|
|
|
value={settings.invidiousServer}
|
|
|
|
value={
|
|
|
|
|
|
|
|
settings.invidiousServer
|
|
|
|
|
|
|
|
}
|
|
|
|
label="Server"
|
|
|
|
label="Server"
|
|
|
|
onChange={(e) => {
|
|
|
|
onChange={(
|
|
|
|
const server = e.target.value;
|
|
|
|
e
|
|
|
|
|
|
|
|
) => {
|
|
|
|
invidiousServerResponse.mutate(server);
|
|
|
|
const server =
|
|
|
|
|
|
|
|
e
|
|
|
|
|
|
|
|
.target
|
|
|
|
|
|
|
|
.value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
invidiousServerResponse.mutate(
|
|
|
|
|
|
|
|
server
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
setSetting("invidiousServer", server);
|
|
|
|
setSetting(
|
|
|
|
|
|
|
|
"invidiousServer",
|
|
|
|
|
|
|
|
server
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
MenuProps={{
|
|
|
|
|
|
|
|
sx: {
|
|
|
|
|
|
|
|
maxHeight: 300
|
|
|
|
|
|
|
|
}
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
MenuProps={{ sx: { maxHeight: 300 } }}
|
|
|
|
|
|
|
|
>
|
|
|
|
>
|
|
|
|
{instances.data &&
|
|
|
|
{instances.data &&
|
|
|
|
instances.data
|
|
|
|
instances.data
|
|
|
|
.filter(
|
|
|
|
.filter(
|
|
|
|
([, server]) =>
|
|
|
|
([
|
|
|
|
server.type != ServerInstanceType.Onion &&
|
|
|
|
,
|
|
|
|
server.api == true
|
|
|
|
server
|
|
|
|
|
|
|
|
]) =>
|
|
|
|
|
|
|
|
server.type !=
|
|
|
|
|
|
|
|
ServerInstanceType.Onion &&
|
|
|
|
|
|
|
|
server.api ==
|
|
|
|
|
|
|
|
true
|
|
|
|
)
|
|
|
|
)
|
|
|
|
.map(([uri, server]) => (
|
|
|
|
.map(
|
|
|
|
<MenuItem key={uri} value={uri}>
|
|
|
|
([
|
|
|
|
{server.flag} {uri}
|
|
|
|
uri,
|
|
|
|
|
|
|
|
server
|
|
|
|
|
|
|
|
]) => (
|
|
|
|
|
|
|
|
<MenuItem
|
|
|
|
|
|
|
|
key={
|
|
|
|
|
|
|
|
uri
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
value={
|
|
|
|
|
|
|
|
uri
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
server.flag
|
|
|
|
|
|
|
|
}{" "}
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
uri
|
|
|
|
|
|
|
|
}
|
|
|
|
</MenuItem>
|
|
|
|
</MenuItem>
|
|
|
|
))}
|
|
|
|
)
|
|
|
|
|
|
|
|
)}
|
|
|
|
</Select>
|
|
|
|
</Select>
|
|
|
|
</FormControl>
|
|
|
|
</FormControl>
|
|
|
|
</Setting>
|
|
|
|
</Setting>
|
|
|
@ -281,22 +446,43 @@ const Settings: NextPage = () => {
|
|
|
|
title="Data Storage Location"
|
|
|
|
title="Data Storage Location"
|
|
|
|
description="Where your personal data will be stored"
|
|
|
|
description="Where your personal data will be stored"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<FormControl sx={{ minWidth: 200 }}>
|
|
|
|
<FormControl
|
|
|
|
<InputLabel id="location-select-label">Location</InputLabel>
|
|
|
|
sx={{ minWidth: 200 }}
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<InputLabel id="location-select-label">
|
|
|
|
|
|
|
|
Location
|
|
|
|
|
|
|
|
</InputLabel>
|
|
|
|
<Select
|
|
|
|
<Select
|
|
|
|
labelId="location-select-label"
|
|
|
|
labelId="location-select-label"
|
|
|
|
id="location-select"
|
|
|
|
id="location-select"
|
|
|
|
value={settings.storageType}
|
|
|
|
value={
|
|
|
|
|
|
|
|
settings.storageType
|
|
|
|
|
|
|
|
}
|
|
|
|
label="Location"
|
|
|
|
label="Location"
|
|
|
|
onChange={(e) => {
|
|
|
|
onChange={(
|
|
|
|
const location = e.target.value;
|
|
|
|
e
|
|
|
|
|
|
|
|
) => {
|
|
|
|
setSetting("storageType", location);
|
|
|
|
const location =
|
|
|
|
|
|
|
|
e
|
|
|
|
|
|
|
|
.target
|
|
|
|
|
|
|
|
.value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setSetting(
|
|
|
|
|
|
|
|
"storageType",
|
|
|
|
|
|
|
|
location
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
MenuProps={{
|
|
|
|
|
|
|
|
sx: {
|
|
|
|
|
|
|
|
maxHeight: 300
|
|
|
|
|
|
|
|
}
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
MenuProps={{ sx: { maxHeight: 300 } }}
|
|
|
|
|
|
|
|
>
|
|
|
|
>
|
|
|
|
{[
|
|
|
|
{[
|
|
|
|
{ name: "Locally", value: StorageType.Local },
|
|
|
|
{
|
|
|
|
|
|
|
|
name: "Locally",
|
|
|
|
|
|
|
|
value: StorageType.Local
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
name: "Invidious server using auth",
|
|
|
|
name: "Invidious server using auth",
|
|
|
|
value: StorageType.Invidious
|
|
|
|
value: StorageType.Invidious
|
|
|
@ -305,43 +491,69 @@ const Settings: NextPage = () => {
|
|
|
|
name: `A custom ${process.env.NEXT_PUBLIC_APP_NAME} auth server`,
|
|
|
|
name: `A custom ${process.env.NEXT_PUBLIC_APP_NAME} auth server`,
|
|
|
|
value: StorageType.RemoteServer
|
|
|
|
value: StorageType.RemoteServer
|
|
|
|
}
|
|
|
|
}
|
|
|
|
].map((location, i) => (
|
|
|
|
].map(
|
|
|
|
<MenuItem key={i} value={location.value}>
|
|
|
|
(
|
|
|
|
{location.name}
|
|
|
|
location,
|
|
|
|
|
|
|
|
i
|
|
|
|
|
|
|
|
) => (
|
|
|
|
|
|
|
|
<MenuItem
|
|
|
|
|
|
|
|
key={
|
|
|
|
|
|
|
|
i
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
value={
|
|
|
|
|
|
|
|
location.value
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
location.name
|
|
|
|
|
|
|
|
}
|
|
|
|
</MenuItem>
|
|
|
|
</MenuItem>
|
|
|
|
))}
|
|
|
|
)
|
|
|
|
|
|
|
|
)}
|
|
|
|
</Select>
|
|
|
|
</Select>
|
|
|
|
</FormControl>
|
|
|
|
</FormControl>
|
|
|
|
</Setting>
|
|
|
|
</Setting>
|
|
|
|
|
|
|
|
|
|
|
|
{settings.storageType != StorageType.Local && (
|
|
|
|
{settings.storageType !=
|
|
|
|
|
|
|
|
StorageType.Local && (
|
|
|
|
<>
|
|
|
|
<>
|
|
|
|
{settings.storageType == "invidious" && allowsRegistrations && (
|
|
|
|
{settings.storageType ==
|
|
|
|
|
|
|
|
"invidious" &&
|
|
|
|
|
|
|
|
allowsRegistrations && (
|
|
|
|
<Setting
|
|
|
|
<Setting
|
|
|
|
title="Username"
|
|
|
|
title="Username"
|
|
|
|
description="The username for your Invidious account"
|
|
|
|
description="The username for your Invidious account"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<TextField label="Username" color="primary" />
|
|
|
|
<TextField
|
|
|
|
|
|
|
|
label="Username"
|
|
|
|
|
|
|
|
color="primary"
|
|
|
|
|
|
|
|
/>
|
|
|
|
</Setting>
|
|
|
|
</Setting>
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
|
|
{settings.storageType == StorageType.RemoteServer && (
|
|
|
|
{settings.storageType ==
|
|
|
|
|
|
|
|
StorageType.RemoteServer && (
|
|
|
|
<Setting
|
|
|
|
<Setting
|
|
|
|
title="Server address"
|
|
|
|
title="Server address"
|
|
|
|
description={`The address for your ${process.env.NEXT_PUBLIC_APP_NAME} auth server`}
|
|
|
|
description={`The address for your ${process.env.NEXT_PUBLIC_APP_NAME} auth server`}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<TextField label="Server adress" color="primary" />
|
|
|
|
<TextField
|
|
|
|
|
|
|
|
label="Server adress"
|
|
|
|
|
|
|
|
color="primary"
|
|
|
|
|
|
|
|
/>
|
|
|
|
</Setting>
|
|
|
|
</Setting>
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
|
|
<Setting
|
|
|
|
<Setting
|
|
|
|
title={
|
|
|
|
title={
|
|
|
|
settings.storageType == StorageType.Invidious
|
|
|
|
settings.storageType ==
|
|
|
|
|
|
|
|
StorageType.Invidious
|
|
|
|
? "Password"
|
|
|
|
? "Password"
|
|
|
|
: "Passphrase"
|
|
|
|
: "Passphrase"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
description={
|
|
|
|
description={
|
|
|
|
settings.storageType == StorageType.Invidious
|
|
|
|
settings.storageType ==
|
|
|
|
|
|
|
|
StorageType.Invidious
|
|
|
|
? "The password for your invidious account"
|
|
|
|
? "The password for your invidious account"
|
|
|
|
: "The passphrase for your account"
|
|
|
|
: "The passphrase for your account"
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -349,7 +561,8 @@ const Settings: NextPage = () => {
|
|
|
|
<TextField
|
|
|
|
<TextField
|
|
|
|
type="password"
|
|
|
|
type="password"
|
|
|
|
label={
|
|
|
|
label={
|
|
|
|
settings.storageType == StorageType.Invidious
|
|
|
|
settings.storageType ==
|
|
|
|
|
|
|
|
StorageType.Invidious
|
|
|
|
? "Password"
|
|
|
|
? "Password"
|
|
|
|
: "Passphrase"
|
|
|
|
: "Passphrase"
|
|
|
|
}
|
|
|
|
}
|
|
|
|