1
0
Fork 0
mirror of https://github.com/pawelmalak/flame.git synced 2025-07-21 20:39:36 +02:00

Merge remote-tracking branch 'upstream/master'

This commit is contained in:
François Darveau 2022-01-09 22:39:51 -05:00
commit e75c5a7d4e
8 changed files with 80 additions and 57 deletions

2
.env
View file

@ -1,5 +1,5 @@
PORT=5005 PORT=5005
NODE_ENV=development NODE_ENV=development
VERSION=2.2.0 VERSION=2.2.1
PASSWORD=flame_password PASSWORD=flame_password
SECRET=e02eb43d69953658c6d07311d6313f2d4467672cb881f96b29368ba1f3f4da4b SECRET=e02eb43d69953658c6d07311d6313f2d4467672cb881f96b29368ba1f3f4da4b

View file

@ -1,3 +1,8 @@
### v2.2.1 (2022-01-08)
- Local search will now include app descriptions ([#266](https://github.com/pawelmalak/flame/issues/266))
- Fixed bug with unsupported characters in local search [#279](https://github.com/pawelmalak/flame/issues/279))
- Background tasks optimization ([#283](https://github.com/pawelmalak/flame/issues/283))
### v2.2.0 (2021-12-17) ### v2.2.0 (2021-12-17)
- Added option to set custom description for apps ([#201](https://github.com/pawelmalak/flame/issues/201)) - Added option to set custom description for apps ([#201](https://github.com/pawelmalak/flame/issues/201))
- Fixed fatal error while deploying Flame to cluster ([#242](https://github.com/pawelmalak/flame/issues/242)) - Fixed fatal error while deploying Flame to cluster ([#242](https://github.com/pawelmalak/flame/issues/242))

View file

@ -1 +1 @@
REACT_APP_VERSION=2.2.0 REACT_APP_VERSION=2.2.1

View file

@ -59,9 +59,8 @@ export const Home = (): JSX.Element => {
appCategory.apps = appCategories appCategory.apps = appCategories
.map(({ apps }) => apps) .map(({ apps }) => apps)
.flat() .flat()
.filter(({ name, url }) => .filter(({ name, url, description }) =>
new RegExp(escapeRegex(localSearch), 'i').test(name) || new RegExp(escapeRegex(localSearch), 'i').test(`${name} ${url} ${description}`)
new RegExp(escapeRegex(localSearch), 'i').test(url)
); );
setAppSearchResult([appCategory]); setAppSearchResult([appCategory]);
@ -74,8 +73,7 @@ export const Home = (): JSX.Element => {
.map(({ bookmarks }) => bookmarks) .map(({ bookmarks }) => bookmarks)
.flat() .flat()
.filter(({ name, url }) => .filter(({ name, url }) =>
new RegExp(escapeRegex(localSearch), 'i').test(name) || new RegExp(escapeRegex(localSearch), 'i').test(`${name} ${url}`)
new RegExp(escapeRegex(localSearch), 'i').test(url)
); );
setBookmarkSearchResult([bookmarkCategory]); setBookmarkSearchResult([bookmarkCategory]);

View file

@ -66,7 +66,8 @@ export const SearchBar = (props: Props): JSX.Element => {
); );
if (isLocal) { if (isLocal) {
setLocalSearch(search); // no additional encoding required for local search
setLocalSearch(inputRef.current.value);
} }
if (e.code === 'Enter' || e.code === 'NumpadEnter') { if (e.code === 'Enter' || e.code === 'NumpadEnter') {

View file

@ -1,43 +1,57 @@
import { Fragment } from 'react'; import { Fragment } from 'react';
// UI
import { Button, SettingsHeadline } from '../../UI'; import { Button, SettingsHeadline } from '../../UI';
import classes from './AppDetails.module.css';
import { checkVersion } from '../../../utility';
import { AuthForm } from './AuthForm/AuthForm'; import { AuthForm } from './AuthForm/AuthForm';
import classes from './AppDetails.module.css';
// Store
import { useSelector } from 'react-redux';
import { State } from '../../../store/reducers';
// Other
import { checkVersion } from '../../../utility';
export const AppDetails = (): JSX.Element => { export const AppDetails = (): JSX.Element => {
const { isAuthenticated } = useSelector((state: State) => state.auth);
return ( return (
<Fragment> <Fragment>
<SettingsHeadline text="Authentication" /> <SettingsHeadline text="Authentication" />
<AuthForm /> <AuthForm />
<hr className={classes.separator} /> {isAuthenticated && (
<Fragment>
<hr className={classes.separator} />
<div> <div>
<SettingsHeadline text="App version" /> <SettingsHeadline text="App version" />
<p className={classes.text}> <p className={classes.text}>
<a <a
href="https://github.com/pawelmalak/flame" href="https://github.com/pawelmalak/flame"
target="_blank" target="_blank"
rel="noreferrer" rel="noreferrer"
> >
Flame Flame
</a>{' '} </a>{' '}
version {process.env.REACT_APP_VERSION} version {process.env.REACT_APP_VERSION}
</p> </p>
<p className={classes.text}> <p className={classes.text}>
See changelog{' '} See changelog{' '}
<a <a
href="https://github.com/pawelmalak/flame/blob/master/CHANGELOG.md" href="https://github.com/pawelmalak/flame/blob/master/CHANGELOG.md"
target="_blank" target="_blank"
rel="noreferrer" rel="noreferrer"
> >
here here
</a> </a>
</p> </p>
<Button click={() => checkVersion(true)}>Check for updates</Button> <Button click={() => checkVersion(true)}>Check for updates</Button>
</div> </div>
</Fragment>
)}
</Fragment> </Fragment>
); );
}; };

View file

@ -24,6 +24,7 @@ const logger = new Logger();
await initApp(); await initApp();
await connectDB(); await connectDB();
await associateModels(); await associateModels();
await jobs();
// Load apps to create/update apps from integrations (Docker, Kubernetes, etc.) // Load apps to create/update apps from integrations (Docker, Kubernetes, etc.)
await initIntegrationsApps(); await initIntegrationsApps();

View file

@ -6,30 +6,34 @@ const Logger = require('./Logger');
const loadConfig = require('./loadConfig'); const loadConfig = require('./loadConfig');
const logger = new Logger(); const logger = new Logger();
// Update weather data every 15 minutes module.exports = async function () {
const weatherJob = schedule.scheduleJob( const { WEATHER_API_KEY } = await loadConfig();
'updateWeather',
'0 */15 * * * *',
async () => {
const { WEATHER_API_KEY: secret } = await loadConfig();
try { if (WEATHER_API_KEY != '') {
const weatherData = await getExternalWeather(); // Update weather data every 15 minutes
const weatherJob = schedule.scheduleJob(
'updateWeather',
'0 */15 * * * *',
async () => {
try {
const weatherData = await getExternalWeather();
Sockets.getSocket('weather').socket.send(JSON.stringify(weatherData)); Sockets.getSocket('weather').socket.send(JSON.stringify(weatherData));
} catch (err) { } catch (err) {
if (secret) { if (WEATHER_API_KEY) {
logger.log(err.message, 'ERROR'); logger.log(err.message, 'ERROR');
}
}
} }
} );
}
);
// Clear old weather data every 4 hours // Clear old weather data every 4 hours
const weatherCleanerJob = schedule.scheduleJob( const weatherCleanerJob = schedule.scheduleJob(
'clearWeather', 'clearWeather',
'0 5 */4 * * *', '0 5 */4 * * *',
async () => { async () => {
clearWeatherData(); clearWeatherData();
}
);
} }
); };