DmitrMakeev commited on
Commit
151a839
·
verified ·
1 Parent(s): fef9f64

Update settings.html

Browse files
Files changed (1) hide show
  1. settings.html +6 -4
settings.html CHANGED
@@ -52,7 +52,7 @@
52
 
53
  <form id="settingsForm">
54
  <label for="api_key_sys">api_key_sys:</label>
55
- <input type="text" id="api_key_sys" name="api_key_sys"><br><br>
56
 
57
  <label for="crypto_key_sys">crypto_key_sys:</label>
58
  <input type="text" id="crypto_key_sys" name="crypto_key_sys"><br><br>
@@ -116,9 +116,6 @@
116
  }
117
  });
118
 
119
- // Сохраняем ключ в локальное хранилище
120
- localStorage.setItem('api_key_sys', data.api_key_sys);
121
-
122
  fetch('/save_settings', {
123
  method: 'POST',
124
  headers: {
@@ -133,6 +130,11 @@
133
  .catch(error => console.error('Error:', error));
134
  }
135
 
 
 
 
 
 
136
  window.onload = loadSettings;
137
  </script>
138
  </body>
 
52
 
53
  <form id="settingsForm">
54
  <label for="api_key_sys">api_key_sys:</label>
55
+ <input type="text" id="api_key_sys" name="api_key_sys" onblur="saveApiKeySys()"><br><br>
56
 
57
  <label for="crypto_key_sys">crypto_key_sys:</label>
58
  <input type="text" id="crypto_key_sys" name="crypto_key_sys"><br><br>
 
116
  }
117
  });
118
 
 
 
 
119
  fetch('/save_settings', {
120
  method: 'POST',
121
  headers: {
 
130
  .catch(error => console.error('Error:', error));
131
  }
132
 
133
+ function saveApiKeySys() {
134
+ const apiKeySys = document.getElementById('api_key_sys').value;
135
+ localStorage.setItem('api_key_sys', apiKeySys);
136
+ }
137
+
138
  window.onload = loadSettings;
139
  </script>
140
  </body>