killbill-kpm-ui 4.0.4 → 4.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d38283eaf5f069611c6cdc2efa0336215781d00d993cb60c3edf86bd0d845b2d
4
- data.tar.gz: aebb0ad2b619dd0686e92f7e5965a8026cfe9c614b96812587926ca4cf164ac9
3
+ metadata.gz: aeee3342d14d83254084b4db07913167143b2353e6d615dbfe0120c64c6b0aca
4
+ data.tar.gz: bafb91d439c6cb9327fd6fb708906bb1a5cd428ffde9f70bb7c492869f741334
5
5
  SHA512:
6
- metadata.gz: 82269060072dcddbb742abe0efb52133430c50cd5a7ea8bebd27cf030b45cd9252e35155df7b4c965bf04824ac53ab2380be2b1ec356df767b9e87f21532e538
7
- data.tar.gz: 91fbee537d8b6c2af497244f30a8767ecf21862c1d9151d0437172559891d99f2d1e830fec8643088d08f92589e6a0fa0c6815e053c1082e7e372e33b89f8802
6
+ metadata.gz: 52bdb9126d07e97fa192d778b2772efe3a1ad9bb9cc26a3243967aefdac257cdb728ae93c39d60922d820b08d2cf256e85be571d250243e8bd2b0ee1ee177d08
7
+ data.tar.gz: bf2bddf0f2f359e831a9ac161274968f05ff60f3ed421da553bc7cf0ac3f22f8f12eb75bab6e743d97b2011c116eb2098053c0149a47b8a38561a47f7c29458f
@@ -0,0 +1,5 @@
1
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M9.59637 1.6665H15C15.9205 1.6665 16.6667 2.4127 16.6667 3.33317V12.5119L10.8322 18.3344H5.00004C4.07957 18.3344 3.33337 17.5883 3.33337 16.6678V9.99984" stroke="#414651" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
3
+ <path d="M3.33337 5.83317L5.83337 8.33317L8.33337 5.83317M5.83337 1.6665V7.82585" stroke="#414651" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
4
+ <path d="M16.6667 12.5H12.5C11.5795 12.5 10.8334 13.2462 10.8334 14.1667V18.3333" stroke="#414651" stroke-width="1.5" stroke-linejoin="round"/>
5
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M15.8337 4.1665L4.16699 15.8332M4.16699 4.1665L15.8337 15.8332" stroke="#A4A7AE" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
3
+ </svg>
@@ -22,6 +22,104 @@
22
22
  margin-bottom: 15px;
23
23
  }
24
24
 
25
+ .kpm-nodes-info-index .dropdown-container {
26
+ display: flex;
27
+ justify-content: flex-end;
28
+ }
29
+
30
+ .kpm-nodes-info-index #modalDownloadButton {
31
+ white-space: nowrap;
32
+ flex-shrink: 0;
33
+ }
34
+
35
+ .kpm-nodes-info-index #downloadJsonModal .modal-dialog {
36
+ max-width: 40.5rem;
37
+ width: 100%;
38
+ }
39
+
40
+ .kpm-nodes-info-index #downloadJsonModal .modal-content {
41
+ border-radius: 1rem;
42
+ }
43
+
44
+ .kpm-nodes-info-index #downloadJsonModal .modal-body {
45
+ padding-bottom: 0.375rem !important;
46
+ padding-top: 1.25rem !important;
47
+ }
48
+
49
+ .kpm-nodes-info-index #downloadJsonModal .modal-header {
50
+ padding: 1.5rem 1.5rem 1rem 1.5rem !important;
51
+ }
52
+
53
+ .kpm-nodes-info-index #downloadJsonModal .modal-footer {
54
+ padding: 1rem 1.5rem 1.5rem 1.5rem !important;
55
+ }
56
+
57
+ .kpm-nodes-info-index #downloadJsonModal .modal-title {
58
+ font-weight: 600;
59
+ font-size: 1.125rem;
60
+ line-height: 1.75rem;
61
+ color: #181d27;
62
+ }
63
+
64
+ .kpm-nodes-info-index #downloadJsonModal .close-button {
65
+ background: transparent;
66
+ padding: 0;
67
+ margin-top: -1.25rem;
68
+ border: 0;
69
+ }
70
+
71
+ .kpm-nodes-info-index #downloadJsonModal .close-button:hover {
72
+ background: transparent;
73
+ padding: 0;
74
+ }
75
+
76
+ .kpm-nodes-info-index #downloadJsonModal .modal-header .icon-container {
77
+ display: inline-flex;
78
+ justify-content: center;
79
+ align-items: center;
80
+ border: 0.0625rem solid #d5d7da;
81
+ border-radius: 0.375rem;
82
+ width: 2.5rem;
83
+ height: 2.5rem;
84
+ padding: 0.25rem;
85
+ }
86
+
87
+ .kpm-nodes-info-index #downloadJsonModal .modal-header .icon-container img {
88
+ width: 1.25rem;
89
+ height: 1.25rem;
90
+ }
91
+
92
+ .kpm-nodes-info-index #downloadJsonModal .field-label {
93
+ font-weight: 500;
94
+ font-size: 0.875rem;
95
+ line-height: 1.25rem;
96
+ color: #414651;
97
+ min-width: 9.59375rem;
98
+ }
99
+
100
+ .kpm-nodes-info-index #downloadJsonModal .level-checkbox-group {
101
+ display: flex;
102
+ flex-wrap: wrap;
103
+ gap: 0.75rem 1.25rem;
104
+ }
105
+
106
+ .kpm-nodes-info-index #downloadJsonModal .level-checkbox-option {
107
+ display: inline-flex;
108
+ align-items: center;
109
+ gap: 0.5rem;
110
+ margin: 0;
111
+ font-weight: 500;
112
+ font-size: 0.875rem;
113
+ line-height: 1.25rem;
114
+ color: #414651;
115
+ cursor: pointer;
116
+ }
117
+
118
+ .kpm-nodes-info-index #downloadJsonModal .level-checkbox-option input {
119
+ margin: 0;
120
+ cursor: pointer;
121
+ }
122
+
25
123
  /* Plugin config modal */
