update.js 689 B

12345678910111213141516171819
  1. import $ from 'jquery';
  2. import request from '../utils/request';
  3. // Dashboard update and Grav update
  4. $('body').on('click', '[data-maintenance-update]', function() {
  5. let element = $(this);
  6. let url = element.data('maintenanceUpdate');
  7. element.attr('disabled', 'disabled').find('> .fa').removeClass('fa-cloud-download').addClass('fa-refresh fa-spin');
  8. request(url, (response) => {
  9. if (response.type === 'updategrav') {
  10. $('[data-gpm-grav]').remove();
  11. $('#footer .grav-version').html(response.version);
  12. }
  13. element.removeAttr('disabled').find('> .fa').removeClass('fa-refresh fa-spin').addClass('fa-cloud-download');
  14. });
  15. });