feat(logs): make log files downloadable (#706)

* feat(logs): show and download log files

* feat(logs): make logs settings dropdown

* feat(logs): minor cosmetic changes

* fix(logs): send empty response when lohpath not configured

* fix(logs): remove unused imports

* feat(logs): check if logs dir exists

* feat(logs): list log files in settings
This commit is contained in:
ze0s 2023-02-12 17:34:09 +01:00 committed by GitHub
parent 21724f29f6
commit b21c01a7df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 394 additions and 79 deletions

View file

@ -6,6 +6,7 @@ import Toast from "../../components/notifications/Toast";
import { queryClient } from "../../App";
import Select, { components, ControlProps, InputProps, MenuProps, OptionProps } from "react-select";
import { LogLevelOptions, SelectOption } from "../../domain/constants";
import { LogFiles } from "../Logs";
interface RowItemProps {
label: string;
@ -20,7 +21,7 @@ const RowItem = ({ label, value, title, emptyText }: RowItemProps) => {
<div className="py-4 sm:py-5 sm:grid sm:grid-cols-4 sm:gap-4 sm:px-6">
<dt className="font-medium text-gray-500 dark:text-white" title={title}>{label}:</dt>
<dd className="mt-1 text-gray-900 dark:text-white sm:mt-0 sm:col-span-2 break-all">
{value ? value : emptyText}
<span className="px-1 py-0.5 bg-gray-200 dark:bg-gray-700 rounded shadow">{value ? value : emptyText}</span>
</dd>
</div>
);
@ -168,6 +169,10 @@ function LogSettings() {
</form>
</div>
<div className="mt-4 flex flex-col py-4 px-4 sm:px-6">
<LogFiles />
</div>
{/*<div className="mt-4 flex justify-end py-4 px-4 sm:px-6">*/}
{/* <button*/}
{/* type="button"*/}