Built files from Bizgaze WebServer
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

threadtable.js 5.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. var Unibase;
  2. (function (Unibase) {
  3. let Platform;
  4. (function (Platform) {
  5. let Common;
  6. (function (Common) {
  7. let Components;
  8. (function (Components) {
  9. class ThreadTable extends Platform.Core.BaseComponent {
  10. cssFiles() {
  11. return [];
  12. }
  13. jsFiles() {
  14. return ["platform/apps/managers/threadtable.js"];
  15. }
  16. html(id, containerid) {
  17. return '';
  18. }
  19. load(id, containerid, callback) {
  20. }
  21. init(containerid) {
  22. this.myList;
  23. }
  24. getThreads(time) {
  25. var instance = this;
  26. var delay = time;
  27. if (delay == 0) {
  28. delay = 5;
  29. }
  30. delay = delay * 1000;
  31. var currentdate = new Date();
  32. var _delay = delay;
  33. var datetime = currentdate.getDate() + "/"
  34. + (currentdate.getMonth() + 1) + "/"
  35. + currentdate.getFullYear() + " @ "
  36. + currentdate.getHours() + ":"
  37. + currentdate.getMinutes() + ":"
  38. + currentdate.getSeconds();
  39. $.ajax({
  40. type: 'GET', url: 'http://localhost:3088/appperformance/threads', success: function (data) {
  41. debugger;
  42. Unibase.Platform.Common.Components.ThreadTable.Instance().addAllColumnHeaders(data, datetime, _delay);
  43. }
  44. });
  45. }
  46. ;
  47. loadForm(FormId, Pk_Value, AppConfigurationId, Callback, ElementId) {
  48. }
  49. buildHtmlTable(columns, datetime, time) {
  50. var dt = datetime;
  51. var time = time;
  52. let html = '<tr>';
  53. html += `<td>${dt}</td>`;
  54. for (var colIndex = 0; colIndex < columns.length; colIndex++) {
  55. var cellValue = columns[colIndex];
  56. if (cellValue == null) {
  57. cellValue = "";
  58. }
  59. html += `<td>${cellValue}</td>`;
  60. }
  61. html += '</tr>';
  62. $("#bizgaze_body .t-body").prepend(html);
  63. Unibase.Platform.Helpers.NavigationHelper.Instance().hideLoading();
  64. setTimeout(function () {
  65. Unibase.Platform.Common.Components.ThreadTable.Instance().addVals(time);
  66. }, time);
  67. }
  68. addVals(time) {
  69. var currentdate = new Date();
  70. var time = time;
  71. var datetime = currentdate.getDate() + "/"
  72. + (currentdate.getMonth() + 1) + "/"
  73. + currentdate.getFullYear() + " @ "
  74. + currentdate.getHours() + ":"
  75. + currentdate.getMinutes() + ":"
  76. + currentdate.getSeconds();
  77. $.ajax({
  78. type: 'GET', url: 'http://localhost:3088/appperformance/threads', success: function (data) {
  79. debugger;
  80. const values = Object.keys(data).map(key => data[key]);
  81. Unibase.Platform.Common.Components.ThreadTable.Instance().buildHtmlTable(values, datetime, time);
  82. }
  83. });
  84. }
  85. addAllColumnHeaders(arr, datetime, time) {
  86. var columnSet = [];
  87. var time = time;
  88. const values = Object.keys(arr).map(key => arr[key]);
  89. var headerTr$ = $('<tr/>');
  90. this.myList = Object.getOwnPropertyNames(arr);
  91. let html = '<div class="px-20 py-20 biz-custom-scrollbar " style="overflow:auto;height:97vh;width:100%"><table class="table table-bordered table-striped " border="1" cellpadding="0"><thead> <tr>', loophtml = '';
  92. html += `<th>Time</th>`;
  93. for (var i = 0; i < this.myList.length; i++) {
  94. html += `<th>${this.myList[i]}</th>`;
  95. }
  96. html += '</thead><tbody class="t-body " style="overflow:auto"></tbody></table></div>';
  97. $("#bizgaze_body").append(html);
  98. Unibase.Platform.Common.Components.ThreadTable.Instance().buildHtmlTable(values, datetime, time);
  99. }
  100. static Instance() {
  101. if (this.instance === undefined) {
  102. this.instance = new ThreadTable();
  103. }
  104. return this.instance;
  105. }
  106. }
  107. Components.ThreadTable = ThreadTable;
  108. })(Components = Common.Components || (Common.Components = {}));
  109. })(Common = Platform.Common || (Platform.Common = {}));
  110. })(Platform = Unibase.Platform || (Unibase.Platform = {}));
  111. })(Unibase || (Unibase = {}));