diff --git a/README.md b/README.md index a86b7961..50626c43 100644 --- a/README.md +++ b/README.md @@ -125,6 +125,12 @@ Direct links copied from the link copy buttons in Fireshare will allow websites

Logo

+

RSS Feed Support

+

+ Stay up to date in your favorite RSS reader. Fireshare publishes a feed of the + latest public videos so you can subscribe and get new uploads automatically. +

+

LDAP Authentication Support

diff --git a/app/client/src/components/nav/Navbar20.js b/app/client/src/components/nav/Navbar20.js index a0481e4a..33f9a602 100644 --- a/app/client/src/components/nav/Navbar20.js +++ b/app/client/src/components/nav/Navbar20.js @@ -429,8 +429,8 @@ function Navbar20({ - - + + {folderSize !== null ? ( open ? ( - + ) ) : ( - + {open ? Loading Disk Usage... : } + />} )} diff --git a/app/client/src/views/Settings.js b/app/client/src/views/Settings.js index ab87f598..4853c957 100644 --- a/app/client/src/views/Settings.js +++ b/app/client/src/views/Settings.js @@ -14,6 +14,7 @@ import { import SnackbarAlert from '../components/alert/SnackbarAlert' import SaveIcon from '@mui/icons-material/Save' import SensorsIcon from '@mui/icons-material/Sensors' +import RssFeedIcon from '@mui/icons-material/RssFeed' import SportsEsportsIcon from '@mui/icons-material/SportsEsports' import CalendarMonthIcon from '@mui/icons-material/CalendarMonth' import VisibilityIcon from '@mui/icons-material/Visibility' @@ -41,9 +42,18 @@ const Settings = ({ authenticated }) => { React.useEffect(() => { async function fetch() { try { - const conf = (await ConfigService.getAdminConfig()).data - setConfig(conf) - setUpdatedConfig(conf) + const res = await ConfigService.getAdminConfig() + const conf = _.cloneDeep(res.data) + + // Ensure rss_config exists and has default values for comparison + if (!conf.rss_config) { + conf.rss_config = { title: '', description: '' } + } + if (!conf.rss_config.title) conf.rss_config.title = '' + if (!conf.rss_config.description) conf.rss_config.description = '' + + setConfig(_.cloneDeep(conf)) + setUpdatedConfig(_.cloneDeep(conf)) await checkForWarnings() } catch (err) { console.error(err) @@ -53,7 +63,9 @@ const Settings = ({ authenticated }) => { }, []) React.useEffect(() => { - setUpdateable(!_.isEqual(config, updatedConfig)) + if (config && updatedConfig) { + setUpdateable(!_.isEqual(config, updatedConfig)) + } }, [updatedConfig, config]) React.useEffect(() => { @@ -66,11 +78,11 @@ const Settings = ({ authenticated }) => { try { await ConfigService.updateConfig(updatedConfig) setUpdateable(false) - setConfig((prev) => ({ ...prev, ...updatedConfig })) + setConfig(_.cloneDeep(updatedConfig)) setAlert({ open: true, message: 'Settings Updated! Changes may take a minute to take effect.', type: 'success' }) } catch (err) { console.error(err) - setAlert({ open: true, message: err.response.data, type: 'error' }) + setAlert({ open: true, message: err.response?.data || 'Error saving settings', type: 'error' }) } } @@ -135,41 +147,41 @@ const Settings = ({ authenticated }) => { const checkForWarnings = async () =>{ let warnings = await WarningService.getAdminWarnings() - if (Object.keys(warnings.data).length === 0) - return; + if (Object.keys(warnings.data).length === 0) + return; - for (const warning of warnings.data) { - // Check if this is the SteamGridDB warning - if (warning.includes('SteamGridDB API key not configured')) { - setAlert({ - open: true, - type: 'warning', - message: ( - - {warning.replace('Click here to set it up.', '')} - { - e.preventDefault(); - document.getElementById('steamgrid-api-key-field')?.scrollIntoView({ behavior: 'smooth', block: 'center' }); - document.getElementById('steamgrid-api-key-field')?.focus(); - }} - style={{ color: '#2684FF', textDecoration: 'underline', cursor: 'pointer', marginLeft: '4px' }} - > - Click here to set it up. - - - ), - }); - } else { - setAlert({ - open: true, - type: 'warning', - message: warning, - }); - } - await new Promise(r => setTimeout(r, 2000)); //Without this a second Warning would instantly overwrite the first... + for (const warning of warnings.data) { + // Check if this is the SteamGridDB warning + if (warning.includes('SteamGridDB API key not configured')) { + setAlert({ + open: true, + type: 'warning', + message: ( + + {warning.replace('Click here to set it up.', '')} + { + e.preventDefault(); + document.getElementById('steamgrid-api-key-field')?.scrollIntoView({ behavior: 'smooth', block: 'center' }); + document.getElementById('steamgrid-api-key-field')?.focus(); + }} + style={{ color: '#2684FF', textDecoration: 'underline', cursor: 'pointer', marginLeft: '4px' }} + > + Click here to set it up. + + + ), + }); + } else { + setAlert({ + open: true, + type: 'warning', + message: warning, + }); } + await new Promise(r => setTimeout(r, 2000)); //Without this a second Warning would instantly overwrite the first... + } } return ( @@ -467,10 +479,50 @@ const Settings = ({ authenticated }) => { ), }} /> + + + + Feeds + + + + setUpdatedConfig((prev) => ({ + ...prev, + rss_config: { ...(prev.rss_config || {}), title: e.target.value }, + })) + } + /> + + setUpdatedConfig((prev) => ({ + ...prev, + rss_config: { ...(prev.rss_config || {}), description: e.target.value }, + })) + } + /> + +