Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fireshare",
"version": "1.5.6",
"version": "1.5.7",
"private": true,
"dependencies": {
"@emotion/react": "^11.9.0",
Expand Down
106 changes: 56 additions & 50 deletions app/client/src/components/nav/Navbar20.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,13 @@ function Navbar20({
src={logo}
height={42}
onClick={() => navigate(authenticated ? '/' : '/feed')}
sx={{ pr: open ? 2 : 0, cursor: 'pointer', flexShrink: 0, opacity: (!open && logoHovered) ? 0 : 1, transition: 'opacity 0.15s' }}
sx={{
pr: open ? 2 : 0,
cursor: 'pointer',
flexShrink: 0,
opacity: !open && logoHovered ? 0 : 1,
transition: 'opacity 0.15s',
}}
/>
{open && (
<>
Expand Down Expand Up @@ -423,53 +429,53 @@ function Navbar20({
!isMobile &&
folders.length > 1 &&
uiConfig.show_folder_dropdown === true ? (
<>
<Divider />
<Box sx={{ p: open ? 1.5 : 0.75 }}>
{open ? (
<Select
value={selectedFolder}
options={createSelectFolders(folders)}
onChange={handleFolderChange}
styles={selectFolderTheme}
blurInputOnSelect
isSearchable={false}
menuPlacement="auto"
/>
) : (
<LightTooltip title={selectedFolder.label} placement="right" arrow>
<Box
sx={{
width: 42,
height: 38,
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
border: '1px solid #FFFFFF26',
borderRadius: '8px',
backgroundColor: '#FFFFFF0D',
cursor: 'pointer',
color: '#fff',
fontSize: 11,
fontWeight: 600,
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
}}
onClick={() => {
// Cycle through folders
const idx = folders.indexOf(selectedFolder.value)
const next = folders[(idx + 1) % folders.length]
handleFolderChange({ value: next, label: next })
}}
>
{selectedFolder.label.substring(0, 3)}
</Box>
</LightTooltip>
)}
</Box>
</>
) : null}
<>
<Divider />
<Box sx={{ p: open ? 1.5 : 0.75 }}>
{open ? (
<Select
value={selectedFolder}
options={createSelectFolders(folders)}
onChange={handleFolderChange}
styles={selectFolderTheme}
blurInputOnSelect
isSearchable={false}
menuPlacement="auto"
/>
) : (
<LightTooltip title={selectedFolder.label} placement="right" arrow>
<Box
sx={{
width: 42,
height: 38,
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
border: '1px solid #FFFFFF26',
borderRadius: '8px',
backgroundColor: '#FFFFFF0D',
cursor: 'pointer',
color: '#fff',
fontSize: 11,
fontWeight: 600,
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
}}
onClick={() => {
// Cycle through folders
const idx = folders.indexOf(selectedFolder.value)
const next = folders[(idx + 1) % folders.length]
handleFolderChange({ value: next, label: next })
}}
>
{selectedFolder.label.substring(0, 3)}
</Box>
</LightTooltip>
)}
</Box>
</>
) : null}
{cardSlider && open && !isMobile ? (
<>
<Divider />
Expand Down Expand Up @@ -635,7 +641,7 @@ function Navbar20({
)
return (
<Box sx={{ display: 'flex' }}>
{page !== '/login' && page !== '/watch' && (
{page !== '/login' && page !== '/watch' && page !== '/files' && page !== '/settings' && (
<AppBar
position="fixed"
open={open}
Expand Down Expand Up @@ -768,7 +774,7 @@ function Navbar20({
}),
}}
>
{toolbar && page !== '/watch' && <Toolbar />}
{toolbar && page !== '/watch' && page !== '/files' && page !== '/settings' && <Toolbar />}
<SnackbarAlert severity={alert.type} open={alert.open} setOpen={(open) => setAlert({ ...alert, open })}>
{alert.message}
</SnackbarAlert>
Expand Down
35 changes: 28 additions & 7 deletions app/client/src/views/FileManager.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,38 @@
import React from 'react'
import { Box, Typography } from '@mui/material'
import LockOutlinedIcon from '@mui/icons-material/LockOutlined'
import BulkFileManager from '../components/admin/BulkFileManager'
import SnackbarAlert from '../components/alert/SnackbarAlert'

const FileManager = ({ authenticated, isAdmin }) => {
const FileManager = ({ authenticated }) => {
const [alert, setAlert] = React.useState({ open: false })
if (!isAdmin) return (
<Box sx={{ p: 4, textAlign: 'center' }}>
<Typography color="error">Admin access required.</Typography>
</Box>
)
if (!authenticated)
return (
<Box
sx={{
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
gap: 2,
py: 8,
px: 3,
border: '1px solid #FFFFFF14',
borderRadius: '16px',
background: '#00000040',
m: 4,
}}
>
<LockOutlinedIcon sx={{ fontSize: 56, color: '#FFFFFF33' }} />
<Box sx={{ textAlign: 'center' }}>
<Typography sx={{ fontWeight: 700, fontSize: 20, color: 'white', mb: 0.5 }}>
You must be authenticated to access this page
</Typography>
</Box>
</Box>
)
return (
<Box sx={{ p: 3 }}>
<Box>
<SnackbarAlert severity={alert.type} open={alert.open} setOpen={(open) => setAlert({ ...alert, open })}>
{alert.message}
</SnackbarAlert>
Expand Down
2 changes: 1 addition & 1 deletion app/client/src/views/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ const Settings = () => {
<SnackbarAlert severity={alert.type} open={alert.open} setOpen={(open) => setAlert({ ...alert, open })}>
{alert.message}
</SnackbarAlert>
<Box sx={{ display: 'flex', height: 'calc(100vh - 112px)' }}>
<Box sx={{ display: 'flex', maxHeight: 'calc(100vh - 50px)' }}>
{/* Vertical Tabs */}
<Tabs
orientation="vertical"
Expand Down
3 changes: 1 addition & 2 deletions app/client/src/views/Tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -507,9 +507,9 @@ const Tags = ({ authenticated, searchText }) => {
open={newTagDialogOpen}
onClose={() => {
setNewTagDialogOpen(false)
setEditingTag(null)
setColorPickerAnchorEl(null)
}}
TransitionProps={{ onExited: () => setEditingTag(null) }}
PaperProps={{ sx: dialogPaperSx }}
>
<DialogTitle sx={dialogTitleSx}>{editingTag ? 'Edit Tag' : 'Create New Tag'}</DialogTitle>
Expand Down Expand Up @@ -566,7 +566,6 @@ const Tags = ({ authenticated, searchText }) => {
<Button
onClick={() => {
setNewTagDialogOpen(false)
setEditingTag(null)
setColorPickerAnchorEl(null)
}}
sx={{ borderRadius: '8px', color: 'white', borderColor: 'white' }}
Expand Down
19 changes: 10 additions & 9 deletions app/server/fireshare/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,20 +275,21 @@ def load_user(user_id):
if 'integrations' not in DEFAULT_CONFIG:
DEFAULT_CONFIG['integrations'] = {}

DEFAULT_CONFIG['integrations']['discord_webhook_url'] = app.config.get('DISCORD_WEBHOOK_URL', '')
DEFAULT_CONFIG['integrations']['generic_webhook_url'] = app.config.get('GENERIC_WEBHOOK_URL', '')
DEFAULT_CONFIG['integrations']['generic_webhook_payload'] = app.config.get('GENERIC_WEBHOOK_PAYLOAD', {})

update_config(paths['data'] / 'config.json')

# Only overwrite integration settings in config.json if the env vars are explicitly set.
# This preserves values the user may have configured via the UI or directly in config.json.
config_path = paths['data'] / 'config.json'
with open(config_path, 'r+') as f:
data = json.load(f)

data['integrations']['discord_webhook_url'] = app.config.get('DISCORD_WEBHOOK_URL', '')
data['integrations']['generic_webhook_url'] = app.config.get('GENERIC_WEBHOOK_URL', '')
data['integrations']['generic_webhook_payload'] = app.config.get('GENERIC_WEBHOOK_PAYLOAD', {})


if app.config.get('DISCORD_WEBHOOK_URL'):
data['integrations']['discord_webhook_url'] = app.config['DISCORD_WEBHOOK_URL']
if app.config.get('GENERIC_WEBHOOK_URL'):
data['integrations']['generic_webhook_url'] = app.config['GENERIC_WEBHOOK_URL']
if app.config.get('GENERIC_WEBHOOK_PAYLOAD'):
data['integrations']['generic_webhook_payload'] = app.config['GENERIC_WEBHOOK_PAYLOAD']

f.seek(0)
json.dump(data, f, indent=2)
f.truncate()
Expand Down
Loading
Loading