1
0
Fork 0
mirror of https://github.com/pawelmalak/flame.git synced 2025-08-06 03:15:18 +02:00
This commit is contained in:
Joe Longendyke 2022-01-08 16:25:35 +01:00 committed by GitHub
commit a227b0ecf3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 18 additions and 0 deletions

View file

@ -106,6 +106,7 @@ export const SearchBar = (props: Props): JSX.Element => {
const url = `${query.template}${search}`; const url = `${query.template}${search}`;
redirectUrl(url, sameTab); redirectUrl(url, sameTab);
} }
if(config.autoClearSearch) clearSearch();
} else if (e.code === 'Escape') { } else if (e.code === 'Escape') {
clearSearch(); clearSearch();
} }

View file

@ -130,6 +130,19 @@ export const SearchSettings = (): JSX.Element => {
</select> </select>
</InputGroup> </InputGroup>
<InputGroup>
<label htmlFor={"autoClearSearch"}>Automatically clear the search bar</label>
<select
id={"autoClearSearch"}
name={"autoClearSearch"}
value={formData.autoClearSearch ? 1 : 0}
onChange={(e) => inputChangeHandler(e, { isBool: true })}
>
<option value={1}>True</option>
<option value={0}>False</option>
</select>
</InputGroup>
<Button>Save changes</Button> <Button>Save changes</Button>
</form> </form>

View file

@ -17,6 +17,7 @@ export interface Config {
hideCategories: boolean; hideCategories: boolean;
hideSearch: boolean; hideSearch: boolean;
defaultSearchProvider: string; defaultSearchProvider: string;
autoClearSearch: boolean;
dockerApps: boolean; dockerApps: boolean;
dockerHost: string; dockerHost: string;
kubernetesApps: boolean; kubernetesApps: boolean;

View file

@ -13,6 +13,7 @@ export interface SearchForm {
defaultSearchProvider: string; defaultSearchProvider: string;
searchSameTab: boolean; searchSameTab: boolean;
disableAutofocus: boolean; disableAutofocus: boolean;
autoClearSearch: boolean;
} }
export interface OtherSettingsForm { export interface OtherSettingsForm {

View file

@ -17,6 +17,7 @@ export const configTemplate: Config = {
hideCategories: false, hideCategories: false,
hideSearch: false, hideSearch: false,
defaultSearchProvider: 'l', defaultSearchProvider: 'l',
autoClearSearch: false,
dockerApps: false, dockerApps: false,
dockerHost: 'localhost', dockerHost: 'localhost',
kubernetesApps: false, kubernetesApps: false,

View file

@ -38,6 +38,7 @@ export const searchSettingsTemplate: SearchForm = {
searchSameTab: false, searchSameTab: false,
defaultSearchProvider: 'l', defaultSearchProvider: 'l',
disableAutofocus: false, disableAutofocus: false,
autoClearSearch: false,
}; };
export const dockerSettingsTemplate: DockerSettingsForm = { export const dockerSettingsTemplate: DockerSettingsForm = {