dblist.ui.js 727 B

123456789101112131415161718192021222324252627
  1. window.manageDb = function(dbName, dbType, namespace)
  2. {
  3. $.post($.createLink('system', 'ajaxDBAuthUrl'), {dbName, namespace, dbType}, function(res)
  4. {
  5. var response = JSON.parse(res);
  6. if(response.result == 'success')
  7. {
  8. window.parent.open(response.data.url, 'Adminer');
  9. }
  10. else
  11. {
  12. zui.Modal.alert(response.message);
  13. }
  14. });
  15. }
  16. window.renderDbList = function (result, {col, row, value})
  17. {
  18. if(col.name === 'status')
  19. {
  20. var statusClass = value == 'normal' ? 'text-success' : 'text-danger';
  21. result[0] = {html: '<span class="' + statusClass + '">' + result[0] + '</span>'};
  22. return result;
  23. }
  24. return result;
  25. }