HM-56. Добавлена страница для просмотра логов с фильтрацией, пагинацией (#20)

This commit is contained in:
Nikolay
2020-07-19 16:19:39 +03:00
committed by GitHub
parent d01ee79202
commit 47fe69bc65
20 changed files with 520 additions and 10 deletions

15
src/api/StorageLogsAPI.js Normal file
View File

@ -0,0 +1,15 @@
import axios from 'axios';
import {API_URL, ENDPOINTS} from './consts';
class StorageLogsApi {
URL = `${API_URL}${ENDPOINTS.SERVER_LOGS}`;
request = async () => {
const {data} = await axios.get(this.URL);
return data;
}
}
const storageLogsApi = new StorageLogsApi();
export default storageLogsApi;

View File

@ -1,6 +1,6 @@
import axios from 'axios';
import {API_URL, ENDPOINT, TESTING_HEADERS} from './consts';
import {API_URL, ENDPOINTS, TESTING_HEADERS} from './consts';
/**
* @interface Store
@ -17,7 +17,7 @@ import {API_URL, ENDPOINT, TESTING_HEADERS} from './consts';
* @class
*/
class StorageServiceApi {
URL = `${API_URL}${ENDPOINT}`;
URL = `${API_URL}${ENDPOINTS.STORE}`;
get defaultConfig () {
if (location.hostname.includes('localhost')) {

View File

@ -1,7 +1,11 @@
export const API_URL = 'http://api.storage.vigdorov.ru';
export const ENDPOINT = '/store';
export const ENDPOINTS = {
STORE: '/store',
CLIENT_LOGS: '/logs/client',
SERVER_LOGS: '/logs/server',
};
export const TESTING_HEADERS = {
'Api-Name': 'store-service-test',