DmitrMakeev commited on
Commit
65d94dd
·
verified ·
1 Parent(s): 6bda9b5

Update biz_v.html

Browse files
Files changed (1) hide show
  1. biz_v.html +27 -41
biz_v.html CHANGED
@@ -3,7 +3,8 @@
3
  <head>
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;
@@ -36,53 +37,39 @@
36
  button:hover {
37
  background-color: #388E3C;
38
  }
39
- .input-row {
40
- display: flex;
41
- justify-content: center;
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, #secondResponseArea {
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
  <button id="sendGetRequestButton">Send GET Request</button>
84
- <textarea id="secondResponseArea" rows="10" cols="50" readonly></textarea>
85
 
 
86
  <script>
87
  document.getElementById('sendRequestButton').addEventListener('click', function() {
88
  const token = document.getElementById('tokenInput').value;
@@ -99,18 +86,17 @@
99
  .then(response => response.json())
100
  .then(data => {
101
  console.log('JSON Response:', data);
102
- document.getElementById('responseArea').value = JSON.stringify(data, null, 2);
103
  createDropdown(data);
104
  })
105
  .catch(error => {
106
  console.error('Error:', error);
107
- document.getElementById('responseArea').value = 'Error: ' + error.message;
108
  });
109
  });
110
 
111
  function createDropdown(data) {
112
  const container = document.getElementById('dropdown-container');
113
- container.innerHTML = ''; // Очистить контейнер перед созданием нового списка
114
  const select = document.createElement('select');
115
  select.id = 'dropdown';
116
  data.forEach(item => {
@@ -120,7 +106,7 @@
120
  select.appendChild(option);
121
  });
122
  container.appendChild(select);
123
- // Добавление обработчика для кнопки отправки GET-запроса
124
  document.getElementById('sendGetRequestButton').addEventListener('click', function() {
125
  const selectedValue = document.getElementById('dropdown').value;
126
  const token = document.getElementById('tokenInput').value;
@@ -131,11 +117,11 @@
131
  .then(response => response.json())
132
  .then(data => {
133
  console.log('GET Response:', data);
134
- document.getElementById('secondResponseArea').value = JSON.stringify(data, null, 2);
135
  })
136
  .catch(error => {
137
  console.error('Error:', error);
138
- document.getElementById('secondResponseArea').value = 'Error: ' + error.message;
139
  });
140
  });
141
  }
 
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>API Request</title>
7
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css">
8
  <style>
9
  body {
10
  font-family: Arial, sans-serif;
 
37
  button:hover {
38
  background-color: #388E3C;
39
  }
40
+ select {
 
 
 
 
 
 
41
  padding: 10px;
42
  font-size: 16px;
43
  border: 1px solid #ccc;
44
  border-radius: 5px;
45
+ margin: 10px;
 
 
 
 
46
  }
47
  </style>
48
  </head>
49
  <body>
50
  <h1>Комменты Бизон 365</h1>
51
+ <label for="tokenInput">Enter Token:</label>
52
+ <input type="text" id="tokenInput" placeholder="Your Token">
53
+
54
+ <label for="dateSelect">Select Date:</label>
55
+ <select id="dateSelect">
56
+ <option value="2021-01-01T00:00:00">2021-01-01</option>
57
+ <option value="2022-01-01T00:00:00">2022-01-01</option>
58
+ <option value="2023-01-01T00:00:00">2023-01-01</option>
59
+ <option value="2024-01-01T00:00:00">2024-01-01</option>
60
+ </select>
61
+
62
+ <label for="typeSelect">Type:</label>
63
+ <select id="typeSelect">
64
+ <option value="LiveWebinars">Live Webinars</option>
65
+ <option value="AutoWebinars">Auto Webinars</option>
66
+ </select>
67
+
 
 
 
68
  <button id="sendRequestButton">Send Request</button>
 
69
  <div id="dropdown-container"></div>
70
  <button id="sendGetRequestButton">Send GET Request</button>
 
71
 
72
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js"></script>
73
  <script>
74
  document.getElementById('sendRequestButton').addEventListener('click', function() {
75
  const token = document.getElementById('tokenInput').value;
 
86
  .then(response => response.json())
87
  .then(data => {
88
  console.log('JSON Response:', data);
 
89
  createDropdown(data);
90
  })
91
  .catch(error => {
92
  console.error('Error:', error);
93
+ toastr.error('Error: ' + error.message);
94
  });
95
  });
96
 
97
  function createDropdown(data) {
98
  const container = document.getElementById('dropdown-container');
99
+ container.innerHTML = ''; // Очистить контейнер перед добавлением нового списка
100
  const select = document.createElement('select');
101
  select.id = 'dropdown';
102
  data.forEach(item => {
 
106
  select.appendChild(option);
107
  });
108
  container.appendChild(select);
109
+
110
  document.getElementById('sendGetRequestButton').addEventListener('click', function() {
111
  const selectedValue = document.getElementById('dropdown').value;
112
  const token = document.getElementById('tokenInput').value;
 
117
  .then(response => response.json())
118
  .then(data => {
119
  console.log('GET Response:', data);
120
+ toastr.success('User data saved successfully');
121
  })
122
  .catch(error => {
123
  console.error('Error:', error);
124
+ toastr.error('Error: ' + error.message);
125
  });
126
  });
127
  }