mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-13 16:40:01 +00:00
@@ -1,25 +1,12 @@
|
||||
import React, {useEffect} from "react";
|
||||
import React from "react";
|
||||
import {SystemEndpoint} from "Frontend/generated/endpoints";
|
||||
import withConfigPage from "Frontend/components/administration/withConfigPage";
|
||||
import {Button} from "@heroui/react";
|
||||
import ConfigFormField from "Frontend/components/administration/ConfigFormField";
|
||||
import Section from "Frontend/components/general/Section";
|
||||
|
||||
function SystemManagementLayout({getConfig, formik, setSaveMessage}: any) {
|
||||
|
||||
useEffect(() => {
|
||||
if (formik.dirty && (formik.initialValues.system.cors["allowed-origins"] !== formik.values.system.cors["allowed-origins"])) {
|
||||
setSaveMessage("Gameyfin must be restarted for the changes to take effect");
|
||||
} else {
|
||||
setSaveMessage(null);
|
||||
}
|
||||
}, [formik.dirty]);
|
||||
|
||||
function SystemManagementLayout() {
|
||||
return (
|
||||
<div className="flex flex-col mt-4">
|
||||
<Section title="Security configuration"/>
|
||||
<ConfigFormField configElement={getConfig("system.cors.allowed-origins")}/>
|
||||
|
||||
<Section title="Restart Gameyfin"/>
|
||||
<Button onPress={() => SystemEndpoint.restart()}>Restart</Button>
|
||||
</div>
|
||||
|
||||
@@ -256,18 +256,6 @@ sealed class ConfigProperties<T : Serializable>(
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/** System */
|
||||
sealed class System {
|
||||
sealed class Cors {
|
||||
data object AllowedOrigins : ConfigProperties<Array<String>>(
|
||||
Array<String>::class,
|
||||
"system.cors.allowed-origins",
|
||||
"List of allowed CORS origins (currently unused)",
|
||||
emptyArray()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
enum class MatchUsersBy {
|
||||
|
||||
@@ -31,7 +31,6 @@ class SecurityConfig(
|
||||
) : VaadinWebSecurity() {
|
||||
|
||||
private val ssoProviderKey: String = "oidc"
|
||||
private val allowedOrigins: List<String>? = config.get(ConfigProperties.System.Cors.AllowedOrigins)?.toList()
|
||||
|
||||
@Throws(Exception::class)
|
||||
override fun configure(http: HttpSecurity) {
|
||||
|
||||
Reference in New Issue
Block a user