26
124
  .plugin-config-modal .close-button {
27
125
  background: none;
@@ -1,3 +1,5 @@
1
+ <%= render :partial => 'kpm/nodes_info/multi_functions_bar' %>
2
+
1
3
  <table id="logs-table" class="">
2
4
  <thead>
3
5
  <tr>
@@ -42,7 +44,14 @@
42
44
 
43
45
  var kbHostForm = $('#kb_host-form').detach();
44
46
  var leftOfSearchBox = $("#logs-table_wrapper > div:nth-child(1) > div:nth-child(1)");
47
+ leftOfSearchBox.addClass('d-flex align-items-center');
45
48
  kbHostForm.appendTo(leftOfSearchBox);
46
49
  kbHostForm.show();
50
+
51
+ var downloadBtn = $('#modalDownloadButton').detach();
52
+ downloadBtn.addClass('ms-2');
53
+ var filterDiv = $('#logs-table_filter');
54
+ filterDiv.css({'display': 'flex', 'align-items': 'center'});
55
+ filterDiv.append(downloadBtn);
47
56
  });
48
57
  <% end %>
@@ -0,0 +1,128 @@
1
+ <div class="dropdown-container">
2
+ <%= render "kaui/components/button/button", {
3
+ label: "Download JSON",
4
+ icon: "kaui/download.svg",
5
+ variant: "outline-secondary d-inline-flex align-items-center gap-1 mx-2",
6
+ type: "button",
7
+ html_class: "kaui-button custom-hover",
8
+ html_options: {
9
+ id: "modalDownloadButton"
10
+ }
11
+ } %>
12
+ </div>
13
+
14
+ <div class="modal fade" id="downloadJsonModal" tabindex="-1" role="dialog" aria-labelledby="downloadJsonModalLabel" aria-hidden="true">
15
+ <div class="modal-dialog" role="document">
16
+ <div class="modal-content">
17
+ <div class="modal-header">
18
+ <h5 class="modal-title d-flex align-items-center gap-3" id="downloadJsonModalLabel">
19
+ <span class="icon-container">
20
+ <%= image_tag("kaui/download.svg") %>
21
+ </span>
22
+ Download JSON
23
+ </h5>
24
+ <button type="button" class="close close-button custom-hover" data-bs-dismiss="modal" aria-label="Close">
25
+ <span aria-hidden="true">
26
+ <%= image_tag("kaui/modal/close.svg", width: 20, height: 20) %>
27
+ </span>
28
+ </button>
29
+ </div>
30
+ <div class="modal-body">
31
+ <form id="downloadJsonForm">
32
+ <div class="row">
33
+ <div class="d-flex align-items-start">
34
+ <label class="field-label col-sm-3">Log Level</label>
35
+ <div class="col-sm-9 level-checkbox-group">
36
+ <% %w[ERROR WARNING INFO DEBUG].each do |level| %>
37
+ <label class="level-checkbox-option">
38
+ <input type="checkbox" name="download_level" value="<%= level %>" checked />
39
+ <span><%= level %></span>
40
+ </label>
41
+ <% end %>
42
+ </div>
43
+ </div>
44
+ </div>
45
+ </form>
46
+ </div>
47
+ <div class="modal-footer">
48
+ <%= render "kaui/components/button/button", {
49
+ label: 'Close',
50
+ variant: "outline-secondary d-inline-flex align-items-center gap-1",
51
+ type: "button",
52
+ html_class: "kaui-button custom-hover mx-2 my-0",
53
+ html_options: {
54
+ data: {
55
+ bs_dismiss: "modal"
56
+ },
57
+ }
58
+ } %>
59
+ <%= render "kaui/components/button/button", {
60
+ label: 'Download JSON',
61
+ variant: "outline-secondary d-inline-flex align-items-center gap-1",
62
+ type: "button",
63
+ html_class: "kaui-dropdown custom-hover m-0",
64
+ html_options: {
65
+ id: "downloadButton"
66
+ }
67
+ } %>
68
+ </div>
69
+ </div>
70
+ </div>
71
+ </div>
72
+
73
+ <%= javascript_tag do %>
74
+ $(document).ready(function() {
75
+ var downloadJsonModalEl = document.getElementById('downloadJsonModal');
76
+ var downloadJsonModal = new bootstrap.Modal(downloadJsonModalEl);
77
+
78
+ $('#modalDownloadButton').click(function() {
79
+ downloadJsonModal.show();
80
+ });
81
+
82
+ downloadJsonModalEl.addEventListener('show.bs.modal', function () {
83
+ $('#downloadJsonForm input[name="download_level"]').prop('checked', true);
84
+ });
85
+
86
+ function htmlToText(html) {
87
+ if (html === null || html === undefined) { return ''; }
88
+ return $('<div>').html(html).text();
89
+ }
90
+
91
+ $('#downloadButton').on('click', function(e) {
92
+ e.preventDefault();
93
+ var table = window.logsDataTable;
94
+ if (!table) { return; }
95
+
96
+ var selectedLevels = $('#downloadJsonForm input[name="download_level"]:checked')
97
+ .map(function() { return this.value; }).get();
98
+
99
+ var rows = [];
100
+
101
+ table.rows().every(function() {
102
+ var data = this.data();
103
+ if (!data) { return; }
104
+ var timeText = htmlToText(data[0]).trim();
105
+ var levelText = htmlToText(data[1]).trim();
106
+ var messageText = htmlToText(data[2]).trim();
107
+
108
+ if (selectedLevels.indexOf(levelText) === -1) { return; }
109
+
110
+ rows.push({ time: timeText, level: levelText, message: messageText });
111
+ });
112
+
113
+ var jsonContent = JSON.stringify(rows, null, 2);
114
+ var blob = new Blob([jsonContent], { type: 'application/json;charset=utf-8;' });
115
+ var url = URL.createObjectURL(blob);
116
+ var today = new Date().toISOString().slice(0, 10);
117
+ var a = document.createElement('a');
118
+ a.href = url;
119
+ a.download = 'kpm-logs-' + today + '.json';
120
+ document.body.appendChild(a);
121
+ a.click();
122
+ document.body.removeChild(a);
123
+ URL.revokeObjectURL(url);
124
+
125
+ downloadJsonModal.hide();
126
+ });
127
+ });
128
+ <% end %>
data/lib/kpm/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module KPM
4
- VERSION = '4.0.4'
4
+ VERSION = '4.0.5'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: killbill-kpm-ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.4
4
+ version: 4.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kill Bill core team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-06-03 00:00:00.000000000 Z
11
+ date: 2026-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: killbill-assets-ui
@@ -76,6 +76,8 @@ files:
76
76
  - README.md
77
77
  - Rakefile
78
78
  - app/assets/config/kpm_manifest.js
79
+ - app/assets/images/kaui/download.svg
80
+ - app/assets/images/kaui/modal/close.svg
79
81
  - app/assets/javascripts/application.js
80
82
  - app/assets/javascripts/kpm/kpm.js
81
83
  - app/assets/javascripts/kpm/logs_refresh.js
@@ -92,6 +94,7 @@ files:
92
94
  - app/views/kpm/layouts/kpm_application.html.erb
93
95
  - app/views/kpm/nodes_info/_form_plugin_config.html.erb
94
96
  - app/views/kpm/nodes_info/_logs_table.html.erb
97
+ - app/views/kpm/nodes_info/_multi_functions_bar.html.erb
95
98
  - app/views/kpm/nodes_info/_nodes_table.html.erb
96
99
  - app/views/kpm/nodes_info/_official_plugins.html.erb
97
100
  - app/views/kpm/nodes_info/index.html.erb