From 47fe69bc650ec37ccb93bfead2bdfca57d975c68 Mon Sep 17 00:00:00 2001 From: Nikolay <46225163+vigdorov@users.noreply.github.com> Date: Sun, 19 Jul 2020 16:19:39 +0300 Subject: [PATCH] =?UTF-8?q?HM-56.=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D1=81=D1=82=D1=80=D0=B0=D0=BD=D0=B8=D1=86?= =?UTF-8?q?=D0=B0=20=D0=B4=D0=BB=D1=8F=20=D0=BF=D1=80=D0=BE=D1=81=D0=BC?= =?UTF-8?q?=D0=BE=D1=82=D1=80=D0=B0=20=D0=BB=D0=BE=D0=B3=D0=BE=D0=B2=20?= =?UTF-8?q?=D1=81=20=D1=84=D0=B8=D0=BB=D1=8C=D1=82=D1=80=D0=B0=D1=86=D0=B8?= =?UTF-8?q?=D0=B5=D0=B9,=20=D0=BF=D0=B0=D0=B3=D0=B8=D0=BD=D0=B0=D1=86?= =?UTF-8?q?=D0=B8=D0=B5=D0=B9=20(#20)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/StorageLogsAPI.js | 15 +++ src/api/StorageServiceAPI.js | 4 +- src/api/consts.js | 6 +- src/app.html | 45 +++++++ src/app.js | 2 + src/components/component/Component.js | 11 +- src/components/logs-filters/LogsFilters.js | 25 ++++ src/components/logs-filters/index.js | 3 + src/components/logs-page/LogsPage.js | 83 +++++++++++++ src/components/logs-page/index.js | 3 + .../navigation-buttons-component/constants.js | 4 +- src/components/pagination/Pagination.js | 111 ++++++++++++++++++ src/components/pagination/index.js | 3 + src/components/table/HeaderCol.js | 13 ++ src/components/table/Table.js | 89 ++++++++++++++ src/components/table/TableRow.js | 31 +++++ src/components/table/index.js | 3 + src/services/RouteService.js | 27 ++++- src/utils/elementUtils.js | 34 ++++++ src/utils/urlUtils.js | 18 +++ 20 files changed, 520 insertions(+), 10 deletions(-) create mode 100644 src/api/StorageLogsAPI.js create mode 100644 src/components/logs-filters/LogsFilters.js create mode 100644 src/components/logs-filters/index.js create mode 100644 src/components/logs-page/LogsPage.js create mode 100644 src/components/logs-page/index.js create mode 100644 src/components/pagination/Pagination.js create mode 100644 src/components/pagination/index.js create mode 100644 src/components/table/HeaderCol.js create mode 100644 src/components/table/Table.js create mode 100644 src/components/table/TableRow.js create mode 100644 src/components/table/index.js create mode 100644 src/utils/elementUtils.js diff --git a/src/api/StorageLogsAPI.js b/src/api/StorageLogsAPI.js new file mode 100644 index 0000000..3b0d702 --- /dev/null +++ b/src/api/StorageLogsAPI.js @@ -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; diff --git a/src/api/StorageServiceAPI.js b/src/api/StorageServiceAPI.js index bac842d..8958885 100644 --- a/src/api/StorageServiceAPI.js +++ b/src/api/StorageServiceAPI.js @@ -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')) { diff --git a/src/api/consts.js b/src/api/consts.js index 9a32147..7f23508 100644 --- a/src/api/consts.js +++ b/src/api/consts.js @@ -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', diff --git a/src/app.html b/src/app.html index 02eec38..ca7f3ce 100644 --- a/src/app.html +++ b/src/app.html @@ -66,6 +66,51 @@ + + + + + + + + + + + + +