Skip to content

Commit bbf9cf2

Browse files
committed
misc ui tweaks
1 parent 81de0bd commit bbf9cf2

File tree

2 files changed

+102
-44
lines changed

2 files changed

+102
-44
lines changed

webui/src/api.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const fetch = (
2626

2727
const transport = createConnectTransport({
2828
baseUrl: "./",
29-
useBinaryFormat: false,
29+
useBinaryFormat: true,
3030
fetch: fetch as typeof globalThis.fetch,
3131
});
3232

webui/src/views/AddRepoModal.tsx

+101-43
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
Collapse,
1515
Checkbox,
1616
Select,
17+
Space,
1718
} from "antd";
1819
import React, { useEffect, useState } from "react";
1920
import { useShowModal } from "../components/ModalManager";
@@ -38,6 +39,7 @@ import { useConfig } from "../components/ConfigProvider";
3839
import Cron from "react-js-cron";
3940
import { ScheduleFormItem } from "../components/ScheduleFormItem";
4041
import { proto3 } from "@bufbuild/protobuf";
42+
import { isWindows } from "../state/buildcfg";
4143

4244
export const AddRepoModal = ({ template }: { template: Repo | null }) => {
4345
const [confirmLoading, setConfirmLoading] = useState(false);
@@ -495,55 +497,111 @@ export const AddRepoModal = ({ template }: { template: Repo | null }) => {
495497
</Form.Item>
496498

497499
{/* Repo.commandPrefix */}
498-
<Form.Item
499-
label={
500-
<Tooltip
501-
title={
502-
<span>
503-
Modifiers for the backup operation e.g. set the CPU or IO
504-
priority. Currently only available on unix systems.
505-
</span>
506-
}
507-
>
508-
Command Modifiers
509-
</Tooltip>
510-
}
511-
>
512-
<Row>
513-
<Col span={12}>
514-
<Form.Item name={["commandPrefix", "ioNice"]} required={false}>
515-
<Select
516-
allowClear
517-
style={{ width: "100%" }}
518-
placeholder="Select an IO priority"
519-
options={proto3
520-
.getEnumType(CommandPrefix_IONiceLevel)
521-
.values.map((v) => ({ label: v.name, value: v.name }))}
522-
/>
523-
</Form.Item>
524-
</Col>
525-
526-
<Col span={12}>
527-
<Form.Item name={["commandPrefix", "cpuNice"]} required={false}>
528-
<Select
529-
allowClear
530-
style={{ width: "100%" }}
531-
placeholder="Select a CPU priority"
532-
options={proto3
533-
.getEnumType(CommandPrefix_CPUNiceLevel)
534-
.values.map((v) => ({ label: v.name, value: v.name }))}
535-
/>
536-
</Form.Item>
537-
</Col>
538-
</Row>
539-
</Form.Item>
500+
{!isWindows && (
501+
<Form.Item
502+
label={
503+
<Tooltip
504+
title={
505+
<span>
506+
Modifiers for the backup operation e.g. set the CPU or IO
507+
priority.
508+
</span>
509+
}
510+
>
511+
Command Modifiers
512+
</Tooltip>
513+
}
514+
colon={false}
515+
>
516+
<Row>
517+
<Col span={12} style={{ paddingLeft: "5px" }}>
518+
<Tooltip
519+
title={
520+
<>
521+
Available IO priority modes
522+
<ul>
523+
<li>
524+
IO_BEST_EFFORT_LOW - runs at lower than default disk
525+
priority (will prioritize other processes)
526+
</li>
527+
<li>
528+
IO_BEST_EFFORT_HIGH - runs at higher than default
529+
disk priority (top of disk IO queue)
530+
</li>
531+
<li>
532+
IO_IDLE - only runs when disk bandwidth is idle
533+
(e.g. no other operations are queued)
534+
</li>
535+
</ul>
536+
</>
537+
}
538+
>
539+
IO Priority:
540+
<br />
541+
<Form.Item
542+
name={["commandPrefix", "ioNice"]}
543+
required={false}
544+
>
545+
<Select
546+
allowClear
547+
style={{ width: "100%" }}
548+
placeholder="Select an IO priority"
549+
options={proto3
550+
.getEnumType(CommandPrefix_IONiceLevel)
551+
.values.map((v) => ({
552+
label: v.name,
553+
value: v.name,
554+
}))}
555+
/>
556+
</Form.Item>
557+
</Tooltip>
558+
</Col>
559+
<Col span={12} style={{ paddingLeft: "5px" }}>
560+
<Tooltip
561+
title={
562+
<>
563+
Available CPU priority modes:
564+
<ul>
565+
<li>CPU_DEFAULT - no change in priority</li>
566+
<li>
567+
CPU_HIGH - higher than default priority (backrest
568+
must be running as root)
569+
</li>
570+
<li>CPU_LOW - lower than default priority</li>
571+
</ul>
572+
</>
573+
}
574+
>
575+
CPU Priority:
576+
<br />
577+
<Form.Item
578+
name={["commandPrefix", "cpuNice"]}
579+
required={false}
580+
>
581+
<Select
582+
allowClear
583+
style={{ width: "100%" }}
584+
placeholder="Select a CPU priority"
585+
options={proto3
586+
.getEnumType(CommandPrefix_CPUNiceLevel)
587+
.values.map((v) => ({
588+
label: v.name,
589+
value: v.name,
590+
}))}
591+
/>
592+
</Form.Item>
593+
</Tooltip>
594+
</Col>
595+
</Row>
596+
</Form.Item>
597+
)}
540598

541599
<Form.Item
542600
label={
543601
<Tooltip
544602
title={
545603
"Auto-unlock will remove lockfiles at the start of forget and prune operations. " +
546-
"This is potentially unsafe if the repo is shared by multiple client devices. Opt-in (and disabled) by default."
604+
"This is potentially unsafe if the repo is shared by multiple client devices. Disabled by default."
547605
}
548606
>
549607
Auto Unlock

0 commit comments

Comments
 (0)