diff --git a/src/lib/tools/requests/requests.js b/src/lib/tools/requests/requests.js index 8796f7e..5384da5 100644 --- a/src/lib/tools/requests/requests.js +++ b/src/lib/tools/requests/requests.js @@ -13,10 +13,10 @@ function defaultDataResponseProcessor(data) { } +export const API_PATH_MAIN = "https://hostapay.trade/api/v1/"; +export const API_PATH_TEST = "https://test.0x000f.ru/api/v1/"; -let BasicURLValue = "https://hostapay.trade/api/v1/"; - - +let BasicURLValue = API_PATH_TEST; async function makePost(url, data, options = undefined, responseProcessor = defaultResponseProcessor, diff --git a/src/lib/tools/strings/Strings.js b/src/lib/tools/strings/Strings.js index 716c0b9..c63e346 100644 --- a/src/lib/tools/strings/Strings.js +++ b/src/lib/tools/strings/Strings.js @@ -9,4 +9,15 @@ export function isStringEmptyOrSpaces(str) { } } return false; +} + +export function truncateMiddle(str, n) { + if (str.length <= 2 * n) { + return str; // Если длина строки меньше или равна 2n, то ничего не обрезаем + } + + const leftPart = str.slice(0, n); // Первые n символов + const rightPart = str.slice(-n); // Последние n символов + + return leftPart + '...' + rightPart; // Соединяем с "..." } \ No newline at end of file diff --git a/src/lib/ui-components/navbar.svelte b/src/lib/ui-components/navbar.svelte index 21d21b0..7098a2a 100644 --- a/src/lib/ui-components/navbar.svelte +++ b/src/lib/ui-components/navbar.svelte @@ -47,6 +47,8 @@ {#if jwtDecode(getAuthInfo()?.a)?.role == "4"}
+ SMS +
+ { + if (e.currentTarget.checked) { + selectedNotificationType = "push"; + } else { + selectedNotificationType = "sms"; + } + getNotifications(); + }} + type="checkbox" + class="toggle border-base-content bg-base-content hover:bg-base-content" + checked="checked" + /> ++ Push +
+С:
+ +По:
+ +Токен:
+ +Нет данных
+ {:else} +{headNamesMap[head]} | + {/each} +
---|
{noti[head]} | + {/each} +
Нет данных
+ {:else} +{headNamesMap[head]} | + {/each} +||||
---|---|---|---|---|
{truncateMiddle(noti[head], 4)} | + {:else if head === "is_active"} +{noti[head] === "t" ? "Активна" : "Неактивна"} | + {:else if head === "amount"} +{(Number(noti[head]) / 1e6).toFixed(0)} USDT | + {:else if head === "opt" && noti["is_active"] === "t"} ++ + | + {:else} +{noti[head]} | + {/if} + {/each} +
Хэш
+ +UUID
+ + + +