github.com/siglens/siglens@v0.0.0-20240328180423-f7ce9ae441ed/static/js/application-version.js (about)

     1  
     2  
     3  $(document).ready(function () {
     4      if (Cookies.get('theme')) {
     5          theme = Cookies.get('theme');
     6          $('body').attr('data-theme', theme);
     7          
     8      }
     9      $('.theme-btn').on('click', themePickerHandler);
    10      fetchVersionInfo();
    11      {{ .Button1Function }}
    12  });
    13  
    14  function fetchVersionInfo() {
    15  
    16      $.ajax({
    17          method: "GET",
    18          url: "/api/version/info",
    19          headers: {
    20              'Content-Type': 'application/json; charset=utf-8',
    21              'Accept': '*/*'
    22          },
    23          dataType: 'json',
    24          crossDomain: true,
    25      }).then(function (res) {
    26          const versionInfo = 'SigLens Version: ' + res.version;
    27          $('#versionInfo').text(versionInfo);
    28      }).fail(function (jqXHR, textStatus, errorThrown) {
    29          console.error('Error fetching version:', textStatus, errorThrown);
    30          $('#versionInfo').text('Error loading version');
    31      });
    32  }
    33  
    34