123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- var Unibase;
- (function (Unibase) {
- let Platform;
- (function (Platform) {
- let Common;
- (function (Common) {
- let Components;
- (function (Components) {
- class ThreadTable extends Platform.Core.BaseComponent {
- cssFiles() {
- return [];
- }
- jsFiles() {
- return ["platform/apps/managers/threadtable.js"];
- }
- html(id, containerid) {
- return '';
- }
- load(id, containerid, callback) {
- }
- init(containerid) {
- this.myList;
- }
- getThreads(time) {
- var instance = this;
- var delay = time;
- if (delay == 0) {
- delay = 5;
- }
- delay = delay * 1000;
- var currentdate = new Date();
- var _delay = delay;
- var datetime = currentdate.getDate() + "/"
- + (currentdate.getMonth() + 1) + "/"
- + currentdate.getFullYear() + " @ "
- + currentdate.getHours() + ":"
- + currentdate.getMinutes() + ":"
- + currentdate.getSeconds();
- $.ajax({
- type: 'GET', url: 'http://localhost:3088/appperformance/threads', success: function (data) {
- debugger;
- Unibase.Platform.Common.Components.ThreadTable.Instance().addAllColumnHeaders(data, datetime, _delay);
- }
- });
- }
- ;
- loadForm(FormId, Pk_Value, AppConfigurationId, Callback, ElementId) {
- }
- buildHtmlTable(columns, datetime, time) {
- var dt = datetime;
- var time = time;
- let html = '<tr>';
- html += `<td>${dt}</td>`;
- for (var colIndex = 0; colIndex < columns.length; colIndex++) {
- var cellValue = columns[colIndex];
- if (cellValue == null) {
- cellValue = "";
- }
- html += `<td>${cellValue}</td>`;
- }
- html += '</tr>';
- $("#bizgaze_body .t-body").prepend(html);
- Unibase.Platform.Helpers.NavigationHelper.Instance().hideLoading();
- setTimeout(function () {
- Unibase.Platform.Common.Components.ThreadTable.Instance().addVals(time);
- }, time);
- }
- addVals(time) {
- var currentdate = new Date();
- var time = time;
- var datetime = currentdate.getDate() + "/"
- + (currentdate.getMonth() + 1) + "/"
- + currentdate.getFullYear() + " @ "
- + currentdate.getHours() + ":"
- + currentdate.getMinutes() + ":"
- + currentdate.getSeconds();
- $.ajax({
- type: 'GET', url: 'http://localhost:3088/appperformance/threads', success: function (data) {
- debugger;
- const values = Object.keys(data).map(key => data[key]);
- Unibase.Platform.Common.Components.ThreadTable.Instance().buildHtmlTable(values, datetime, time);
- }
- });
- }
- addAllColumnHeaders(arr, datetime, time) {
- var columnSet = [];
- var time = time;
- const values = Object.keys(arr).map(key => arr[key]);
- var headerTr$ = $('<tr/>');
- this.myList = Object.getOwnPropertyNames(arr);
- 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 = '';
- html += `<th>Time</th>`;
- for (var i = 0; i < this.myList.length; i++) {
- html += `<th>${this.myList[i]}</th>`;
- }
- html += '</thead><tbody class="t-body " style="overflow:auto"></tbody></table></div>';
- $("#bizgaze_body").append(html);
- Unibase.Platform.Common.Components.ThreadTable.Instance().buildHtmlTable(values, datetime, time);
- }
- static Instance() {
- if (this.instance === undefined) {
- this.instance = new ThreadTable();
- }
- return this.instance;
- }
- }
- Components.ThreadTable = ThreadTable;
- })(Components = Common.Components || (Common.Components = {}));
- })(Common = Platform.Common || (Platform.Common = {}));
- })(Platform = Unibase.Platform || (Unibase.Platform = {}));
- })(Unibase || (Unibase = {}));
|