DmitrMakeev commited on
Commit
7a01815
1 Parent(s): a471f43

Update biz_v.html

Browse files
Files changed (1) hide show
  1. biz_v.html +35 -66
biz_v.html CHANGED
@@ -18,6 +18,23 @@
18
  padding: 20px;
19
  margin: 0;
20
  border-bottom: 2px solid #388E3C;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  }
22
  .input-row {
23
  display: flex;
@@ -25,86 +42,57 @@
25
  gap: 10px;
26
  margin-top: 20px;
27
  }
28
- .input-row input, .input-row select, .input-row button {
29
  padding: 10px;
30
  font-size: 16px;
31
  border: 1px solid #ccc;
32
  border-radius: 5px;
33
  }
34
- #sendRequestButton {
35
- color: white;
36
- background-color: #4CAF50;
37
- border: none;
38
- cursor: pointer;
39
- }
40
- #sendRequestButton:hover {
41
- background-color: #388E3C;
42
- }
43
- textarea {
44
  width: 80%;
45
- margin-top: 20px;
46
  padding: 10px;
47
- font-size: 16px;
48
- border: 1px solid #ccc;
49
- border-radius: 5px;
50
  }
51
  </style>
52
  </head>
53
  <body>
54
  <h1>Комменты Бизон 365</h1>
55
-
56
  <div class="input-row">
57
  <label for="tokenInput">Enter Token:</label>
58
  <input type="text" id="tokenInput" placeholder="Your Token">
59
  </div>
60
-
61
  <div class="input-row">
62
- <label for="minDate">Select Min Date:</label>
63
- <input type="date" id="minDate">
64
- <label for="maxDate">Select Max Date:</label>
65
- <input type="date" id="maxDate">
66
- </div>
67
-
68
- <div class="input-row">
69
- <label for="limitInput">Limit:</label>
70
- <input type="number" id="limitInput" placeholder="20" max="100">
71
- <label for="typeSelect">Type:</label>
72
  <select id="typeSelect">
73
  <option value="LiveWebinars">Live Webinars</option>
74
  <option value="AutoWebinars">Auto Webinars</option>
75
  </select>
76
  </div>
77
-
 
 
 
 
 
 
 
 
78
  <button id="sendRequestButton">Send Request</button>
79
-
80
  <textarea id="responseArea" rows="10" cols="50" readonly></textarea>
81
-
82
  <div id="dropdown-container"></div>
83
 
84
- <button id="sendGetRequestButton">Send GET Request</button>
85
-
86
- <textarea id="secondResponseArea" rows="10" cols="50" readonly></textarea>
87
-
88
  <script>
