browse.ui.js 670 B

12345678910111213141516171819202122232425262728
  1. $(function()
  2. {
  3. $.getJSON($.createLink('artifactrepo', 'ajaxUpdateArtifactRepos'), function(data)
  4. {
  5. if(data.hasUpdate) reloadPage();
  6. });
  7. });
  8. window.renderList = function (result, {col, value})
  9. {
  10. if(col.name === 'status')
  11. {
  12. switch(value)
  13. {
  14. case 'online':
  15. var statusClass = 'text-success';
  16. break;
  17. case 'offline':
  18. var statusClass = 'text-danger';
  19. break;
  20. default:
  21. var statusClass = '';
  22. }
  23. result[0] = {html: '<span class="' + statusClass + '">' + result[0] + '</span>'};
  24. }
  25. return result;
  26. }