mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-08-29 12:00:30 +00:00
Adds dynamic table with initial settings page
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
export * from "./createUser";
|
||||
export * from "./getToken";
|
||||
export * from "./getUser";
|
||||
export * from "./models";
|
||||
export * from "./refreshToken";
|
||||
export * from "./requestHealth";
|
||||
export * from "./requestSettings";
|
||||
export * from "./responseTypes";
|
||||
|
12
frontend/src/api/npm/models.ts
Normal file
12
frontend/src/api/npm/models.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
export interface Sort {
|
||||
field: string;
|
||||
direction: "ASC" | "DESC";
|
||||
}
|
||||
|
||||
export interface Setting {
|
||||
id: number;
|
||||
createdOn: number;
|
||||
modifiedOn: number;
|
||||
name: string;
|
||||
value: any;
|
||||
}
|
@@ -1,7 +1,6 @@
|
||||
import * as api from "./base";
|
||||
import { HealthResponse } from "./responseTypes";
|
||||
|
||||
// Request function.
|
||||
export async function requestHealth(
|
||||
abortController?: AbortController,
|
||||
): Promise<HealthResponse> {
|
||||
|
16
frontend/src/api/npm/requestSettings.ts
Normal file
16
frontend/src/api/npm/requestSettings.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import * as api from "./base";
|
||||
import { SettingsResponse } from "./responseTypes";
|
||||
|
||||
export async function requestSettings(
|
||||
offset?: number,
|
||||
abortController?: AbortController,
|
||||
): Promise<SettingsResponse> {
|
||||
const { result } = await api.get(
|
||||
{
|
||||
url: "settings",
|
||||
params: { limit: 20, offset: offset || 0 },
|
||||
},
|
||||
abortController,
|
||||
);
|
||||
return result;
|
||||
}
|
@@ -1,3 +1,5 @@
|
||||
import { Sort, Setting } from "./models";
|
||||
|
||||
export interface HealthResponse {
|
||||
commit: string;
|
||||
errorReporting: boolean;
|
||||
@@ -31,3 +33,11 @@ export interface UserResponse {
|
||||
isDisabled: boolean;
|
||||
auth?: UserAuthResponse;
|
||||
}
|
||||
|
||||
export interface SettingsResponse {
|
||||
total: number;
|
||||
offset: number;
|
||||
limit: number;
|
||||
sort: Sort[];
|
||||
items: Setting[];
|
||||
}
|
||||
|
Reference in New Issue
Block a user