DmitrMakeev commited on
Commit
f9d7605
·
verified ·
1 Parent(s): f47f85a

Update biz_v.html

Browse files
Files changed (1) hide show
  1. biz_v.html +56 -79
biz_v.html CHANGED
@@ -4,6 +4,7 @@
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
  <title>Комменты Бизон 365</title>
 
7
  <style>
8
  body {
9
  font-family: Arial, sans-serif;
@@ -21,20 +22,23 @@
21
  }
22
  .input-row {
23
  display: flex;
24
- flex-direction: column;
25
- align-items: center;
26
  gap: 10px;
27
  margin-top: 20px;
 
28
  }
29
- .input-row label, .input-row input, .input-row select, .input-row textarea {
30
- width: 80%;
31
  padding: 10px;
32
  font-size: 16px;
33
  border: 1px solid #ccc;
34
  border-radius: 5px;
35
  }
36
- .input-row input[type="number"] {
37
- max-width: 100px;
 
 
 
 
38
  }
39
  #sendRequestButton, #sendGetRequestButton {
40
  color: white;
@@ -44,32 +48,17 @@
44
  padding: 10px 20px;
45
  font-size: 16px;
46
  border-radius: 5px;
47
- margin-top: 10px;
48
  }
49
  #sendRequestButton:hover, #sendGetRequestButton:hover {
50
  background-color: #388E3C;
51
  }
52
- .dropdown-container {
53
  margin-top: 20px;
54
- width: 80%;
55
- display: flex;
56
- justify-content: center;
57
- }
58
- select {
59
- background-color: #e8f5e9; /* Зеленый фон для выпадающего списка */
60
- }
61
- input[type="datetime-local"], input[type="date"] {
62
- background-color: #e8f5e9; /* Зеленый фон для выбора даты и времени */
63
- border: 1px solid #4CAF50; /* Зеленая рамка */
64
- color: #4CAF50; /* Зеленый текст */
65
  }
66
- input[type="datetime-local"]::-webkit-datetime-edit,
67
- input[type="date"]::-webkit-datetime-edit {
68
- color: #4CAF50; /* Зеленый текст внутри поля */
69
- }
70
- input[type="datetime-local"]::-webkit-calendar-picker-indicator,
71
- input[type="date"]::-webkit-calendar-picker-indicator {
72
- filter: invert(45%) sepia(20%) saturate(3500%) hue-rotate(90deg) brightness(95%) contrast(90%);
73
  }
74
  </style>
75
  </head>
@@ -80,38 +69,20 @@
80
  <label for="tokenInput">Enter Token:</label>
81
  <input type="text" id="tokenInput" placeholder="Your Token">
82
  </div>
83
-
84
  <div class="input-row">
85
- <label for="dateSelect">Select Date:</label>
86
- <select id="dateSelect">
87
- <!-- Даты от 1 января 2000 года до 31 декабря 2020 года -->
88
- <option value="2000-01-01">2000-01-01</option>
89
- <option value="2001-01-01">2001-01-01</option>
90
- <option value="2002-01-01">2002-01-01</option>
91
- <option value="2003-01-01">2003-01-01</option>
92
- <option value="2004-01-01">2004-01-01</option>
93
- <option value="2005-01-01">2005-01-01</option>
94
- <option value="2006-01-01">2006-01-01</option>
95
- <option value="2007-01-01">2007-01-01</option>
96
- <option value="2008-01-01">2008-01-01</option>
97
- <option value="2009-01-01">2009-01-01</option>
98
- <option value="2010-01-01">2010-01-01</option>
99
- <option value="2011-01-01">2011-01-01</option>
100
- <option value="2012-01-01">2012-01-01</option>
101
- <option value="2013-01-01">2013-01-01</option>
102
- <option value="2014-01-01">2014-01-01</option>
103
- <option value="2015-01-01">2015-01-01</option>
104
- <option value="2016-01-01">2016-01-01</option>
105
- <option value="2017-01-01">2017-01-01</option>
106
- <option value="2018-01-01">2018-01-01</option>
107
- <option value="2019-01-01">2019-01-01</option>
108
- <option value="2020-01-01">2020-01-01</option>
109
- </select>
110
  </div>
