|
5 | 5 | * Handles events and dynamic updates for server-rendered HTML |
6 | 6 | */ |
7 | 7 |
|
| 8 | +import { generateUrl } from '@nextcloud/router' |
| 9 | + |
8 | 10 | (function() { |
9 | 11 | 'use strict' |
10 | 12 |
|
|
152 | 154 | * |
153 | 155 | */ |
154 | 156 | function loadConnectedUsersCount() { |
155 | | - fetch(OC.generateUrl('/apps/integration_itop/admin-config'), { |
| 157 | + fetch(generateUrl('/apps/integration_itop/admin-config'), { |
156 | 158 | method: 'GET', |
157 | 159 | headers: { |
158 | 160 | requesttoken: OC.requestToken, |
|
221 | 223 | requestData.values.application_token = token |
222 | 224 | } |
223 | 225 |
|
224 | | - fetch(OC.generateUrl('/apps/integration_itop/admin-config'), { |
| 226 | + fetch(generateUrl('/apps/integration_itop/admin-config'), { |
225 | 227 | method: 'PUT', |
226 | 228 | headers: { |
227 | 229 | 'Content-Type': 'application/json', |
|
303 | 305 | statusElement.textContent = textTesting |
304 | 306 | if (statusCard) statusCard.className = 'status-card connection-status testing' |
305 | 307 |
|
306 | | - fetch(OC.generateUrl('/apps/integration_itop/admin-config/test'), { |
| 308 | + fetch(generateUrl('/apps/integration_itop/admin-config/test'), { |
307 | 309 | method: 'POST', |
308 | 310 | headers: { |
309 | 311 | 'Content-Type': 'application/json', |
|
356 | 358 | const originalText = testButton.innerHTML |
357 | 359 | testButton.innerHTML = '<span class="btn-icon">⏳</span> ' + t('integration_itop', 'Testing...') |
358 | 360 |
|
359 | | - fetch(OC.generateUrl('/apps/integration_itop/admin-config/test-token'), { |
| 361 | + fetch(generateUrl('/apps/integration_itop/admin-config/test-token'), { |
360 | 362 | method: 'POST', |
361 | 363 | headers: { |
362 | 364 | 'Content-Type': 'application/json', |
|
399 | 401 | const originalText = saveButton.innerHTML |
400 | 402 | saveButton.innerHTML = '<span class="btn-icon">⏳</span> ' + t('integration_itop', 'Saving...') |
401 | 403 |
|
402 | | - fetch(OC.generateUrl('/apps/integration_itop/admin-config'), { |
| 404 | + fetch(generateUrl('/apps/integration_itop/admin-config'), { |
403 | 405 | method: 'PUT', |
404 | 406 | headers: { |
405 | 407 | 'Content-Type': 'application/json', |
|
437 | 439 | const originalText = clearButton.innerHTML |
438 | 440 | clearButton.innerHTML = '<span class="btn-icon">⏳</span> ' + t('integration_itop', 'Clearing...') |
439 | 441 |
|
440 | | - fetch(OC.generateUrl('/apps/integration_itop/clear-cache'), { |
| 442 | + fetch(generateUrl('/apps/integration_itop/clear-cache'), { |
441 | 443 | method: 'DELETE', |
442 | 444 | headers: { |
443 | 445 | requesttoken: OC.requestToken, |
|
477 | 479 | const originalText = saveButton.innerHTML |
478 | 480 | saveButton.innerHTML = '<span class="btn-icon">⏳</span> ' + t('integration_itop', 'Saving...') |
479 | 481 |
|
480 | | - fetch(OC.generateUrl('/apps/integration_itop/admin-config'), { |
| 482 | + fetch(generateUrl('/apps/integration_itop/admin-config'), { |
481 | 483 | method: 'PUT', |
482 | 484 | headers: { |
483 | 485 | 'Content-Type': 'application/json', |
|
544 | 546 | */ |
545 | 547 | function checkAppVersion(currentVersion) { |
546 | 548 |
|
547 | | - fetch(OC.generateUrl('/apps/integration_itop/version-check'), { |
| 549 | + fetch(generateUrl('/apps/integration_itop/version-check'), { |
548 | 550 | method: 'GET', |
549 | 551 | headers: { |
550 | 552 | requesttoken: OC.requestToken, |
|
0 commit comments