mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-23 00:33:46 +02:00
Update server listing and associated logic to pull from the panel dynamiacally
This commit is contained in:
@@ -1,9 +1,5 @@
|
||||
import axios, { AxiosInstance } from 'axios';
|
||||
|
||||
// This token is set in the bootstrap.js file at the beginning of the request
|
||||
// and is carried through from there.
|
||||
// const token: string = '';
|
||||
|
||||
const http: AxiosInstance = axios.create({
|
||||
headers: {
|
||||
'X-Requested-With': 'XMLHttpRequest',
|
||||
@@ -41,3 +37,26 @@ export function httpErrorToHuman (error: any): string {
|
||||
|
||||
return error.message;
|
||||
}
|
||||
|
||||
export interface PaginatedResult<T> {
|
||||
items: T[];
|
||||
pagination: PaginationDataSet;
|
||||
}
|
||||
|
||||
interface PaginationDataSet {
|
||||
total: number;
|
||||
count: number;
|
||||
perPage: number;
|
||||
currentPage: number;
|
||||
totalPages: number;
|
||||
}
|
||||
|
||||
export function getPaginationSet (data: any): PaginationDataSet {
|
||||
return {
|
||||
total: data.total,
|
||||
count: data.count,
|
||||
perPage: data.per_page,
|
||||
currentPage: data.current_page,
|
||||
totalPages: data.total_pages,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user