111
 
112
  <div class="input-row">
113
  <label for="limitInput">Limit:</label>
114
- <input type="number" id="limitInput" value="20" min="1" max="100">
115
  </div>
116
 
117
  <div class="input-row">
@@ -122,38 +93,50 @@
122
  </select>
123
  </div>
124
 
125
- <div class="input-row">
126
- <button id="sendRequestButton">Send Request</button>
127
- </div>
128
 
129
- <div class="input-row">
130
- <textarea id="responseArea" rows="10" cols="50" readonly></textarea>
131
- </div>
132
 
133
- <div class="dropdown-container" id="dropdown-container"></div>
134
 
135
- <div class="input-row">
136
- <button id="sendGetRequestButton">Send GET Request</button>
137
- </div>
138
 
139
- <div class="input-row">
140
- <textarea id="secondResponseArea" rows="10" cols="50" readonly></textarea>
141
- </div>
142
 
 
 
143
  <script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
144
  document.getElementById('sendRequestButton').addEventListener('click', function() {
145
  const token = document.getElementById('tokenInput').value;
146
- const selectedDate = document.getElementById('dateSelect').value;
 
147
  const limit = document.getElementById('limitInput').value;
148
  const type = document.getElementById('typeSelect').value;
149
-
150
  const url = '/send_request';
151
  const params = new URLSearchParams();
152
  params.append('token', token);
153
- params.append('minDate', selectedDate); // Используем выбранную дату как минимальную
 
154
  params.append('limit', limit);
155
  params.append('type', type);
156
-
157
  fetch(url, {
158
  method: 'POST',
159
  headers: {
@@ -178,7 +161,6 @@
178
  container.innerHTML = ''; // Очистить контейнер перед добавлением нового списка
179
  const select = document.createElement('select');
180
  select.id = 'dropdown';
181
- select.style.backgroundColor = '#e8f5e9'; // Зеленый фон для выпадающего списка
182
  data.forEach(item => {
183
  const option = document.createElement('option');
184
  option.value = item;
@@ -189,14 +171,9 @@
189
  }
190
 
191
  document.getElementById('sendGetRequestButton').addEventListener('click', function() {
192
- const selectedValue = document.getElementById('dropdown')?.value;
193
- if (!selectedValue) {
194
- alert('Please select a webinar from the dropdown.');
195
- return;
196
- }
197
  const token = document.getElementById('tokenInput').value;
198
- const getUrl = `/send_get_request?token=${encodeURIComponent(token)}&webinarId=${encodeURIComponent(selectedValue)}`;
199
-
200
  fetch(getUrl, {
201
  method: 'GET'
202
  })
@@ -212,4 +189,4 @@
212
  });
213
  </script>
214
  </body>
215
- </html>
 
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
  <title>Комменты Бизон 365</title>
7
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pikaday/1.8.0/css/pikaday.min.css">
8
  <style>
9
  body {
10
  font-family: Arial, sans-serif;
 
22
  }
23
  .input-row {
24
  display: flex;
25
+ justify-content: center;
 
26
  gap: 10px;
27
  margin-top: 20px;
28
+ flex-wrap: wrap;
29
  }
30
+ .input-row input, .input-row select, .input-row textarea {
 
31
  padding: 10px;
32
  font-size: 16px;
33
  border: 1px solid #ccc;
34
  border-radius: 5px;
35
  }
36
+ #dateSelect, #maxDateSelect {
37
+ width: 200px;
38
+ margin: 5px;
39
+ }
40
+ #limitInput {
41
+ width: 80px;
42
  }
43
  #sendRequestButton, #sendGetRequestButton {
44
  color: white;
 
48
  padding: 10px 20px;
49
  font-size: 16px;
50
  border-radius: 5px;
51
+ margin-top: 20px;
52
  }
53
  #sendRequestButton:hover, #sendGetRequestButton:hover {
54
  background-color: #388E3C;
55
  }
56
+ #dropdown-container {
57
  margin-top: 20px;
 
 
 
 
 
 
 
 
 
 
 
58
  }
59
+ textarea {
60
+ width: 80%;
61
+ margin-top: 20px;
 
 
 
 
62
  }
63
  </style>
64
  </head>
 
69
  <label for="tokenInput">Enter Token:</label>
70
  <input type="text" id="tokenInput" placeholder="Your Token">
71
  </div>
72
+
73
  <div class="input-row">
74
+ <label for="dateSelect">Select Min Date:</label>
75
+ <input type="text" id="dateSelect" placeholder="Select Min Date">
76
+ </div>
77
+
78
+ <div class="input-row">
79
+ <label for="maxDateSelect">Select Max Date:</label>
80
+ <input type="text" id="maxDateSelect" placeholder="Select Max Date">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  </div>
82
 
83
  <div class="input-row">
84
  <label for="limitInput">Limit:</label>
85
+ <input type="number" id="limitInput" placeholder="20">
86
  </div>
87
 
88
  <div class="input-row">
 
93
  </select>
94
  </div>
95
 
96
+ <button id="sendRequestButton">Send Request</button>
 
 
97
 
98
+ <textarea id="responseArea" rows="10" readonly></textarea>
 
 
99
 
100
+ <div id="dropdown-container"></div>
101
 
102
+ <button id="sendGetRequestButton">Send GET Request</button>
 
 
103
 
104
+ <textarea id="secondResponseArea" rows="10" readonly></textarea>
 
 
105
 
106
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js"></script>
107
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/pikaday/1.8.0/pikaday.min.js"></script>
108
  <script>
109
+ document.addEventListener('DOMContentLoaded', function() {
110
+ const minDatePicker = new Pikaday({
111
+ field: document.getElementById('dateSelect'),
112
+ format: 'YYYY-MM-DD',
113
+ onSelect: function(date) {
114
+ console.log('Min Date Selected:', date.toISOString());
115
+ }
116
+ });
117
+
118
+ const maxDatePicker = new Pikaday({
119
+ field: document.getElementById('maxDateSelect'),
120
+ format: 'YYYY-MM-DD',
121
+ onSelect: function(date) {
122
+ console.log('Max Date Selected:', date.toISOString());
123
+ }
124
+ });
125
+ });
126
+
127
  document.getElementById('sendRequestButton').addEventListener('click', function() {
128
  const token = document.getElementById('tokenInput').value;
129
+ const minDate = document.getElementById('dateSelect').value;
130
+ const maxDate = document.getElementById('maxDateSelect').value;
131
  const limit = document.getElementById('limitInput').value;
132
  const type = document.getElementById('typeSelect').value;
 
133
  const url = '/send_request';
134
  const params = new URLSearchParams();
135
  params.append('token', token);
136
+ params.append('minDate', minDate);
137
+ params.append('maxDate', maxDate);
138
  params.append('limit', limit);
139
  params.append('type', type);
 
140
  fetch(url, {
141
  method: 'POST',
142
  headers: {
 
161
  container.innerHTML = ''; // Очистить контейнер перед добавлением нового списка
162
  const select = document.createElement('select');
163
  select.id = 'dropdown';
 
164
  data.forEach(item => {
165
  const option = document.createElement('option');
166
  option.value = item;
 
171
  }
172
 
173
  document.getElementById('sendGetRequestButton').addEventListener('click', function() {
174
+ const selectedValue = document.getElementById('dropdown').value;
 
 
 
 
175
  const token = document.getElementById('tokenInput').value;
176
+ const getUrl = '/send_get_request?token=' + encodeURIComponent(token) + '&webinarId=' + encodeURIComponent(selectedValue);
 
177
  fetch(getUrl, {
178
  method: 'GET'
179
  })
 
189
  });
190
  </script>
191
  </body>
192
+