mirror of
https://github.com/immich-app/immich
synced 2026-08-29 13:15:45 +00:00
refactor: use system metadata for maintenance status
This commit is contained in:
parent
625230f3e5
commit
2afbff36a3
21 changed files with 240 additions and 124 deletions
|
|
@ -40,6 +40,9 @@ export type ActivityStatisticsResponseDto = {
|
|||
comments: number;
|
||||
likes: number;
|
||||
};
|
||||
export type MaintenanceModeResponseDto = {
|
||||
isMaintenanceMode: boolean;
|
||||
};
|
||||
export type NotificationCreateDto = {
|
||||
data?: object;
|
||||
description?: string | null;
|
||||
|
|
@ -1471,9 +1474,6 @@ export type SystemConfigMachineLearningDto = {
|
|||
ocr: OcrConfig;
|
||||
urls: string[];
|
||||
};
|
||||
export type SystemConfigMaintenanceDto = {
|
||||
enabled: boolean;
|
||||
};
|
||||
export type SystemConfigMapDto = {
|
||||
darkStyle: string;
|
||||
enabled: boolean;
|
||||
|
|
@ -1561,7 +1561,6 @@ export type SystemConfigDto = {
|
|||
library: SystemConfigLibraryDto;
|
||||
logging: SystemConfigLoggingDto;
|
||||
machineLearning: SystemConfigMachineLearningDto;
|
||||
maintenance: SystemConfigMaintenanceDto;
|
||||
map: SystemConfigMapDto;
|
||||
metadata: SystemConfigMetadataDto;
|
||||
newVersionCheck: SystemConfigNewVersionCheckDto;
|
||||
|
|
@ -1754,6 +1753,32 @@ export function unlinkAllOAuthAccountsAdmin(opts?: Oazapfts.RequestOpts) {
|
|||
method: "POST"
|
||||
}));
|
||||
}
|
||||
export function getMaintenanceMode(opts?: Oazapfts.RequestOpts) {
|
||||
return oazapfts.ok(oazapfts.fetchJson<{
|
||||
status: 200;
|
||||
data: MaintenanceModeResponseDto;
|
||||
}>("/admin/maintenance", {
|
||||
...opts
|
||||
}));
|
||||
}
|
||||
/**
|
||||
* This endpoint is an admin-only route, and requires the `systemMetadata.update` permission.
|
||||
*/
|
||||
export function endMaintenance(opts?: Oazapfts.RequestOpts) {
|
||||
return oazapfts.ok(oazapfts.fetchText("/admin/maintenance/end", {
|
||||
...opts,
|
||||
method: "POST"
|
||||
}));
|
||||
}
|
||||
/**
|
||||
* This endpoint is an admin-only route, and requires the `systemMetadata.update` permission.
|
||||
*/
|
||||
export function startMaintenance(opts?: Oazapfts.RequestOpts) {
|
||||
return oazapfts.ok(oazapfts.fetchText("/admin/maintenance/start", {
|
||||
...opts,
|
||||
method: "POST"
|
||||
}));
|
||||
}
|
||||
export function createNotification({ notificationCreateDto }: {
|
||||
notificationCreateDto: NotificationCreateDto;
|
||||
}, opts?: Oazapfts.RequestOpts) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue