refactor: reorder arguments in web ui

This commit is contained in:
2026-03-22 03:23:09 +02:00
parent d7984c12f0
commit 5e090cebdb
61 changed files with 547 additions and 578 deletions
+1 -1
View File
@@ -18,6 +18,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
export interface AURPackage {
package: string;
description: string;
package: string;
}
+1 -1
View File
@@ -17,4 +17,4 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
export type BuildStatus = "unknown" | "pending" | "building" | "failed" | "success";
export type BuildStatus = "building" | "failed" | "pending" | "success" | "unknown";
+2 -2
View File
@@ -23,9 +23,9 @@ import type { RepositoryId } from "models/RepositoryId";
export interface InfoResponse {
auth: AuthInfo;
repositories: RepositoryId[];
version: string;
autorefresh_intervals: AutoRefreshInterval[];
docs_enabled: boolean;
index_url?: string;
repositories: RepositoryId[];
version: string;
}
+1 -1
View File
@@ -23,8 +23,8 @@ import type { Status } from "models/Status";
export interface InternalStatus {
architecture: string;
repository: string;
packages: Counters;
repository: string;
stats: RepositoryStats;
status: Status;
version: string;
+1 -1
View File
@@ -18,6 +18,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
export interface LoginRequest {
username: string;
password: string;
username: string;
}
+1 -1
View File
@@ -21,7 +21,7 @@ import type { AlertColor } from "@mui/material";
export interface Notification {
id: string;
title: string;
message: string;
severity: AlertColor;
title: string;
}
+3 -3
View File
@@ -20,10 +20,10 @@
import type { Patch } from "models/Patch";
export interface PackageActionRequest {
packages: string[];
patches?: Patch[];
refresh?: boolean;
aur?: boolean;
local?: boolean;
manual?: boolean;
packages: string[];
patches?: Patch[];
refresh?: boolean;
}
+13 -14
View File
@@ -21,32 +21,31 @@ import type { BuildStatus } from "models/BuildStatus";
import type { PackageStatus } from "models/PackageStatus";
export class PackageRow {
id: string;
base: string;
webUrl?: string;
version: string;
packages: string[];
groups: string[];
id: string;
isHeld: boolean;
licenses: string[];
packager: string;
timestamp: string;
timestampValue: number;
packages: string[];
status: BuildStatus;
isHeld: boolean;
timestamp: string;
version: string;
webUrl?: string;
constructor(descriptor: PackageStatus) {
this.id = descriptor.package.base;
this.base = descriptor.package.base;
this.webUrl = descriptor.package.remote.web_url ?? undefined;
this.version = descriptor.package.version;
this.packages = Object.keys(descriptor.package.packages).sort();
this.groups = PackageRow.extractListProperties(descriptor.package, "groups");
this.id = descriptor.package.base;
this.isHeld = descriptor.status.is_held ?? false;
this.licenses = PackageRow.extractListProperties(descriptor.package, "licenses");
this.packager = descriptor.package.packager ?? "";
this.timestamp = new Date(descriptor.status.timestamp * 1000).toISOStringShort();
this.timestampValue = descriptor.status.timestamp;
this.packages = Object.keys(descriptor.package.packages).sort();
this.status = descriptor.status.status;
this.isHeld = descriptor.status.is_held ?? false;
this.timestamp = new Date(descriptor.status.timestamp * 1000).toISOStringShort();
this.version = descriptor.package.version;
this.webUrl = descriptor.package.remote.web_url ?? undefined;
}
private static extractListProperties(pkg: PackageStatus["package"], property: "groups" | "licenses"): string[] {
+1
View File
@@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
export class RepositoryId {
readonly architecture: string;
readonly repository: string;
+1 -1
View File
@@ -20,7 +20,7 @@
import type { BuildStatus } from "models/BuildStatus";
export interface Status {
is_held?: boolean;
status: BuildStatus;
timestamp: number;
is_held?: boolean;
}