adasand commited on
Commit
277ef96
·
verified ·
1 Parent(s): a028e89

Add 2 files

Browse files
Files changed (2) hide show
  1. README.md +7 -5
  2. index.html +931 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Wdev
3
- emoji: 📉
4
- colorFrom: green
5
- colorTo: yellow
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: wdev
3
+ emoji: 🐳
4
+ colorFrom: blue
5
+ colorTo: blue
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,931 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="ru">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Wildberries Analytics Platform</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
+ <style>
10
+ .sidebar {
11
+ transition: all 0.3s ease;
12
+ }
13
+ .chart-container {
14
+ height: 400px;
15
+ }
16
+ .report-builder {
17
+ min-height: 500px;
18
+ border: 2px dashed #e2e8f0;
19
+ transition: all 0.3s ease;
20
+ }
21
+ .report-builder:hover {
22
+ border-color: #818cf8;
23
+ }
24
+ .draggable-widget {
25
+ cursor: grab;
26
+ transition: all 0.2s ease;
27
+ }
28
+ .draggable-widget:active {
29
+ cursor: grabbing;
30
+ }
31
+ .draggable-widget:hover {
32
+ transform: translateY(-2px);
33
+ box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
34
+ }
35
+ .widget-placeholder {
36
+ border: 2px dashed #818cf8;
37
+ background-color: rgba(129, 140, 248, 0.1);
38
+ }
39
+ .api-response {
40
+ max-height: 300px;
41
+ overflow-y: auto;
42
+ }
43
+ .dark .dark\:bg-gray-800 {
44
+ background-color: #1e293b;
45
+ }
46
+ .dark .dark\:text-white {
47
+ color: #ffffff;
48
+ }
49
+ </style>
50
+ </head>
51
+ <body class="bg-gray-50 dark:bg-gray-900">
52
+ <div class="flex h-screen overflow-hidden">
53
+ <!-- Sidebar -->
54
+ <div class="sidebar w-64 bg-white dark:bg-gray-800 shadow-lg flex-shrink-0">
55
+ <div class="p-4 border-b border-gray-200 dark:border-gray-700">
56
+ <div class="flex items-center">
57
+ <img src="https://via.placeholder.com/40" alt="Logo" class="h-8 w-8 mr-2">
58
+ <h1 class="text-xl font-bold text-gray-800 dark:text-white">WB Analytics</h1>
59
+ </div>
60
+ </div>
61
+ <nav class="p-4">
62
+ <div class="mb-6">
63
+ <h3 class="text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2 dark:text-gray-400">Основное</h3>
64
+ <ul>
65
+ <li class="mb-1">
66
+ <a href="#" class="flex items-center p-2 text-purple-700 dark:text-purple-400 bg-purple-50 dark:bg-gray-700 rounded-lg">
67
+ <i class="fas fa-chart-line mr-3"></i>
68
+ <span>Дашборд</span>
69
+ </a>
70
+ </li>
71
+ <li class="mb-1">
72
+ <a href="#" class="flex items-center p-2 text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg">
73
+ <i class="fas fa-shopping-bag mr-3"></i>
74
+ <span>Товары</span>
75
+ </a>
76
+ </li>
77
+ <li class="mb-1">
78
+ <a href="#" class="flex items-center p-2 text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg">
79
+ <i class="fas fa-truck mr-3"></i>
80
+ <span>Поставки</span>
81
+ </a>
82
+ </li>
83
+ <li class="mb-1">
84
+ <a href="#" class="flex items-center p-2 text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg">
85
+ <i class="fas fa-file-invoice-dollar mr-3"></i>
86
+ <span>Финансы</span>
87
+ </a>
88
+ </li>
89
+ </ul>
90
+ </div>
91
+ <div class="mb-6">
92
+ <h3 class="text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2 dark:text-gray-400">Отчеты</h3>
93
+ <ul>
94
+ <li class="mb-1">
95
+ <a href="#" class="flex items-center p-2 text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg">
96
+ <i class="fas fa-file-alt mr-3"></i>
97
+ <span>Стандартные</span>
98
+ </a>
99
+ </li>
100
+ <li class="mb-1">
101
+ <a href="#" class="flex items-center p-2 text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg">
102
+ <i class="fas fa-magic mr-3"></i>
103
+ <span>Конструктор</span>
104
+ </a>
105
+ </li>
106
+ <li class="mb-1">
107
+ <a href="#" class="flex items-center p-2 text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg">
108
+ <i class="fas fa-history mr-3"></i>
109
+ <span>История</span>
110
+ </a>
111
+ </li>
112
+ </ul>
113
+ </div>
114
+ <div>
115
+ <h3 class="text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2 dark:text-gray-400">Настройки</h3>
116
+ <ul>
117
+ <li class="mb-1">
118
+ <a href="#" class="flex items-center p-2 text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg">
119
+ <i class="fas fa-plug mr-3"></i>
120
+ <span>API ключи</span>
121
+ </a>
122
+ </li>
123
+ <li class="mb-1">
124
+ <a href="#" class="flex items-center p-2 text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg">
125
+ <i class="fas fa-user-cog mr-3"></i>
126
+ <span>Профиль</span>
127
+ </a>
128
+ </li>
129
+ </ul>
130
+ </div>
131
+ </nav>
132
+ </div>
133
+
134
+ <!-- Main Content -->
135
+ <div class="flex-1 overflow-auto">
136
+ <!-- Header -->
137
+ <header class="bg-white dark:bg-gray-800 shadow-sm">
138
+ <div class="flex items-center justify-between p-4">
139
+ <div class="flex items-center">
140
+ <button class="mr-4 text-gray-500 dark:text-gray-300">
141
+ <i class="fas fa-bars"></i>
142
+ </button>
143
+ <h2 class="text-xl font-semibold text-gray-800 dark:text-white">Конструктор отчетов</h2>
144
+ </div>
145
+ <div class="flex items-center space-x-4">
146
+ <div class="relative">
147
+ <input type="text" placeholder="Поиск..." class="pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white">
148
+ <i class="fas fa-search absolute left-3 top-3 text-gray-400"></i>
149
+ </div>
150
+ <button class="p-2 text-gray-500 hover:text-gray-700 dark:text-gray-300 dark:hover:text-white">
151
+ <i class="fas fa-bell"></i>
152
+ </button>
153
+ <div class="flex items-center">
154
+ <img src="https://via.placeholder.com/40" alt="User" class="h-8 w-8 rounded-full mr-2">
155
+ <span class="text-gray-700 dark:text-white">Иван Иванов</span>
156
+ </div>
157
+ </div>
158
+ </div>
159
+ </header>
160
+
161
+ <!-- Content -->
162
+ <main class="p-6">
163
+ <div class="grid grid-cols-1 lg:grid-cols-3 gap-6 mb-6">
164
+ <!-- API Connection Panel -->
165
+ <div class="bg-white dark:bg-gray-800 rounded-lg shadow p-6">
166
+ <div class="flex items-center justify-between mb-4">
167
+ <h3 class="text-lg font-semibold text-gray-800 dark:text-white">Подключение к API Wildberries</h3>
168
+ <span class="bg-green-100 text-green-800 text-xs font-medium px-2.5 py-0.5 rounded-full dark:bg-green-900 dark:text-green-300">Активно</span>
169
+ </div>
170
+ <div class="mb-4">
171
+ <label for="api-key" class="block mb-2 text-sm font-medium text-gray-700 dark:text-gray-300">API ключ</label>
172
+ <div class="relative">
173
+ <input type="password" id="api-key" value="wb_1234567890abcdef" class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-purple-500 focus:border-purple-500 block w-full p-2.5 pr-10 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white" readonly>
174
+ <button onclick="toggleApiKeyVisibility()" class="absolute right-2.5 bottom-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-white">
175
+ <i class="fas fa-eye"></i>
176
+ </button>
177
+ </div>
178
+ </div>
179
+ <div class="mb-4">
180
+ <label for="api-url" class="block mb-2 text-sm font-medium text-gray-700 dark:text-gray-300">URL API</label>
181
+ <input type="text" id="api-url" value="https://suppliers-api.wildberries.ru" class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-purple-500 focus:border-purple-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white" readonly>
182
+ </div>
183
+ <div class="flex justify-between">
184
+ <button onclick="testApiConnection()" class="text-white bg-purple-700 hover:bg-purple-800 focus:ring-4 focus:ring-purple-300 font-medium rounded-lg text-sm px-5 py-2.5 dark:bg-purple-600 dark:hover:bg-purple-700 focus:outline-none dark:focus:ring-purple-800">
185
+ Проверить соединение
186
+ </button>
187
+ <button onclick="showApiDocumentation()" class="text-purple-700 hover:text-white border border-purple-700 hover:bg-purple-800 focus:ring-4 focus:ring-purple-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:border-purple-500 dark:text-purple-500 dark:hover:text-white dark:hover:bg-purple-600 dark:focus:ring-purple-900">
188
+ Документация API
189
+ </button>
190
+ </div>
191
+ </div>
192
+
193
+ <!-- API Response Preview -->
194
+ <div class="bg-white dark:bg-gray-800 rounded-lg shadow p-6 col-span-2">
195
+ <div class="flex items-center justify-between mb-4">
196
+ <h3 class="text-lg font-semibold text-gray-800 dark:text-white">Пример ответа API</h3>
197
+ <div class="flex space-x-2">
198
+ <button onclick="loadSampleData('sales')" class="text-xs bg-gray-100 hover:bg-gray-200 text-gray-800 font-medium px-3 py-1 rounded dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-gray-600">
199
+ Продажи
200
+ </button>
201
+ <button onclick="loadSampleData('stocks')" class="text-xs bg-gray-100 hover:bg-gray-200 text-gray-800 font-medium px-3 py-1 rounded dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-gray-600">
202
+ Остатки
203
+ </button>
204
+ <button onclick="loadSampleData('orders')" class="text-xs bg-gray-100 hover:bg-gray-200 text-gray-800 font-medium px-3 py-1 rounded dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-gray-600">
205
+ Заказы
206
+ </button>
207
+ </div>
208
+ </div>
209
+ <div class="api-response bg-gray-50 dark:bg-gray-700 p-4 rounded-lg">
210
+ <pre class="text-xs text-gray-800 dark:text-gray-300" id="api-response-content">Выберите тип данных для загрузки...</pre>
211
+ </div>
212
+ </div>
213
+ </div>
214
+
215
+ <!-- Report Builder Section -->
216
+ <div class="bg-white dark:bg-gray-800 rounded-lg shadow p-6 mb-6">
217
+ <div class="flex items-center justify-between mb-6">
218
+ <h3 class="text-lg font-semibold text-gray-800 dark:text-white">Конструктор отчета</h3>
219
+ <div class="flex space-x-3">
220
+ <button onclick="saveReport()" class="text-white bg-purple-700 hover:bg-purple-800 focus:ring-4 focus:ring-purple-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-purple-600 dark:hover:bg-purple-700 focus:outline-none dark:focus:ring-purple-800">
221
+ <i class="fas fa-save mr-2"></i> Сохранить
222
+ </button>
223
+ <button onclick="exportReport()" class="text-purple-700 hover:text-white border border-purple-700 hover:bg-purple-800 focus:ring-4 focus:ring-purple-300 font-medium rounded-lg text-sm px-4 py-2 text-center dark:border-purple-500 dark:text-purple-500 dark:hover:text-white dark:hover:bg-purple-600 dark:focus:ring-purple-900">
224
+ <i class="fas fa-file-export mr-2"></i> Экспорт
225
+ </button>
226
+ </div>
227
+ </div>
228
+
229
+ <div class="grid grid-cols-1 lg:grid-cols-4 gap-6">
230
+ <!-- Widgets Panel -->
231
+ <div class="bg-gray-50 dark:bg-gray-700 rounded-lg p-4">
232
+ <h4 class="text-sm font-semibold text-gray-700 dark:text-gray-300 mb-3">Доступные виджеты</h4>
233
+ <div class="space-y-3">
234
+ <div draggable="true" ondragstart="drag(event)" data-widget-type="chart-line" class="draggable-widget bg-white dark:bg-gray-600 p-3 rounded-lg shadow-sm cursor-move">
235
+ <div class="flex items-center">
236
+ <div class="bg-purple-100 dark:bg-purple-900 p-2 rounded-lg mr-3">
237
+ <i class="fas fa-chart-line text-purple-600 dark:text-purple-300"></i>
238
+ </div>
239
+ <span class="text-sm font-medium text-gray-700 dark:text-gray-300">Линейный график</span>
240
+ </div>
241
+ </div>
242
+ <div draggable="true" ondragstart="drag(event)" data-widget-type="chart-bar" class="draggable-widget bg-white dark:bg-gray-600 p-3 rounded-lg shadow-sm cursor-move">
243
+ <div class="flex items-center">
244
+ <div class="bg-blue-100 dark:bg-blue-900 p-2 rounded-lg mr-3">
245
+ <i class="fas fa-chart-bar text-blue-600 dark:text-blue-300"></i>
246
+ </div>
247
+ <span class="text-sm font-medium text-gray-700 dark:text-gray-300">Столбчатая диаграмма</span>
248
+ </div>
249
+ </div>
250
+ <div draggable="true" ondragstart="drag(event)" data-widget-type="chart-pie" class="draggable-widget bg-white dark:bg-gray-600 p-3 rounded-lg shadow-sm cursor-move">
251
+ <div class="flex items-center">
252
+ <div class="bg-green-100 dark:bg-green-900 p-2 rounded-lg mr-3">
253
+ <i class="fas fa-chart-pie text-green-600 dark:text-green-300"></i>
254
+ </div>
255
+ <span class="text-sm font-medium text-gray-700 dark:text-gray-300">Круговая диаграмма</span>
256
+ </div>
257
+ </div>
258
+ <div draggable="true" ondragstart="drag(event)" data-widget-type="table" class="draggable-widget bg-white dark:bg-gray-600 p-3 rounded-lg shadow-sm cursor-move">
259
+ <div class="flex items-center">
260
+ <div class="bg-yellow-100 dark:bg-yellow-900 p-2 rounded-lg mr-3">
261
+ <i class="fas fa-table text-yellow-600 dark:text-yellow-300"></i>
262
+ </div>
263
+ <span class="text-sm font-medium text-gray-700 dark:text-gray-300">Таблица данных</span>
264
+ </div>
265
+ </div>
266
+ <div draggable="true" ondragstart="drag(event)" data-widget-type="kpi" class="draggable-widget bg-white dark:bg-gray-600 p-3 rounded-lg shadow-sm cursor-move">
267
+ <div class="flex items-center">
268
+ <div class="bg-red-100 dark:bg-red-900 p-2 rounded-lg mr-3">
269
+ <i class="fas fa-tachometer-alt text-red-600 dark:text-red-300"></i>
270
+ </div>
271
+ <span class="text-sm font-medium text-gray-700 dark:text-gray-300">KPI метрика</span>
272
+ </div>
273
+ </div>
274
+ </div>
275
+ </div>
276
+
277
+ <!-- Report Builder Area -->
278
+ <div class="report-builder bg-gray-50 dark:bg-gray-700 rounded-lg p-4 col-span-3" id="report-builder" ondrop="drop(event)" ondragover="allowDrop(event)">
279
+ <div class="flex items-center justify-between mb-4">
280
+ <h4 class="text-sm font-semibold text-gray-700 dark:text-gray-300">Рабочая область</h4>
281
+ <div class="flex space-x-2">
282
+ <button onclick="clearReport()" class="text-xs bg-gray-200 hover:bg-gray-300 text-gray-800 font-medium px-3 py-1 rounded dark:bg-gray-600 dark:text-gray-300 dark:hover:bg-gray-500">
283
+ <i class="fas fa-trash-alt mr-1"></i> Очистить
284
+ </button>
285
+ <button onclick="addSection()" class="text-xs bg-gray-200 hover:bg-gray-300 text-gray-800 font-medium px-3 py-1 rounded dark:bg-gray-600 dark:text-gray-300 dark:hover:bg-gray-500">
286
+ <i class="fas fa-plus mr-1"></i> Раздел
287
+ </button>
288
+ </div>
289
+ </div>
290
+
291
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-4" id="report-content">
292
+ <!-- Placeholder when empty -->
293
+ <div class="col-span-2 flex flex-col items-center justify-center py-12 text-center" id="empty-placeholder">
294
+ <i class="fas fa-magic text-4xl text-gray-300 mb-4"></i>
295
+ <h4 class="text-lg font-medium text-gray-500 mb-2">Пустой отчет</h4>
296
+ <p class="text-sm text-gray-400 max-w-md">Перетащите виджеты из панели слева или нажмите "Добавить раздел"</p>
297
+ </div>
298
+ </div>
299
+ </div>
300
+ </div>
301
+ </div>
302
+
303
+ <!-- Report Settings -->
304
+ <div class="bg-white dark:bg-gray-800 rounded-lg shadow p-6">
305
+ <h3 class="text-lg font-semibold text-gray-800 dark:text-white mb-4">Настройки отчета</h3>
306
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
307
+ <div>
308
+ <label for="report-name" class="block mb-2 text-sm font-medium text-gray-700 dark:text-gray-300">Название отчета</label>
309
+ <input type="text" id="report-name" placeholder="Мой отчет" class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-purple-500 focus:border-purple-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white">
310
+ </div>
311
+ <div>
312
+ <label for="report-period" class="block mb-2 text-sm font-medium text-gray-700 dark:text-gray-300">Период</label>
313
+ <select id="report-period" class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-purple-500 focus:border-purple-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white">
314
+ <option value="day">За день</option>
315
+ <option value="week" selected>За неделю</option>
316
+ <option value="month">За месяц</option>
317
+ <option value="quarter">За квартал</option>
318
+ <option value="year">За год</option>
319
+ <option value="custom">Произвольный период</option>
320
+ </select>
321
+ </div>
322
+ <div>
323
+ <label for="report-category" class="block mb-2 text-sm font-medium text-gray-700 dark:text-gray-300">Категория товаров</label>
324
+ <select id="report-category" class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-purple-500 focus:border-purple-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white">
325
+ <option value="all">Все категории</option>
326
+ <option value="electronics">Электроника</option>
327
+ <option value="clothing">Одежда</option>
328
+ <option value="home">Дом и сад</option>
329
+ <option value="beauty">Красота</option>
330
+ <option value="kids">Детские товары</option>
331
+ </select>
332
+ </div>
333
+ <div>
334
+ <label for="report-frequency" class="block mb-2 text-sm font-medium text-gray-700 dark:text-gray-300">Автоматическое обновление</label>
335
+ <select id="report-frequency" class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-purple-500 focus:border-purple-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white">
336
+ <option value="none">Не обновлять</option>
337
+ <option value="hourly">Каждый час</option>
338
+ <option value="daily">Ежедневно</option>
339
+ <option value="weekly">Еженедельно</option>
340
+ </select>
341
+ </div>
342
+ </div>
343
+ </div>
344
+ </main>
345
+ </div>
346
+ </div>
347
+
348
+ <script>
349
+ // Toggle API key visibility
350
+ function toggleApiKeyVisibility() {
351
+ const apiKeyInput = document.getElementById('api-key');
352
+ const eyeIcon = event.currentTarget.querySelector('i');
353
+
354
+ if (apiKeyInput.type === 'password') {
355
+ apiKeyInput.type = 'text';
356
+ eyeIcon.classList.replace('fa-eye', 'fa-eye-slash');
357
+ } else {
358
+ apiKeyInput.type = 'password';
359
+ eyeIcon.classList.replace('fa-eye-slash', 'fa-eye');
360
+ }
361
+ }
362
+
363
+ // Test API connection
364
+ function testApiConnection() {
365
+ // Simulate API connection test
366
+ const button = event.currentTarget;
367
+ const originalText = button.innerHTML;
368
+
369
+ button.innerHTML = '<i class="fas fa-spinner fa-spin mr-2"></i> Проверка...';
370
+ button.disabled = true;
371
+
372
+ setTimeout(() => {
373
+ button.innerHTML = '<i class="fas fa-check-circle mr-2"></i> Успешно!';
374
+ setTimeout(() => {
375
+ button.innerHTML = originalText;
376
+ button.disabled = false;
377
+ }, 2000);
378
+ }, 1500);
379
+ }
380
+
381
+ // Show API documentation
382
+ function showApiDocumentation() {
383
+ alert('Открытие документации API Wildberries в новом окне...');
384
+ // In a real app, this would open the official API docs
385
+ }
386
+
387
+ // Load sample data
388
+ function loadSampleData(type) {
389
+ const responseContainer = document.getElementById('api-response-content');
390
+ let sampleData = '';
391
+
392
+ // Simulate loading
393
+ responseContainer.innerHTML = '<div class="flex justify-center py-8"><i class="fas fa-spinner fa-spin text-gray-400"></i></div>';
394
+
395
+ setTimeout(() => {
396
+ if (type === 'sales') {
397
+ sampleData = `{
398
+ "data": [
399
+ {
400
+ "date": "2023-05-01",
401
+ "ordersCount": 42,
402
+ "totalSales": 125600,
403
+ "avgOrderValue": 2990,
404
+ "returnsCount": 3
405
+ },
406
+ {
407
+ "date": "2023-05-02",
408
+ "ordersCount": 38,
409
+ "totalSales": 112400,
410
+ "avgOrderValue": 2958,
411
+ "returnsCount": 2
412
+ },
413
+ {
414
+ "date": "2023-05-03",
415
+ "ordersCount": 56,
416
+ "totalSales": 168900,
417
+ "avgOrderValue": 3016,
418
+ "returnsCount": 5
419
+ }
420
+ ],
421
+ "total": {
422
+ "ordersCount": 136,
423
+ "totalSales": 406900,
424
+ "avgOrderValue": 2992,
425
+ "returnsCount": 10
426
+ }
427
+ }`;
428
+ } else if (type === 'stocks') {
429
+ sampleData = `{
430
+ "stocks": [
431
+ {
432
+ "sku": "ABC123",
433
+ "name": "Смартфон X Pro",
434
+ "warehouse": "Москва",
435
+ "quantity": 124,
436
+ "inTransit": 50,
437
+ "reserved": 12
438
+ },
439
+ {
440
+ "sku": "DEF456",
441
+ "name": "Наушники Wireless",
442
+ "warehouse": "Санкт-Петербург",
443
+ "quantity": 89,
444
+ "inTransit": 30,
445
+ "reserved": 8
446
+ },
447
+ {
448
+ "sku": "GHI789",
449
+ "name": "Чехол для телефона",
450
+ "warehouse": "Казань",
451
+ "quantity": 215,
452
+ "inTransit": 0,
453
+ "reserved": 25
454
+ }
455
+ ],
456
+ "totalItems": 3,
457
+ "totalQuantity": 428,
458
+ "totalInTransit": 80,
459
+ "totalReserved": 45
460
+ }`;
461
+ } else if (type === 'orders') {
462
+ sampleData = `{
463
+ "orders": [
464
+ {
465
+ "orderId": "WB12345678",
466
+ "date": "2023-05-01T14:30:22Z",
467
+ "sku": "ABC123",
468
+ "name": "Смартфон X Pro",
469
+ "quantity": 1,
470
+ "price": 29990,
471
+ "status": "delivered",
472
+ "region": "Москва"
473
+ },
474
+ {
475
+ "orderId": "WB12345679",
476
+ "date": "2023-05-02T09:15:10Z",
477
+ "sku": "DEF456",
478
+ "name": "Наушники Wireless",
479
+ "quantity": 2,
480
+ "price": 5990,
481
+ "status": "shipped",
482
+ "region": "Санкт-Петербург"
483
+ },
484
+ {
485
+ "orderId": "WB12345680",
486
+ "date": "2023-05-03T16:45:33Z",
487
+ "sku": "GHI789",
488
+ "name": "Чехол для телефона",
489
+ "quantity": 1,
490
+ "price": 990,
491
+ "status": "processing",
492
+ "region": "Казань"
493
+ }
494
+ ],
495
+ "totalOrders": 3,
496
+ "totalItems": 4,
497
+ "totalValue": 37960,
498
+ "statusSummary": {
499
+ "processing": 1,
500
+ "shipped": 1,
501
+ "delivered": 1
502
+ }
503
+ }`;
504
+ }
505
+
506
+ responseContainer.textContent = sampleData;
507
+ Prism.highlightElement(responseContainer);
508
+ }, 800);
509
+ }
510
+
511
+ // Drag and drop functionality
512
+ function allowDrop(ev) {
513
+ ev.preventDefault();
514
+ ev.currentTarget.classList.add('widget-placeholder');
515
+ }
516
+
517
+ function drag(ev) {
518
+ ev.dataTransfer.setData("widget-type", ev.target.getAttribute('data-widget-type'));
519
+ }
520
+
521
+ function drop(ev) {
522
+ ev.preventDefault();
523
+ ev.currentTarget.classList.remove('widget-placeholder');
524
+
525
+ const widgetType = ev.dataTransfer.getData("widget-type");
526
+ addWidgetToReport(widgetType);
527
+ }
528
+
529
+ // Add widget to report
530
+ function addWidgetToReport(widgetType) {
531
+ const reportContent = document.getElementById('report-content');
532
+ const emptyPlaceholder = document.getElementById('empty-placeholder');
533
+
534
+ // Remove empty placeholder if it exists
535
+ if (emptyPlaceholder) {
536
+ emptyPlaceholder.remove();
537
+ }
538
+
539
+ // Create widget based on type
540
+ let widgetHtml = '';
541
+ const widgetId = 'widget-' + Date.now();
542
+
543
+ switch(widgetType) {
544
+ case 'chart-line':
545
+ widgetHtml = `
546
+ <div class="widget bg-white dark:bg-gray-600 rounded-lg shadow p-4" id="${widgetId}" data-widget-type="chart-line">
547
+ <div class="flex items-center justify-between mb-3">
548
+ <h5 class="text-sm font-medium text-gray-700 dark:text-gray-300">Линейный график</h5>
549
+ <div class="flex space-x-2">
550
+ <button onclick="configureWidget('${widgetId}')" class="text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-white">
551
+ <i class="fas fa-cog"></i>
552
+ </button>
553
+ <button onclick="removeWidget('${widgetId}')" class="text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-white">
554
+ <i class="fas fa-times"></i>
555
+ </button>
556
+ </div>
557
+ </div>
558
+ <div class="chart-container">
559
+ <canvas id="${widgetId}-chart"></canvas>
560
+ </div>
561
+ </div>
562
+ `;
563
+ break;
564
+
565
+ case 'chart-bar':
566
+ widgetHtml = `
567
+ <div class="widget bg-white dark:bg-gray-600 rounded-lg shadow p-4" id="${widgetId}" data-widget-type="chart-bar">
568
+ <div class="flex items-center justify-between mb-3">
569
+ <h5 class="text-sm font-medium text-gray-700 dark:text-gray-300">Столбчатая диаграмма</h5>
570
+ <div class="flex space-x-2">
571
+ <button onclick="configureWidget('${widgetId}')" class="text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-white">
572
+ <i class="fas fa-cog"></i>
573
+ </button>
574
+ <button onclick="removeWidget('${widgetId}')" class="text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-white">
575
+ <i class="fas fa-times"></i>
576
+ </button>
577
+ </div>
578
+ </div>
579
+ <div class="chart-container">
580
+ <canvas id="${widgetId}-chart"></canvas>
581
+ </div>
582
+ </div>
583
+ `;
584
+ break;
585
+
586
+ case 'chart-pie':
587
+ widgetHtml = `
588
+ <div class="widget bg-white dark:bg-gray-600 rounded-lg shadow p-4" id="${widgetId}" data-widget-type="chart-pie">
589
+ <div class="flex items-center justify-between mb-3">
590
+ <h5 class="text-sm font-medium text-gray-700 dark:text-gray-300">Круговая диаграмма</h5>
591
+ <div class="flex space-x-2">
592
+ <button onclick="configureWidget('${widgetId}')" class="text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-white">
593
+ <i class="fas fa-cog"></i>
594
+ </button>
595
+ <button onclick="removeWidget('${widgetId}')" class="text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-white">
596
+ <i class="fas fa-times"></i>
597
+ </button>
598
+ </div>
599
+ </div>
600
+ <div class="chart-container">
601
+ <canvas id="${widgetId}-chart"></canvas>
602
+ </div>
603
+ </div>
604
+ `;
605
+ break;
606
+
607
+ case 'table':
608
+ widgetHtml = `
609
+ <div class="widget bg-white dark:bg-gray-600 rounded-lg shadow p-4" id="${widgetId}" data-widget-type="table">
610
+ <div class="flex items-center justify-between mb-3">
611
+ <h5 class="text-sm font-medium text-gray-700 dark:text-gray-300">Таблица данных</h5>
612
+ <div class="flex space-x-2">
613
+ <button onclick="configureWidget('${widgetId}')" class="text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-white">
614
+ <i class="fas fa-cog"></i>
615
+ </button>
616
+ <button onclick="removeWidget('${widgetId}')" class="text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-white">
617
+ <i class="fas fa-times"></i>
618
+ </button>
619
+ </div>
620
+ </div>
621
+ <div class="overflow-x-auto">
622
+ <table class="w-full text-sm text-left text-gray-500 dark:text-gray-400">
623
+ <thead class="text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400">
624
+ <tr>
625
+ <th scope="col" class="px-4 py-3">Дата</th>
626
+ <th scope="col" class="px-4 py-3">Заказы</th>
627
+ <th scope="col" class="px-4 py-3">Продажи</th>
628
+ <th scope="col" class="px-4 py-3">Возвраты</th>
629
+ </tr>
630
+ </thead>
631
+ <tbody>
632
+ <tr class="bg-white border-b dark:bg-gray-800 dark:border-gray-700">
633
+ <td class="px-4 py-2">2023-05-01</td>
634
+ <td class="px-4 py-2">42</td>
635
+ <td class="px-4 py-2">125,600 ₽</td>
636
+ <td class="px-4 py-2">3</td>
637
+ </tr>
638
+ <tr class="bg-white border-b dark:bg-gray-800 dark:border-gray-700">
639
+ <td class="px-4 py-2">2023-05-02</td>
640
+ <td class="px-4 py-2">38</td>
641
+ <td class="px-4 py-2">112,400 ₽</td>
642
+ <td class="px-4 py-2">2</td>
643
+ </tr>
644
+ <tr class="bg-white border-b dark:bg-gray-800 dark:border-gray-700">
645
+ <td class="px-4 py-2">2023-05-03</td>
646
+ <td class="px-4 py-2">56</td>
647
+ <td class="px-4 py-2">168,900 ₽</td>
648
+ <td class="px-4 py-2">5</td>
649
+ </tr>
650
+ </tbody>
651
+ </table>
652
+ </div>
653
+ </div>
654
+ `;
655
+ break;
656
+
657
+ case 'kpi':
658
+ widgetHtml = `
659
+ <div class="widget bg-white dark:bg-gray-600 rounded-lg shadow p-4" id="${widgetId}" data-widget-type="kpi">
660
+ <div class="flex items-center justify-between mb-3">
661
+ <h5 class="text-sm font-medium text-gray-700 dark:text-gray-300">KPI метрика</h5>
662
+ <div class="flex space-x-2">
663
+ <button onclick="configureWidget('${widgetId}')" class="text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-white">
664
+ <i class="fas fa-cog"></i>
665
+ </button>
666
+ <button onclick="removeWidget('${widgetId}')" class="text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-white">
667
+ <i class="fas fa-times"></i>
668
+ </button>
669
+ </div>
670
+ </div>
671
+ <div class="flex flex-col items-center justify-center py-4">
672
+ <span class="text-3xl font-bold text-purple-600 dark:text-purple-400 mb-1">136</span>
673
+ <span class="text-sm text-gray-500 dark:text-gray-400">Всего заказов</span>
674
+ </div>
675
+ </div>
676
+ `;
677
+ break;
678
+ }
679
+
680
+ // Add widget to report
681
+ reportContent.insertAdjacentHTML('beforeend', widgetHtml);
682
+
683
+ // Initialize chart if needed
684
+ if (widgetType.includes('chart')) {
685
+ setTimeout(() => {
686
+ initializeChart(widgetId);
687
+ }, 100);
688
+ }
689
+ }
690
+
691
+ // Initialize chart
692
+ function initializeChart(widgetId) {
693
+ const widget = document.getElementById(widgetId);
694
+ const chartType = widget.getAttribute('data-widget-type').split('-')[1];
695
+ const canvas = document.getElementById(`${widgetId}-chart`);
696
+ const ctx = canvas.getContext('2d');
697
+
698
+ // Sample data based on chart type
699
+ let chartData = {};
700
+
701
+ if (chartType === 'line') {
702
+ chartData = {
703
+ labels: ['Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс'],
704
+ datasets: [{
705
+ label: 'Продажи',
706
+ data: [12000, 19000, 3000, 5000, 2000, 30000, 45000],
707
+ borderColor: 'rgb(99, 102, 241)',
708
+ backgroundColor: 'rgba(99, 102, 241, 0.1)',
709
+ tension: 0.1,
710
+ fill: true
711
+ }]
712
+ };
713
+ } else if (chartType === 'bar') {
714
+ chartData = {
715
+ labels: ['Электроника', 'Одежда', 'Дом', 'Красота', 'Дети'],
716
+ datasets: [{
717
+ label: 'Продажи',
718
+ data: [120000, 190000, 80000, 50000, 70000],
719
+ backgroundColor: [
720
+ 'rgba(99, 102, 241, 0.7)',
721
+ 'rgba(59, 130, 246, 0.7)',
722
+ 'rgba(16, 185, 129, 0.7)',
723
+ 'rgba(245, 158, 11, 0.7)',
724
+ 'rgba(244, 63, 94, 0.7)'
725
+ ],
726
+ borderColor: [
727
+ 'rgba(99, 102, 241, 1)',
728
+ 'rgba(59, 130, 246, 1)',
729
+ 'rgba(16, 185, 129, 1)',
730
+ 'rgba(245, 158, 11, 1)',
731
+ 'rgba(244, 63, 94, 1)'
732
+ ],
733
+ borderWidth: 1
734
+ }]
735
+ };
736
+ } else if (chartType === 'pie') {
737
+ chartData = {
738
+ labels: ['Электроника', 'Одежда', 'Дом', 'Красота', 'Дети'],
739
+ datasets: [{
740
+ data: [35, 25, 20, 10, 10],
741
+ backgroundColor: [
742
+ 'rgba(99, 102, 241, 0.7)',
743
+ 'rgba(59, 130, 246, 0.7)',
744
+ 'rgba(16, 185, 129, 0.7)',
745
+ 'rgba(245, 158, 11, 0.7)',
746
+ 'rgba(244, 63, 94, 0.7)'
747
+ ],
748
+ borderColor: [
749
+ 'rgba(99, 102, 241, 1)',
750
+ 'rgba(59, 130, 246, 1)',
751
+ 'rgba(16, 185, 129, 1)',
752
+ 'rgba(245, 158, 11, 1)',
753
+ 'rgba(244, 63, 94, 1)'
754
+ ],
755
+ borderWidth: 1
756
+ }]
757
+ };
758
+ }
759
+
760
+ // Create chart
761
+ new Chart(ctx, {
762
+ type: chartType,
763
+ data: chartData,
764
+ options: {
765
+ responsive: true,
766
+ maintainAspectRatio: false,
767
+ plugins: {
768
+ legend: {
769
+ position: 'top',
770
+ },
771
+ tooltip: {
772
+ callbacks: {
773
+ label: function(context) {
774
+ return context.dataset.label + ': ' + context.raw.toLocaleString() + ' ₽';
775
+ }
776
+ }
777
+ }
778
+ },
779
+ scales: chartType === 'line' || chartType === 'bar' ? {
780
+ y: {
781
+ beginAtZero: true,
782
+ ticks: {
783
+ callback: function(value) {
784
+ return value.toLocaleString() + ' ₽';
785
+ }
786
+ }
787
+ }
788
+ } : {}
789
+ }
790
+ });
791
+ }
792
+
793
+ // Remove widget
794
+ function removeWidget(widgetId) {
795
+ if (confirm('Удалить этот виджет?')) {
796
+ document.getElementById(widgetId).remove();
797
+
798
+ // Show empty placeholder if no widgets left
799
+ const reportContent = document.getElementById('report-content');
800
+ if (reportContent.children.length === 0) {
801
+ reportContent.innerHTML = `
802
+ <div class="col-span-2 flex flex-col items-center justify-center py-12 text-center" id="empty-placeholder">
803
+ <i class="fas fa-magic text-4xl text-gray-300 mb-4"></i>
804
+ <h4 class="text-lg font-medium text-gray-500 mb-2">Пустой отчет</h4>
805
+ <p class="text-sm text-gray-400 max-w-md">Перетащите виджеты из панели слева или нажмите "Добавить раздел"</p>
806
+ </div>
807
+ `;
808
+ }
809
+ }
810
+ }
811
+
812
+ // Configure widget
813
+ function configureWidget(widgetId) {
814
+ alert('Открытие настроек виджета ' + widgetId);
815
+ // In a real app, this would open a modal with configuration options
816
+ }
817
+
818
+ // Add section
819
+ function addSection() {
820
+ const reportContent = document.getElementById('report-content');
821
+ const emptyPlaceholder = document.getElementById('empty-placeholder');
822
+
823
+ // Remove empty placeholder if it exists
824
+ if (emptyPlaceholder) {
825
+ emptyPlaceholder.remove();
826
+ }
827
+
828
+ // Add section divider
829
+ reportContent.insertAdjacentHTML('beforeend', `
830
+ <div class="col-span-2 border-t-2 border-gray-200 dark:border-gray-700 my-4 relative">
831
+ <div class="absolute left-1/2 transform -translate-x-1/2 -translate-y-1/2 bg-white dark:bg-gray-800 px-4">
832
+ <span class="text-sm font-medium text-gray-500 dark:text-gray-400">Новый раздел</span>
833
+ </div>
834
+ </div>
835
+ `);
836
+ }
837
+
838
+ // Clear report
839
+ function clearReport() {
840
+ if (confirm('Очистить весь отчет? Это действие нельзя отменить.')) {
841
+ const reportContent = document.getElementById('report-content');
842
+ reportContent.innerHTML = `
843
+ <div class="col-span-2 flex flex-col items-center justify-center py-12 text-center" id="empty-placeholder">
844
+ <i class="fas fa-magic text-4xl text-gray-300 mb-4"></i>
845
+ <h4 class="text-lg font-medium text-gray-500 mb-2">Пустой отчет</h4>
846
+ <p class="text-sm text-gray-400 max-w-md">Перетащите виджеты из панели слева или нажмите "Добавить раздел"</p>
847
+ </div>
848
+ `;
849
+ }
850
+ }
851
+
852
+ // Save report
853
+ function saveReport() {
854
+ const reportName = document.getElementById('report-name').value || 'Без названия';
855
+
856
+ // Simulate saving
857
+ const button = event.currentTarget;
858
+ const originalText = button.innerHTML;
859
+
860
+ button.innerHTML = '<i class="fas fa-spinner fa-spin mr-2"></i> Сохранение...';
861
+ button.disabled = true;
862
+
863
+ setTimeout(() => {
864
+ button.innerHTML = '<i class="fas fa-check-circle mr-2"></i> Сохранено!';
865
+ setTimeout(() => {
866
+ button.innerHTML = originalText;
867
+ button.disabled = false;
868
+
869
+ // Show notification
870
+ showNotification('Отчет "' + reportName + '" успешно сохранен', 'success');
871
+ }, 1000);
872
+ }, 1500);
873
+ }
874
+
875
+ // Export report
876
+ function exportReport() {
877
+ const reportName = document.getElementById('report-name').value || 'wildberries_report';
878
+ const exportType = prompt('Выберите формат экспорта (PDF, Excel, Image):', 'PDF');
879
+
880
+ if (exportType) {
881
+ // Simulate exporting
882
+ const button = event.currentTarget;
883
+ const originalText = button.innerHTML;
884
+
885
+ button.innerHTML = '<i class="fas fa-spinner fa-spin mr-2"></i> Экспорт...';
886
+ button.disabled = true;
887
+
888
+ setTimeout(() => {
889
+ button.innerHTML = '<i class="fas fa-check-circle mr-2"></i> Готово!';
890
+ setTimeout(() => {
891
+ button.innerHTML = originalText;
892
+ button.disabled = false;
893
+
894
+ // Show notification
895
+ showNotification('Отчет экспортирован в формате ' + exportType, 'success');
896
+ }, 1000);
897
+ }, 2000);
898
+ }
899
+ }
900
+
901
+ // Show notification
902
+ function showNotification(message, type) {
903
+ const notification = document.createElement('div');
904
+ notification.className = `fixed bottom-4 right-4 flex items-center p-4 rounded-lg shadow-lg text-white ${type === 'success' ? 'bg-green-500' : 'bg-red-500'}`;
905
+ notification.innerHTML = `
906
+ <i class="fas ${type === 'success' ? 'fa-check-circle' : 'fa-exclamation-circle'} mr-2"></i>
907
+ <span>${message}</span>
908
+ <button onclick="this.parentElement.remove()" class="ml-4">
909
+ <i class="fas fa-times"></i>
910
+ </button>
911
+ `;
912
+
913
+ document.body.appendChild(notification);
914
+
915
+ setTimeout(() => {
916
+ notification.remove();
917
+ }, 5000);
918
+ }
919
+
920
+ // Initialize tooltips
921
+ document.addEventListener('DOMContentLoaded', function() {
922
+ // In a real app, we would initialize tooltips here
923
+ // For example: tippy('[data-tippy-content]');
924
+
925
+ // Load sample data by default
926
+ loadSampleData('sales');
927
+ });
928
+ </script>
929
+ <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
930
+ <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=adasand/wdev" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
931
+ </html>