leva 0.1.10 → 0.1.11
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 +4 -4
- data/README.md +1 -2
- data/app/assets/stylesheets/leva/application.css +3083 -15
- data/app/controllers/leva/design_system_controller.rb +9 -0
- data/app/views/layouts/leva/application.html.erb +23 -24
- data/app/views/leva/dataset_records/index.html.erb +63 -61
- data/app/views/leva/dataset_records/show.html.erb +115 -25
- data/app/views/leva/datasets/_dataset.html.erb +11 -18
- data/app/views/leva/datasets/_form.html.erb +18 -14
- data/app/views/leva/datasets/edit.html.erb +16 -4
- data/app/views/leva/datasets/index.html.erb +33 -41
- data/app/views/leva/datasets/new.html.erb +15 -4
- data/app/views/leva/datasets/show.html.erb +120 -139
- data/app/views/leva/design_system/index.html.erb +1731 -0
- data/app/views/leva/experiments/_experiment.html.erb +46 -31
- data/app/views/leva/experiments/_form.html.erb +62 -35
- data/app/views/leva/experiments/edit.html.erb +17 -3
- data/app/views/leva/experiments/index.html.erb +41 -36
- data/app/views/leva/experiments/new.html.erb +40 -19
- data/app/views/leva/experiments/show.html.erb +155 -98
- data/app/views/leva/runner_results/show.html.erb +271 -54
- data/app/views/leva/workbench/_evaluation_area.html.erb +18 -4
- data/app/views/leva/workbench/_prompt_content.html.erb +116 -111
- data/app/views/leva/workbench/_prompt_form.html.erb +24 -23
- data/app/views/leva/workbench/_prompt_sidebar.html.erb +57 -12
- data/app/views/leva/workbench/_results_section.html.erb +274 -112
- data/app/views/leva/workbench/_top_bar.html.erb +16 -6
- data/app/views/leva/workbench/edit.html.erb +46 -15
- data/app/views/leva/workbench/index.html.erb +5 -8
- data/app/views/leva/workbench/new.html.erb +74 -42
- data/config/routes.rb +2 -0
- data/lib/leva/version.rb +1 -1
- metadata +4 -2
|
@@ -1,40 +1,39 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
|
-
<html lang="en"
|
|
2
|
+
<html lang="en">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>Leva - <%= yield(:title) || 'AI Evaluation Engine' %></title>
|
|
7
7
|
<%= csrf_meta_tags %>
|
|
8
8
|
<%= csp_meta_tag %>
|
|
9
|
-
|
|
9
|
+
|
|
10
|
+
<%# Fira Code for monospace, Helvetica is system font %>
|
|
11
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
12
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
13
|
+
<link href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500&display=swap" rel="stylesheet">
|
|
14
|
+
|
|
15
|
+
<%= stylesheet_link_tag "leva/application", media: "all" %>
|
|
10
16
|
<script src="https://cdn.jsdelivr.net/npm/stimulus@3.2.2/dist/stimulus.umd.min.js"></script>
|
|
11
17
|
<%= yield(:head) %>
|
|
12
18
|
</head>
|
|
13
|
-
<body
|
|
14
|
-
<nav class="
|
|
15
|
-
<div class="
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
LLM Evals
|
|
28
|
-
<% end %>
|
|
29
|
-
<div class="ml-10 flex space-x-6">
|
|
30
|
-
<%= link_to 'Workbench', workbench_index_path, class: "px-3 py-2 rounded-md text-sm font-medium transition-colors duration-150 ease-in-out #{request.path.start_with?(workbench_index_path) ? 'bg-indigo-600 text-white shadow-lg' : 'text-gray-300 hover:bg-gray-800 hover:text-white'}" %>
|
|
31
|
-
<%= link_to 'Datasets', datasets_path, class: "px-3 py-2 rounded-md text-sm font-medium transition-colors duration-150 ease-in-out #{request.path.start_with?(datasets_path) ? 'bg-indigo-600 text-white shadow-lg' : 'text-gray-300 hover:bg-gray-800 hover:text-white'}" %>
|
|
32
|
-
<%= link_to 'Experiments', experiments_path, class: "px-3 py-2 rounded-md text-sm font-medium transition-colors duration-150 ease-in-out #{request.path.start_with?(experiments_path) ? 'bg-indigo-600 text-white shadow-lg' : 'text-gray-300 hover:bg-gray-800 hover:text-white'}" %>
|
|
33
|
-
</div>
|
|
19
|
+
<body>
|
|
20
|
+
<nav class="nav">
|
|
21
|
+
<div class="nav-inner">
|
|
22
|
+
<%= link_to root_path, class: 'nav-brand' do %>
|
|
23
|
+
<svg viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" class="nav-logo">
|
|
24
|
+
<rect x="2" y="2" width="16" height="16" rx="3" fill="currentColor" fill-opacity="0.15"/>
|
|
25
|
+
<path d="M6 6V14H14" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
26
|
+
</svg>
|
|
27
|
+
<span>leva</span>
|
|
28
|
+
<% end %>
|
|
29
|
+
<div class="nav-links">
|
|
30
|
+
<%= link_to 'Workbench', workbench_index_path, class: "nav-link #{request.path == root_path || request.path.start_with?(workbench_index_path) ? 'active' : ''}" %>
|
|
31
|
+
<%= link_to 'Datasets', datasets_path, class: "nav-link #{request.path.start_with?(datasets_path) ? 'active' : ''}" %>
|
|
32
|
+
<%= link_to 'Experiments', experiments_path, class: "nav-link #{request.path.start_with?(experiments_path) ? 'active' : ''}" %>
|
|
34
33
|
</div>
|
|
35
34
|
</div>
|
|
36
35
|
</nav>
|
|
37
|
-
<main
|
|
36
|
+
<main>
|
|
38
37
|
<%= yield %>
|
|
39
38
|
</main>
|
|
40
39
|
</body>
|
|
@@ -1,74 +1,76 @@
|
|
|
1
1
|
<% content_for :title, "#{@dataset.name} - Records" %>
|
|
2
|
-
<div class="container
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
<div class="container page">
|
|
3
|
+
<%# Breadcrumb Navigation %>
|
|
4
|
+
<nav class="breadcrumb mb-4">
|
|
5
|
+
<%= link_to datasets_path, class: 'breadcrumb-link' do %>Datasets<% end %>
|
|
6
|
+
<span class="breadcrumb-sep">/</span>
|
|
7
|
+
<%= link_to @dataset.name, dataset_path(@dataset), class: 'breadcrumb-link' %>
|
|
8
|
+
<span class="breadcrumb-sep">/</span>
|
|
9
|
+
<span class="breadcrumb-current">Records</span>
|
|
10
|
+
</nav>
|
|
11
|
+
|
|
12
|
+
<div class="page-header">
|
|
13
|
+
<div>
|
|
14
|
+
<h1 class="page-title">Dataset Records</h1>
|
|
15
|
+
<p class="text-muted mt-2">All records in <strong><%= @dataset.name %></strong></p>
|
|
12
16
|
</div>
|
|
13
17
|
</div>
|
|
14
18
|
|
|
15
19
|
<% if @records.any? %>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
<% @records.first.index_attributes.keys.each do |key| %>
|
|
21
|
-
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-300 uppercase tracking-wider">
|
|
22
|
-
<%= key.to_s.humanize %>
|
|
23
|
-
</th>
|
|
24
|
-
<% end %>
|
|
25
|
-
<th scope="col" class="relative px-6 py-3">
|
|
26
|
-
<span class="sr-only">Actions</span>
|
|
27
|
-
</th>
|
|
28
|
-
</tr>
|
|
29
|
-
</thead>
|
|
30
|
-
<tbody class="bg-gray-800 divide-y divide-gray-700">
|
|
31
|
-
<% @records.each do |record| %>
|
|
32
|
-
<tr class="hover:bg-gray-700 transition-colors duration-200">
|
|
33
|
-
<% record.index_attributes.values.each do |value| %>
|
|
34
|
-
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-300">
|
|
35
|
-
<%= value %>
|
|
36
|
-
</td>
|
|
37
|
-
<% end %>
|
|
38
|
-
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
|
|
39
|
-
<%= link_to 'View', dataset_dataset_record_path(@dataset, record), class: 'text-indigo-400 hover:text-indigo-300 transition-colors duration-200' %>
|
|
40
|
-
</td>
|
|
41
|
-
</tr>
|
|
42
|
-
<% end %>
|
|
43
|
-
</tbody>
|
|
44
|
-
</table>
|
|
20
|
+
<%# Section Header with Count %>
|
|
21
|
+
<div class="section-header">
|
|
22
|
+
<h3 class="section-title">Records</h3>
|
|
23
|
+
<span class="section-count"><%= @records.count %> total</span>
|
|
45
24
|
</div>
|
|
46
25
|
|
|
47
|
-
<div class="
|
|
48
|
-
|
|
26
|
+
<div class="table-wrapper">
|
|
27
|
+
<div class="table-scroll">
|
|
28
|
+
<table class="table table-clickable">
|
|
29
|
+
<thead>
|
|
30
|
+
<tr>
|
|
31
|
+
<% @records.first.index_attributes.keys.each do |key| %>
|
|
32
|
+
<th><%= key.to_s.humanize %></th>
|
|
33
|
+
<% end %>
|
|
34
|
+
<th class="text-right" style="width: 50px;"></th>
|
|
35
|
+
</tr>
|
|
36
|
+
</thead>
|
|
37
|
+
<tbody>
|
|
38
|
+
<% @records.each do |record| %>
|
|
39
|
+
<tr class="clickable-row" onclick="window.location='<%= dataset_dataset_record_path(@dataset, record) %>'">
|
|
40
|
+
<% record.index_attributes.each_with_index do |(key, value), index| %>
|
|
41
|
+
<td class="<%= index == 0 ? '' : 'cell-truncate' %>">
|
|
42
|
+
<%= index == 0 ? content_tag(:span, value, class: 'row-title') : value %>
|
|
43
|
+
</td>
|
|
44
|
+
<% end %>
|
|
45
|
+
<td class="text-right">
|
|
46
|
+
<svg class="icon-sm text-muted" viewBox="0 0 20 20" fill="currentColor" style="opacity: 0.5;">
|
|
47
|
+
<path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" />
|
|
48
|
+
</svg>
|
|
49
|
+
</td>
|
|
50
|
+
</tr>
|
|
51
|
+
<% end %>
|
|
52
|
+
</tbody>
|
|
53
|
+
</table>
|
|
54
|
+
</div>
|
|
49
55
|
</div>
|
|
50
56
|
<% else %>
|
|
51
|
-
<div class="
|
|
52
|
-
<
|
|
53
|
-
<
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
<p>To add records to this dataset, use the Rails console or create them programmatically:</p>
|
|
59
|
-
<div class="mt-2 bg-gray-900 rounded px-3 py-2 text-left font-mono text-xs text-gray-300">
|
|
60
|
-
<p>dataset = Leva::Dataset.find(<%= @dataset.id %>)</p>
|
|
61
|
-
<p>dataset.add_record(your_model_instance)</p>
|
|
62
|
-
</div>
|
|
57
|
+
<div class="card p-6">
|
|
58
|
+
<div class="empty-state" style="padding: var(--space-10) var(--space-6);">
|
|
59
|
+
<svg class="empty-state-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
60
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10" />
|
|
61
|
+
</svg>
|
|
62
|
+
<h3 class="empty-state-title">No records in this dataset</h3>
|
|
63
|
+
<p class="empty-state-description">Add records to start building your evaluation dataset.</p>
|
|
63
64
|
</div>
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
65
|
+
|
|
66
|
+
<div class="divider"></div>
|
|
67
|
+
|
|
68
|
+
<div class="p-5" style="background: var(--gray-850, #222120); border-radius: var(--radius-md);">
|
|
69
|
+
<h4 class="text-sm font-semibold mb-3" style="color: var(--gray-300);">Adding Records</h4>
|
|
70
|
+
<p class="text-sm text-muted mb-3">Use the Rails console to add records to this dataset:</p>
|
|
71
|
+
<pre style="margin: 0;"><code>dataset = Leva::Dataset.find(<%= @dataset.id %>)
|
|
72
|
+
dataset.add_record(your_model_instance)</code></pre>
|
|
71
73
|
</div>
|
|
72
74
|
</div>
|
|
73
75
|
<% end %>
|
|
74
|
-
</div>
|
|
76
|
+
</div>
|
|
@@ -1,30 +1,120 @@
|
|
|
1
1
|
<% content_for :title, "#{@dataset.name} - Record Details" %>
|
|
2
|
-
<div class="container
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
2
|
+
<div class="container page">
|
|
3
|
+
<%# Breadcrumb Navigation %>
|
|
4
|
+
<nav class="breadcrumb mb-4">
|
|
5
|
+
<%= link_to datasets_path, class: 'breadcrumb-link' do %>Datasets<% end %>
|
|
6
|
+
<span class="breadcrumb-sep">/</span>
|
|
7
|
+
<%= link_to @dataset.name, dataset_path(@dataset), class: 'breadcrumb-link' %>
|
|
8
|
+
<span class="breadcrumb-sep">/</span>
|
|
9
|
+
<%= link_to 'Records', dataset_dataset_records_path(@dataset), class: 'breadcrumb-link' %>
|
|
10
|
+
<span class="breadcrumb-sep">/</span>
|
|
11
|
+
<span class="breadcrumb-current"><%= @record.display_name.truncate(30) %></span>
|
|
12
|
+
</nav>
|
|
13
|
+
|
|
14
|
+
<div class="page-header">
|
|
15
|
+
<div>
|
|
16
|
+
<h1 class="page-title"><%= @record.display_name %></h1>
|
|
17
|
+
<p class="text-muted mt-2">Record from <strong><%= @dataset.name %></strong></p>
|
|
18
|
+
</div>
|
|
19
|
+
<div class="btn-group">
|
|
20
|
+
<%= link_to workbench_index_path(dataset_record_id: @record.id), class: 'btn btn-primary' do %>
|
|
21
|
+
<svg class="icon-sm" viewBox="0 0 20 20" fill="currentColor">
|
|
22
|
+
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM9.555 7.168A1 1 0 008 8v4a1 1 0 001.555.832l3-2a1 1 0 000-1.664l-3-2z" clip-rule="evenodd" />
|
|
23
|
+
</svg>
|
|
24
|
+
Open in Workbench
|
|
25
|
+
<% end %>
|
|
20
26
|
</div>
|
|
21
27
|
</div>
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
28
|
+
|
|
29
|
+
<%# Record Metadata %>
|
|
30
|
+
<section class="mb-6">
|
|
31
|
+
<div class="exp-meta">
|
|
32
|
+
<div class="exp-meta-item">
|
|
33
|
+
<span class="exp-meta-label">Record ID</span>
|
|
34
|
+
<span class="exp-meta-value font-mono"><%= @record.id %></span>
|
|
35
|
+
</div>
|
|
36
|
+
<div class="exp-meta-item">
|
|
37
|
+
<span class="exp-meta-label">Recordable Type</span>
|
|
38
|
+
<span class="exp-meta-value"><%= @record.recordable_type %></span>
|
|
39
|
+
</div>
|
|
40
|
+
<div class="exp-meta-item">
|
|
41
|
+
<span class="exp-meta-label">Recordable ID</span>
|
|
42
|
+
<span class="exp-meta-value font-mono"><%= @record.recordable_id %></span>
|
|
43
|
+
</div>
|
|
44
|
+
<div class="exp-meta-item">
|
|
45
|
+
<span class="exp-meta-label">Created</span>
|
|
46
|
+
<span class="exp-meta-value"><%= time_ago_in_words(@record.created_at) %> ago</span>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
</section>
|
|
50
|
+
|
|
51
|
+
<%# Record Attributes %>
|
|
52
|
+
<section class="mb-8">
|
|
53
|
+
<div class="section-header">
|
|
54
|
+
<h3 class="section-title">Record Data</h3>
|
|
55
|
+
<span class="section-count"><%= @record.show_attributes.count %> fields</span>
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<% if @record.show_attributes.any? %>
|
|
59
|
+
<div class="grid gap-4" style="grid-template-columns: 1fr;">
|
|
60
|
+
<% @record.show_attributes.each do |key, value| %>
|
|
61
|
+
<div class="result-panel">
|
|
62
|
+
<div class="result-panel-header">
|
|
63
|
+
<span class="result-panel-label"><%= key.to_s.humanize %></span>
|
|
64
|
+
</div>
|
|
65
|
+
<div class="result-panel-content">
|
|
66
|
+
<% if value.to_s.length > 200 || value.to_s.include?("\n") %>
|
|
67
|
+
<pre class="result-code"><code><%= value %></code></pre>
|
|
68
|
+
<% else %>
|
|
69
|
+
<p style="color: var(--gray-200); margin: 0; font-size: var(--text-sm);"><%= value.presence || '—' %></p>
|
|
70
|
+
<% end %>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
<% end %>
|
|
74
|
+
</div>
|
|
75
|
+
<% else %>
|
|
76
|
+
<div class="empty-state-inline">
|
|
77
|
+
<p class="text-muted">No display attributes defined for this record type.</p>
|
|
27
78
|
</div>
|
|
28
79
|
<% end %>
|
|
29
|
-
</
|
|
30
|
-
|
|
80
|
+
</section>
|
|
81
|
+
|
|
82
|
+
<%# Record Navigation %>
|
|
83
|
+
<%
|
|
84
|
+
all_records = @dataset.dataset_records.order(:id).pluck(:id)
|
|
85
|
+
current_index = all_records.index(@record.id)
|
|
86
|
+
prev_record_id = current_index && current_index > 0 ? all_records[current_index - 1] : nil
|
|
87
|
+
next_record_id = current_index && current_index < all_records.length - 1 ? all_records[current_index + 1] : nil
|
|
88
|
+
%>
|
|
89
|
+
<% if prev_record_id || next_record_id %>
|
|
90
|
+
<section>
|
|
91
|
+
<div class="flex justify-between items-center" style="padding: var(--space-4) 0; border-top: 1px solid var(--gray-800);">
|
|
92
|
+
<% if prev_record_id %>
|
|
93
|
+
<%= link_to dataset_dataset_record_path(@dataset, prev_record_id), class: 'btn btn-ghost' do %>
|
|
94
|
+
<svg class="icon-sm" viewBox="0 0 20 20" fill="currentColor">
|
|
95
|
+
<path fill-rule="evenodd" d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z" clip-rule="evenodd" />
|
|
96
|
+
</svg>
|
|
97
|
+
Previous Record
|
|
98
|
+
<% end %>
|
|
99
|
+
<% else %>
|
|
100
|
+
<span></span>
|
|
101
|
+
<% end %>
|
|
102
|
+
|
|
103
|
+
<span class="text-sm text-muted">
|
|
104
|
+
Record <%= (current_index || 0) + 1 %> of <%= all_records.length %>
|
|
105
|
+
</span>
|
|
106
|
+
|
|
107
|
+
<% if next_record_id %>
|
|
108
|
+
<%= link_to dataset_dataset_record_path(@dataset, next_record_id), class: 'btn btn-ghost' do %>
|
|
109
|
+
Next Record
|
|
110
|
+
<svg class="icon-sm" viewBox="0 0 20 20" fill="currentColor">
|
|
111
|
+
<path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" />
|
|
112
|
+
</svg>
|
|
113
|
+
<% end %>
|
|
114
|
+
<% else %>
|
|
115
|
+
<span></span>
|
|
116
|
+
<% end %>
|
|
117
|
+
</div>
|
|
118
|
+
</section>
|
|
119
|
+
<% end %>
|
|
120
|
+
</div>
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
<tr class="
|
|
2
|
-
<td
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
</td>
|
|
8
|
-
<td class="
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<%= dataset.experiments.count %>
|
|
13
|
-
</td>
|
|
14
|
-
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
|
|
15
|
-
<%= link_to 'View', dataset_path(dataset), class: 'text-indigo-400 hover:text-indigo-300 transition-colors duration-200 mr-3' %>
|
|
16
|
-
<%= link_to 'Edit', edit_dataset_path(dataset), class: 'text-indigo-400 hover:text-indigo-300 transition-colors duration-200' %>
|
|
17
|
-
</td>
|
|
18
|
-
</tr>
|
|
1
|
+
<tr class="clickable-row" onclick="window.location='<%= dataset_path(dataset) %>'">
|
|
2
|
+
<td>
|
|
3
|
+
<span class="row-title"><%= dataset.name %></span>
|
|
4
|
+
<% if dataset.description.present? %>
|
|
5
|
+
<p class="text-xs text-muted truncate mt-1" style="max-width: 300px;"><%= dataset.description %></p>
|
|
6
|
+
<% end %>
|
|
7
|
+
</td>
|
|
8
|
+
<td class="text-right text-muted text-sm text-nowrap"><%= time_ago_in_words(dataset.created_at) %></td>
|
|
9
|
+
<td class="text-right cell-numeric font-mono"><%= dataset.dataset_records.count %></td>
|
|
10
|
+
<td class="text-right cell-numeric font-mono"><%= dataset.experiments.count %></td>
|
|
11
|
+
</tr>
|
|
@@ -1,24 +1,28 @@
|
|
|
1
|
-
<%= form_with(model: dataset, local: true, class: "
|
|
1
|
+
<%= form_with(model: dataset, local: true, class: "card p-5") do |form| %>
|
|
2
2
|
<% if dataset.errors.any? %>
|
|
3
|
-
<div class="
|
|
4
|
-
<
|
|
5
|
-
<ul
|
|
3
|
+
<div class="form-errors">
|
|
4
|
+
<p class="form-errors-title">Please fix the following errors:</p>
|
|
5
|
+
<ul>
|
|
6
6
|
<% dataset.errors.full_messages.each do |message| %>
|
|
7
7
|
<li><%= message %></li>
|
|
8
8
|
<% end %>
|
|
9
9
|
</ul>
|
|
10
10
|
</div>
|
|
11
11
|
<% end %>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
<%= form.
|
|
12
|
+
|
|
13
|
+
<div class="form-group">
|
|
14
|
+
<%= form.label :name, class: "form-label" %>
|
|
15
|
+
<%= form.text_field :name, autofocus: true, class: "form-input", placeholder: "e.g., Customer Support Q&A" %>
|
|
15
16
|
</div>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
<%= form.
|
|
17
|
+
|
|
18
|
+
<div class="form-group">
|
|
19
|
+
<%= form.label :description, class: "form-label" %>
|
|
20
|
+
<%= form.text_area :description, rows: 3, class: "form-textarea", placeholder: "Brief description of what this dataset contains..." %>
|
|
21
|
+
<p class="form-hint">Optional. Helps you and your team understand the dataset's purpose.</p>
|
|
19
22
|
</div>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
<%=
|
|
23
|
+
|
|
24
|
+
<div class="form-actions justify-end">
|
|
25
|
+
<%= link_to "Cancel", dataset.persisted? ? dataset_path(dataset) : datasets_path, class: "btn btn-ghost" %>
|
|
26
|
+
<%= form.submit dataset.persisted? ? "Save Changes" : "Create Dataset", class: "btn btn-primary" %>
|
|
23
27
|
</div>
|
|
24
|
-
<% end %>
|
|
28
|
+
<% end %>
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
<% content_for :title, "Edit #{@dataset.name}" %>
|
|
2
|
-
<div class="container
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
<div class="container page">
|
|
3
|
+
<div class="mb-6">
|
|
4
|
+
<div class="breadcrumb mb-2">
|
|
5
|
+
<%= link_to "Datasets", datasets_path, class: "breadcrumb-link" %>
|
|
6
|
+
<span class="breadcrumb-sep">/</span>
|
|
7
|
+
<%= link_to @dataset.name, dataset_path(@dataset), class: "breadcrumb-link" %>
|
|
8
|
+
<span class="breadcrumb-sep">/</span>
|
|
9
|
+
<span class="breadcrumb-current">Edit</span>
|
|
10
|
+
</div>
|
|
11
|
+
<h1 class="page-title">Edit Dataset</h1>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<div style="max-width: 560px;">
|
|
15
|
+
<%= render 'form', dataset: @dataset %>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
@@ -1,51 +1,43 @@
|
|
|
1
1
|
<% content_for :title, 'Datasets' %>
|
|
2
|
-
<div class="container
|
|
3
|
-
<div class="
|
|
4
|
-
<h1
|
|
5
|
-
<%= link_to new_dataset_path, class: "btn btn-primary
|
|
6
|
-
<svg
|
|
2
|
+
<div class="container page">
|
|
3
|
+
<div class="page-header">
|
|
4
|
+
<h1>Datasets</h1>
|
|
5
|
+
<%= link_to new_dataset_path, class: "btn btn-primary" do %>
|
|
6
|
+
<svg class="icon-sm" viewBox="0 0 20 20" fill="currentColor">
|
|
7
7
|
<path fill-rule="evenodd" d="M10 3a1 1 0 011 1v5h5a1 1 0 110 2h-5v5a1 1 0 11-2 0v-5H4a1 1 0 110-2h5V4a1 1 0 011-1z" clip-rule="evenodd" />
|
|
8
8
|
</svg>
|
|
9
|
-
|
|
9
|
+
New Dataset
|
|
10
10
|
<% end %>
|
|
11
11
|
</div>
|
|
12
|
+
|
|
12
13
|
<% if @datasets.any? %>
|
|
13
|
-
<div class="
|
|
14
|
-
<
|
|
15
|
-
<
|
|
16
|
-
<
|
|
17
|
-
<
|
|
18
|
-
Name
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
</
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
<th scope="col" class="relative px-6 py-3">
|
|
30
|
-
<span class="sr-only">Actions</span>
|
|
31
|
-
</th>
|
|
32
|
-
</tr>
|
|
33
|
-
</thead>
|
|
34
|
-
<tbody class="bg-gray-800 divide-y divide-gray-700">
|
|
35
|
-
<%= render @datasets %>
|
|
36
|
-
</tbody>
|
|
37
|
-
</table>
|
|
14
|
+
<div class="table-wrapper">
|
|
15
|
+
<div class="table-scroll">
|
|
16
|
+
<table class="table table-clickable">
|
|
17
|
+
<thead>
|
|
18
|
+
<tr>
|
|
19
|
+
<th>Name</th>
|
|
20
|
+
<th class="text-right" style="width: 90px;">Created</th>
|
|
21
|
+
<th class="text-right" style="width: 70px;">Records</th>
|
|
22
|
+
<th class="text-right" style="width: 70px;">Exps</th>
|
|
23
|
+
</tr>
|
|
24
|
+
</thead>
|
|
25
|
+
<tbody>
|
|
26
|
+
<%= render @datasets %>
|
|
27
|
+
</tbody>
|
|
28
|
+
</table>
|
|
29
|
+
</div>
|
|
38
30
|
</div>
|
|
39
31
|
<% else %>
|
|
40
|
-
<div class="
|
|
41
|
-
<
|
|
42
|
-
<
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
<%= link_to new_dataset_path, class: "btn btn-primary
|
|
48
|
-
<svg
|
|
32
|
+
<div class="card">
|
|
33
|
+
<div class="empty-state">
|
|
34
|
+
<svg class="empty-state-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
35
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10" />
|
|
36
|
+
</svg>
|
|
37
|
+
<h3 class="empty-state-title">No datasets yet</h3>
|
|
38
|
+
<p class="empty-state-description">Get started by creating a new dataset.</p>
|
|
39
|
+
<%= link_to new_dataset_path, class: "btn btn-primary" do %>
|
|
40
|
+
<svg class="icon-sm" viewBox="0 0 20 20" fill="currentColor">
|
|
49
41
|
<path fill-rule="evenodd" d="M10 3a1 1 0 011 1v5h5a1 1 0 110 2h-5v5a1 1 0 11-2 0v-5H4a1 1 0 110-2h5V4a1 1 0 011-1z" clip-rule="evenodd" />
|
|
50
42
|
</svg>
|
|
51
43
|
Create your first dataset
|
|
@@ -53,4 +45,4 @@
|
|
|
53
45
|
</div>
|
|
54
46
|
</div>
|
|
55
47
|
<% end %>
|
|
56
|
-
</div>
|
|
48
|
+
</div>
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
<% content_for :title, 'New Dataset' %>
|
|
2
|
-
<div class="container
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
<div class="container page">
|
|
3
|
+
<div class="mb-6">
|
|
4
|
+
<div class="breadcrumb mb-2">
|
|
5
|
+
<%= link_to "Datasets", datasets_path, class: "breadcrumb-link" %>
|
|
6
|
+
<span class="breadcrumb-sep">/</span>
|
|
7
|
+
<span class="breadcrumb-current">New</span>
|
|
8
|
+
</div>
|
|
9
|
+
<h1 class="page-title">New Dataset</h1>
|
|
10
|
+
<p class="text-muted text-sm mt-2">Create a dataset to organize your evaluation records.</p>
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
<div style="max-width: 560px;">
|
|
14
|
+
<%= render 'form', dataset: @dataset %>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|