give_auth.js 700 B

123456789101112131415161718192021222324252627282930313233
  1. "use strict";
  2. function opennamu_give_auth() {
  3. const url = window.location.pathname;
  4. const url_split = url.split('/');
  5. let mode = 0;
  6. if(url_split.length === 3) {
  7. if(url_split[2] === 'auth_total') {
  8. mode = 1;
  9. }
  10. }
  11. let html_data = '';
  12. if(mode === 0) {
  13. if(url_split.length === 3) {
  14. html_data += '<textarea></textarea>';
  15. }
  16. } else {
  17. }
  18. fetch('/api/v2/list/auth').then(function(res) {
  19. return res.json();
  20. }).then(function(data) {
  21. let data_list = data["data"];
  22. console.log(data_list);
  23. document.getElementById('opennamu_give_auth').innerHTML = html_data;
  24. });
  25. }