diff --git a/server/src/uds/static/adm/js/api.coffee b/server/src/uds/static/adm/js/api.coffee index cdf6b97b3..6a595916d 100644 --- a/server/src/uds/static/adm/js/api.coffee +++ b/server/src/uds/static/adm/js/api.coffee @@ -180,8 +180,10 @@ class BasicModelRest success_fnc {} return if cacheKey isnt "." and @cache.get(cacheKey) + api.doLog "Cache SUCCESS for " + cacheKey success_fnc @cache.get(cacheKey) else + api.doLog "Cache FAIL for " + cacheKey $this = @ api.doLog 'Obtaining json for ', path api.getJson path, @@ -321,7 +323,7 @@ class BasicModelRest path = @guiPath @_requestPath path, - cacheKey: "." + cacheKey: path success: success_fnc fail: fail_fnc @@ -333,6 +335,7 @@ class BasicModelRest path = @tableInfoPath @_requestPath path, + cacheKey: path success: success_fnc fail: fail_fnc diff --git a/server/src/uds/static/adm/js/gui-d-servicespools.coffee b/server/src/uds/static/adm/js/gui-d-servicespools.coffee index 0bc882da3..41233be6e 100644 --- a/server/src/uds/static/adm/js/gui-d-servicespools.coffee +++ b/server/src/uds/static/adm/js/gui-d-servicespools.coffee @@ -117,7 +117,7 @@ gui.servicesPools.link = (event) -> api.templates.get "services_pool", (tmpl) -> gui.appendToWorkspace api.templates.evaluate(tmpl, deployed_services: "deployed-services-placeholder" - pool_info: "pool-info" + pool_info: "pool-info-placeholder" assigned_services: "assigned-services-placeholder" cache: "cache-placeholder" groups: "groups-placeholder" @@ -176,6 +176,10 @@ gui.servicesPools.link = (event) -> return $("#detail-placeholder").removeClass "hidden" + $('#detail-placeholder a[href="#pool-info-placeholder"]').tab('show') + + # Load provider "info" + gui.methods.typedShow gui.servicesPools, selected[0], '#pool-info-placeholder .well', gettext('Error accessing data') # # * Cache Part @@ -186,11 +190,13 @@ gui.servicesPools.link = (event) -> # Shows/hides cache if info.uses_cache or info.uses_cache_l2 $("#cache-placeholder_tab").removeClass "hidden" + cachedItems = new GuiElement(api.servicesPools.detail(servPool.id, "cache", { permission: servPool.permission }), "cache") # Cached items table prevCacheLogTbl = null cachedItemsTable = cachedItems.table( + doNotLoadData: true icon: 'cached' container: "cache-placeholder_tbl" rowSelect: "single" @@ -205,7 +211,6 @@ gui.servicesPools.link = (event) -> return onRowSelect: (selected) -> - gui.do cached = selected[0] if prevCacheLogTbl $tbl = $(prevCacheLogTbl).dataTable() @@ -234,6 +239,7 @@ gui.servicesPools.link = (event) -> # Groups items table groupsTable = groups.table( + doNotLoadData: true icon: 'groups' container: "groups-placeholder" rowSelect: "single" @@ -310,6 +316,7 @@ gui.servicesPools.link = (event) -> prevAssignedLogTbl = null assignedServices = new GuiElement(api.servicesPools.detail(servPool.id, "services", { permission: servPool.permission }), "services") assignedServicesTable = assignedServices.table( + doNotLoadData: true icon: 'assigned' container: "assigned-services-placeholder_tbl" rowSelect: "single" @@ -356,6 +363,7 @@ gui.servicesPools.link = (event) -> # Transports items table transportsTable = transports.table( + doNotLoadData: true icon: 'transports' container: "transports-placeholder" doNotLoadData: true @@ -424,6 +432,7 @@ gui.servicesPools.link = (event) -> # Publications table publicationsTable = publications.table( + doNotLoadData: true icon: 'publications' container: "publications-placeholder" doNotLoadData: true @@ -513,6 +522,7 @@ gui.servicesPools.link = (event) -> # * Log table # logTable = gui.servicesPools.logTable(servPool.id, + doNotLoadData: true container: "logs-placeholder" ) prevTables.push logTable @@ -538,7 +548,7 @@ gui.servicesPools.link = (event) -> return onNew: gui.methods.typedNew(gui.servicesPools, gettext("New service pool"), "Service pool " + gettext("creation error"), - guiProcessor: (guiDef) -> # Create has "save on publish" field + guiProcessor: (guiDef) -> # Create has "publish on save" field editMode = false gui.doLog guiDef newDef = [].concat(guiDef).concat([ diff --git a/server/src/uds/static/adm/js/gui-element.coffee b/server/src/uds/static/adm/js/gui-element.coffee index 51496503f..94852eb68 100644 --- a/server/src/uds/static/adm/js/gui-element.coffee +++ b/server/src/uds/static/adm/js/gui-element.coffee @@ -428,7 +428,7 @@ data: data deferRender: tblParams.deferedRender or tblParams.deferRender or false - oLanguage: gui.config.dataTablesLanguage + language: gui.config.dataTablesLanguage # If row is "styled" @@ -436,9 +436,14 @@ field = row_style.field dct = row_style.dict prefix = row_style.prefix - dataTableOptions.fnCreatedRow = (nRow, aData, iDataIndex) -> - v = (if dct? then dct[@fnGetData(iDataIndex)[field]] else @fnGetData(iDataIndex)[field]) - $(nRow).addClass prefix + v + dataTableOptions.createdRow = (row, data, dataIndex) -> + # gui.doLog row, data, dataIndex, data[field] + try + v = (if dct? then dct[data[field]] else data[field]) + $(row).addClass prefix + v + catch err + gui.doLog "Exception got: ", err + return dTable = $("#" + tableId).DataTable dataTableOptions @@ -615,27 +620,25 @@ $("#" + tblParams.container).append table.text # Responsive style for tables, using tables.css and this code generates the "titles" for vertical display on small sizes - $("#style-" + tableId).remove() # Remove existing style for table before adding new one - $(api.templates.evaluate("tmpl_comp_responsive_table", - tableId: tableId - columns: columns - )).appendTo "head" initLog = (data) -> - gui.doLog data - $("#" + tableId).dataTable - aaData: data - aaSorting: [[ - 0 - "desc" - ]] + $("#" + tableId).DataTable + data: data + ordering: true + order: [[ 1, 'desc' ]] + + columns: columns + language: gui.config.dataTablesLanguage + # dom: '<"' + tbId + ' btns-tables">fr<"uds-table"t>ip' + dom: "<'row'<'col-xs-8'T><'col-xs-4'f>r>t<'row'<'col-xs-5'i><'col-xs-7'p>>" + deferRender: tblParams.deferedRender or tblParams.deferRender or false + # bDeferRender: tblParams.deferedRender or false + createdRow: (row, data, dataIndex) -> + try + v = "log-" + logRenderer(data.level) + $(row).addClass v + catch error + gui.doLog "Log cretedRow error", error - aoColumns: columns - oLanguage: gui.config.dataTablesLanguage - sDom: "<'row'<'col-xs-8'T><'col-xs-4'f>r>t<'row'<'col-xs-5'i><'col-xs-7'p>>" - bDeferRender: tblParams.deferedRender or false - fnCreatedRow: (nRow, aData, iDataIndex) -> - v = "log-" + logRenderer(@fnGetData(iDataIndex).level) - $(nRow).addClass v return diff --git a/server/src/uds/static/adm/js/gui.coffee b/server/src/uds/static/adm/js/gui.coffee index 0087c46ff..3a9e2f259 100644 --- a/server/src/uds/static/adm/js/gui.coffee +++ b/server/src/uds/static/adm/js/gui.coffee @@ -20,18 +20,19 @@ # Several convenience "constants" for tables gui.config.dataTablesLanguage = sLengthMenu: gettext("_MENU_ records per page") - sZeroRecords: gettext("Empty") - sInfo: gettext("Records _START_ to _END_ of _TOTAL_") - sInfoEmpty: gettext("No records") - sInfoFiltered: gettext("(filtered from _MAX_ total records)") - sProcessing: gettext("Please wait, processing") - sSearch: gettext("Filter") - sInfoThousands: django.formats.THOUSAND_SEPARATOR - oPaginate: - sFirst: " " - sLast: " " - sNext: " " - sPrevious: " " + emptyTable: gettext("Empty") + zeroRecords: gettext("No records") + info: gettext("Records _START_ to _END_ of _TOTAL_") + infoEmpty: gettext("No records") + infoFiltered: ' ' + gettext("(filtered from _MAX_ total records)") + processing: gettext("Please wait, processing") + search: gettext("Filter") + thousands: django.formats.THOUSAND_SEPARATOR + paginate: + first: " " + last: " " + next: " " + previous: " " select: rows: _: gettext("Selected %d rows") diff --git a/server/src/uds/templates/uds/admin/tmpl/services_pool.html b/server/src/uds/templates/uds/admin/tmpl/services_pool.html index 05d17d3fc..3f76d637e 100644 --- a/server/src/uds/templates/uds/admin/tmpl/services_pool.html +++ b/server/src/uds/templates/uds/admin/tmpl/services_pool.html @@ -29,15 +29,20 @@