mirror of
https://github.com/stashapp/stash.git
synced 2025-12-12 19:33:00 +01:00
* Upgrade Typescript to 4.0 * Update i18n-iso-countries to 6.0 * Update react-intl to 5.8.0 * Update jimp to 0.16.1 * Update apollo and graphql libraries * Update various libraries and fix linting/type errors * Refactor cache invalidation * Codegen refetch queries
76 lines
2.7 KiB
TypeScript
76 lines
2.7 KiB
TypeScript
import React from "react";
|
|
import queryString from "query-string";
|
|
import { Card, Tab, Nav, Row, Col } from "react-bootstrap";
|
|
import { useHistory, useLocation } from "react-router-dom";
|
|
import { SettingsAboutPanel } from "./SettingsAboutPanel";
|
|
import { SettingsConfigurationPanel } from "./SettingsConfigurationPanel";
|
|
import { SettingsInterfacePanel } from "./SettingsInterfacePanel";
|
|
import { SettingsLogsPanel } from "./SettingsLogsPanel";
|
|
import { SettingsTasksPanel } from "./SettingsTasksPanel/SettingsTasksPanel";
|
|
import { SettingsPluginsPanel } from "./SettingsPluginsPanel";
|
|
|
|
export const Settings: React.FC = () => {
|
|
const location = useLocation();
|
|
const history = useHistory();
|
|
const defaultTab = queryString.parse(location.search).tab ?? "tasks";
|
|
|
|
const onSelect = (val: string) => history.push(`?tab=${val}`);
|
|
|
|
return (
|
|
<Card className="col col-lg-9 mx-auto">
|
|
<Tab.Container
|
|
defaultActiveKey={defaultTab}
|
|
id="configuration-tabs"
|
|
onSelect={(tab) => tab && onSelect(tab)}
|
|
>
|
|
<Row>
|
|
<Col sm={3} md={2}>
|
|
<Nav variant="pills" className="flex-column">
|
|
<Nav.Item>
|
|
<Nav.Link eventKey="configuration">Configuration</Nav.Link>
|
|
</Nav.Item>
|
|
<Nav.Item>
|
|
<Nav.Link eventKey="interface">Interface</Nav.Link>
|
|
</Nav.Item>
|
|
<Nav.Item>
|
|
<Nav.Link eventKey="tasks">Tasks</Nav.Link>
|
|
</Nav.Item>
|
|
<Nav.Item>
|
|
<Nav.Link eventKey="plugins">Plugins</Nav.Link>
|
|
</Nav.Item>
|
|
<Nav.Item>
|
|
<Nav.Link eventKey="logs">Logs</Nav.Link>
|
|
</Nav.Item>
|
|
<Nav.Item>
|
|
<Nav.Link eventKey="about">About</Nav.Link>
|
|
</Nav.Item>
|
|
<hr className="d-sm-none" />
|
|
</Nav>
|
|
</Col>
|
|
<Col sm={9} md={10}>
|
|
<Tab.Content>
|
|
<Tab.Pane eventKey="configuration">
|
|
<SettingsConfigurationPanel />
|
|
</Tab.Pane>
|
|
<Tab.Pane eventKey="interface">
|
|
<SettingsInterfacePanel />
|
|
</Tab.Pane>
|
|
<Tab.Pane eventKey="tasks">
|
|
<SettingsTasksPanel />
|
|
</Tab.Pane>
|
|
<Tab.Pane eventKey="plugins">
|
|
<SettingsPluginsPanel />
|
|
</Tab.Pane>
|
|
<Tab.Pane eventKey="logs">
|
|
<SettingsLogsPanel />
|
|
</Tab.Pane>
|
|
<Tab.Pane eventKey="about">
|
|
<SettingsAboutPanel />
|
|
</Tab.Pane>
|
|
</Tab.Content>
|
|
</Col>
|
|
</Row>
|
|
</Tab.Container>
|
|
</Card>
|
|
);
|
|
};
|