meta_workflows 0.8.15 → 0.8.17

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: 1723e59bcb1187c0f399e13a47a36f723faf63e802949e1de286ea19d45c41e0
4
- data.tar.gz: cf50da3efc3fb50b022d8b037a43becb3cb94577b0de94d85fe0a76e496ca5f3
3
+ metadata.gz: ad09f1d339b0efee72ca8bcd71d89e60d9dbd431eae240d0a2763fd688e4ad81
4
+ data.tar.gz: 1cfb07dea381b3730a7a185c50ac4238eef821d656f969e4ca287ead0c507e6e
5
5
  SHA512:
6
- metadata.gz: a1f020ce6ca0db97c9f035a5473ba38fc24440f0de85062f7fc56be2c10fd2d66937daa82616923710b2c08a4264a245b85199c548fa5ab2d7311be68f6a5652
7
- data.tar.gz: a6654329fb1662efdc6cf95c14a2405bc06d87d7af89f6d79c3ab3e8f65e7c29a3c27e27396005ce8157f771f57ede5136cb8407ba9c09ea68a26aee58337a8e
6
+ metadata.gz: 8f651f54303a4c5724157d1cf37b0ae4ea5c36525fac453faf1aa260b5977530522c509e26c700b8ded23cded243cd4bcd1cbd2ed1d39fb3dd31da8794b1f6b1
7
+ data.tar.gz: 6b473d2dcef5fa839e48b7a908a8bfb25fffd7a896ca6f3a86a765e79b08ac0156e581c2af8b73b64f025dd138cf5fde3b621f4c56ff9b68ab8d9234738aef6a
@@ -14,9 +14,31 @@ module MetaWorkflows
14
14
  end
15
15
  end
16
16
 
17
- # Generate a formatted JSON display with syntax highlighting
17
+ # Generate a formatted JSON display with syntax highlighting using json-viewer component
18
18
  def json_display(data, classes: 'bg-gray-100 p-4 rounded-lg text-sm overflow-x-auto')
19
- content_tag :pre, pretty_json(data), class: classes
19
+ return content_tag(:div, 'No data', class: 'text-gray-500 italic') if data.blank?
20
+
21
+ begin
22
+ # Convert data to JSON object if it's a string, otherwise use as-is
23
+ json_data = data.is_a?(String) ? JSON.parse(data) : data
24
+
25
+ # Generate a unique ID for this json-viewer instance
26
+ viewer_id = "json-viewer-#{SecureRandom.hex(4)}"
27
+
28
+ # Create the json-viewer element and set data via JavaScript
29
+ content_tag :div, class: classes do
30
+ viewer_element = content_tag(:'json-viewer', '', id: viewer_id,
31
+ expanded: true,
32
+ style: json_viewer_styles)
33
+
34
+ script_tag = javascript_tag(json_viewer_script(viewer_id, json_data))
35
+
36
+ viewer_element + script_tag
37
+ end
38
+ rescue JSON::ParserError
39
+ # Fallback to original pre tag display if JSON parsing fails
40
+ content_tag :pre, data.to_s, class: classes
41
+ end
20
42
  end
21
43
 
22
44
  # Helper to format token usage
@@ -26,5 +48,35 @@ module MetaWorkflows
26
48
 
27
49
  "Tokens: #{tokens.join('/')}"
28
50
  end
51
+
52
+ private
53
+
54
+ def json_viewer_styles
55
+ styles = [
56
+ '--background-color: transparent',
57
+ '--indentguide-color: #6b7280',
58
+ '--string-color: #059669',
59
+ '--number-color: #dc2626',
60
+ '--boolean-color: #2563eb',
61
+ '--null-color: #7c3aed',
62
+ '--property-color: #1f2937',
63
+ '--preview-color: #374151',
64
+ '--expand-icon-color: #374151'
65
+ ]
66
+ "#{styles.join('; ')};"
67
+ end
68
+
69
+ def json_viewer_script(viewer_id, json_data)
70
+ "document.addEventListener('DOMContentLoaded', function() {
71
+ const viewer = document.getElementById('#{viewer_id}');
72
+ if (viewer) {
73
+ viewer.data = #{json_data.to_json};
74
+ // Expand only the first level by default
75
+ if (typeof viewer.expand === 'function') {
76
+ viewer.expand('*');
77
+ }
78
+ }
79
+ });"
80
+ end
29
81
  end
