1
0
Fork 0
mirror of https://github.com/pawelmalak/flame.git synced 2025-07-28 15:19:36 +02:00

Merge branch 'feature' into v1.7.0

This commit is contained in:
Paweł Malak 2021-10-11 14:31:59 +02:00
commit 55f192f664
53 changed files with 1172 additions and 385 deletions

View file

@ -13,20 +13,16 @@ import {
import {
GlobalState,
NewNotification,
Query,
SettingsForm,
} from '../../../interfaces';
// UI
import InputGroup from '../../UI/Forms/InputGroup/InputGroup';
import Button from '../../UI/Buttons/Button/Button';
// CSS
import classes from './OtherSettings.module.css';
import SettingsHeadline from '../../UI/Headlines/SettingsHeadline/SettingsHeadline';
// Utils
import { searchConfig } from '../../../utility';
import { queries } from '../../../utility/searchQueries.json';
interface ComponentProps {
createNotification: (notification: NewNotification) => void;
@ -45,12 +41,9 @@ const OtherSettings = (props: ComponentProps): JSX.Element => {
hideHeader: 0,
hideApps: 0,
hideCategories: 0,
hideSearch: 0,
defaultSearchProvider: 'd',
useOrdering: 'createdAt',
appsSameTab: 0,
bookmarksSameTab: 0,
searchSameTab: 0,
dockerApps: 1,
dockerHost: 'localhost',
kubernetesApps: 1,
@ -66,12 +59,9 @@ const OtherSettings = (props: ComponentProps): JSX.Element => {
hideHeader: searchConfig('hideHeader', 0),
hideApps: searchConfig('hideApps', 0),
hideCategories: searchConfig('hideCategories', 0),
hideSearch: searchConfig('hideSearch', 0),
defaultSearchProvider: searchConfig('defaultSearchProvider', 'd'),
useOrdering: searchConfig('useOrdering', 'createdAt'),
appsSameTab: searchConfig('appsSameTab', 0),
bookmarksSameTab: searchConfig('bookmarksSameTab', 0),
searchSameTab: searchConfig('searchSameTab', 0),
dockerApps: searchConfig('dockerApps', 0),
dockerHost: searchConfig('dockerHost', 'localhost'),
kubernetesApps: searchConfig('kubernetesApps', 0),
@ -114,7 +104,7 @@ const OtherSettings = (props: ComponentProps): JSX.Element => {
return (
<form onSubmit={(e) => formSubmitHandler(e)}>
{/* OTHER OPTIONS */}
<h2 className={classes.SettingsSection}>Miscellaneous</h2>
<SettingsHeadline text="Miscellaneous" />
<InputGroup>
<label htmlFor="customTitle">Custom page title</label>
<input
@ -128,7 +118,7 @@ const OtherSettings = (props: ComponentProps): JSX.Element => {
</InputGroup>
{/* BEAHVIOR OPTIONS */}
<h2 className={classes.SettingsSection}>App Behavior</h2>
<SettingsHeadline text="App Behavior" />
<InputGroup>
<label htmlFor="pinAppsByDefault">
Pin new applications by default
@ -170,35 +160,6 @@ const OtherSettings = (props: ComponentProps): JSX.Element => {
<option value="orderId">Custom order</option>
</select>
</InputGroup>
<InputGroup>
<label htmlFor="defaultSearchProvider">Default Search Provider</label>
<select
id="defaultSearchProvider"
name="defaultSearchProvider"
value={formData.defaultSearchProvider}
onChange={(e) => inputChangeHandler(e)}
>
{queries.map((query: Query, idx) => (
<option key={idx} value={query.prefix}>
{query.name}
</option>
))}
</select>
</InputGroup>
<InputGroup>
<label htmlFor="searchSameTab">
Open search results in the same tab
</label>
<select
id="searchSameTab"
name="searchSameTab"
value={formData.searchSameTab}
onChange={(e) => inputChangeHandler(e, true)}
>
<option value={1}>True</option>
<option value={0}>False</option>
</select>
</InputGroup>
<InputGroup>
<label htmlFor="appsSameTab">Open applications in the same tab</label>
<select
@ -225,19 +186,7 @@ const OtherSettings = (props: ComponentProps): JSX.Element => {
</InputGroup>
{/* MODULES OPTIONS */}
<h2 className={classes.SettingsSection}>Modules</h2>
<InputGroup>
<label htmlFor="hideSearch">Hide search bar</label>
<select
id="hideSearch"
name="hideSearch"
value={formData.hideSearch}
onChange={(e) => inputChangeHandler(e, true)}
>
<option value={1}>True</option>
<option value={0}>False</option>
</select>
</InputGroup>
<SettingsHeadline text="Modules" />
<InputGroup>
<label htmlFor="hideHeader">Hide greeting and date</label>
<select
@ -276,7 +225,7 @@ const OtherSettings = (props: ComponentProps): JSX.Element => {
</InputGroup>
{/* DOCKER SETTINGS */}
<h2 className={classes.SettingsSection}>Docker</h2>
<SettingsHeadline text="Docker" />
<InputGroup>
<label htmlFor="dockerHost">Docker Host</label>
<input
@ -316,7 +265,7 @@ const OtherSettings = (props: ComponentProps): JSX.Element => {
</InputGroup>
{/* KUBERNETES SETTINGS */}
<h2 className={classes.SettingsSection}>Kubernetes</h2>
<SettingsHeadline text="Kubernetes" />
<InputGroup>
<label htmlFor="kubernetesApps">Use Kubernetes Ingress API</label>
<select