20-12-2024

This commit is contained in:
FIRST_NAME LAST_NAME 2024-12-20 21:20:48 +03:00
parent ab5e815b48
commit fe358b8bbd
4 changed files with 88 additions and 35 deletions

View File

@ -4,9 +4,11 @@
import { onMount } from "svelte"; import { onMount } from "svelte";
onMount(() => { onMount(() => {
if(checkAuthSync()) if (checkAuthSync()) redirect("/admin/userslist");
redirect("/admin/userslist"); else redirect("/admin/login");
else
redirect("/admin/login");
}); });
</script> </script>
<div class="w-full flex justify-center items-center">
<span class="loading loading-lg"></span>
</div>

View File

@ -157,7 +157,9 @@
<div <div
class="fixed inset-0 z-[1000] bg-black bg-opacity-50 flex justify-center items-center" class="fixed inset-0 z-[1000] bg-black bg-opacity-50 flex justify-center items-center"
> >
<div class="flex flex-col p-4 bg-base-100 rounded-md"> <div
class="flex flex-col p-4 bg-base-100 rounded-md overflow-y-auto max-h-[90%]"
>
<p class="text-sm">UUID</p> <p class="text-sm">UUID</p>
<p class="font-semibold">{foundedDispute["uuid"]}</p> <p class="font-semibold">{foundedDispute["uuid"]}</p>
<!-- <p class="text-sm mt-3">ID заявки</p> <!-- <p class="text-sm mt-3">ID заявки</p>
@ -166,6 +168,18 @@
<p class="font-semibold">{foundedDispute["external_user_id"]}</p> <p class="font-semibold">{foundedDispute["external_user_id"]}</p>
<p class="text-sm mt-3">Статус</p> <p class="text-sm mt-3">Статус</p>
<p class="">{orderStatusMap[foundedDispute["status"]]}</p> <p class="">{orderStatusMap[foundedDispute["status"]]}</p>
{#if foundedDispute["token"] !== ""}
<p class="text-sm mt-3">Токен трейдера</p>
<p>{foundedDispute["token"]}</p>
{/if}
{#if foundedDispute["trader_name"] !== ""}
<p class="text-sm mt-3">Трейдер</p>
<p>{foundedDispute["trader_name"]} {foundedDispute["surname"]}</p>
{/if}
{#if foundedDispute["close_reason"] !== ""}
<p class="text-sm mt-3">Причина отклонения</p>
<p>{foundedDispute["close_reason"]}</p>
{/if}
<p class="text-sm mt-3">Сумма</p> <p class="text-sm mt-3">Сумма</p>
<p> <p>
{foundedDispute["summa"]} {foundedDispute["summa"]}
@ -176,12 +190,22 @@
</p> </p>
<!-- <p class="text-sm mt-3">Курс</p> <!-- <p class="text-sm mt-3">Курс</p>
<p>{foundedDispute["rate"]} {foundedDispute["currency_code"]}</p> --> <p>{foundedDispute["rate"]} {foundedDispute["currency_code"]}</p> -->
{#if foundedDispute["bank_name"] !== ""}
<p class="text-sm mt-3">Банк</p>
<p>{foundedDispute["bank_name"]}</p>
{/if}
{#if foundedDispute["name"] !== ""}
<p class="text-sm mt-3">Владелец</p> <p class="text-sm mt-3">Владелец</p>
<p>{foundedDispute["name"]}</p> <p>{foundedDispute["name"]}</p>
{/if}
{#if foundedDispute["cardnumber"] !== ""}
<p class="text-sm mt-3">Карта</p> <p class="text-sm mt-3">Карта</p>
<p>{foundedDispute["cardnumber"]}</p> <p>{foundedDispute["cardnumber"]}</p>
{/if}
{#if foundedDispute["phone"] !== ""}
<p class="text-sm mt-3">Телефон</p> <p class="text-sm mt-3">Телефон</p>
<p>{foundedDispute["phone"]}</p> <p>{foundedDispute["phone"]}</p>
{/if}
<p class="text-sm mt-3">Время создания</p> <p class="text-sm mt-3">Время создания</p>
<p>{foundedDispute["creationtime"]}</p> <p>{foundedDispute["creationtime"]}</p>
<!-- <p>{foundedDispute["closetime"]}</p> --> <!-- <p>{foundedDispute["closetime"]}</p> -->

View File

@ -17,14 +17,13 @@
from_bank_name: "Название банка", from_bank_name: "Название банка",
from_to: "Получатель", from_to: "Получатель",
got_from_device_uuid: "Девайс UUID", got_from_device_uuid: "Девайс UUID",
initial_text: initial_text: "Текст сообщения",
"Текст сообщения",
matched_order_uuid: "Совпадение с заявкой", matched_order_uuid: "Совпадение с заявкой",
on_device_msg_creation: "Время сообщения на устройство", on_device_msg_creation: "Время сообщения на устройство",
to_bank_id: "ID банка", to_bank_id: "ID банка",
type: "Тип", type: "Тип",
uuid: "UUID", uuid: "UUID",
requisite_type: "Тип реквизита" requisite_type: "Тип реквизита",
}; };
let selectedNotificationType = "push"; let selectedNotificationType = "push";
@ -51,7 +50,7 @@
notification_type: selectedNotificationType === "push" ? 1 : 2, notification_type: selectedNotificationType === "push" ? 1 : 2,
fromDate: formatDateTime(value_startTime), fromDate: formatDateTime(value_startTime),
toDate: formatDateTime(value_endTime), toDate: formatDateTime(value_endTime),
token: (value_token.length >= 36 ? value_token:undefined), token: value_token.length >= 36 ? value_token : undefined,
page: currentPage, page: currentPage,
}, },
makeAuthHeaderForAxios(getAuthInfo()?.a) makeAuthHeaderForAxios(getAuthInfo()?.a)
@ -87,17 +86,20 @@
currentPage = 1; currentPage = 1;
getNotifications(); getNotifications();
} }
$: if(typeof value_token === 'string' && value_token.length >= 36 || value_token.length === 0) { $: if (
(typeof value_token === "string" && value_token.length >= 36) ||
value_token.length === 0
) {
currentPage = 1; currentPage = 1;
getNotifications(); getNotifications();
} }
function formatDateForStartup(date) { function formatDateForStartup(date) {
const year = date.getFullYear(); const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0'); const month = String(date.getMonth() + 1).padStart(2, "0");
const day = String(date.getDate()).padStart(2, '0'); const day = String(date.getDate()).padStart(2, "0");
const hours = String(date.getHours()).padStart(2, '0'); const hours = String(date.getHours()).padStart(2, "0");
const minutes = String(date.getMinutes()).padStart(2, '0'); const minutes = String(date.getMinutes()).padStart(2, "0");
return `${year}-${month}-${day}T${hours}:${minutes}`; return `${year}-${month}-${day}T${hours}:${minutes}`;
} }
@ -198,7 +200,11 @@
</div> </div>
<div class="flex items-center gap-2"> <div class="flex items-center gap-2">
<p>Токен:</p> <p>Токен:</p>
<input type="text" bind:value={value_token} class="input input-sm input-bordered"> <input
type="text"
bind:value={value_token}
class="input input-sm input-bordered"
/>
</div> </div>
</div> </div>
<Pagination <Pagination
@ -220,19 +226,39 @@
<thead> <thead>
<tr> <tr>
{#each tableHeads as head} {#each tableHeads as head}
{#if head !== "bank"}
<th>{headNamesMap[head]}</th> <th>{headNamesMap[head]}</th>
{/if}
{/each} {/each}
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{#each notifications as noti} {#each notifications as noti}
<tr class="hover:bg-neutral group border-t-[2px] border-neutral"> {#if noti["matched_order_uuid"] !== ""}
<tr
class="hover:bg-info hover:bg-opacity-50 group border-t-[2px] border-neutral bg-accent bg-opacity-10"
>
{#each tableHeads as head} {#each tableHeads as head}
{#if head !== "bank"}
<td class={head === "initial_text" ? "text-xs" : ""} <td class={head === "initial_text" ? "text-xs" : ""}
>{noti[head]}</td >{noti[head]}</td
> >
{/if}
{/each} {/each}
</tr> </tr>
{:else}
<tr
class="hover:bg-info hover:bg-opacity-50 group border-t-[2px] border-neutral bg-warning bg-opacity-10"
>
{#each tableHeads as head}
{#if head !== "bank"}
<td class={head === "initial_text" ? "text-xs" : ""}
>{noti[head]}</td
>
{/if}
{/each}
</tr>
{/if}
{/each} {/each}
</tbody> </tbody>
</table> </table>

View File

@ -1,11 +1,12 @@
/** @type {import('tailwindcss').Config} */ /** @type {import('tailwindcss').Config} */
import daisyui from 'daisyui';
export default { export default {
content: ['./src/**/*.{html,js,svelte,ts}'], content: ['./src/**/*.{html,js,svelte,ts}'],
theme: { theme: {
extend: {} extend: {}
}, },
plugins: [ plugins: [
require('daisyui'), daisyui,
], ],
daisyui: { daisyui: {
themes: ["forest"], themes: ["forest"],