From 05b43cac78fbce417e1abd375935fb56c2609e58 Mon Sep 17 00:00:00 2001 From: Nikolay <46225163+vigdorov@users.noreply.github.com> Date: Mon, 20 Jul 2020 00:29:06 +0300 Subject: [PATCH] =?UTF-8?q?HM-58.=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20=D0=BD=D0=BE=D0=B2=D1=8B=D0=B9=20=D1=82=D0=B8?= =?UTF-8?q?=D0=BF=20=D0=BB=D0=BE=D0=B3=D0=BE=D0=B2=20client-logs=20(#21)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.json | 2 +- src/api/StorageLogsAPI.js | 21 +++- src/app.html | 27 ++++- src/components/component/Component.js | 4 +- src/components/logs-filters/LogsFilters.js | 85 +++++++++++++-- src/components/logs-page/LogsPage.js | 115 ++++++++++++--------- src/consts.js | 31 ++++++ src/utils/elementUtils.js | 14 +++ 8 files changed, 232 insertions(+), 67 deletions(-) create mode 100644 src/consts.js diff --git a/.eslintrc.json b/.eslintrc.json index 5ce3ece..ef9b39e 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -70,7 +70,7 @@ "multiline-comment-style": ["warn", "starred-block"], "new-cap": "warn", "new-parens": "warn", - "newline-per-chained-call": ["warn", {"ignoreChainWithDepth": 1}], + "newline-per-chained-call": ["warn", {"ignoreChainWithDepth": 3}], "no-bitwise": "warn", "no-inline-comments": "warn", "no-lonely-if": "warn", diff --git a/src/api/StorageLogsAPI.js b/src/api/StorageLogsAPI.js index 3b0d702..a49538b 100644 --- a/src/api/StorageLogsAPI.js +++ b/src/api/StorageLogsAPI.js @@ -2,10 +2,25 @@ import axios from 'axios'; import {API_URL, ENDPOINTS} from './consts'; class StorageLogsApi { - URL = `${API_URL}${ENDPOINTS.SERVER_LOGS}`; + URL = `${API_URL}`; - request = async () => { - const {data} = await axios.get(this.URL); + requestServerLogs = async () => { + const {data} = await axios.get(`${this.URL}${ENDPOINTS.SERVER_LOGS}`); + return data; + } + + requestClientLogs = async () => { + const {data} = await axios.get(`${this.URL}${ENDPOINTS.CLIENT_LOGS}`); + return data; + } + + deleteAllServerLogs = async () => { + const {data} = await axios.delete(`${this.URL}${ENDPOINTS.SERVER_LOGS}`); + return data; + } + + deleteAllClientLogs = async () => { + const {data} = await axios.delete(`${this.URL}${ENDPOINTS.CLIENT_LOGS}`); return data; } } diff --git a/src/app.html b/src/app.html index ca7f3ce..3b93ce4 100644 --- a/src/app.html +++ b/src/app.html @@ -76,7 +76,7 @@ - + - +