30
82
  end
@@ -12,6 +12,9 @@
12
12
  <!-- Tailwind CSS -->
13
13
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
14
14
  <script src="https://cdn.tailwindcss.com"></script>
15
+
16
+ <!-- JSON Viewer Web Component -->
17
+ <script src="https://unpkg.com/@alenaksu/json-viewer@2.1.0/dist/json-viewer.bundle.js"></script>
15
18
  </head>
16
19
  <body class="bg-gray-50 min-h-screen">
17
20
  <!-- Header Navigation -->
@@ -15,15 +15,15 @@
15
15
  <%= form.text_field :search,
16
16
  placeholder: "Search executions...",
17
17
  value: params[:search],
18
- class: "block w-48 rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm" %>
18
+ class: "block w-48 px-3 py-2 text-sm rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500" %>
19
19
  <%= form.hidden_field :workflow_id, value: params[:workflow_id] %>
20
20
  <%= form.submit "Search",
21
- class: "inline-flex items-center px-3 py-2 border border-transparent text-sm leading-4 font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500" %>
21
+ class: "inline-flex items-center px-4 py-2 border border-transparent text-sm leading-4 font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500" %>
22
22
  <% end %>
23
23
 
24
24
  <% if params.slice(:workflow_id, :status, :date_from, :date_to).values.any?(&:present?) %>
25
25
  <%= link_to "Clear Filters", executions_path,
26
- class: "inline-flex items-center px-3 py-2 border border-gray-300 text-sm leading-4 font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500" %>
26
+ class: "inline-flex items-center px-4 py-2 border border-gray-300 text-sm leading-4 font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500" %>
27
27
  <% end %>
28
28
  </div>
29
29
  </div>
@@ -34,7 +34,7 @@
34
34
  <div class="grid grid-cols-1 md:grid-cols-4 gap-4">
35
35
  <!-- Status Filter -->
36
36
  <div>
37
- <%= form.label :status, "Status", class: "block text-sm font-medium text-gray-700" %>
37
+ <%= form.label :status, "Status", class: "block text-sm font-medium text-gray-700 mb-1" %>
38
38
  <%= form.select :status,
39
39
  options_for_select([
40
40
  ['All Statuses', ''],
@@ -43,23 +43,23 @@
43
43
  ['Failed', 'failed']
44
44
  ], params[:status]),
45
45
  { prompt: false },
46
- { class: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm" } %>
46
+ { class: "block w-full px-3 py-2 text-sm rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500" } %>
47
47
  </div>
48
48
 
49
49
  <!-- Date From -->
50
50
  <div>
51
- <%= form.label :date_from, "From Date", class: "block text-sm font-medium text-gray-700" %>
51
+ <%= form.label :date_from, "From Date", class: "block text-sm font-medium text-gray-700 mb-1" %>
52
52
  <%= form.date_field :date_from,
53
53
  value: params[:date_from],
54
- class: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm" %>
54
+ class: "block w-full px-3 py-2 text-sm rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500" %>
55
55
  </div>
56
56
 
57
57
  <!-- Date To -->
58
58
  <div>
59
- <%= form.label :date_to, "To Date", class: "block text-sm font-medium text-gray-700" %>
59
+ <%= form.label :date_to, "To Date", class: "block text-sm font-medium text-gray-700 mb-1" %>
60
60
  <%= form.date_field :date_to,
61
61
  value: params[:date_to],
62
- class: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm" %>
62
+ class: "block w-full px-3 py-2 text-sm rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500" %>
63
63
  </div>
64
64
 
65
65
  <!-- Apply Filters Button -->
@@ -3,7 +3,7 @@
3
3
  module MetaWorkflows
4
4
  MAJOR = 0
5
5
  MINOR = 8
6
- PATCH = 15 # this is automatically incremented by the build process
6
+ PATCH = 17 # this is automatically incremented by the build process
7
7
 
8
8
  VERSION = "#{MetaWorkflows::MAJOR}.#{MetaWorkflows::MINOR}.#{MetaWorkflows::PATCH}".freeze
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: meta_workflows
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.15
4
+ version: 0.8.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leonid Medovyy