easy_ml 0.2.0.pre.rc93 → 0.2.0.pre.rc95
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/app/controllers/easy_ml/predictions_controller.rb +2 -1
- data/app/frontend/pages/SettingsPage.tsx +28 -1
- data/app/serializers/easy_ml/settings_serializer.rb +18 -0
- data/lib/easy_ml/error_logger/adapter.rb +16 -0
- data/lib/easy_ml/error_logger/rollbar_adapter.rb +23 -0
- data/lib/easy_ml/error_logger.rb +15 -0
- data/lib/easy_ml/version.rb +1 -1
- data/lib/easy_ml.rb +1 -0
- data/public/easy_ml/assets/.vite/manifest.json +1 -1
- data/public/easy_ml/assets/assets/entrypoints/{Application.tsx-KENNRQpC.js → Application.tsx-BXwsBCuQ.js} +58 -58
- data/public/easy_ml/assets/assets/entrypoints/{Application.tsx-KENNRQpC.js.map → Application.tsx-BXwsBCuQ.js.map} +1 -1
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c7bb2e3e683bfa64b859db712827e9c3f0253dfdbb0ca0ed1454a21c9eaced2
|
4
|
+
data.tar.gz: 7ed6cfa37a0723b2d2eeb7da2a98e5fa38608ac60e82536022949bcf6a4cf121
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0125002301a9455366d06397b75b991ab39b32d35f26c5a6130e133be6148dc8229240d3a7202914376bf407481b301faac35c72bf3c979923b2544230c0a3b3
|
7
|
+
data.tar.gz: f4233cfb23f8638507af07ba8806837dd89c4e7ba4c9b67f4c21ed0b78ceaa5e44d10a2a263dc573a649d9cdd0cb60f59212a065973df8dee942322b71b80f31
|
@@ -41,7 +41,8 @@ module EasyML
|
|
41
41
|
rescue ActiveRecord::RecordNotFound
|
42
42
|
render json: { error: "Model not found" }, status: :not_found
|
43
43
|
rescue => e
|
44
|
-
|
44
|
+
EasyML::ErrorLogger.error(e)
|
45
|
+
render json: { error: "Internal server error" }, status: 500
|
45
46
|
end
|
46
47
|
end
|
47
48
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React, { useState } from 'react';
|
2
2
|
import { usePage } from '@inertiajs/react'
|
3
3
|
import { useInertiaForm } from 'use-inertia-form';
|
4
|
-
import { Settings2, Save, AlertCircle, Key, Globe2, Database } from 'lucide-react';
|
4
|
+
import { Settings2, Save, AlertCircle, Key, Globe2, Database, GitBranch } from 'lucide-react';
|
5
5
|
import { PluginSettings } from '../components/settings/PluginSettings';
|
6
6
|
|
7
7
|
interface Settings {
|
@@ -9,6 +9,8 @@ interface Settings {
|
|
9
9
|
timezone: string;
|
10
10
|
s3_bucket: string;
|
11
11
|
s3_region: string;
|
12
|
+
git_sha: string;
|
13
|
+
version: string;
|
12
14
|
}
|
13
15
|
}
|
14
16
|
|
@@ -156,6 +158,31 @@ export default function SettingsPage({ settings: initialSettings }: { settings:
|
|
156
158
|
</div>
|
157
159
|
</div>
|
158
160
|
|
161
|
+
{/* Deployment Information */}
|
162
|
+
<div className="space-y-4">
|
163
|
+
<div className="flex items-center gap-2 mb-4">
|
164
|
+
<GitBranch className="w-5 h-5 text-gray-500" />
|
165
|
+
<h3 className="text-lg font-medium text-gray-900">Deployment Information</h3>
|
166
|
+
</div>
|
167
|
+
|
168
|
+
<div className="bg-gray-50 rounded-lg p-4">
|
169
|
+
<div className="space-y-1">
|
170
|
+
<div className="flex items-center gap-2">
|
171
|
+
<span className="text-sm font-medium text-gray-700">Git SHA</span>
|
172
|
+
<span className="text-sm font-mono bg-gray-100 px-2 py-1 rounded text-gray-600">
|
173
|
+
{initialSettings?.settings?.git_sha || 'Not available'}
|
174
|
+
</span>
|
175
|
+
</div>
|
176
|
+
<div className="flex items-center gap-2">
|
177
|
+
<span className="text-sm font-medium text-gray-700">EasyML Version</span>
|
178
|
+
<span className="text-sm font-mono bg-gray-100 px-2 py-1 rounded text-gray-600">
|
179
|
+
{initialSettings?.settings?.version || 'Not available'}
|
180
|
+
</span>
|
181
|
+
</div>
|
182
|
+
</div>
|
183
|
+
</div>
|
184
|
+
</div>
|
185
|
+
|
159
186
|
<div className="pt-6 border-t flex items-center justify-between">
|
160
187
|
{saved && (
|
161
188
|
<div className="flex items-center gap-2 text-green-600">
|
@@ -5,5 +5,23 @@ module EasyML
|
|
5
5
|
include JSONAPI::Serializer
|
6
6
|
|
7
7
|
attributes *EasyML::Settings.configuration_attributes
|
8
|
+
|
9
|
+
attribute :version do |object|
|
10
|
+
EasyML::VERSION
|
11
|
+
end
|
12
|
+
|
13
|
+
attribute :git_sha do |object|
|
14
|
+
# Get git SHA of the main app
|
15
|
+
if Rails.root.join('.git').exist?
|
16
|
+
sha = `cd #{Rails.root} && git rev-parse HEAD`.strip
|
17
|
+
sha.presence || "Git SHA unavailable"
|
18
|
+
elsif ENV["GIT_REVISION"]
|
19
|
+
ENV["GIT_REVISION"]
|
20
|
+
else
|
21
|
+
"Not a git repository"
|
22
|
+
end
|
23
|
+
rescue
|
24
|
+
"Error determining git SHA"
|
25
|
+
end
|
8
26
|
end
|
9
27
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EasyML
|
4
|
+
module ErrorLogger
|
5
|
+
class Adapter
|
6
|
+
require_relative "rollbar_adapter"
|
7
|
+
|
8
|
+
ADAPTERS = [RollbarAdapter]
|
9
|
+
|
10
|
+
def pick
|
11
|
+
adapter_class = ADAPTERS.find { |a| a.use? }
|
12
|
+
adapter_class.new
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EasyML
|
4
|
+
module ErrorLogger
|
5
|
+
class RollbarAdapter < Adapter
|
6
|
+
def error(e)
|
7
|
+
Rollbar.error(e)
|
8
|
+
end
|
9
|
+
|
10
|
+
def warning(e)
|
11
|
+
Rollbar.warning(e)
|
12
|
+
end
|
13
|
+
|
14
|
+
def info(e)
|
15
|
+
Rollbar.info(e)
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.use?
|
19
|
+
ENV["ROLLBAR_ACCESS_TOKEN"].present?
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/easy_ml/version.rb
CHANGED
data/lib/easy_ml.rb
CHANGED