89
  document.getElementById('sendRequestButton').addEventListener('click', function() {
90
  const token = document.getElementById('tokenInput').value;
91
- const minDate = document.getElementById('minDate').value;
92
- const maxDate = document.getElementById('maxDate').value;
93
- const limit = document.getElementById('limitInput').value;
94
  const type = document.getElementById('typeSelect').value;
95
  const url = '/send_request';
96
- const params = new URLSearchParams();
97
- params.append('token', token);
98
- params.append('minDate', minDate);
99
- params.append('maxDate', maxDate);
100
- params.append('limit', limit);
101
- params.append('type', type);
102
  fetch(url, {
103
  method: 'POST',
104
  headers: {
105
  'Content-Type': 'application/x-www-form-urlencoded'
106
  },
107
- body: params.toString()
108
  })
109
  .then(response => response.json())
110
  .then(data => {
@@ -120,36 +108,17 @@
120
 
121
  function createDropdown(data) {
122
  const container = document.getElementById('dropdown-container');
123
- container.innerHTML = ''; // Очистить контейнер перед добавлением нового списка
124
  const select = document.createElement('select');
125
  select.id = 'dropdown';
126
  data.forEach(item => {
127
  const option = document.createElement('option');
128
- option.value = item.id;
129
- option.text = item.name;
130
  select.appendChild(option);
131
  });
132
  container.appendChild(select);
133
  }
134
-
135
- document.getElementById('sendGetRequestButton').addEventListener('click', function() {
136
- const selectedValue = document.getElementById('dropdown').value;
137
- const token = document.getElementById('tokenInput').value;
138
- const getUrl = '/send_get_request?token=' + encodeURIComponent(token) + '&webinarId=' + encodeURIComponent(selectedValue);
139
- fetch(getUrl, {
140
- method: 'GET'
141
- })
142
- .then(response => response.json())
143
- .then(data => {
144
- console.log('GET Response:', data);
145
- document.getElementById('secondResponseArea').value = JSON.stringify(data, null, 2);
146
- })
147
- .catch(error => {
148
- console.error('Error:', error);
149
- document.getElementById('secondResponseArea').value = 'Error: ' + error.message;
150
- });
151
- });
152
  </script>
153
  </body>
154
  </html>
155
-
 
18
  padding: 20px;
19
  margin: 0;
20
  border-bottom: 2px solid #388E3C;
21
+ font-size: 28px;
22
+ text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
23
+ }
24
+ button {
25
+ display: block;
26
+ margin: 20px auto;
27
+ color: white;
28
+ background-color: #4CAF50;
29
+ border: none;
30
+ cursor: pointer;
31
+ padding: 10px 20px;
32
+ font-size: 16px;
33
+ border-radius: 5px;
34
+ transition: background-color 0.3s ease;
35
+ }
36
+ button:hover {
37
+ background-color: #388E3C;
38
  }
39
  .input-row {
40
  display: flex;
 
42
  gap: 10px;
43
  margin-top: 20px;
44
  }
45
+ .input-row input, .input-row select {
46
  padding: 10px;
47
  font-size: 16px;
48
  border: 1px solid #ccc;
49
  border-radius: 5px;
50
  }
51
+ #responseArea {
 
 
 
 
 
 
 
 
 
52
  width: 80%;
53
+ margin: 20px auto;
54
  padding: 10px;
 
 
 
55
  }
56
  </style>
57
  </head>
58
  <body>
59
  <h1>Комменты Бизон 365</h1>
 
60
  <div class="input-row">
61
  <label for="tokenInput">Enter Token:</label>
62
  <input type="text" id="tokenInput" placeholder="Your Token">
63
  </div>
 
64
  <div class="input-row">
65
+ <label for="typeSelect">Select Type:</label>
 
 
 
 
 
 
 
 
 
66
  <select id="typeSelect">
67
  <option value="LiveWebinars">Live Webinars</option>
68
  <option value="AutoWebinars">Auto Webinars</option>
69
  </select>
70
  </div>
71
+ <div class="input-row">
72
+ <label for="dateSelect">Select Date:</label>
73
+ <select id="dateSelect">
74
+ <option value="2021-01-01T00:00:00">2021-01-01</option>
75
+ <option value="2022-01-01T00:00:00">2022-01-01</option>
76
+ <option value="2023-01-01T00:00:00">2023-01-01</option>
77
+ <option value="2024-01-01T00:00:00">2024-01-01</option>
78
+ </select>
79
+ </div>
80
  <button id="sendRequestButton">Send Request</button>
 
81
  <textarea id="responseArea" rows="10" cols="50" readonly></textarea>
 
82
  <div id="dropdown-container"></div>
83
 
 
 
 
 
84
  <script>
85
  document.getElementById('sendRequestButton').addEventListener('click', function() {
86
  const token = document.getElementById('tokenInput').value;
87
+ const minDate = document.getElementById('dateSelect').value;
 
 
88
  const type = document.getElementById('typeSelect').value;
89
  const url = '/send_request';
 
 
 
 
 
 
90
  fetch(url, {
91
  method: 'POST',
92
  headers: {
93
  'Content-Type': 'application/x-www-form-urlencoded'
94
  },
95
+ body: 'token=' + encodeURIComponent(token) + '&minDate=' + encodeURIComponent(minDate) + '&type=' + encodeURIComponent(type)
96
  })
97
  .then(response => response.json())
98
  .then(data => {
 
108
 
109
  function createDropdown(data) {
110
  const container = document.getElementById('dropdown-container');
111
+ container.innerHTML = ''; // Очистить контейнер перед созданием нового списка
112
  const select = document.createElement('select');
113
  select.id = 'dropdown';
114
  data.forEach(item => {
115
  const option = document.createElement('option');
116
+ option.value = item;
117
+ option.text = item;
118
  select.appendChild(option);
119
  });
120
  container.appendChild(select);
121
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
122
  </script>
123
  </body>
124
  </html>