+// {isOver
+// ? canDrop
+// ? "C'mon, drop 'em!"
+// : "Folders are not allowed!"
+// : maybeImpostor
+// ? `${maybeImpostor} was not the impostor.`
+// : "Drag & drop a (Chonky) file here"}
+//
+// );
+// };
+
+export const BackupType = "backup";
+
+export const BackupBrowser = () => {
+ const sourceProps = useBackupSourceBrowser();
+ const targetProps = useBackupTargetBrowser();
+
+ return (
+
+
+
+ {/* */}
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+};
diff --git a/frontend/src/detail.less b/frontend/src/detail.less
new file mode 100644
index 0000000..25336e2
--- /dev/null
+++ b/frontend/src/detail.less
@@ -0,0 +1,23 @@
+.detail-content {
+ .position {
+ .app-MuiDialogContent-dividers {
+ border-bottom: none;
+ }
+
+ .app-MuiGrid-item {
+ width: 100%;
+ padding: 0.5em;
+
+ p, pre {
+ margin: 0.2em 0;
+
+ white-space: pre-wrap; /* Since CSS 2.1 */
+ white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
+ white-space: -pre-wrap; /* Opera 4-6 */
+ white-space: -o-pre-wrap; /* Opera 7 */
+ word-wrap: break-word; /* Internet Explorer 5.5+ */
+ }
+ }
+ }
+}
+
diff --git a/frontend/src/detail.tsx b/frontend/src/detail.tsx
new file mode 100644
index 0000000..54411ac
--- /dev/null
+++ b/frontend/src/detail.tsx
@@ -0,0 +1,186 @@
+import { Nullable } from "tsdef";
+
+import Dialog, { DialogProps } from "@mui/material/Dialog";
+import DialogContent from "@mui/material/DialogContent";
+import DialogTitle from "@mui/material/DialogTitle";
+
+import { Grid } from "@mui/material";
+import moment from "moment";
+
+import { useState, useCallback } from "react";
+
+import "./app.less";
+import { cli } from "./api";
+import { formatFilesize } from "./tools";
+
+import "./detail.less";
+import { FileGetReply, Tape } from "./entity";
+
+export type Detail = FileGetReply & {
+ tapes: Map;
+};
+
+export const useDetailModal = () => {
+ const [detail, setDetail] = useState>(null);
+ const openDetailModel = useCallback(
+ (detail: FileGetReply) => {
+ (async () => {
+ const tapeList = await cli.tapeMGet({
+ ids: detail.positions.map((posi) => posi.tapeId),
+ }).response;
+
+ const tapes = new Map();
+ for (const tape of tapeList.tapes) {
+ tapes.set(tape.id, tape);
+ }
+
+ setDetail({ ...detail, tapes });
+ })();
+ },
+ [setDetail]
+ );
+ const closeDetailModel = useCallback(() => {
+ setDetail(null);
+ }, [setDetail]);
+
+ return { detail, closeDetailModel, openDetailModel };
+};
+
+export const DetailModal = (props: Omit & { detail: Nullable }) => {
+ const { detail, ...otherProps } = props;
+ if (!detail) {
+ return null;
+ }
+
+ return (
+
+ );
+
+ // return ;
+};
diff --git a/frontend/src/entity/copy_status.ts b/frontend/src/entity/copy_status.ts
new file mode 100644
index 0000000..c907a23
--- /dev/null
+++ b/frontend/src/entity/copy_status.ts
@@ -0,0 +1,34 @@
+// @generated by protobuf-ts 2.8.2
+// @generated from protobuf file "copy_status.proto" (package "copy_status", syntax proto3)
+// tslint:disable
+/**
+ * @generated from protobuf enum copy_status.CopyStatus
+ */
+export enum CopyStatus {
+ /**
+ * @generated from protobuf enum value: Draft = 0;
+ */
+ Draft = 0,
+ /**
+ * waiting in queue
+ *
+ * @generated from protobuf enum value: Pending = 1;
+ */
+ Pending = 1,
+ /**
+ * @generated from protobuf enum value: Running = 2;
+ */
+ Running = 2,
+ /**
+ * @generated from protobuf enum value: Staged = 3;
+ */
+ Staged = 3,
+ /**
+ * @generated from protobuf enum value: Submited = 4;
+ */
+ Submited = 4,
+ /**
+ * @generated from protobuf enum value: Failed = 255;
+ */
+ Failed = 255
+}
diff --git a/frontend/src/entity/file.ts b/frontend/src/entity/file.ts
new file mode 100644
index 0000000..42077a4
--- /dev/null
+++ b/frontend/src/entity/file.ts
@@ -0,0 +1,202 @@
+// @generated by protobuf-ts 2.8.2
+// @generated from protobuf file "file.proto" (package "file", syntax proto3)
+// tslint:disable
+import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
+import type { IBinaryWriter } from "@protobuf-ts/runtime";
+import { WireType } from "@protobuf-ts/runtime";
+import type { BinaryReadOptions } from "@protobuf-ts/runtime";
+import type { IBinaryReader } from "@protobuf-ts/runtime";
+import { UnknownFieldHandler } from "@protobuf-ts/runtime";
+import type { PartialMessage } from "@protobuf-ts/runtime";
+import { reflectionMergePartial } from "@protobuf-ts/runtime";
+import { MESSAGE_TYPE } from "@protobuf-ts/runtime";
+import { MessageType } from "@protobuf-ts/runtime";
+/**
+ * @generated from protobuf message file.File
+ */
+export interface File {
+ /**
+ * @generated from protobuf field: int64 id = 1;
+ */
+ id: bigint;
+ /**
+ * @generated from protobuf field: int64 parent_id = 2;
+ */
+ parentId: bigint;
+ /**
+ * @generated from protobuf field: string name = 3;
+ */
+ name: string;
+ /**
+ * @generated from protobuf field: int64 mode = 17;
+ */
+ mode: bigint;
+ /**
+ * @generated from protobuf field: int64 mod_time = 18;
+ */
+ modTime: bigint;
+ /**
+ * @generated from protobuf field: int64 size = 19;
+ */
+ size: bigint;
+ /**
+ * @generated from protobuf field: bytes hash = 20;
+ */
+ hash: Uint8Array;
+}
+/**
+ * @generated from protobuf message file.EditedFile
+ */
+export interface EditedFile {
+ /**
+ * @generated from protobuf field: optional int64 parent_id = 2;
+ */
+ parentId?: bigint;
+ /**
+ * @generated from protobuf field: optional string name = 3;
+ */
+ name?: string;
+}
+// @generated message type with reflection information, may provide speed optimized methods
+class File$Type extends MessageType {
+ constructor() {
+ super("file.File", [
+ { no: 1, name: "id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 2, name: "parent_id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 3, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
+ { no: 17, name: "mode", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 18, name: "mod_time", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 19, name: "size", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 20, name: "hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }
+ ]);
+ }
+ create(value?: PartialMessage): File {
+ const message = { id: 0n, parentId: 0n, name: "", mode: 0n, modTime: 0n, size: 0n, hash: new Uint8Array(0) };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: File): File {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* int64 id */ 1:
+ message.id = reader.int64().toBigInt();
+ break;
+ case /* int64 parent_id */ 2:
+ message.parentId = reader.int64().toBigInt();
+ break;
+ case /* string name */ 3:
+ message.name = reader.string();
+ break;
+ case /* int64 mode */ 17:
+ message.mode = reader.int64().toBigInt();
+ break;
+ case /* int64 mod_time */ 18:
+ message.modTime = reader.int64().toBigInt();
+ break;
+ case /* int64 size */ 19:
+ message.size = reader.int64().toBigInt();
+ break;
+ case /* bytes hash */ 20:
+ message.hash = reader.bytes();
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: File, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* int64 id = 1; */
+ if (message.id !== 0n)
+ writer.tag(1, WireType.Varint).int64(message.id);
+ /* int64 parent_id = 2; */
+ if (message.parentId !== 0n)
+ writer.tag(2, WireType.Varint).int64(message.parentId);
+ /* string name = 3; */
+ if (message.name !== "")
+ writer.tag(3, WireType.LengthDelimited).string(message.name);
+ /* int64 mode = 17; */
+ if (message.mode !== 0n)
+ writer.tag(17, WireType.Varint).int64(message.mode);
+ /* int64 mod_time = 18; */
+ if (message.modTime !== 0n)
+ writer.tag(18, WireType.Varint).int64(message.modTime);
+ /* int64 size = 19; */
+ if (message.size !== 0n)
+ writer.tag(19, WireType.Varint).int64(message.size);
+ /* bytes hash = 20; */
+ if (message.hash.length)
+ writer.tag(20, WireType.LengthDelimited).bytes(message.hash);
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message file.File
+ */
+export const File = new File$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class EditedFile$Type extends MessageType {
+ constructor() {
+ super("file.EditedFile", [
+ { no: 2, name: "parent_id", kind: "scalar", opt: true, T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 3, name: "name", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }
+ ]);
+ }
+ create(value?: PartialMessage): EditedFile {
+ const message = {};
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EditedFile): EditedFile {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* optional int64 parent_id */ 2:
+ message.parentId = reader.int64().toBigInt();
+ break;
+ case /* optional string name */ 3:
+ message.name = reader.string();
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: EditedFile, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* optional int64 parent_id = 2; */
+ if (message.parentId !== undefined)
+ writer.tag(2, WireType.Varint).int64(message.parentId);
+ /* optional string name = 3; */
+ if (message.name !== undefined)
+ writer.tag(3, WireType.LengthDelimited).string(message.name);
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message file.EditedFile
+ */
+export const EditedFile = new EditedFile$Type();
diff --git a/frontend/src/entity/gen_index.sh b/frontend/src/entity/gen_index.sh
new file mode 100755
index 0000000..4511ab8
--- /dev/null
+++ b/frontend/src/entity/gen_index.sh
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+set -e
+
+CURDIR=$(cd $(dirname $0); pwd);
+cd ${CURDIR};
+
+echo '' > index.ts;
+
+FILES=`ls *.ts | grep -v index.ts | sed -e 's/\.ts$//'`;
+for file in ${FILES}; do
+ echo "export * from \"./${file}\";" >> index.ts;
+done
diff --git a/frontend/src/entity/index.ts b/frontend/src/entity/index.ts
new file mode 100644
index 0000000..43ee895
--- /dev/null
+++ b/frontend/src/entity/index.ts
@@ -0,0 +1,11 @@
+
+export * from "./copy_status";
+export * from "./file";
+export * from "./job";
+export * from "./job_archive";
+export * from "./job_restore";
+export * from "./position";
+export * from "./service.client";
+export * from "./service";
+export * from "./source";
+export * from "./tape";
diff --git a/frontend/src/entity/job.ts b/frontend/src/entity/job.ts
new file mode 100644
index 0000000..3b37030
--- /dev/null
+++ b/frontend/src/entity/job.ts
@@ -0,0 +1,574 @@
+// @generated by protobuf-ts 2.8.2
+// @generated from protobuf file "job.proto" (package "job", syntax proto3)
+// tslint:disable
+import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
+import type { IBinaryWriter } from "@protobuf-ts/runtime";
+import { WireType } from "@protobuf-ts/runtime";
+import type { BinaryReadOptions } from "@protobuf-ts/runtime";
+import type { IBinaryReader } from "@protobuf-ts/runtime";
+import { UnknownFieldHandler } from "@protobuf-ts/runtime";
+import type { PartialMessage } from "@protobuf-ts/runtime";
+import { reflectionMergePartial } from "@protobuf-ts/runtime";
+import { MESSAGE_TYPE } from "@protobuf-ts/runtime";
+import { MessageType } from "@protobuf-ts/runtime";
+import { JobDisplayArchive } from "./job_archive";
+import { JobArchiveNextParam } from "./job_archive";
+import { JobStateArchive } from "./job_archive";
+import { JobParamArchive } from "./job_archive";
+/**
+ * @generated from protobuf message job.Job
+ */
+export interface Job {
+ /**
+ * @generated from protobuf field: int64 id = 1;
+ */
+ id: bigint;
+ /**
+ * @generated from protobuf field: job.JobStatus status = 2;
+ */
+ status: JobStatus;
+ /**
+ * @generated from protobuf field: int64 priority = 3;
+ */
+ priority: bigint;
+ /**
+ * @generated from protobuf field: int64 create_time = 4;
+ */
+ createTime: bigint;
+ /**
+ * @generated from protobuf field: int64 update_time = 5;
+ */
+ updateTime: bigint;
+ /**
+ * @generated from protobuf field: job.JobState state = 17;
+ */
+ state?: JobState;
+}
+/**
+ * @generated from protobuf message job.JobParam
+ */
+export interface JobParam {
+ /**
+ * @generated from protobuf oneof: param
+ */
+ param: {
+ oneofKind: "archive";
+ /**
+ * @generated from protobuf field: job_archive.JobParamArchive Archive = 1 [json_name = "Archive"];
+ */
+ archive: JobParamArchive;
+ } | {
+ oneofKind: undefined;
+ };
+}
+/**
+ * @generated from protobuf message job.JobState
+ */
+export interface JobState {
+ /**
+ * @generated from protobuf oneof: state
+ */
+ state: {
+ oneofKind: "archive";
+ /**
+ * @generated from protobuf field: job_archive.JobStateArchive Archive = 1 [json_name = "Archive"];
+ */
+ archive: JobStateArchive;
+ } | {
+ oneofKind: undefined;
+ };
+}
+/**
+ * @generated from protobuf message job.JobNextParam
+ */
+export interface JobNextParam {
+ /**
+ * @generated from protobuf oneof: param
+ */
+ param: {
+ oneofKind: "archive";
+ /**
+ * @generated from protobuf field: job_archive.JobArchiveNextParam archive = 1;
+ */
+ archive: JobArchiveNextParam;
+ } | {
+ oneofKind: undefined;
+ };
+}
+/**
+ * @generated from protobuf message job.CreatableJob
+ */
+export interface CreatableJob {
+ /**
+ * @generated from protobuf field: int64 priority = 3;
+ */
+ priority: bigint;
+ /**
+ * @generated from protobuf field: job.JobParam param = 17;
+ */
+ param?: JobParam;
+}
+/**
+ * @generated from protobuf message job.JobFilter
+ */
+export interface JobFilter {
+ /**
+ * @generated from protobuf field: optional job.JobStatus status = 1;
+ */
+ status?: JobStatus;
+ /**
+ * @generated from protobuf field: optional int64 limit = 33;
+ */
+ limit?: bigint;
+ /**
+ * @generated from protobuf field: optional int64 offset = 34;
+ */
+ offset?: bigint;
+}
+/**
+ * @generated from protobuf message job.JobDisplay
+ */
+export interface JobDisplay {
+ /**
+ * @generated from protobuf oneof: display
+ */
+ display: {
+ oneofKind: "archive";
+ /**
+ * @generated from protobuf field: job_archive.JobDisplayArchive archive = 1;
+ */
+ archive: JobDisplayArchive;
+ } | {
+ oneofKind: undefined;
+ };
+}
+/**
+ * @generated from protobuf enum job.JobStatus
+ */
+export enum JobStatus {
+ /**
+ * @generated from protobuf enum value: Draft = 0;
+ */
+ Draft = 0,
+ /**
+ * dependencies not satisfied
+ *
+ * @generated from protobuf enum value: NotReady = 1;
+ */
+ NotReady = 1,
+ /**
+ * waiting in queue
+ *
+ * @generated from protobuf enum value: Pending = 2;
+ */
+ Pending = 2,
+ /**
+ * @generated from protobuf enum value: Processing = 3;
+ */
+ Processing = 3,
+ /**
+ * @generated from protobuf enum value: Completed = 4;
+ */
+ Completed = 4,
+ /**
+ * @generated from protobuf enum value: Failed = 255;
+ */
+ Failed = 255
+}
+// @generated message type with reflection information, may provide speed optimized methods
+class Job$Type extends MessageType {
+ constructor() {
+ super("job.Job", [
+ { no: 1, name: "id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 2, name: "status", kind: "enum", T: () => ["job.JobStatus", JobStatus] },
+ { no: 3, name: "priority", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 4, name: "create_time", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 5, name: "update_time", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 17, name: "state", kind: "message", T: () => JobState }
+ ]);
+ }
+ create(value?: PartialMessage): Job {
+ const message = { id: 0n, status: 0, priority: 0n, createTime: 0n, updateTime: 0n };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Job): Job {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* int64 id */ 1:
+ message.id = reader.int64().toBigInt();
+ break;
+ case /* job.JobStatus status */ 2:
+ message.status = reader.int32();
+ break;
+ case /* int64 priority */ 3:
+ message.priority = reader.int64().toBigInt();
+ break;
+ case /* int64 create_time */ 4:
+ message.createTime = reader.int64().toBigInt();
+ break;
+ case /* int64 update_time */ 5:
+ message.updateTime = reader.int64().toBigInt();
+ break;
+ case /* job.JobState state */ 17:
+ message.state = JobState.internalBinaryRead(reader, reader.uint32(), options, message.state);
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: Job, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* int64 id = 1; */
+ if (message.id !== 0n)
+ writer.tag(1, WireType.Varint).int64(message.id);
+ /* job.JobStatus status = 2; */
+ if (message.status !== 0)
+ writer.tag(2, WireType.Varint).int32(message.status);
+ /* int64 priority = 3; */
+ if (message.priority !== 0n)
+ writer.tag(3, WireType.Varint).int64(message.priority);
+ /* int64 create_time = 4; */
+ if (message.createTime !== 0n)
+ writer.tag(4, WireType.Varint).int64(message.createTime);
+ /* int64 update_time = 5; */
+ if (message.updateTime !== 0n)
+ writer.tag(5, WireType.Varint).int64(message.updateTime);
+ /* job.JobState state = 17; */
+ if (message.state)
+ JobState.internalBinaryWrite(message.state, writer.tag(17, WireType.LengthDelimited).fork(), options).join();
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message job.Job
+ */
+export const Job = new Job$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class JobParam$Type extends MessageType {
+ constructor() {
+ super("job.JobParam", [
+ { no: 1, name: "Archive", kind: "message", jsonName: "Archive", oneof: "param", T: () => JobParamArchive }
+ ]);
+ }
+ create(value?: PartialMessage): JobParam {
+ const message = { param: { oneofKind: undefined } };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: JobParam): JobParam {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* job_archive.JobParamArchive Archive = 1 [json_name = "Archive"];*/ 1:
+ message.param = {
+ oneofKind: "archive",
+ archive: JobParamArchive.internalBinaryRead(reader, reader.uint32(), options, (message.param as any).archive)
+ };
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: JobParam, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* job_archive.JobParamArchive Archive = 1 [json_name = "Archive"]; */
+ if (message.param.oneofKind === "archive")
+ JobParamArchive.internalBinaryWrite(message.param.archive, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message job.JobParam
+ */
+export const JobParam = new JobParam$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class JobState$Type extends MessageType {
+ constructor() {
+ super("job.JobState", [
+ { no: 1, name: "Archive", kind: "message", jsonName: "Archive", oneof: "state", T: () => JobStateArchive }
+ ]);
+ }
+ create(value?: PartialMessage): JobState {
+ const message = { state: { oneofKind: undefined } };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: JobState): JobState {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* job_archive.JobStateArchive Archive = 1 [json_name = "Archive"];*/ 1:
+ message.state = {
+ oneofKind: "archive",
+ archive: JobStateArchive.internalBinaryRead(reader, reader.uint32(), options, (message.state as any).archive)
+ };
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: JobState, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* job_archive.JobStateArchive Archive = 1 [json_name = "Archive"]; */
+ if (message.state.oneofKind === "archive")
+ JobStateArchive.internalBinaryWrite(message.state.archive, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message job.JobState
+ */
+export const JobState = new JobState$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class JobNextParam$Type extends MessageType {
+ constructor() {
+ super("job.JobNextParam", [
+ { no: 1, name: "archive", kind: "message", oneof: "param", T: () => JobArchiveNextParam }
+ ]);
+ }
+ create(value?: PartialMessage): JobNextParam {
+ const message = { param: { oneofKind: undefined } };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: JobNextParam): JobNextParam {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* job_archive.JobArchiveNextParam archive */ 1:
+ message.param = {
+ oneofKind: "archive",
+ archive: JobArchiveNextParam.internalBinaryRead(reader, reader.uint32(), options, (message.param as any).archive)
+ };
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: JobNextParam, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* job_archive.JobArchiveNextParam archive = 1; */
+ if (message.param.oneofKind === "archive")
+ JobArchiveNextParam.internalBinaryWrite(message.param.archive, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message job.JobNextParam
+ */
+export const JobNextParam = new JobNextParam$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class CreatableJob$Type extends MessageType {
+ constructor() {
+ super("job.CreatableJob", [
+ { no: 3, name: "priority", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 17, name: "param", kind: "message", T: () => JobParam }
+ ]);
+ }
+ create(value?: PartialMessage): CreatableJob {
+ const message = { priority: 0n };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CreatableJob): CreatableJob {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* int64 priority */ 3:
+ message.priority = reader.int64().toBigInt();
+ break;
+ case /* job.JobParam param */ 17:
+ message.param = JobParam.internalBinaryRead(reader, reader.uint32(), options, message.param);
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: CreatableJob, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* int64 priority = 3; */
+ if (message.priority !== 0n)
+ writer.tag(3, WireType.Varint).int64(message.priority);
+ /* job.JobParam param = 17; */
+ if (message.param)
+ JobParam.internalBinaryWrite(message.param, writer.tag(17, WireType.LengthDelimited).fork(), options).join();
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message job.CreatableJob
+ */
+export const CreatableJob = new CreatableJob$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class JobFilter$Type extends MessageType {
+ constructor() {
+ super("job.JobFilter", [
+ { no: 1, name: "status", kind: "enum", opt: true, T: () => ["job.JobStatus", JobStatus] },
+ { no: 33, name: "limit", kind: "scalar", opt: true, T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 34, name: "offset", kind: "scalar", opt: true, T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }
+ ]);
+ }
+ create(value?: PartialMessage): JobFilter {
+ const message = {};
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: JobFilter): JobFilter {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* optional job.JobStatus status */ 1:
+ message.status = reader.int32();
+ break;
+ case /* optional int64 limit */ 33:
+ message.limit = reader.int64().toBigInt();
+ break;
+ case /* optional int64 offset */ 34:
+ message.offset = reader.int64().toBigInt();
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: JobFilter, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* optional job.JobStatus status = 1; */
+ if (message.status !== undefined)
+ writer.tag(1, WireType.Varint).int32(message.status);
+ /* optional int64 limit = 33; */
+ if (message.limit !== undefined)
+ writer.tag(33, WireType.Varint).int64(message.limit);
+ /* optional int64 offset = 34; */
+ if (message.offset !== undefined)
+ writer.tag(34, WireType.Varint).int64(message.offset);
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message job.JobFilter
+ */
+export const JobFilter = new JobFilter$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class JobDisplay$Type extends MessageType {
+ constructor() {
+ super("job.JobDisplay", [
+ { no: 1, name: "archive", kind: "message", oneof: "display", T: () => JobDisplayArchive }
+ ]);
+ }
+ create(value?: PartialMessage): JobDisplay {
+ const message = { display: { oneofKind: undefined } };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: JobDisplay): JobDisplay {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* job_archive.JobDisplayArchive archive */ 1:
+ message.display = {
+ oneofKind: "archive",
+ archive: JobDisplayArchive.internalBinaryRead(reader, reader.uint32(), options, (message.display as any).archive)
+ };
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: JobDisplay, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* job_archive.JobDisplayArchive archive = 1; */
+ if (message.display.oneofKind === "archive")
+ JobDisplayArchive.internalBinaryWrite(message.display.archive, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message job.JobDisplay
+ */
+export const JobDisplay = new JobDisplay$Type();
diff --git a/frontend/src/entity/job_archive.ts b/frontend/src/entity/job_archive.ts
new file mode 100644
index 0000000..9c0f9d7
--- /dev/null
+++ b/frontend/src/entity/job_archive.ts
@@ -0,0 +1,498 @@
+// @generated by protobuf-ts 2.8.2
+// @generated from protobuf file "job_archive.proto" (package "job_archive", syntax proto3)
+// tslint:disable
+import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
+import type { IBinaryWriter } from "@protobuf-ts/runtime";
+import { WireType } from "@protobuf-ts/runtime";
+import type { BinaryReadOptions } from "@protobuf-ts/runtime";
+import type { IBinaryReader } from "@protobuf-ts/runtime";
+import { UnknownFieldHandler } from "@protobuf-ts/runtime";
+import type { PartialMessage } from "@protobuf-ts/runtime";
+import { reflectionMergePartial } from "@protobuf-ts/runtime";
+import { MESSAGE_TYPE } from "@protobuf-ts/runtime";
+import { MessageType } from "@protobuf-ts/runtime";
+import { SourceState } from "./source";
+import { Source } from "./source";
+/**
+ * @generated from protobuf message job_archive.JobParamArchive
+ */
+export interface JobParamArchive {
+ /**
+ * @generated from protobuf field: repeated source.Source sources = 1;
+ */
+ sources: Source[];
+}
+/**
+ * @generated from protobuf message job_archive.JobArchiveNextParam
+ */
+export interface JobArchiveNextParam {
+ /**
+ * @generated from protobuf oneof: param
+ */
+ param: {
+ oneofKind: "waitForTape";
+ /**
+ * @generated from protobuf field: job_archive.JobArchiveWaitForTapeParam WaitForTape = 1 [json_name = "WaitForTape"];
+ */
+ waitForTape: JobArchiveWaitForTapeParam;
+ } | {
+ oneofKind: "copying";
+ /**
+ * @generated from protobuf field: job_archive.JobArchiveCopyingParam Copying = 2 [json_name = "Copying"];
+ */
+ copying: JobArchiveCopyingParam;
+ } | {
+ oneofKind: "finished";
+ /**
+ * @generated from protobuf field: job_archive.JobArchiveFinishedParam Finished = 255 [json_name = "Finished"];
+ */
+ finished: JobArchiveFinishedParam;
+ } | {
+ oneofKind: undefined;
+ };
+}
+/**
+ * @generated from protobuf message job_archive.JobArchiveWaitForTapeParam
+ */
+export interface JobArchiveWaitForTapeParam {
+}
+/**
+ * @generated from protobuf message job_archive.JobArchiveCopyingParam
+ */
+export interface JobArchiveCopyingParam {
+ /**
+ * @generated from protobuf field: string device = 1;
+ */
+ device: string;
+ /**
+ * @generated from protobuf field: string barcode = 2;
+ */
+ barcode: string;
+ /**
+ * @generated from protobuf field: string name = 3;
+ */
+ name: string;
+}
+/**
+ * @generated from protobuf message job_archive.JobArchiveFinishedParam
+ */
+export interface JobArchiveFinishedParam {
+}
+/**
+ * @generated from protobuf message job_archive.JobStateArchive
+ */
+export interface JobStateArchive {
+ /**
+ * @generated from protobuf field: job_archive.JobArchiveStep step = 1;
+ */
+ step: JobArchiveStep;
+ /**
+ * @generated from protobuf field: repeated source.SourceState sources = 2;
+ */
+ sources: SourceState[];
+}
+/**
+ * @generated from protobuf message job_archive.JobDisplayArchive
+ */
+export interface JobDisplayArchive {
+ /**
+ * @generated from protobuf field: int64 copyedBytes = 1;
+ */
+ copyedBytes: bigint;
+ /**
+ * @generated from protobuf field: int64 copyedFiles = 2;
+ */
+ copyedFiles: bigint;
+ /**
+ * @generated from protobuf field: int64 totalBytes = 3;
+ */
+ totalBytes: bigint;
+ /**
+ * @generated from protobuf field: int64 totalFiles = 4;
+ */
+ totalFiles: bigint;
+ /**
+ * @generated from protobuf field: optional int64 speed = 5;
+ */
+ speed?: bigint;
+}
+/**
+ * @generated from protobuf enum job_archive.JobArchiveStep
+ */
+export enum JobArchiveStep {
+ /**
+ * @generated from protobuf enum value: Pending = 0;
+ */
+ Pending = 0,
+ /**
+ * @generated from protobuf enum value: WaitForTape = 1;
+ */
+ WaitForTape = 1,
+ /**
+ * @generated from protobuf enum value: Copying = 2;
+ */
+ Copying = 2,
+ /**
+ * @generated from protobuf enum value: Finished = 255;
+ */
+ Finished = 255
+}
+// @generated message type with reflection information, may provide speed optimized methods
+class JobParamArchive$Type extends MessageType {
+ constructor() {
+ super("job_archive.JobParamArchive", [
+ { no: 1, name: "sources", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Source }
+ ]);
+ }
+ create(value?: PartialMessage): JobParamArchive {
+ const message = { sources: [] };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: JobParamArchive): JobParamArchive {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* repeated source.Source sources */ 1:
+ message.sources.push(Source.internalBinaryRead(reader, reader.uint32(), options));
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: JobParamArchive, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* repeated source.Source sources = 1; */
+ for (let i = 0; i < message.sources.length; i++)
+ Source.internalBinaryWrite(message.sources[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message job_archive.JobParamArchive
+ */
+export const JobParamArchive = new JobParamArchive$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class JobArchiveNextParam$Type extends MessageType {
+ constructor() {
+ super("job_archive.JobArchiveNextParam", [
+ { no: 1, name: "WaitForTape", kind: "message", jsonName: "WaitForTape", oneof: "param", T: () => JobArchiveWaitForTapeParam },
+ { no: 2, name: "Copying", kind: "message", jsonName: "Copying", oneof: "param", T: () => JobArchiveCopyingParam },
+ { no: 255, name: "Finished", kind: "message", jsonName: "Finished", oneof: "param", T: () => JobArchiveFinishedParam }
+ ]);
+ }
+ create(value?: PartialMessage): JobArchiveNextParam {
+ const message = { param: { oneofKind: undefined } };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: JobArchiveNextParam): JobArchiveNextParam {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* job_archive.JobArchiveWaitForTapeParam WaitForTape = 1 [json_name = "WaitForTape"];*/ 1:
+ message.param = {
+ oneofKind: "waitForTape",
+ waitForTape: JobArchiveWaitForTapeParam.internalBinaryRead(reader, reader.uint32(), options, (message.param as any).waitForTape)
+ };
+ break;
+ case /* job_archive.JobArchiveCopyingParam Copying = 2 [json_name = "Copying"];*/ 2:
+ message.param = {
+ oneofKind: "copying",
+ copying: JobArchiveCopyingParam.internalBinaryRead(reader, reader.uint32(), options, (message.param as any).copying)
+ };
+ break;
+ case /* job_archive.JobArchiveFinishedParam Finished = 255 [json_name = "Finished"];*/ 255:
+ message.param = {
+ oneofKind: "finished",
+ finished: JobArchiveFinishedParam.internalBinaryRead(reader, reader.uint32(), options, (message.param as any).finished)
+ };
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: JobArchiveNextParam, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* job_archive.JobArchiveWaitForTapeParam WaitForTape = 1 [json_name = "WaitForTape"]; */
+ if (message.param.oneofKind === "waitForTape")
+ JobArchiveWaitForTapeParam.internalBinaryWrite(message.param.waitForTape, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
+ /* job_archive.JobArchiveCopyingParam Copying = 2 [json_name = "Copying"]; */
+ if (message.param.oneofKind === "copying")
+ JobArchiveCopyingParam.internalBinaryWrite(message.param.copying, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
+ /* job_archive.JobArchiveFinishedParam Finished = 255 [json_name = "Finished"]; */
+ if (message.param.oneofKind === "finished")
+ JobArchiveFinishedParam.internalBinaryWrite(message.param.finished, writer.tag(255, WireType.LengthDelimited).fork(), options).join();
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message job_archive.JobArchiveNextParam
+ */
+export const JobArchiveNextParam = new JobArchiveNextParam$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class JobArchiveWaitForTapeParam$Type extends MessageType {
+ constructor() {
+ super("job_archive.JobArchiveWaitForTapeParam", []);
+ }
+ create(value?: PartialMessage): JobArchiveWaitForTapeParam {
+ const message = {};
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: JobArchiveWaitForTapeParam): JobArchiveWaitForTapeParam {
+ return target ?? this.create();
+ }
+ internalBinaryWrite(message: JobArchiveWaitForTapeParam, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message job_archive.JobArchiveWaitForTapeParam
+ */
+export const JobArchiveWaitForTapeParam = new JobArchiveWaitForTapeParam$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class JobArchiveCopyingParam$Type extends MessageType {
+ constructor() {
+ super("job_archive.JobArchiveCopyingParam", [
+ { no: 1, name: "device", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
+ { no: 2, name: "barcode", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
+ { no: 3, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
+ ]);
+ }
+ create(value?: PartialMessage): JobArchiveCopyingParam {
+ const message = { device: "", barcode: "", name: "" };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: JobArchiveCopyingParam): JobArchiveCopyingParam {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* string device */ 1:
+ message.device = reader.string();
+ break;
+ case /* string barcode */ 2:
+ message.barcode = reader.string();
+ break;
+ case /* string name */ 3:
+ message.name = reader.string();
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: JobArchiveCopyingParam, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* string device = 1; */
+ if (message.device !== "")
+ writer.tag(1, WireType.LengthDelimited).string(message.device);
+ /* string barcode = 2; */
+ if (message.barcode !== "")
+ writer.tag(2, WireType.LengthDelimited).string(message.barcode);
+ /* string name = 3; */
+ if (message.name !== "")
+ writer.tag(3, WireType.LengthDelimited).string(message.name);
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message job_archive.JobArchiveCopyingParam
+ */
+export const JobArchiveCopyingParam = new JobArchiveCopyingParam$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class JobArchiveFinishedParam$Type extends MessageType {
+ constructor() {
+ super("job_archive.JobArchiveFinishedParam", []);
+ }
+ create(value?: PartialMessage): JobArchiveFinishedParam {
+ const message = {};
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: JobArchiveFinishedParam): JobArchiveFinishedParam {
+ return target ?? this.create();
+ }
+ internalBinaryWrite(message: JobArchiveFinishedParam, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message job_archive.JobArchiveFinishedParam
+ */
+export const JobArchiveFinishedParam = new JobArchiveFinishedParam$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class JobStateArchive$Type extends MessageType {
+ constructor() {
+ super("job_archive.JobStateArchive", [
+ { no: 1, name: "step", kind: "enum", T: () => ["job_archive.JobArchiveStep", JobArchiveStep] },
+ { no: 2, name: "sources", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => SourceState }
+ ]);
+ }
+ create(value?: PartialMessage): JobStateArchive {
+ const message = { step: 0, sources: [] };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: JobStateArchive): JobStateArchive {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* job_archive.JobArchiveStep step */ 1:
+ message.step = reader.int32();
+ break;
+ case /* repeated source.SourceState sources */ 2:
+ message.sources.push(SourceState.internalBinaryRead(reader, reader.uint32(), options));
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: JobStateArchive, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* job_archive.JobArchiveStep step = 1; */
+ if (message.step !== 0)
+ writer.tag(1, WireType.Varint).int32(message.step);
+ /* repeated source.SourceState sources = 2; */
+ for (let i = 0; i < message.sources.length; i++)
+ SourceState.internalBinaryWrite(message.sources[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join();
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message job_archive.JobStateArchive
+ */
+export const JobStateArchive = new JobStateArchive$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class JobDisplayArchive$Type extends MessageType {
+ constructor() {
+ super("job_archive.JobDisplayArchive", [
+ { no: 1, name: "copyedBytes", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 2, name: "copyedFiles", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 3, name: "totalBytes", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 4, name: "totalFiles", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 5, name: "speed", kind: "scalar", opt: true, T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }
+ ]);
+ }
+ create(value?: PartialMessage): JobDisplayArchive {
+ const message = { copyedBytes: 0n, copyedFiles: 0n, totalBytes: 0n, totalFiles: 0n };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: JobDisplayArchive): JobDisplayArchive {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* int64 copyedBytes */ 1:
+ message.copyedBytes = reader.int64().toBigInt();
+ break;
+ case /* int64 copyedFiles */ 2:
+ message.copyedFiles = reader.int64().toBigInt();
+ break;
+ case /* int64 totalBytes */ 3:
+ message.totalBytes = reader.int64().toBigInt();
+ break;
+ case /* int64 totalFiles */ 4:
+ message.totalFiles = reader.int64().toBigInt();
+ break;
+ case /* optional int64 speed */ 5:
+ message.speed = reader.int64().toBigInt();
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: JobDisplayArchive, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* int64 copyedBytes = 1; */
+ if (message.copyedBytes !== 0n)
+ writer.tag(1, WireType.Varint).int64(message.copyedBytes);
+ /* int64 copyedFiles = 2; */
+ if (message.copyedFiles !== 0n)
+ writer.tag(2, WireType.Varint).int64(message.copyedFiles);
+ /* int64 totalBytes = 3; */
+ if (message.totalBytes !== 0n)
+ writer.tag(3, WireType.Varint).int64(message.totalBytes);
+ /* int64 totalFiles = 4; */
+ if (message.totalFiles !== 0n)
+ writer.tag(4, WireType.Varint).int64(message.totalFiles);
+ /* optional int64 speed = 5; */
+ if (message.speed !== undefined)
+ writer.tag(5, WireType.Varint).int64(message.speed);
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message job_archive.JobDisplayArchive
+ */
+export const JobDisplayArchive = new JobDisplayArchive$Type();
diff --git a/frontend/src/entity/job_restore.ts b/frontend/src/entity/job_restore.ts
new file mode 100644
index 0000000..162dac8
--- /dev/null
+++ b/frontend/src/entity/job_restore.ts
@@ -0,0 +1,583 @@
+// @generated by protobuf-ts 2.8.2
+// @generated from protobuf file "job_restore.proto" (package "job_restore", syntax proto3)
+// tslint:disable
+import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
+import type { IBinaryWriter } from "@protobuf-ts/runtime";
+import type { BinaryReadOptions } from "@protobuf-ts/runtime";
+import type { IBinaryReader } from "@protobuf-ts/runtime";
+import { UnknownFieldHandler } from "@protobuf-ts/runtime";
+import { WireType } from "@protobuf-ts/runtime";
+import type { PartialMessage } from "@protobuf-ts/runtime";
+import { reflectionMergePartial } from "@protobuf-ts/runtime";
+import { MESSAGE_TYPE } from "@protobuf-ts/runtime";
+import { MessageType } from "@protobuf-ts/runtime";
+import { CopyStatus } from "./copy_status";
+/**
+ * @generated from protobuf message job_restore.JobParamRestore
+ */
+export interface JobParamRestore {
+ /**
+ * @generated from protobuf field: repeated int64 file_ids = 1;
+ */
+ fileIds: bigint[];
+}
+/**
+ * @generated from protobuf message job_restore.JobRestoreNextParam
+ */
+export interface JobRestoreNextParam {
+ /**
+ * @generated from protobuf oneof: param
+ */
+ param: {
+ oneofKind: "waitForTape";
+ /**
+ * @generated from protobuf field: job_restore.JobRestoreWaitForTapeParam WaitForTape = 1 [json_name = "WaitForTape"];
+ */
+ waitForTape: JobRestoreWaitForTapeParam;
+ } | {
+ oneofKind: "copying";
+ /**
+ * @generated from protobuf field: job_restore.JobRestoreCopyingParam Copying = 2 [json_name = "Copying"];
+ */
+ copying: JobRestoreCopyingParam;
+ } | {
+ oneofKind: "finished";
+ /**
+ * @generated from protobuf field: job_restore.JobRestoreFinishedParam Finished = 255 [json_name = "Finished"];
+ */
+ finished: JobRestoreFinishedParam;
+ } | {
+ oneofKind: undefined;
+ };
+}
+/**
+ * @generated from protobuf message job_restore.JobRestoreWaitForTapeParam
+ */
+export interface JobRestoreWaitForTapeParam {
+}
+/**
+ * @generated from protobuf message job_restore.JobRestoreCopyingParam
+ */
+export interface JobRestoreCopyingParam {
+ /**
+ * @generated from protobuf field: string device = 1;
+ */
+ device: string;
+}
+/**
+ * @generated from protobuf message job_restore.JobRestoreFinishedParam
+ */
+export interface JobRestoreFinishedParam {
+}
+/**
+ * @generated from protobuf message job_restore.FileRestoreState
+ */
+export interface FileRestoreState {
+ /**
+ * @generated from protobuf field: int64 file_id = 1;
+ */
+ fileId: bigint;
+ /**
+ * @generated from protobuf field: copy_status.CopyStatus status = 2;
+ */
+ status: CopyStatus;
+ /**
+ * @generated from protobuf field: int64 tape_id = 17;
+ */
+ tapeId: bigint;
+ /**
+ * @generated from protobuf field: int64 position_id = 18;
+ */
+ positionId: bigint;
+ /**
+ * @generated from protobuf field: repeated string path_in_tape = 19;
+ */
+ pathInTape: string[];
+}
+/**
+ * @generated from protobuf message job_restore.JobStateRestore
+ */
+export interface JobStateRestore {
+ /**
+ * @generated from protobuf field: job_restore.JobRestoreStep step = 1;
+ */
+ step: JobRestoreStep;
+ /**
+ * @generated from protobuf field: repeated job_restore.FileRestoreState files = 2;
+ */
+ files: FileRestoreState[];
+}
+/**
+ * @generated from protobuf message job_restore.JobDisplayRestore
+ */
+export interface JobDisplayRestore {
+ /**
+ * @generated from protobuf field: int64 copyedBytes = 1;
+ */
+ copyedBytes: bigint;
+ /**
+ * @generated from protobuf field: int64 copyedFiles = 2;
+ */
+ copyedFiles: bigint;
+ /**
+ * @generated from protobuf field: int64 totalBytes = 3;
+ */
+ totalBytes: bigint;
+ /**
+ * @generated from protobuf field: int64 totalFiles = 4;
+ */
+ totalFiles: bigint;
+ /**
+ * @generated from protobuf field: bytes logs = 17;
+ */
+ logs: Uint8Array;
+}
+/**
+ * @generated from protobuf enum job_restore.JobRestoreStep
+ */
+export enum JobRestoreStep {
+ /**
+ * @generated from protobuf enum value: Pending = 0;
+ */
+ Pending = 0,
+ /**
+ * @generated from protobuf enum value: WaitForTape = 1;
+ */
+ WaitForTape = 1,
+ /**
+ * @generated from protobuf enum value: Copying = 2;
+ */
+ Copying = 2,
+ /**
+ * @generated from protobuf enum value: Finished = 255;
+ */
+ Finished = 255
+}
+// @generated message type with reflection information, may provide speed optimized methods
+class JobParamRestore$Type extends MessageType {
+ constructor() {
+ super("job_restore.JobParamRestore", [
+ { no: 1, name: "file_ids", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }
+ ]);
+ }
+ create(value?: PartialMessage): JobParamRestore {
+ const message = { fileIds: [] };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: JobParamRestore): JobParamRestore {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* repeated int64 file_ids */ 1:
+ if (wireType === WireType.LengthDelimited)
+ for (let e = reader.int32() + reader.pos; reader.pos < e;)
+ message.fileIds.push(reader.int64().toBigInt());
+ else
+ message.fileIds.push(reader.int64().toBigInt());
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: JobParamRestore, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* repeated int64 file_ids = 1; */
+ if (message.fileIds.length) {
+ writer.tag(1, WireType.LengthDelimited).fork();
+ for (let i = 0; i < message.fileIds.length; i++)
+ writer.int64(message.fileIds[i]);
+ writer.join();
+ }
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message job_restore.JobParamRestore
+ */
+export const JobParamRestore = new JobParamRestore$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class JobRestoreNextParam$Type extends MessageType {
+ constructor() {
+ super("job_restore.JobRestoreNextParam", [
+ { no: 1, name: "WaitForTape", kind: "message", jsonName: "WaitForTape", oneof: "param", T: () => JobRestoreWaitForTapeParam },
+ { no: 2, name: "Copying", kind: "message", jsonName: "Copying", oneof: "param", T: () => JobRestoreCopyingParam },
+ { no: 255, name: "Finished", kind: "message", jsonName: "Finished", oneof: "param", T: () => JobRestoreFinishedParam }
+ ]);
+ }
+ create(value?: PartialMessage): JobRestoreNextParam {
+ const message = { param: { oneofKind: undefined } };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: JobRestoreNextParam): JobRestoreNextParam {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* job_restore.JobRestoreWaitForTapeParam WaitForTape = 1 [json_name = "WaitForTape"];*/ 1:
+ message.param = {
+ oneofKind: "waitForTape",
+ waitForTape: JobRestoreWaitForTapeParam.internalBinaryRead(reader, reader.uint32(), options, (message.param as any).waitForTape)
+ };
+ break;
+ case /* job_restore.JobRestoreCopyingParam Copying = 2 [json_name = "Copying"];*/ 2:
+ message.param = {
+ oneofKind: "copying",
+ copying: JobRestoreCopyingParam.internalBinaryRead(reader, reader.uint32(), options, (message.param as any).copying)
+ };
+ break;
+ case /* job_restore.JobRestoreFinishedParam Finished = 255 [json_name = "Finished"];*/ 255:
+ message.param = {
+ oneofKind: "finished",
+ finished: JobRestoreFinishedParam.internalBinaryRead(reader, reader.uint32(), options, (message.param as any).finished)
+ };
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: JobRestoreNextParam, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* job_restore.JobRestoreWaitForTapeParam WaitForTape = 1 [json_name = "WaitForTape"]; */
+ if (message.param.oneofKind === "waitForTape")
+ JobRestoreWaitForTapeParam.internalBinaryWrite(message.param.waitForTape, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
+ /* job_restore.JobRestoreCopyingParam Copying = 2 [json_name = "Copying"]; */
+ if (message.param.oneofKind === "copying")
+ JobRestoreCopyingParam.internalBinaryWrite(message.param.copying, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
+ /* job_restore.JobRestoreFinishedParam Finished = 255 [json_name = "Finished"]; */
+ if (message.param.oneofKind === "finished")
+ JobRestoreFinishedParam.internalBinaryWrite(message.param.finished, writer.tag(255, WireType.LengthDelimited).fork(), options).join();
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message job_restore.JobRestoreNextParam
+ */
+export const JobRestoreNextParam = new JobRestoreNextParam$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class JobRestoreWaitForTapeParam$Type extends MessageType {
+ constructor() {
+ super("job_restore.JobRestoreWaitForTapeParam", []);
+ }
+ create(value?: PartialMessage): JobRestoreWaitForTapeParam {
+ const message = {};
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: JobRestoreWaitForTapeParam): JobRestoreWaitForTapeParam {
+ return target ?? this.create();
+ }
+ internalBinaryWrite(message: JobRestoreWaitForTapeParam, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message job_restore.JobRestoreWaitForTapeParam
+ */
+export const JobRestoreWaitForTapeParam = new JobRestoreWaitForTapeParam$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class JobRestoreCopyingParam$Type extends MessageType {
+ constructor() {
+ super("job_restore.JobRestoreCopyingParam", [
+ { no: 1, name: "device", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
+ ]);
+ }
+ create(value?: PartialMessage): JobRestoreCopyingParam {
+ const message = { device: "" };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: JobRestoreCopyingParam): JobRestoreCopyingParam {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* string device */ 1:
+ message.device = reader.string();
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: JobRestoreCopyingParam, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* string device = 1; */
+ if (message.device !== "")
+ writer.tag(1, WireType.LengthDelimited).string(message.device);
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message job_restore.JobRestoreCopyingParam
+ */
+export const JobRestoreCopyingParam = new JobRestoreCopyingParam$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class JobRestoreFinishedParam$Type extends MessageType {
+ constructor() {
+ super("job_restore.JobRestoreFinishedParam", []);
+ }
+ create(value?: PartialMessage): JobRestoreFinishedParam {
+ const message = {};
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: JobRestoreFinishedParam): JobRestoreFinishedParam {
+ return target ?? this.create();
+ }
+ internalBinaryWrite(message: JobRestoreFinishedParam, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message job_restore.JobRestoreFinishedParam
+ */
+export const JobRestoreFinishedParam = new JobRestoreFinishedParam$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class FileRestoreState$Type extends MessageType {
+ constructor() {
+ super("job_restore.FileRestoreState", [
+ { no: 1, name: "file_id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 2, name: "status", kind: "enum", T: () => ["copy_status.CopyStatus", CopyStatus] },
+ { no: 17, name: "tape_id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 18, name: "position_id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 19, name: "path_in_tape", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }
+ ]);
+ }
+ create(value?: PartialMessage): FileRestoreState {
+ const message = { fileId: 0n, status: 0, tapeId: 0n, positionId: 0n, pathInTape: [] };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FileRestoreState): FileRestoreState {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* int64 file_id */ 1:
+ message.fileId = reader.int64().toBigInt();
+ break;
+ case /* copy_status.CopyStatus status */ 2:
+ message.status = reader.int32();
+ break;
+ case /* int64 tape_id */ 17:
+ message.tapeId = reader.int64().toBigInt();
+ break;
+ case /* int64 position_id */ 18:
+ message.positionId = reader.int64().toBigInt();
+ break;
+ case /* repeated string path_in_tape */ 19:
+ message.pathInTape.push(reader.string());
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: FileRestoreState, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* int64 file_id = 1; */
+ if (message.fileId !== 0n)
+ writer.tag(1, WireType.Varint).int64(message.fileId);
+ /* copy_status.CopyStatus status = 2; */
+ if (message.status !== 0)
+ writer.tag(2, WireType.Varint).int32(message.status);
+ /* int64 tape_id = 17; */
+ if (message.tapeId !== 0n)
+ writer.tag(17, WireType.Varint).int64(message.tapeId);
+ /* int64 position_id = 18; */
+ if (message.positionId !== 0n)
+ writer.tag(18, WireType.Varint).int64(message.positionId);
+ /* repeated string path_in_tape = 19; */
+ for (let i = 0; i < message.pathInTape.length; i++)
+ writer.tag(19, WireType.LengthDelimited).string(message.pathInTape[i]);
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message job_restore.FileRestoreState
+ */
+export const FileRestoreState = new FileRestoreState$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class JobStateRestore$Type extends MessageType {
+ constructor() {
+ super("job_restore.JobStateRestore", [
+ { no: 1, name: "step", kind: "enum", T: () => ["job_restore.JobRestoreStep", JobRestoreStep] },
+ { no: 2, name: "files", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => FileRestoreState }
+ ]);
+ }
+ create(value?: PartialMessage): JobStateRestore {
+ const message = { step: 0, files: [] };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: JobStateRestore): JobStateRestore {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* job_restore.JobRestoreStep step */ 1:
+ message.step = reader.int32();
+ break;
+ case /* repeated job_restore.FileRestoreState files */ 2:
+ message.files.push(FileRestoreState.internalBinaryRead(reader, reader.uint32(), options));
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: JobStateRestore, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* job_restore.JobRestoreStep step = 1; */
+ if (message.step !== 0)
+ writer.tag(1, WireType.Varint).int32(message.step);
+ /* repeated job_restore.FileRestoreState files = 2; */
+ for (let i = 0; i < message.files.length; i++)
+ FileRestoreState.internalBinaryWrite(message.files[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join();
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message job_restore.JobStateRestore
+ */
+export const JobStateRestore = new JobStateRestore$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class JobDisplayRestore$Type extends MessageType {
+ constructor() {
+ super("job_restore.JobDisplayRestore", [
+ { no: 1, name: "copyedBytes", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 2, name: "copyedFiles", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 3, name: "totalBytes", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 4, name: "totalFiles", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 17, name: "logs", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }
+ ]);
+ }
+ create(value?: PartialMessage): JobDisplayRestore {
+ const message = { copyedBytes: 0n, copyedFiles: 0n, totalBytes: 0n, totalFiles: 0n, logs: new Uint8Array(0) };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: JobDisplayRestore): JobDisplayRestore {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* int64 copyedBytes */ 1:
+ message.copyedBytes = reader.int64().toBigInt();
+ break;
+ case /* int64 copyedFiles */ 2:
+ message.copyedFiles = reader.int64().toBigInt();
+ break;
+ case /* int64 totalBytes */ 3:
+ message.totalBytes = reader.int64().toBigInt();
+ break;
+ case /* int64 totalFiles */ 4:
+ message.totalFiles = reader.int64().toBigInt();
+ break;
+ case /* bytes logs */ 17:
+ message.logs = reader.bytes();
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: JobDisplayRestore, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* int64 copyedBytes = 1; */
+ if (message.copyedBytes !== 0n)
+ writer.tag(1, WireType.Varint).int64(message.copyedBytes);
+ /* int64 copyedFiles = 2; */
+ if (message.copyedFiles !== 0n)
+ writer.tag(2, WireType.Varint).int64(message.copyedFiles);
+ /* int64 totalBytes = 3; */
+ if (message.totalBytes !== 0n)
+ writer.tag(3, WireType.Varint).int64(message.totalBytes);
+ /* int64 totalFiles = 4; */
+ if (message.totalFiles !== 0n)
+ writer.tag(4, WireType.Varint).int64(message.totalFiles);
+ /* bytes logs = 17; */
+ if (message.logs.length)
+ writer.tag(17, WireType.LengthDelimited).bytes(message.logs);
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message job_restore.JobDisplayRestore
+ */
+export const JobDisplayRestore = new JobDisplayRestore$Type();
diff --git a/frontend/src/entity/position.ts b/frontend/src/entity/position.ts
new file mode 100644
index 0000000..20e3ae4
--- /dev/null
+++ b/frontend/src/entity/position.ts
@@ -0,0 +1,157 @@
+// @generated by protobuf-ts 2.8.2
+// @generated from protobuf file "position.proto" (package "position", syntax proto3)
+// tslint:disable
+import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
+import type { IBinaryWriter } from "@protobuf-ts/runtime";
+import { WireType } from "@protobuf-ts/runtime";
+import type { BinaryReadOptions } from "@protobuf-ts/runtime";
+import type { IBinaryReader } from "@protobuf-ts/runtime";
+import { UnknownFieldHandler } from "@protobuf-ts/runtime";
+import type { PartialMessage } from "@protobuf-ts/runtime";
+import { reflectionMergePartial } from "@protobuf-ts/runtime";
+import { MESSAGE_TYPE } from "@protobuf-ts/runtime";
+import { MessageType } from "@protobuf-ts/runtime";
+/**
+ * @generated from protobuf message position.Position
+ */
+export interface Position {
+ /**
+ * @generated from protobuf field: int64 id = 1;
+ */
+ id: bigint;
+ /**
+ * @generated from protobuf field: int64 file_id = 2;
+ */
+ fileId: bigint;
+ /**
+ * @generated from protobuf field: int64 tape_id = 3;
+ */
+ tapeId: bigint;
+ /**
+ * @generated from protobuf field: string path = 4;
+ */
+ path: string;
+ /**
+ * @generated from protobuf field: int64 mode = 17;
+ */
+ mode: bigint;
+ /**
+ * @generated from protobuf field: int64 mod_time = 18;
+ */
+ modTime: bigint;
+ /**
+ * @generated from protobuf field: int64 write_time = 19;
+ */
+ writeTime: bigint;
+ /**
+ * @generated from protobuf field: int64 size = 20;
+ */
+ size: bigint;
+ /**
+ * @generated from protobuf field: bytes hash = 21;
+ */
+ hash: Uint8Array;
+}
+// @generated message type with reflection information, may provide speed optimized methods
+class Position$Type extends MessageType {
+ constructor() {
+ super("position.Position", [
+ { no: 1, name: "id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 2, name: "file_id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 3, name: "tape_id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 4, name: "path", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
+ { no: 17, name: "mode", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 18, name: "mod_time", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 19, name: "write_time", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 20, name: "size", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 21, name: "hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }
+ ]);
+ }
+ create(value?: PartialMessage): Position {
+ const message = { id: 0n, fileId: 0n, tapeId: 0n, path: "", mode: 0n, modTime: 0n, writeTime: 0n, size: 0n, hash: new Uint8Array(0) };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Position): Position {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* int64 id */ 1:
+ message.id = reader.int64().toBigInt();
+ break;
+ case /* int64 file_id */ 2:
+ message.fileId = reader.int64().toBigInt();
+ break;
+ case /* int64 tape_id */ 3:
+ message.tapeId = reader.int64().toBigInt();
+ break;
+ case /* string path */ 4:
+ message.path = reader.string();
+ break;
+ case /* int64 mode */ 17:
+ message.mode = reader.int64().toBigInt();
+ break;
+ case /* int64 mod_time */ 18:
+ message.modTime = reader.int64().toBigInt();
+ break;
+ case /* int64 write_time */ 19:
+ message.writeTime = reader.int64().toBigInt();
+ break;
+ case /* int64 size */ 20:
+ message.size = reader.int64().toBigInt();
+ break;
+ case /* bytes hash */ 21:
+ message.hash = reader.bytes();
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: Position, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* int64 id = 1; */
+ if (message.id !== 0n)
+ writer.tag(1, WireType.Varint).int64(message.id);
+ /* int64 file_id = 2; */
+ if (message.fileId !== 0n)
+ writer.tag(2, WireType.Varint).int64(message.fileId);
+ /* int64 tape_id = 3; */
+ if (message.tapeId !== 0n)
+ writer.tag(3, WireType.Varint).int64(message.tapeId);
+ /* string path = 4; */
+ if (message.path !== "")
+ writer.tag(4, WireType.LengthDelimited).string(message.path);
+ /* int64 mode = 17; */
+ if (message.mode !== 0n)
+ writer.tag(17, WireType.Varint).int64(message.mode);
+ /* int64 mod_time = 18; */
+ if (message.modTime !== 0n)
+ writer.tag(18, WireType.Varint).int64(message.modTime);
+ /* int64 write_time = 19; */
+ if (message.writeTime !== 0n)
+ writer.tag(19, WireType.Varint).int64(message.writeTime);
+ /* int64 size = 20; */
+ if (message.size !== 0n)
+ writer.tag(20, WireType.Varint).int64(message.size);
+ /* bytes hash = 21; */
+ if (message.hash.length)
+ writer.tag(21, WireType.LengthDelimited).bytes(message.hash);
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message position.Position
+ */
+export const Position = new Position$Type();
diff --git a/frontend/src/entity/service.client.ts b/frontend/src/entity/service.client.ts
new file mode 100644
index 0000000..5e67583
--- /dev/null
+++ b/frontend/src/entity/service.client.ts
@@ -0,0 +1,193 @@
+// @generated by protobuf-ts 2.8.2
+// @generated from protobuf file "service.proto" (package "service", syntax proto3)
+// tslint:disable
+import type { RpcTransport } from "@protobuf-ts/runtime-rpc";
+import type { ServiceInfo } from "@protobuf-ts/runtime-rpc";
+import { Service } from "./service";
+import type { DeviceListReply } from "./service";
+import type { DeviceListRequest } from "./service";
+import type { SourceListReply } from "./service";
+import type { SourceListRequest } from "./service";
+import type { JobGetLogReply } from "./service";
+import type { JobGetLogRequest } from "./service";
+import type { JobDisplayReply } from "./service";
+import type { JobDisplayRequest } from "./service";
+import type { JobNextReply } from "./service";
+import type { JobNextRequest } from "./service";
+import type { JobCreateReply } from "./service";
+import type { JobCreateRequest } from "./service";
+import type { JobListReply } from "./service";
+import type { JobListRequest } from "./service";
+import type { TapeMGetReply } from "./service";
+import type { TapeMGetRequest } from "./service";
+import type { FileListParentsReply } from "./service";
+import type { FileListParentsRequest } from "./service";
+import type { FileDeleteReply } from "./service";
+import type { FileDeleteRequest } from "./service";
+import type { FileMkdirReply } from "./service";
+import type { FileMkdirRequest } from "./service";
+import type { FileEditReply } from "./service";
+import type { FileEditRequest } from "./service";
+import { stackIntercept } from "@protobuf-ts/runtime-rpc";
+import type { FileGetReply } from "./service";
+import type { FileGetRequest } from "./service";
+import type { UnaryCall } from "@protobuf-ts/runtime-rpc";
+import type { RpcOptions } from "@protobuf-ts/runtime-rpc";
+/**
+ * @generated from protobuf service service.Service
+ */
+export interface IServiceClient {
+ /**
+ * @generated from protobuf rpc: FileGet(service.FileGetRequest) returns (service.FileGetReply);
+ */
+ fileGet(input: FileGetRequest, options?: RpcOptions): UnaryCall;
+ /**
+ * @generated from protobuf rpc: FileEdit(service.FileEditRequest) returns (service.FileEditReply);
+ */
+ fileEdit(input: FileEditRequest, options?: RpcOptions): UnaryCall;
+ /**
+ * @generated from protobuf rpc: FileMkdir(service.FileMkdirRequest) returns (service.FileMkdirReply);
+ */
+ fileMkdir(input: FileMkdirRequest, options?: RpcOptions): UnaryCall;
+ /**
+ * @generated from protobuf rpc: FileDelete(service.FileDeleteRequest) returns (service.FileDeleteReply);
+ */
+ fileDelete(input: FileDeleteRequest, options?: RpcOptions): UnaryCall;
+ /**
+ * @generated from protobuf rpc: FileListParents(service.FileListParentsRequest) returns (service.FileListParentsReply);
+ */
+ fileListParents(input: FileListParentsRequest, options?: RpcOptions): UnaryCall;
+ /**
+ * @generated from protobuf rpc: TapeMGet(service.TapeMGetRequest) returns (service.TapeMGetReply);
+ */
+ tapeMGet(input: TapeMGetRequest, options?: RpcOptions): UnaryCall;
+ /**
+ * @generated from protobuf rpc: JobList(service.JobListRequest) returns (service.JobListReply);
+ */
+ jobList(input: JobListRequest, options?: RpcOptions): UnaryCall;
+ /**
+ * @generated from protobuf rpc: JobCreate(service.JobCreateRequest) returns (service.JobCreateReply);
+ */
+ jobCreate(input: JobCreateRequest, options?: RpcOptions): UnaryCall;
+ /**
+ * @generated from protobuf rpc: JobNext(service.JobNextRequest) returns (service.JobNextReply);
+ */
+ jobNext(input: JobNextRequest, options?: RpcOptions): UnaryCall;
+ /**
+ * @generated from protobuf rpc: JobDisplay(service.JobDisplayRequest) returns (service.JobDisplayReply);
+ */
+ jobDisplay(input: JobDisplayRequest, options?: RpcOptions): UnaryCall;
+ /**
+ * @generated from protobuf rpc: JobGetLog(service.JobGetLogRequest) returns (service.JobGetLogReply);
+ */
+ jobGetLog(input: JobGetLogRequest, options?: RpcOptions): UnaryCall;
+ /**
+ * @generated from protobuf rpc: SourceList(service.SourceListRequest) returns (service.SourceListReply);
+ */
+ sourceList(input: SourceListRequest, options?: RpcOptions): UnaryCall;
+ /**
+ * @generated from protobuf rpc: DeviceList(service.DeviceListRequest) returns (service.DeviceListReply);
+ */
+ deviceList(input: DeviceListRequest, options?: RpcOptions): UnaryCall;
+}
+/**
+ * @generated from protobuf service service.Service
+ */
+export class ServiceClient implements IServiceClient, ServiceInfo {
+ typeName = Service.typeName;
+ methods = Service.methods;
+ options = Service.options;
+ constructor(private readonly _transport: RpcTransport) {
+ }
+ /**
+ * @generated from protobuf rpc: FileGet(service.FileGetRequest) returns (service.FileGetReply);
+ */
+ fileGet(input: FileGetRequest, options?: RpcOptions): UnaryCall {
+ const method = this.methods[0], opt = this._transport.mergeOptions(options);
+ return stackIntercept("unary", this._transport, method, opt, input);
+ }
+ /**
+ * @generated from protobuf rpc: FileEdit(service.FileEditRequest) returns (service.FileEditReply);
+ */
+ fileEdit(input: FileEditRequest, options?: RpcOptions): UnaryCall {
+ const method = this.methods[1], opt = this._transport.mergeOptions(options);
+ return stackIntercept("unary", this._transport, method, opt, input);
+ }
+ /**
+ * @generated from protobuf rpc: FileMkdir(service.FileMkdirRequest) returns (service.FileMkdirReply);
+ */
+ fileMkdir(input: FileMkdirRequest, options?: RpcOptions): UnaryCall {
+ const method = this.methods[2], opt = this._transport.mergeOptions(options);
+ return stackIntercept("unary", this._transport, method, opt, input);
+ }
+ /**
+ * @generated from protobuf rpc: FileDelete(service.FileDeleteRequest) returns (service.FileDeleteReply);
+ */
+ fileDelete(input: FileDeleteRequest, options?: RpcOptions): UnaryCall {
+ const method = this.methods[3], opt = this._transport.mergeOptions(options);
+ return stackIntercept("unary", this._transport, method, opt, input);
+ }
+ /**
+ * @generated from protobuf rpc: FileListParents(service.FileListParentsRequest) returns (service.FileListParentsReply);
+ */
+ fileListParents(input: FileListParentsRequest, options?: RpcOptions): UnaryCall {
+ const method = this.methods[4], opt = this._transport.mergeOptions(options);
+ return stackIntercept("unary", this._transport, method, opt, input);
+ }
+ /**
+ * @generated from protobuf rpc: TapeMGet(service.TapeMGetRequest) returns (service.TapeMGetReply);
+ */
+ tapeMGet(input: TapeMGetRequest, options?: RpcOptions): UnaryCall {
+ const method = this.methods[5], opt = this._transport.mergeOptions(options);
+ return stackIntercept("unary", this._transport, method, opt, input);
+ }
+ /**
+ * @generated from protobuf rpc: JobList(service.JobListRequest) returns (service.JobListReply);
+ */
+ jobList(input: JobListRequest, options?: RpcOptions): UnaryCall {
+ const method = this.methods[6], opt = this._transport.mergeOptions(options);
+ return stackIntercept("unary", this._transport, method, opt, input);
+ }
+ /**
+ * @generated from protobuf rpc: JobCreate(service.JobCreateRequest) returns (service.JobCreateReply);
+ */
+ jobCreate(input: JobCreateRequest, options?: RpcOptions): UnaryCall {
+ const method = this.methods[7], opt = this._transport.mergeOptions(options);
+ return stackIntercept("unary", this._transport, method, opt, input);
+ }
+ /**
+ * @generated from protobuf rpc: JobNext(service.JobNextRequest) returns (service.JobNextReply);
+ */
+ jobNext(input: JobNextRequest, options?: RpcOptions): UnaryCall {
+ const method = this.methods[8], opt = this._transport.mergeOptions(options);
+ return stackIntercept("unary", this._transport, method, opt, input);
+ }
+ /**
+ * @generated from protobuf rpc: JobDisplay(service.JobDisplayRequest) returns (service.JobDisplayReply);
+ */
+ jobDisplay(input: JobDisplayRequest, options?: RpcOptions): UnaryCall {
+ const method = this.methods[9], opt = this._transport.mergeOptions(options);
+ return stackIntercept("unary", this._transport, method, opt, input);
+ }
+ /**
+ * @generated from protobuf rpc: JobGetLog(service.JobGetLogRequest) returns (service.JobGetLogReply);
+ */
+ jobGetLog(input: JobGetLogRequest, options?: RpcOptions): UnaryCall {
+ const method = this.methods[10], opt = this._transport.mergeOptions(options);
+ return stackIntercept("unary", this._transport, method, opt, input);
+ }
+ /**
+ * @generated from protobuf rpc: SourceList(service.SourceListRequest) returns (service.SourceListReply);
+ */
+ sourceList(input: SourceListRequest, options?: RpcOptions): UnaryCall {
+ const method = this.methods[11], opt = this._transport.mergeOptions(options);
+ return stackIntercept("unary", this._transport, method, opt, input);
+ }
+ /**
+ * @generated from protobuf rpc: DeviceList(service.DeviceListRequest) returns (service.DeviceListReply);
+ */
+ deviceList(input: DeviceListRequest, options?: RpcOptions): UnaryCall {
+ const method = this.methods[12], opt = this._transport.mergeOptions(options);
+ return stackIntercept("unary", this._transport, method, opt, input);
+ }
+}
diff --git a/frontend/src/entity/service.ts b/frontend/src/entity/service.ts
new file mode 100644
index 0000000..29a1d4e
--- /dev/null
+++ b/frontend/src/entity/service.ts
@@ -0,0 +1,1643 @@
+// @generated by protobuf-ts 2.8.2
+// @generated from protobuf file "service.proto" (package "service", syntax proto3)
+// tslint:disable
+import { ServiceType } from "@protobuf-ts/runtime-rpc";
+import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
+import type { IBinaryWriter } from "@protobuf-ts/runtime";
+import { WireType } from "@protobuf-ts/runtime";
+import type { BinaryReadOptions } from "@protobuf-ts/runtime";
+import type { IBinaryReader } from "@protobuf-ts/runtime";
+import { UnknownFieldHandler } from "@protobuf-ts/runtime";
+import type { PartialMessage } from "@protobuf-ts/runtime";
+import { reflectionMergePartial } from "@protobuf-ts/runtime";
+import { MESSAGE_TYPE } from "@protobuf-ts/runtime";
+import { MessageType } from "@protobuf-ts/runtime";
+import { SourceFile } from "./source";
+import { JobDisplay } from "./job";
+import { JobNextParam } from "./job";
+import { CreatableJob } from "./job";
+import { Job } from "./job";
+import { JobFilter } from "./job";
+import { Tape } from "./tape";
+import { EditedFile } from "./file";
+import { Position } from "./position";
+import { File } from "./file";
+/**
+ * @generated from protobuf message service.FileGetRequest
+ */
+export interface FileGetRequest {
+ /**
+ * @generated from protobuf field: int64 id = 1;
+ */
+ id: bigint;
+}
+/**
+ * @generated from protobuf message service.FileGetReply
+ */
+export interface FileGetReply {
+ /**
+ * @generated from protobuf field: optional file.File file = 1;
+ */
+ file?: File;
+ /**
+ * @generated from protobuf field: repeated position.Position positions = 2;
+ */
+ positions: Position[];
+ /**
+ * @generated from protobuf field: repeated file.File children = 17;
+ */
+ children: File[];
+}
+/**
+ * @generated from protobuf message service.FileEditRequest
+ */
+export interface FileEditRequest {
+ /**
+ * @generated from protobuf field: int64 id = 1;
+ */
+ id: bigint;
+ /**
+ * @generated from protobuf field: file.EditedFile file = 2;
+ */
+ file?: EditedFile;
+}
+/**
+ * @generated from protobuf message service.FileEditReply
+ */
+export interface FileEditReply {
+ /**
+ * @generated from protobuf field: file.File file = 1;
+ */
+ file?: File;
+}
+/**
+ * @generated from protobuf message service.FileMkdirRequest
+ */
+export interface FileMkdirRequest {
+ /**
+ * @generated from protobuf field: int64 parent_id = 1;
+ */
+ parentId: bigint;
+ /**
+ * @generated from protobuf field: string path = 2;
+ */
+ path: string;
+}
+/**
+ * @generated from protobuf message service.FileMkdirReply
+ */
+export interface FileMkdirReply {
+ /**
+ * @generated from protobuf field: file.File file = 1;
+ */
+ file?: File;
+}
+/**
+ * @generated from protobuf message service.FileDeleteRequest
+ */
+export interface FileDeleteRequest {
+ /**
+ * @generated from protobuf field: repeated int64 ids = 1;
+ */
+ ids: bigint[];
+}
+/**
+ * @generated from protobuf message service.FileDeleteReply
+ */
+export interface FileDeleteReply {
+}
+/**
+ * @generated from protobuf message service.FileListParentsRequest
+ */
+export interface FileListParentsRequest {
+ /**
+ * @generated from protobuf field: int64 id = 1;
+ */
+ id: bigint;
+}
+/**
+ * @generated from protobuf message service.FileListParentsReply
+ */
+export interface FileListParentsReply {
+ /**
+ * @generated from protobuf field: repeated file.File parents = 1;
+ */
+ parents: File[];
+}
+/**
+ * @generated from protobuf message service.TapeMGetRequest
+ */
+export interface TapeMGetRequest {
+ /**
+ * @generated from protobuf field: repeated int64 ids = 1;
+ */
+ ids: bigint[];
+}
+/**
+ * @generated from protobuf message service.TapeMGetReply
+ */
+export interface TapeMGetReply {
+ /**
+ * @generated from protobuf field: repeated tape.Tape tapes = 1;
+ */
+ tapes: Tape[];
+}
+/**
+ * @generated from protobuf message service.JobListRequest
+ */
+export interface JobListRequest {
+ /**
+ * @generated from protobuf oneof: param
+ */
+ param: {
+ oneofKind: "mget";
+ /**
+ * @generated from protobuf field: service.JobMGetRequest mget = 1;
+ */
+ mget: JobMGetRequest;
+ } | {
+ oneofKind: "list";
+ /**
+ * @generated from protobuf field: job.JobFilter list = 2;
+ */
+ list: JobFilter;
+ } | {
+ oneofKind: undefined;
+ };
+}
+/**
+ * @generated from protobuf message service.JobMGetRequest
+ */
+export interface JobMGetRequest {
+ /**
+ * @generated from protobuf field: repeated int64 ids = 1;
+ */
+ ids: bigint[];
+}
+/**
+ * @generated from protobuf message service.JobListReply
+ */
+export interface JobListReply {
+ /**
+ * @generated from protobuf field: repeated job.Job jobs = 1;
+ */
+ jobs: Job[];
+}
+/**
+ * @generated from protobuf message service.JobCreateRequest
+ */
+export interface JobCreateRequest {
+ /**
+ * @generated from protobuf field: job.CreatableJob job = 1;
+ */
+ job?: CreatableJob;
+}
+/**
+ * @generated from protobuf message service.JobCreateReply
+ */
+export interface JobCreateReply {
+ /**
+ * @generated from protobuf field: job.Job job = 1;
+ */
+ job?: Job;
+}
+/**
+ * @generated from protobuf message service.JobNextRequest
+ */
+export interface JobNextRequest {
+ /**
+ * @generated from protobuf field: int64 id = 1;
+ */
+ id: bigint;
+ /**
+ * @generated from protobuf field: job.JobNextParam param = 2;
+ */
+ param?: JobNextParam;
+}
+/**
+ * @generated from protobuf message service.JobNextReply
+ */
+export interface JobNextReply {
+ /**
+ * @generated from protobuf field: job.Job job = 1;
+ */
+ job?: Job;
+}
+/**
+ * @generated from protobuf message service.JobDisplayRequest
+ */
+export interface JobDisplayRequest {
+ /**
+ * @generated from protobuf field: int64 id = 1;
+ */
+ id: bigint;
+}
+/**
+ * @generated from protobuf message service.JobDisplayReply
+ */
+export interface JobDisplayReply {
+ /**
+ * @generated from protobuf field: job.JobDisplay display = 1;
+ */
+ display?: JobDisplay;
+}
+/**
+ * @generated from protobuf message service.JobGetLogRequest
+ */
+export interface JobGetLogRequest {
+ /**
+ * @generated from protobuf field: int64 job_id = 1;
+ */
+ jobId: bigint;
+ /**
+ * @generated from protobuf field: optional int64 offset = 2;
+ */
+ offset?: bigint;
+}
+/**
+ * @generated from protobuf message service.JobGetLogReply
+ */
+export interface JobGetLogReply {
+ /**
+ * @generated from protobuf field: bytes logs = 1;
+ */
+ logs: Uint8Array;
+}
+/**
+ * @generated from protobuf message service.SourceListRequest
+ */
+export interface SourceListRequest {
+ /**
+ * @generated from protobuf field: string path = 1;
+ */
+ path: string;
+}
+/**
+ * @generated from protobuf message service.SourceListReply
+ */
+export interface SourceListReply {
+ /**
+ * @generated from protobuf field: source.SourceFile file = 1;
+ */
+ file?: SourceFile;
+ /**
+ * @generated from protobuf field: repeated source.SourceFile chain = 2;
+ */
+ chain: SourceFile[];
+ /**
+ * @generated from protobuf field: repeated source.SourceFile children = 17;
+ */
+ children: SourceFile[];
+}
+/**
+ * @generated from protobuf message service.DeviceListRequest
+ */
+export interface DeviceListRequest {
+}
+/**
+ * @generated from protobuf message service.DeviceListReply
+ */
+export interface DeviceListReply {
+ /**
+ * @generated from protobuf field: repeated string devices = 1;
+ */
+ devices: string[];
+}
+// @generated message type with reflection information, may provide speed optimized methods
+class FileGetRequest$Type extends MessageType {
+ constructor() {
+ super("service.FileGetRequest", [
+ { no: 1, name: "id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }
+ ]);
+ }
+ create(value?: PartialMessage): FileGetRequest {
+ const message = { id: 0n };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FileGetRequest): FileGetRequest {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* int64 id */ 1:
+ message.id = reader.int64().toBigInt();
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: FileGetRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* int64 id = 1; */
+ if (message.id !== 0n)
+ writer.tag(1, WireType.Varint).int64(message.id);
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message service.FileGetRequest
+ */
+export const FileGetRequest = new FileGetRequest$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class FileGetReply$Type extends MessageType {
+ constructor() {
+ super("service.FileGetReply", [
+ { no: 1, name: "file", kind: "message", T: () => File },
+ { no: 2, name: "positions", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Position },
+ { no: 17, name: "children", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => File }
+ ]);
+ }
+ create(value?: PartialMessage): FileGetReply {
+ const message = { positions: [], children: [] };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FileGetReply): FileGetReply {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* optional file.File file */ 1:
+ message.file = File.internalBinaryRead(reader, reader.uint32(), options, message.file);
+ break;
+ case /* repeated position.Position positions */ 2:
+ message.positions.push(Position.internalBinaryRead(reader, reader.uint32(), options));
+ break;
+ case /* repeated file.File children */ 17:
+ message.children.push(File.internalBinaryRead(reader, reader.uint32(), options));
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: FileGetReply, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* optional file.File file = 1; */
+ if (message.file)
+ File.internalBinaryWrite(message.file, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
+ /* repeated position.Position positions = 2; */
+ for (let i = 0; i < message.positions.length; i++)
+ Position.internalBinaryWrite(message.positions[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join();
+ /* repeated file.File children = 17; */
+ for (let i = 0; i < message.children.length; i++)
+ File.internalBinaryWrite(message.children[i], writer.tag(17, WireType.LengthDelimited).fork(), options).join();
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message service.FileGetReply
+ */
+export const FileGetReply = new FileGetReply$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class FileEditRequest$Type extends MessageType {
+ constructor() {
+ super("service.FileEditRequest", [
+ { no: 1, name: "id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 2, name: "file", kind: "message", T: () => EditedFile }
+ ]);
+ }
+ create(value?: PartialMessage): FileEditRequest {
+ const message = { id: 0n };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FileEditRequest): FileEditRequest {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* int64 id */ 1:
+ message.id = reader.int64().toBigInt();
+ break;
+ case /* file.EditedFile file */ 2:
+ message.file = EditedFile.internalBinaryRead(reader, reader.uint32(), options, message.file);
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: FileEditRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* int64 id = 1; */
+ if (message.id !== 0n)
+ writer.tag(1, WireType.Varint).int64(message.id);
+ /* file.EditedFile file = 2; */
+ if (message.file)
+ EditedFile.internalBinaryWrite(message.file, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message service.FileEditRequest
+ */
+export const FileEditRequest = new FileEditRequest$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class FileEditReply$Type extends MessageType {
+ constructor() {
+ super("service.FileEditReply", [
+ { no: 1, name: "file", kind: "message", T: () => File }
+ ]);
+ }
+ create(value?: PartialMessage): FileEditReply {
+ const message = {};
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FileEditReply): FileEditReply {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* file.File file */ 1:
+ message.file = File.internalBinaryRead(reader, reader.uint32(), options, message.file);
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: FileEditReply, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* file.File file = 1; */
+ if (message.file)
+ File.internalBinaryWrite(message.file, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message service.FileEditReply
+ */
+export const FileEditReply = new FileEditReply$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class FileMkdirRequest$Type extends MessageType {
+ constructor() {
+ super("service.FileMkdirRequest", [
+ { no: 1, name: "parent_id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 2, name: "path", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
+ ]);
+ }
+ create(value?: PartialMessage): FileMkdirRequest {
+ const message = { parentId: 0n, path: "" };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FileMkdirRequest): FileMkdirRequest {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* int64 parent_id */ 1:
+ message.parentId = reader.int64().toBigInt();
+ break;
+ case /* string path */ 2:
+ message.path = reader.string();
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: FileMkdirRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* int64 parent_id = 1; */
+ if (message.parentId !== 0n)
+ writer.tag(1, WireType.Varint).int64(message.parentId);
+ /* string path = 2; */
+ if (message.path !== "")
+ writer.tag(2, WireType.LengthDelimited).string(message.path);
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message service.FileMkdirRequest
+ */
+export const FileMkdirRequest = new FileMkdirRequest$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class FileMkdirReply$Type extends MessageType {
+ constructor() {
+ super("service.FileMkdirReply", [
+ { no: 1, name: "file", kind: "message", T: () => File }
+ ]);
+ }
+ create(value?: PartialMessage): FileMkdirReply {
+ const message = {};
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FileMkdirReply): FileMkdirReply {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* file.File file */ 1:
+ message.file = File.internalBinaryRead(reader, reader.uint32(), options, message.file);
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: FileMkdirReply, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* file.File file = 1; */
+ if (message.file)
+ File.internalBinaryWrite(message.file, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message service.FileMkdirReply
+ */
+export const FileMkdirReply = new FileMkdirReply$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class FileDeleteRequest$Type extends MessageType {
+ constructor() {
+ super("service.FileDeleteRequest", [
+ { no: 1, name: "ids", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }
+ ]);
+ }
+ create(value?: PartialMessage): FileDeleteRequest {
+ const message = { ids: [] };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FileDeleteRequest): FileDeleteRequest {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* repeated int64 ids */ 1:
+ if (wireType === WireType.LengthDelimited)
+ for (let e = reader.int32() + reader.pos; reader.pos < e;)
+ message.ids.push(reader.int64().toBigInt());
+ else
+ message.ids.push(reader.int64().toBigInt());
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: FileDeleteRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* repeated int64 ids = 1; */
+ if (message.ids.length) {
+ writer.tag(1, WireType.LengthDelimited).fork();
+ for (let i = 0; i < message.ids.length; i++)
+ writer.int64(message.ids[i]);
+ writer.join();
+ }
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message service.FileDeleteRequest
+ */
+export const FileDeleteRequest = new FileDeleteRequest$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class FileDeleteReply$Type extends MessageType {
+ constructor() {
+ super("service.FileDeleteReply", []);
+ }
+ create(value?: PartialMessage): FileDeleteReply {
+ const message = {};
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FileDeleteReply): FileDeleteReply {
+ return target ?? this.create();
+ }
+ internalBinaryWrite(message: FileDeleteReply, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message service.FileDeleteReply
+ */
+export const FileDeleteReply = new FileDeleteReply$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class FileListParentsRequest$Type extends MessageType {
+ constructor() {
+ super("service.FileListParentsRequest", [
+ { no: 1, name: "id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }
+ ]);
+ }
+ create(value?: PartialMessage): FileListParentsRequest {
+ const message = { id: 0n };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FileListParentsRequest): FileListParentsRequest {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* int64 id */ 1:
+ message.id = reader.int64().toBigInt();
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: FileListParentsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* int64 id = 1; */
+ if (message.id !== 0n)
+ writer.tag(1, WireType.Varint).int64(message.id);
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message service.FileListParentsRequest
+ */
+export const FileListParentsRequest = new FileListParentsRequest$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class FileListParentsReply$Type extends MessageType {
+ constructor() {
+ super("service.FileListParentsReply", [
+ { no: 1, name: "parents", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => File }
+ ]);
+ }
+ create(value?: PartialMessage): FileListParentsReply {
+ const message = { parents: [] };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FileListParentsReply): FileListParentsReply {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* repeated file.File parents */ 1:
+ message.parents.push(File.internalBinaryRead(reader, reader.uint32(), options));
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: FileListParentsReply, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* repeated file.File parents = 1; */
+ for (let i = 0; i < message.parents.length; i++)
+ File.internalBinaryWrite(message.parents[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message service.FileListParentsReply
+ */
+export const FileListParentsReply = new FileListParentsReply$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class TapeMGetRequest$Type extends MessageType {
+ constructor() {
+ super("service.TapeMGetRequest", [
+ { no: 1, name: "ids", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }
+ ]);
+ }
+ create(value?: PartialMessage): TapeMGetRequest {
+ const message = { ids: [] };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TapeMGetRequest): TapeMGetRequest {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* repeated int64 ids */ 1:
+ if (wireType === WireType.LengthDelimited)
+ for (let e = reader.int32() + reader.pos; reader.pos < e;)
+ message.ids.push(reader.int64().toBigInt());
+ else
+ message.ids.push(reader.int64().toBigInt());
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: TapeMGetRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* repeated int64 ids = 1; */
+ if (message.ids.length) {
+ writer.tag(1, WireType.LengthDelimited).fork();
+ for (let i = 0; i < message.ids.length; i++)
+ writer.int64(message.ids[i]);
+ writer.join();
+ }
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message service.TapeMGetRequest
+ */
+export const TapeMGetRequest = new TapeMGetRequest$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class TapeMGetReply$Type extends MessageType {
+ constructor() {
+ super("service.TapeMGetReply", [
+ { no: 1, name: "tapes", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Tape }
+ ]);
+ }
+ create(value?: PartialMessage): TapeMGetReply {
+ const message = { tapes: [] };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TapeMGetReply): TapeMGetReply {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* repeated tape.Tape tapes */ 1:
+ message.tapes.push(Tape.internalBinaryRead(reader, reader.uint32(), options));
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: TapeMGetReply, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* repeated tape.Tape tapes = 1; */
+ for (let i = 0; i < message.tapes.length; i++)
+ Tape.internalBinaryWrite(message.tapes[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message service.TapeMGetReply
+ */
+export const TapeMGetReply = new TapeMGetReply$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class JobListRequest$Type extends MessageType {
+ constructor() {
+ super("service.JobListRequest", [
+ { no: 1, name: "mget", kind: "message", oneof: "param", T: () => JobMGetRequest },
+ { no: 2, name: "list", kind: "message", oneof: "param", T: () => JobFilter }
+ ]);
+ }
+ create(value?: PartialMessage): JobListRequest {
+ const message = { param: { oneofKind: undefined } };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: JobListRequest): JobListRequest {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* service.JobMGetRequest mget */ 1:
+ message.param = {
+ oneofKind: "mget",
+ mget: JobMGetRequest.internalBinaryRead(reader, reader.uint32(), options, (message.param as any).mget)
+ };
+ break;
+ case /* job.JobFilter list */ 2:
+ message.param = {
+ oneofKind: "list",
+ list: JobFilter.internalBinaryRead(reader, reader.uint32(), options, (message.param as any).list)
+ };
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: JobListRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* service.JobMGetRequest mget = 1; */
+ if (message.param.oneofKind === "mget")
+ JobMGetRequest.internalBinaryWrite(message.param.mget, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
+ /* job.JobFilter list = 2; */
+ if (message.param.oneofKind === "list")
+ JobFilter.internalBinaryWrite(message.param.list, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message service.JobListRequest
+ */
+export const JobListRequest = new JobListRequest$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class JobMGetRequest$Type extends MessageType {
+ constructor() {
+ super("service.JobMGetRequest", [
+ { no: 1, name: "ids", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }
+ ]);
+ }
+ create(value?: PartialMessage): JobMGetRequest {
+ const message = { ids: [] };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: JobMGetRequest): JobMGetRequest {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* repeated int64 ids */ 1:
+ if (wireType === WireType.LengthDelimited)
+ for (let e = reader.int32() + reader.pos; reader.pos < e;)
+ message.ids.push(reader.int64().toBigInt());
+ else
+ message.ids.push(reader.int64().toBigInt());
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: JobMGetRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* repeated int64 ids = 1; */
+ if (message.ids.length) {
+ writer.tag(1, WireType.LengthDelimited).fork();
+ for (let i = 0; i < message.ids.length; i++)
+ writer.int64(message.ids[i]);
+ writer.join();
+ }
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message service.JobMGetRequest
+ */
+export const JobMGetRequest = new JobMGetRequest$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class JobListReply$Type extends MessageType {
+ constructor() {
+ super("service.JobListReply", [
+ { no: 1, name: "jobs", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Job }
+ ]);
+ }
+ create(value?: PartialMessage): JobListReply {
+ const message = { jobs: [] };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: JobListReply): JobListReply {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* repeated job.Job jobs */ 1:
+ message.jobs.push(Job.internalBinaryRead(reader, reader.uint32(), options));
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: JobListReply, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* repeated job.Job jobs = 1; */
+ for (let i = 0; i < message.jobs.length; i++)
+ Job.internalBinaryWrite(message.jobs[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message service.JobListReply
+ */
+export const JobListReply = new JobListReply$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class JobCreateRequest$Type extends MessageType {
+ constructor() {
+ super("service.JobCreateRequest", [
+ { no: 1, name: "job", kind: "message", T: () => CreatableJob }
+ ]);
+ }
+ create(value?: PartialMessage): JobCreateRequest {
+ const message = {};
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: JobCreateRequest): JobCreateRequest {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* job.CreatableJob job */ 1:
+ message.job = CreatableJob.internalBinaryRead(reader, reader.uint32(), options, message.job);
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: JobCreateRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* job.CreatableJob job = 1; */
+ if (message.job)
+ CreatableJob.internalBinaryWrite(message.job, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message service.JobCreateRequest
+ */
+export const JobCreateRequest = new JobCreateRequest$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class JobCreateReply$Type extends MessageType {
+ constructor() {
+ super("service.JobCreateReply", [
+ { no: 1, name: "job", kind: "message", T: () => Job }
+ ]);
+ }
+ create(value?: PartialMessage): JobCreateReply {
+ const message = {};
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: JobCreateReply): JobCreateReply {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* job.Job job */ 1:
+ message.job = Job.internalBinaryRead(reader, reader.uint32(), options, message.job);
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: JobCreateReply, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* job.Job job = 1; */
+ if (message.job)
+ Job.internalBinaryWrite(message.job, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message service.JobCreateReply
+ */
+export const JobCreateReply = new JobCreateReply$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class JobNextRequest$Type extends MessageType {
+ constructor() {
+ super("service.JobNextRequest", [
+ { no: 1, name: "id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 2, name: "param", kind: "message", T: () => JobNextParam }
+ ]);
+ }
+ create(value?: PartialMessage): JobNextRequest {
+ const message = { id: 0n };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: JobNextRequest): JobNextRequest {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* int64 id */ 1:
+ message.id = reader.int64().toBigInt();
+ break;
+ case /* job.JobNextParam param */ 2:
+ message.param = JobNextParam.internalBinaryRead(reader, reader.uint32(), options, message.param);
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: JobNextRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* int64 id = 1; */
+ if (message.id !== 0n)
+ writer.tag(1, WireType.Varint).int64(message.id);
+ /* job.JobNextParam param = 2; */
+ if (message.param)
+ JobNextParam.internalBinaryWrite(message.param, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message service.JobNextRequest
+ */
+export const JobNextRequest = new JobNextRequest$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class JobNextReply$Type extends MessageType {
+ constructor() {
+ super("service.JobNextReply", [
+ { no: 1, name: "job", kind: "message", T: () => Job }
+ ]);
+ }
+ create(value?: PartialMessage): JobNextReply {
+ const message = {};
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: JobNextReply): JobNextReply {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* job.Job job */ 1:
+ message.job = Job.internalBinaryRead(reader, reader.uint32(), options, message.job);
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: JobNextReply, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* job.Job job = 1; */
+ if (message.job)
+ Job.internalBinaryWrite(message.job, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message service.JobNextReply
+ */
+export const JobNextReply = new JobNextReply$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class JobDisplayRequest$Type extends MessageType {
+ constructor() {
+ super("service.JobDisplayRequest", [
+ { no: 1, name: "id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }
+ ]);
+ }
+ create(value?: PartialMessage): JobDisplayRequest {
+ const message = { id: 0n };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: JobDisplayRequest): JobDisplayRequest {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* int64 id */ 1:
+ message.id = reader.int64().toBigInt();
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: JobDisplayRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* int64 id = 1; */
+ if (message.id !== 0n)
+ writer.tag(1, WireType.Varint).int64(message.id);
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message service.JobDisplayRequest
+ */
+export const JobDisplayRequest = new JobDisplayRequest$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class JobDisplayReply$Type extends MessageType {
+ constructor() {
+ super("service.JobDisplayReply", [
+ { no: 1, name: "display", kind: "message", T: () => JobDisplay }
+ ]);
+ }
+ create(value?: PartialMessage): JobDisplayReply {
+ const message = {};
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: JobDisplayReply): JobDisplayReply {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* job.JobDisplay display */ 1:
+ message.display = JobDisplay.internalBinaryRead(reader, reader.uint32(), options, message.display);
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: JobDisplayReply, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* job.JobDisplay display = 1; */
+ if (message.display)
+ JobDisplay.internalBinaryWrite(message.display, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message service.JobDisplayReply
+ */
+export const JobDisplayReply = new JobDisplayReply$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class JobGetLogRequest$Type extends MessageType {
+ constructor() {
+ super("service.JobGetLogRequest", [
+ { no: 1, name: "job_id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 2, name: "offset", kind: "scalar", opt: true, T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }
+ ]);
+ }
+ create(value?: PartialMessage): JobGetLogRequest {
+ const message = { jobId: 0n };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: JobGetLogRequest): JobGetLogRequest {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* int64 job_id */ 1:
+ message.jobId = reader.int64().toBigInt();
+ break;
+ case /* optional int64 offset */ 2:
+ message.offset = reader.int64().toBigInt();
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: JobGetLogRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* int64 job_id = 1; */
+ if (message.jobId !== 0n)
+ writer.tag(1, WireType.Varint).int64(message.jobId);
+ /* optional int64 offset = 2; */
+ if (message.offset !== undefined)
+ writer.tag(2, WireType.Varint).int64(message.offset);
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message service.JobGetLogRequest
+ */
+export const JobGetLogRequest = new JobGetLogRequest$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class JobGetLogReply$Type extends MessageType {
+ constructor() {
+ super("service.JobGetLogReply", [
+ { no: 1, name: "logs", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }
+ ]);
+ }
+ create(value?: PartialMessage): JobGetLogReply {
+ const message = { logs: new Uint8Array(0) };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: JobGetLogReply): JobGetLogReply {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* bytes logs */ 1:
+ message.logs = reader.bytes();
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: JobGetLogReply, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* bytes logs = 1; */
+ if (message.logs.length)
+ writer.tag(1, WireType.LengthDelimited).bytes(message.logs);
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message service.JobGetLogReply
+ */
+export const JobGetLogReply = new JobGetLogReply$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class SourceListRequest$Type extends MessageType {
+ constructor() {
+ super("service.SourceListRequest", [
+ { no: 1, name: "path", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
+ ]);
+ }
+ create(value?: PartialMessage): SourceListRequest {
+ const message = { path: "" };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SourceListRequest): SourceListRequest {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* string path */ 1:
+ message.path = reader.string();
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: SourceListRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* string path = 1; */
+ if (message.path !== "")
+ writer.tag(1, WireType.LengthDelimited).string(message.path);
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message service.SourceListRequest
+ */
+export const SourceListRequest = new SourceListRequest$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class SourceListReply$Type extends MessageType {
+ constructor() {
+ super("service.SourceListReply", [
+ { no: 1, name: "file", kind: "message", T: () => SourceFile },
+ { no: 2, name: "chain", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => SourceFile },
+ { no: 17, name: "children", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => SourceFile }
+ ]);
+ }
+ create(value?: PartialMessage): SourceListReply {
+ const message = { chain: [], children: [] };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SourceListReply): SourceListReply {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* source.SourceFile file */ 1:
+ message.file = SourceFile.internalBinaryRead(reader, reader.uint32(), options, message.file);
+ break;
+ case /* repeated source.SourceFile chain */ 2:
+ message.chain.push(SourceFile.internalBinaryRead(reader, reader.uint32(), options));
+ break;
+ case /* repeated source.SourceFile children */ 17:
+ message.children.push(SourceFile.internalBinaryRead(reader, reader.uint32(), options));
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: SourceListReply, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* source.SourceFile file = 1; */
+ if (message.file)
+ SourceFile.internalBinaryWrite(message.file, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
+ /* repeated source.SourceFile chain = 2; */
+ for (let i = 0; i < message.chain.length; i++)
+ SourceFile.internalBinaryWrite(message.chain[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join();
+ /* repeated source.SourceFile children = 17; */
+ for (let i = 0; i < message.children.length; i++)
+ SourceFile.internalBinaryWrite(message.children[i], writer.tag(17, WireType.LengthDelimited).fork(), options).join();
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message service.SourceListReply
+ */
+export const SourceListReply = new SourceListReply$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class DeviceListRequest$Type extends MessageType {
+ constructor() {
+ super("service.DeviceListRequest", []);
+ }
+ create(value?: PartialMessage): DeviceListRequest {
+ const message = {};
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeviceListRequest): DeviceListRequest {
+ return target ?? this.create();
+ }
+ internalBinaryWrite(message: DeviceListRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message service.DeviceListRequest
+ */
+export const DeviceListRequest = new DeviceListRequest$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class DeviceListReply$Type extends MessageType {
+ constructor() {
+ super("service.DeviceListReply", [
+ { no: 1, name: "devices", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }
+ ]);
+ }
+ create(value?: PartialMessage): DeviceListReply {
+ const message = { devices: [] };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeviceListReply): DeviceListReply {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* repeated string devices */ 1:
+ message.devices.push(reader.string());
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: DeviceListReply, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* repeated string devices = 1; */
+ for (let i = 0; i < message.devices.length; i++)
+ writer.tag(1, WireType.LengthDelimited).string(message.devices[i]);
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message service.DeviceListReply
+ */
+export const DeviceListReply = new DeviceListReply$Type();
+/**
+ * @generated ServiceType for protobuf service service.Service
+ */
+export const Service = new ServiceType("service.Service", [
+ { name: "FileGet", options: {}, I: FileGetRequest, O: FileGetReply },
+ { name: "FileEdit", options: {}, I: FileEditRequest, O: FileEditReply },
+ { name: "FileMkdir", options: {}, I: FileMkdirRequest, O: FileMkdirReply },
+ { name: "FileDelete", options: {}, I: FileDeleteRequest, O: FileDeleteReply },
+ { name: "FileListParents", options: {}, I: FileListParentsRequest, O: FileListParentsReply },
+ { name: "TapeMGet", options: {}, I: TapeMGetRequest, O: TapeMGetReply },
+ { name: "JobList", options: {}, I: JobListRequest, O: JobListReply },
+ { name: "JobCreate", options: {}, I: JobCreateRequest, O: JobCreateReply },
+ { name: "JobNext", options: {}, I: JobNextRequest, O: JobNextReply },
+ { name: "JobDisplay", options: {}, I: JobDisplayRequest, O: JobDisplayReply },
+ { name: "JobGetLog", options: {}, I: JobGetLogRequest, O: JobGetLogReply },
+ { name: "SourceList", options: {}, I: SourceListRequest, O: SourceListReply },
+ { name: "DeviceList", options: {}, I: DeviceListRequest, O: DeviceListReply }
+]);
diff --git a/frontend/src/entity/source.ts b/frontend/src/entity/source.ts
new file mode 100644
index 0000000..5f7b1dc
--- /dev/null
+++ b/frontend/src/entity/source.ts
@@ -0,0 +1,281 @@
+// @generated by protobuf-ts 2.8.2
+// @generated from protobuf file "source.proto" (package "source", syntax proto3)
+// tslint:disable
+import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
+import type { IBinaryWriter } from "@protobuf-ts/runtime";
+import { WireType } from "@protobuf-ts/runtime";
+import type { BinaryReadOptions } from "@protobuf-ts/runtime";
+import type { IBinaryReader } from "@protobuf-ts/runtime";
+import { UnknownFieldHandler } from "@protobuf-ts/runtime";
+import type { PartialMessage } from "@protobuf-ts/runtime";
+import { reflectionMergePartial } from "@protobuf-ts/runtime";
+import { MESSAGE_TYPE } from "@protobuf-ts/runtime";
+import { MessageType } from "@protobuf-ts/runtime";
+import { CopyStatus } from "./copy_status";
+/**
+ * @generated from protobuf message source.SourceFile
+ */
+export interface SourceFile {
+ /**
+ * @generated from protobuf field: string path = 1;
+ */
+ path: string;
+ /**
+ * @generated from protobuf field: string parent_path = 2;
+ */
+ parentPath: string;
+ /**
+ * @generated from protobuf field: string name = 3;
+ */
+ name: string;
+ /**
+ * @generated from protobuf field: int64 mode = 17;
+ */
+ mode: bigint;
+ /**
+ * @generated from protobuf field: int64 mod_time = 18;
+ */
+ modTime: bigint;
+ /**
+ * @generated from protobuf field: int64 size = 19;
+ */
+ size: bigint;
+}
+/**
+ * @generated from protobuf message source.Source
+ */
+export interface Source {
+ /**
+ * @generated from protobuf field: string base = 1;
+ */
+ base: string;
+ /**
+ * @generated from protobuf field: repeated string path = 2;
+ */
+ path: string[];
+}
+/**
+ * @generated from protobuf message source.SourceState
+ */
+export interface SourceState {
+ /**
+ * @generated from protobuf field: source.Source source = 1;
+ */
+ source?: Source;
+ /**
+ * @generated from protobuf field: int64 size = 2;
+ */
+ size: bigint;
+ /**
+ * @generated from protobuf field: copy_status.CopyStatus status = 3;
+ */
+ status: CopyStatus;
+ /**
+ * @generated from protobuf field: optional string message = 4;
+ */
+ message?: string;
+}
+// @generated message type with reflection information, may provide speed optimized methods
+class SourceFile$Type extends MessageType {
+ constructor() {
+ super("source.SourceFile", [
+ { no: 1, name: "path", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
+ { no: 2, name: "parent_path", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
+ { no: 3, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
+ { no: 17, name: "mode", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 18, name: "mod_time", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 19, name: "size", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }
+ ]);
+ }
+ create(value?: PartialMessage): SourceFile {
+ const message = { path: "", parentPath: "", name: "", mode: 0n, modTime: 0n, size: 0n };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SourceFile): SourceFile {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* string path */ 1:
+ message.path = reader.string();
+ break;
+ case /* string parent_path */ 2:
+ message.parentPath = reader.string();
+ break;
+ case /* string name */ 3:
+ message.name = reader.string();
+ break;
+ case /* int64 mode */ 17:
+ message.mode = reader.int64().toBigInt();
+ break;
+ case /* int64 mod_time */ 18:
+ message.modTime = reader.int64().toBigInt();
+ break;
+ case /* int64 size */ 19:
+ message.size = reader.int64().toBigInt();
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: SourceFile, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* string path = 1; */
+ if (message.path !== "")
+ writer.tag(1, WireType.LengthDelimited).string(message.path);
+ /* string parent_path = 2; */
+ if (message.parentPath !== "")
+ writer.tag(2, WireType.LengthDelimited).string(message.parentPath);
+ /* string name = 3; */
+ if (message.name !== "")
+ writer.tag(3, WireType.LengthDelimited).string(message.name);
+ /* int64 mode = 17; */
+ if (message.mode !== 0n)
+ writer.tag(17, WireType.Varint).int64(message.mode);
+ /* int64 mod_time = 18; */
+ if (message.modTime !== 0n)
+ writer.tag(18, WireType.Varint).int64(message.modTime);
+ /* int64 size = 19; */
+ if (message.size !== 0n)
+ writer.tag(19, WireType.Varint).int64(message.size);
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message source.SourceFile
+ */
+export const SourceFile = new SourceFile$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class Source$Type extends MessageType {
+ constructor() {
+ super("source.Source", [
+ { no: 1, name: "base", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
+ { no: 2, name: "path", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }
+ ]);
+ }
+ create(value?: PartialMessage): Source {
+ const message = { base: "", path: [] };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Source): Source {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* string base */ 1:
+ message.base = reader.string();
+ break;
+ case /* repeated string path */ 2:
+ message.path.push(reader.string());
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: Source, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* string base = 1; */
+ if (message.base !== "")
+ writer.tag(1, WireType.LengthDelimited).string(message.base);
+ /* repeated string path = 2; */
+ for (let i = 0; i < message.path.length; i++)
+ writer.tag(2, WireType.LengthDelimited).string(message.path[i]);
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message source.Source
+ */
+export const Source = new Source$Type();
+// @generated message type with reflection information, may provide speed optimized methods
+class SourceState$Type extends MessageType {
+ constructor() {
+ super("source.SourceState", [
+ { no: 1, name: "source", kind: "message", T: () => Source },
+ { no: 2, name: "size", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 3, name: "status", kind: "enum", T: () => ["copy_status.CopyStatus", CopyStatus] },
+ { no: 4, name: "message", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }
+ ]);
+ }
+ create(value?: PartialMessage): SourceState {
+ const message = { size: 0n, status: 0 };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SourceState): SourceState {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* source.Source source */ 1:
+ message.source = Source.internalBinaryRead(reader, reader.uint32(), options, message.source);
+ break;
+ case /* int64 size */ 2:
+ message.size = reader.int64().toBigInt();
+ break;
+ case /* copy_status.CopyStatus status */ 3:
+ message.status = reader.int32();
+ break;
+ case /* optional string message */ 4:
+ message.message = reader.string();
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: SourceState, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* source.Source source = 1; */
+ if (message.source)
+ Source.internalBinaryWrite(message.source, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
+ /* int64 size = 2; */
+ if (message.size !== 0n)
+ writer.tag(2, WireType.Varint).int64(message.size);
+ /* copy_status.CopyStatus status = 3; */
+ if (message.status !== 0)
+ writer.tag(3, WireType.Varint).int32(message.status);
+ /* optional string message = 4; */
+ if (message.message !== undefined)
+ writer.tag(4, WireType.LengthDelimited).string(message.message);
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message source.SourceState
+ */
+export const SourceState = new SourceState$Type();
diff --git a/frontend/src/entity/tape.ts b/frontend/src/entity/tape.ts
new file mode 100644
index 0000000..e0e02c3
--- /dev/null
+++ b/frontend/src/entity/tape.ts
@@ -0,0 +1,146 @@
+// @generated by protobuf-ts 2.8.2
+// @generated from protobuf file "tape.proto" (package "tape", syntax proto3)
+// tslint:disable
+import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
+import type { IBinaryWriter } from "@protobuf-ts/runtime";
+import { WireType } from "@protobuf-ts/runtime";
+import type { BinaryReadOptions } from "@protobuf-ts/runtime";
+import type { IBinaryReader } from "@protobuf-ts/runtime";
+import { UnknownFieldHandler } from "@protobuf-ts/runtime";
+import type { PartialMessage } from "@protobuf-ts/runtime";
+import { reflectionMergePartial } from "@protobuf-ts/runtime";
+import { MESSAGE_TYPE } from "@protobuf-ts/runtime";
+import { MessageType } from "@protobuf-ts/runtime";
+/**
+ * @generated from protobuf message tape.Tape
+ */
+export interface Tape {
+ /**
+ * @generated from protobuf field: int64 id = 1;
+ */
+ id: bigint;
+ /**
+ * @generated from protobuf field: string barcode = 2;
+ */
+ barcode: string;
+ /**
+ * @generated from protobuf field: string name = 3;
+ */
+ name: string;
+ /**
+ * @generated from protobuf field: string encryption = 4;
+ */
+ encryption: string;
+ /**
+ * @generated from protobuf field: int64 create_time = 17;
+ */
+ createTime: bigint;
+ /**
+ * @generated from protobuf field: optional int64 destroy_time = 18;
+ */
+ destroyTime?: bigint;
+ /**
+ * @generated from protobuf field: int64 capacity_bytes = 19;
+ */
+ capacityBytes: bigint;
+ /**
+ * @generated from protobuf field: int64 writen_bytes = 20;
+ */
+ writenBytes: bigint;
+}
+// @generated message type with reflection information, may provide speed optimized methods
+class Tape$Type extends MessageType {
+ constructor() {
+ super("tape.Tape", [
+ { no: 1, name: "id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 2, name: "barcode", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
+ { no: 3, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
+ { no: 4, name: "encryption", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
+ { no: 17, name: "create_time", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 18, name: "destroy_time", kind: "scalar", opt: true, T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 19, name: "capacity_bytes", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
+ { no: 20, name: "writen_bytes", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }
+ ]);
+ }
+ create(value?: PartialMessage): Tape {
+ const message = { id: 0n, barcode: "", name: "", encryption: "", createTime: 0n, capacityBytes: 0n, writenBytes: 0n };
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
+ if (value !== undefined)
+ reflectionMergePartial(this, message, value);
+ return message;
+ }
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Tape): Tape {
+ let message = target ?? this.create(), end = reader.pos + length;
+ while (reader.pos < end) {
+ let [fieldNo, wireType] = reader.tag();
+ switch (fieldNo) {
+ case /* int64 id */ 1:
+ message.id = reader.int64().toBigInt();
+ break;
+ case /* string barcode */ 2:
+ message.barcode = reader.string();
+ break;
+ case /* string name */ 3:
+ message.name = reader.string();
+ break;
+ case /* string encryption */ 4:
+ message.encryption = reader.string();
+ break;
+ case /* int64 create_time */ 17:
+ message.createTime = reader.int64().toBigInt();
+ break;
+ case /* optional int64 destroy_time */ 18:
+ message.destroyTime = reader.int64().toBigInt();
+ break;
+ case /* int64 capacity_bytes */ 19:
+ message.capacityBytes = reader.int64().toBigInt();
+ break;
+ case /* int64 writen_bytes */ 20:
+ message.writenBytes = reader.int64().toBigInt();
+ break;
+ default:
+ let u = options.readUnknownField;
+ if (u === "throw")
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
+ let d = reader.skip(wireType);
+ if (u !== false)
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
+ }
+ }
+ return message;
+ }
+ internalBinaryWrite(message: Tape, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
+ /* int64 id = 1; */
+ if (message.id !== 0n)
+ writer.tag(1, WireType.Varint).int64(message.id);
+ /* string barcode = 2; */
+ if (message.barcode !== "")
+ writer.tag(2, WireType.LengthDelimited).string(message.barcode);
+ /* string name = 3; */
+ if (message.name !== "")
+ writer.tag(3, WireType.LengthDelimited).string(message.name);
+ /* string encryption = 4; */
+ if (message.encryption !== "")
+ writer.tag(4, WireType.LengthDelimited).string(message.encryption);
+ /* int64 create_time = 17; */
+ if (message.createTime !== 0n)
+ writer.tag(17, WireType.Varint).int64(message.createTime);
+ /* optional int64 destroy_time = 18; */
+ if (message.destroyTime !== undefined)
+ writer.tag(18, WireType.Varint).int64(message.destroyTime);
+ /* int64 capacity_bytes = 19; */
+ if (message.capacityBytes !== 0n)
+ writer.tag(19, WireType.Varint).int64(message.capacityBytes);
+ /* int64 writen_bytes = 20; */
+ if (message.writenBytes !== 0n)
+ writer.tag(20, WireType.Varint).int64(message.writenBytes);
+ let u = options.writeUnknownFields;
+ if (u !== false)
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
+ return writer;
+ }
+}
+/**
+ * @generated MessageType for protobuf message tape.Tape
+ */
+export const Tape = new Tape$Type();
diff --git a/frontend/src/file.tsx b/frontend/src/file.tsx
new file mode 100644
index 0000000..fb7b20f
--- /dev/null
+++ b/frontend/src/file.tsx
@@ -0,0 +1,184 @@
+import { useState, useRef, useEffect, useMemo, useCallback } from "react";
+
+import Grid from "@mui/material/Grid";
+import Box from "@mui/material/Box";
+import { FullFileBrowser, FileBrowserHandle, FileArray } from "chonky";
+import { ChonkyActions, ChonkyFileActionData } from "chonky";
+
+import "./app.less";
+import { cli, convertFiles } from "./api";
+import { Root } from "./api";
+import { RenameFileAction, RefreshListAction } from "./actions";
+
+import { useDetailModal, DetailModal } from "./detail";
+import { FileGetReply } from "./entity";
+
+const useDualSide = () => {
+ const left = useRef(null);
+ const right = useRef(null);
+ const instances = { left, right };
+
+ const refreshAll = useCallback(async () => {
+ await Promise.all(
+ Object.values(instances).map((ref) => {
+ if (!ref || !ref.current) {
+ return;
+ }
+ return ref.current.requestFileAction(RefreshListAction, {});
+ })
+ );
+ }, [instances]);
+
+ return { instances, refreshAll };
+};
+
+const useFileBrowser = (refreshAll: () => Promise, openDetailModel: (detail: FileGetReply) => void) => {
+ const [files, setFiles] = useState(Array(1).fill(null));
+ const [folderChain, setFolderChan] = useState([Root]);
+ const currentID = useMemo(() => {
+ if (folderChain.length === 0) {
+ return "0";
+ }
+
+ const last = folderChain.slice(-1)[0];
+ if (!last) {
+ return "0";
+ }
+
+ return last.id;
+ }, [folderChain]);
+
+ const openFolder = useCallback((id: string) => {
+ (async () => {
+ const [file, folderChain] = await Promise.all([cli.fileGet({ id: BigInt(id) }).response, cli.fileListParents({ id: BigInt(id) }).response]);
+
+ setFiles(convertFiles(file.children));
+ setFolderChan([Root, ...convertFiles(folderChain.parents)]);
+ })();
+ }, []);
+ useEffect(() => openFolder(Root.id), []);
+
+ const onFileAction = useCallback(
+ (data: ChonkyFileActionData) => {
+ // console.log(data);
+ switch (data.id) {
+ case ChonkyActions.OpenFiles.id:
+ (async () => {
+ const { targetFile, files } = data.payload;
+
+ const fileToOpen = targetFile ?? files[0];
+ if (!fileToOpen) {
+ return;
+ }
+
+ if (fileToOpen.isDir) {
+ await openFolder(fileToOpen.id);
+ return;
+ }
+
+ const file = await cli.fileGet({ id: BigInt(fileToOpen.id) }).response;
+ await openDetailModel(file);
+ })();
+
+ return;
+ case ChonkyActions.MoveFiles.id:
+ (async () => {
+ const { destination, files } = data.payload;
+ for (const file of files) {
+ await cli.fileEdit({
+ id: BigInt(file.id),
+ file: { parentId: BigInt(destination.id) },
+ }).response;
+ }
+ await refreshAll();
+ })();
+
+ return;
+ case RenameFileAction.id:
+ (async () => {
+ const files = data.state.selectedFilesForAction;
+ if (files.length === 0) {
+ return;
+ }
+ const file = files[0];
+
+ const name = prompt("Provide new name for this file:", file.name);
+ if (!name) {
+ return;
+ }
+
+ await cli.fileEdit({ id: BigInt(file.id), file: { name } }).response;
+ await refreshAll();
+ })();
+ return;
+ case ChonkyActions.CreateFolder.id:
+ (async () => {
+ const name = prompt("Provide the name for your new folder:");
+ if (!name) {
+ return;
+ }
+
+ await cli.fileMkdir({ parentId: BigInt(currentID), path: name }).response;
+ await refreshAll();
+ })();
+ return;
+ case ChonkyActions.DeleteFiles.id:
+ (async () => {
+ const files = data.state.selectedFilesForAction;
+ const fileids = files.map((file) => BigInt(file.id));
+ await cli.fileDelete({ ids: fileids }).response;
+ await refreshAll();
+ })();
+
+ return;
+ case RefreshListAction.id:
+ openFolder(currentID);
+ return;
+ }
+ },
+ [openFolder, openDetailModel, refreshAll, currentID]
+ );
+
+ const fileActions = useMemo(() => [ChonkyActions.CreateFolder, ChonkyActions.DeleteFiles, ChonkyActions.MoveFiles, RenameFileAction, RefreshListAction], []);
+
+ return {
+ files,
+ folderChain,
+ onFileAction,
+ fileActions,
+ defaultFileViewActionId: ChonkyActions.EnableListView.id,
+ doubleClickDelay: 300,
+ };
+};
+
+export const FileBrowserType = "file";
+
+export const FileBrowser = () => {
+ const { instances, refreshAll } = useDualSide();
+ const { detail, openDetailModel, closeDetailModel } = useDetailModal();
+
+ const leftProps = useFileBrowser(refreshAll, openDetailModel);
+ const rightProps = useFileBrowser(refreshAll, openDetailModel);
+
+ useEffect(() => {
+ Object.values(instances).map((inst) => inst.current?.requestFileAction(ChonkyActions.ToggleHiddenFiles, {}));
+ const interval = setInterval(() => {
+ Object.values(instances).map((inst) => inst.current && inst.current.requestFileAction(RefreshListAction, {}));
+ }, 10000);
+ return () => clearInterval(interval);
+ }, []);
+
+ return (
+
+
+
+
+
+
+
+
+
+
+
+ );
+};
diff --git a/frontend/src/index.css b/frontend/src/index.css
new file mode 100644
index 0000000..e174036
--- /dev/null
+++ b/frontend/src/index.css
@@ -0,0 +1,41 @@
+:root {
+ padding: 0;
+ margin: 0;
+ height: 100%;
+ width: 100%;
+ overflow: hidden;
+}
+
+body {
+ padding: 0;
+ margin: 0;
+ height: 100%;
+ width: 100%;
+
+ background-color: #ffffff;
+ font-synthesis: none;
+ text-rendering: optimizeLegibility;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ -webkit-text-size-adjust: 100%;
+}
+
+#root {
+ height: 100%;
+ width: 100%;
+ margin: 0;
+ padding: 0;
+ text-align: center;
+}
+
+/*
+:root {
+ font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
+ font-size: 16px;
+ line-height: 24px;
+ font-weight: 400;
+
+ color-scheme: light dark;
+ color: rgba(255, 255, 255, 0.87);
+
+} */
diff --git a/frontend/src/init.tsx b/frontend/src/init.tsx
new file mode 100644
index 0000000..ea11f47
--- /dev/null
+++ b/frontend/src/init.tsx
@@ -0,0 +1,31 @@
+import { setChonkyDefaults } from "chonky";
+import { ChonkyIconFA } from "chonky-icon-fontawesome";
+
+import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+import { faPencilAlt } from "@fortawesome/free-solid-svg-icons/faPencilAlt";
+
+const ExternalIcons: Record = {
+ edit: faPencilAlt,
+};
+
+setChonkyDefaults({
+ iconComponent: (props) => {
+ const icon = ExternalIcons[props.icon] as any;
+ if (!!icon) {
+ const faProps = {
+ ...props,
+ icon: icon,
+ } as const;
+ return ;
+ }
+
+ return ;
+ },
+});
+
+import { unstable_ClassNameGenerator as ClassNameGenerator } from "@mui/material/className";
+
+ClassNameGenerator.configure(
+ // Do something with the componentName
+ (componentName: string) => `app-${componentName}`
+);
diff --git a/frontend/src/jobs.tsx b/frontend/src/jobs.tsx
new file mode 100644
index 0000000..3b5da0e
--- /dev/null
+++ b/frontend/src/jobs.tsx
@@ -0,0 +1,471 @@
+import { Fragment, ChangeEvent } from "react";
+import { useState, useRef, useEffect, useMemo, useCallback, FC } from "react";
+import { assert } from "@protobuf-ts/runtime";
+
+import Grid from "@mui/material/Grid";
+import Box from "@mui/material/Box";
+import List from "@mui/material/List";
+import ListItemButton from "@mui/material/ListItemButton";
+import ListItemText from "@mui/material/ListItemText";
+import Typography from "@mui/material/Typography";
+
+import Card from "@mui/material/Card";
+import CardActions from "@mui/material/CardActions";
+import CardContent from "@mui/material/CardContent";
+
+import Button from "@mui/material/Button";
+import TextField from "@mui/material/TextField";
+import MenuItem from "@mui/material/MenuItem";
+
+import Dialog from "@mui/material/Dialog";
+import DialogActions from "@mui/material/DialogActions";
+import DialogContent from "@mui/material/DialogContent";
+import DialogContentText from "@mui/material/DialogContentText";
+import DialogTitle from "@mui/material/DialogTitle";
+import LinearProgress from "@mui/material/LinearProgress";
+import Divider from "@mui/material/Divider";
+
+import "./app.less";
+import { cli, sleep } from "./api";
+import { Job, JobDisplay, JobCreateRequest, JobListRequest, JobNextRequest, JobStatus, CopyStatus } from "./entity";
+import { JobArchiveCopyingParam, JobArchiveStep, JobDisplayArchive, JobParamArchive, JobStateArchive } from "./entity";
+import { SourceState } from "./entity";
+
+import { formatFilesize } from "./tools";
+
+export const JobsType = "jobs";
+type DisplayableJob = Job & Partial;
+
+export const JobsBrowser = () => {
+ const [jobs, setJobs] = useState([]);
+ const refresh = useCallback(async () => {
+ const jobReplys = await cli.jobList(JobListRequest.create({ param: { oneofKind: "list", list: {} } })).response;
+ const displayReplys = await Promise.all(jobReplys.jobs.map((job) => cli.jobDisplay({ id: job.id }).response));
+ const targets = jobReplys.jobs.map((job, idx) => ({ ...job, ...displayReplys[idx].display }));
+ console.log("refresh jobs list, ", targets);
+ setJobs(targets);
+ }, [setJobs]);
+ useEffect(() => {
+ refresh();
+ const timer = setInterval(refresh, 2000);
+ return () => {
+ clearInterval(timer);
+ };
+ }, []);
+
+ return (
+
+
+
+
+ // Nested List Items
+ //
+ // }
+ >
+
+
+
+
+ {jobs.map((job) => (
+
+ ))}
+
+
+
+ );
+};
+
+const GetJobCard = ({ job, refresh }: { job: DisplayableJob; refresh: () => Promise }): JSX.Element => {
+ if (!job.state) {
+ return ;
+ }
+
+ const type = job.state?.state.oneofKind;
+ switch (type) {
+ case "archive":
+ return (
+
+ );
+ default:
+ return ;
+ }
+};
+
+type ArchiveLastDisplay = { copyedBytes: bigint; lastUpdate: number };
+
+const ArchiveCard = ({
+ job,
+ state,
+ display,
+ refresh,
+}: {
+ job: Job;
+ state: JobStateArchive;
+ display: JobDisplayArchive | null;
+ refresh: () => Promise;
+}): JSX.Element => {
+ const [lastDisplay, setLastDisplay] = useState(null);
+ const [speed, setSpeed] = useState(NaN);
+ const diffDisplay = useCallback(
+ (current: ArchiveLastDisplay | null) => {
+ if (!lastDisplay) {
+ setLastDisplay(current);
+ return;
+ }
+ if (!current) {
+ setLastDisplay(current);
+ setSpeed(NaN);
+ return;
+ }
+
+ const duration = current.lastUpdate - lastDisplay.lastUpdate;
+ if (duration) {
+ const speed = ((Number(current.copyedBytes) - Number(lastDisplay.copyedBytes)) / duration) * 1000;
+ setSpeed(speed);
+ }
+
+ setLastDisplay(current);
+ },
+ [lastDisplay, setLastDisplay, setSpeed]
+ );
+ useEffect(() => {
+ if (!display) {
+ diffDisplay(null);
+ return;
+ }
+ diffDisplay({ copyedBytes: display.copyedBytes, lastUpdate: Date.now() });
+ }, [display]);
+
+ const [fields, progress] = useMemo(() => {
+ const totalFiles = state.sources.length;
+ let submitedFiles = 0,
+ submitedBytes = 0,
+ totalBytes = 0;
+ for (const file of state.sources) {
+ totalBytes += Number(file.size);
+ if (file.status !== CopyStatus.Submited) {
+ continue;
+ }
+ submitedFiles++;
+ submitedBytes += Number(file.size);
+ }
+
+ const copyedFiles = submitedFiles + Number(display?.copyedFiles || 0n);
+ const copyedBytes = submitedBytes + Number(display?.copyedBytes || 0n);
+
+ const progress = (totalBytes > 0 ? copyedBytes / totalBytes : 1) * 100;
+ const fields = [
+ { name: "Current Step", value: JobArchiveStep[state.step] },
+ { name: "Current Speed", value: !Number.isNaN(speed) ? `${formatFilesize(speed)}/s` : "--" },
+ { name: "Total Files", value: totalFiles },
+ { name: "Total Bytes", value: formatFilesize(totalBytes) },
+ { name: "Submited Files", value: submitedFiles },
+ { name: "Submited Bytes", value: formatFilesize(submitedBytes) },
+ { name: "Copyed Files", value: copyedFiles },
+ { name: "Copyed Bytes", value: formatFilesize(copyedBytes) },
+ ];
+
+ return [fields, progress];
+ }, [state, display, speed]);
+
+ return (
+
+
+
+
+
+
+ {fields.map((field, idx) => (
+
+
+ {field.name}: {field.value}
+
+
+ ))}
+
+ }
+ buttons={
+
+ {state.step === JobArchiveStep.WaitForTape && }
+
+
+
+ }
+ />
+ );
+};
+
+const NewArchiveDialog = ({ refresh }: { refresh: () => Promise }) => {
+ const [open, setOpen] = useState(false);
+ const handleClickOpen = () => {
+ setOpen(true);
+ };
+ const handleClose = () => {
+ setOpen(false);
+ };
+
+ const [source, setSource] = useState("");
+ const handleSubmit = async () => {
+ let path = source.trim();
+ if (path.length === 0) {
+ return;
+ }
+
+ while (path.endsWith("/")) {
+ path = path.slice(0, -1);
+ }
+
+ const splitIdx = path.lastIndexOf("/");
+ if (splitIdx < 0) {
+ return;
+ }
+
+ console.log(await cli.jobCreate(makeArchiveParam(1n, { sources: [{ base: path.slice(0, splitIdx + 1), path: [path.slice(splitIdx + 1)] }] })).response);
+ await refresh();
+ handleClose();
+ };
+
+ return (
+
+
+
+
+ {open && (
+
+ )}
+
+ );
+};
+
+const LoadTapeDialog = ({ job, refresh }: { job: Job; refresh: () => Promise }) => {
+ const [devices, setDevices] = useState([]);
+ const [param, setParam] = useState(null);
+ const handleClickOpen = async () => {
+ const reply = await cli.deviceList({}).response;
+ setDevices(reply.devices);
+ setParam(JobArchiveCopyingParam.create());
+ };
+ const handleClose = () => {
+ setParam(null);
+ setDevices([]);
+ };
+ const handleChange = (key: keyof JobArchiveCopyingParam) => (event: ChangeEvent) => {
+ if (param === null) {
+ return;
+ }
+ setParam({ ...param, [key]: event.target.value });
+ };
+ const handleSubmit = async () => {
+ if (!param) {
+ return;
+ }
+
+ const trimedParam: JobArchiveCopyingParam = {
+ device: param.device,
+ barcode: param.barcode.toUpperCase(),
+ name: param.name,
+ };
+ assert(trimedParam.barcode.length === 6);
+
+ const reply = await cli.jobNext(makeArchiveCopyingParam(job.id, trimedParam)).response;
+ console.log("job next reply= ", reply);
+ await refresh();
+ handleClose();
+ };
+
+ return (
+
+
+ {param && (
+
+ )}
+
+ );
+};
+
+const ViewLogDialog = ({ jobID }: { jobID: bigint }) => {
+ const [open, setOpen] = useState(false);
+ const handleClickOpen = () => {
+ setOpen(true);
+ };
+ const handleClose = () => {
+ setOpen(false);
+ };
+
+ return (
+
+
+ {open && (
+
+ )}
+
+ );
+};
+
+const LogConsole = ({ jobId }: { jobId: bigint }) => {
+ const [log, setLog] = useState("");
+ const refreshLog = useCallback(async () => {
+ const reply = await cli.jobGetLog({ jobId, offset: BigInt(log.length) }).response;
+ setLog(log + new TextDecoder().decode(reply.logs));
+ }, [log, setLog]);
+ useEffect(() => {
+ let closed = false;
+ (async () => {
+ while (!closed) {
+ await refreshLog();
+ await sleep(2000);
+ }
+ })();
+
+ return () => {
+ closed = true;
+ };
+ }, []);
+
+ return