motor-admin 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/motor/assets_controller.rb +15 -3
- data/lib/motor/alerts/persistance.rb +1 -2
- data/lib/motor/assets.rb +4 -4
- data/lib/motor/build_schema/find_display_column.rb +1 -1
- data/lib/motor/build_schema/load_from_rails.rb +7 -2
- data/lib/motor/dashboards/persistance.rb +2 -2
- data/lib/motor/forms/persistance.rb +2 -2
- data/lib/motor/queries/persistance.rb +2 -2
- data/lib/motor/version.rb +1 -1
- data/ui/dist/main-4bdedd7fcff1351efaf6.css.gz +0 -0
- data/ui/dist/main-4bdedd7fcff1351efaf6.js.gz +0 -0
- data/ui/dist/manifest.json +5 -5
- metadata +4 -4
- data/ui/dist/main-46621a8bdbb789e17c3f.css.gz +0 -0
- data/ui/dist/main-46621a8bdbb789e17c3f.js.gz +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dffbef14f764d553575a908cee996e197c587b0db25dbe039c95094e0291e451
|
4
|
+
data.tar.gz: 92ba80b363b93b28cd53a80cd0d9725f408f0a8269d0b7398080adfe2c55ad0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb50489810374fef3e44f5016660d4a73bb3e3234622b9452522e4050a48c50240ef296b24c7a1c78d73d202df648a60ae1fbcb3a957e20f1d4dac90b762c6ef
|
7
|
+
data.tar.gz: e94dc6c92b8d96f6d974dffca9fe49698455d3c2229eada3fa43654caf60e671ff9b8a0c8183fc58ac8b1edeec52e68004d869d2fe6934af42a2b4d55e60943f
|
@@ -9,19 +9,31 @@ module Motor
|
|
9
9
|
'text/css'
|
10
10
|
].freeze
|
11
11
|
|
12
|
+
MIME_TYPES = {
|
13
|
+
'.js' => 'application/javascript',
|
14
|
+
'.css' => 'text/css',
|
15
|
+
'.woff2' => 'font/woff2'
|
16
|
+
}.freeze
|
17
|
+
|
12
18
|
def show
|
13
19
|
filename = params[:filename]
|
14
20
|
|
15
21
|
return [404, {}, ''] unless Motor::Assets.manifest.values.include?(filename)
|
16
22
|
|
23
|
+
assign_headers(filename)
|
24
|
+
|
17
25
|
self.response_body = CACHE_STORE.fetch(filename) do
|
18
|
-
Motor::Assets.load_asset(filename)
|
26
|
+
Motor::Assets.load_asset(filename, gzip: headers['Content-Encoding'] == 'gzip')
|
19
27
|
end
|
28
|
+
end
|
20
29
|
|
21
|
-
|
30
|
+
private
|
22
31
|
|
23
|
-
|
32
|
+
def assign_headers(filename)
|
33
|
+
content_type = MIME_TYPES[File.extname(filename)]
|
24
34
|
|
35
|
+
headers['Content-Type'] = content_type
|
36
|
+
headers['Content-Encoding'] = 'gzip' if !Motor.development? && GZIP_TYPES.include?(content_type)
|
25
37
|
headers['Cache-Control'] = 'max-age=31536000'
|
26
38
|
end
|
27
39
|
end
|
@@ -44,10 +44,9 @@ module Motor
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def update_from_params!(alert, params)
|
47
|
-
raise NameAlreadyExists if name_already_exists?(alert)
|
48
|
-
|
49
47
|
alert = assign_attributes(alert, params)
|
50
48
|
|
49
|
+
raise NameAlreadyExists if name_already_exists?(alert)
|
51
50
|
raise InvalidInterval unless alert.cron
|
52
51
|
|
53
52
|
ApplicationRecord.transaction do
|
data/lib/motor/assets.rb
CHANGED
@@ -18,16 +18,16 @@ module Motor
|
|
18
18
|
Motor::Admin.routes.url_helpers.motor_asset_path(manifest[path])
|
19
19
|
end
|
20
20
|
|
21
|
-
def load_asset(filename)
|
21
|
+
def load_asset(filename, gzip: false)
|
22
22
|
if Motor.development?
|
23
23
|
load_from_dev_server(filename)
|
24
24
|
else
|
25
|
-
load_from_disk(filename)
|
25
|
+
load_from_disk(filename, gzip: gzip)
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
-
def load_from_disk(filename)
|
30
|
-
filename += '.gz' if
|
29
|
+
def load_from_disk(filename, gzip:)
|
30
|
+
filename += '.gz' if gzip
|
31
31
|
|
32
32
|
path = ASSETS_PATH.join(filename)
|
33
33
|
|
@@ -58,7 +58,11 @@ module Motor
|
|
58
58
|
def call
|
59
59
|
models.map do |model|
|
60
60
|
build_model_schema(model)
|
61
|
-
|
61
|
+
rescue StandardError => e
|
62
|
+
Rails.logger.error(e)
|
63
|
+
|
64
|
+
next
|
65
|
+
end.compact
|
62
66
|
end
|
63
67
|
|
64
68
|
def models
|
@@ -69,7 +73,8 @@ module Motor
|
|
69
73
|
|
70
74
|
models -= Motor::ApplicationRecord.descendants
|
71
75
|
models -= [ActiveRecord::SchemaMigration] if defined?(ActiveRecord::SchemaMigration)
|
72
|
-
models -= [ActiveStorage::Blob
|
76
|
+
models -= [ActiveStorage::Blob] if defined?(ActiveStorage::Blob)
|
77
|
+
models -= [ActiveStorage::VariantRecord] if defined?(ActiveStorage::VariantRecord)
|
73
78
|
|
74
79
|
models
|
75
80
|
end
|
@@ -30,10 +30,10 @@ module Motor
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def update_from_params!(dashboard, params)
|
33
|
-
raise TitleAlreadyExists if title_already_exists?(dashboard)
|
34
|
-
|
35
33
|
dashboard = assign_attributes(dashboard, params)
|
36
34
|
|
35
|
+
raise TitleAlreadyExists if title_already_exists?(dashboard)
|
36
|
+
|
37
37
|
ApplicationRecord.transaction do
|
38
38
|
dashboard.save!
|
39
39
|
end
|
@@ -30,10 +30,10 @@ module Motor
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def update_from_params!(form, params)
|
33
|
-
raise NameAlreadyExists if name_already_exists?(form)
|
34
|
-
|
35
33
|
form = assign_attributes(form, params)
|
36
34
|
|
35
|
+
raise NameAlreadyExists if name_already_exists?(form)
|
36
|
+
|
37
37
|
ApplicationRecord.transaction do
|
38
38
|
form.save!
|
39
39
|
end
|
@@ -30,10 +30,10 @@ module Motor
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def update_from_params!(query, params)
|
33
|
-
raise NameAlreadyExists if name_already_exists?(query)
|
34
|
-
|
35
33
|
query = assign_attributes(query, params)
|
36
34
|
|
35
|
+
raise NameAlreadyExists if name_already_exists?(query)
|
36
|
+
|
37
37
|
ApplicationRecord.transaction do
|
38
38
|
query.save!
|
39
39
|
end
|
data/lib/motor/version.rb
CHANGED
Binary file
|
Binary file
|
data/ui/dist/manifest.json
CHANGED
@@ -5,9 +5,9 @@
|
|
5
5
|
"fonts/ionicons.ttf?v=3.0.0-alpha.3": "fonts/ionicons.ttf",
|
6
6
|
"fonts/ionicons.woff2?v=3.0.0-alpha.3": "fonts/ionicons.woff2",
|
7
7
|
"fonts/ionicons.woff?v=3.0.0-alpha.3": "fonts/ionicons.woff",
|
8
|
-
"main-
|
9
|
-
"main-
|
10
|
-
"main-
|
11
|
-
"main.css": "main-
|
12
|
-
"main.js": "main-
|
8
|
+
"main-4bdedd7fcff1351efaf6.css.gz": "main-4bdedd7fcff1351efaf6.css.gz",
|
9
|
+
"main-4bdedd7fcff1351efaf6.js.LICENSE.txt": "main-4bdedd7fcff1351efaf6.js.LICENSE.txt",
|
10
|
+
"main-4bdedd7fcff1351efaf6.js.gz": "main-4bdedd7fcff1351efaf6.js.gz",
|
11
|
+
"main.css": "main-4bdedd7fcff1351efaf6.css",
|
12
|
+
"main.js": "main-4bdedd7fcff1351efaf6.js"
|
13
13
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: motor-admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pete Matsyburka
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-04-
|
11
|
+
date: 2021-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord-filter
|
@@ -208,8 +208,8 @@ files:
|
|
208
208
|
- lib/motor/ui_configs.rb
|
209
209
|
- lib/motor/version.rb
|
210
210
|
- ui/dist/fonts/ionicons.woff2
|
211
|
-
- ui/dist/main-
|
212
|
-
- ui/dist/main-
|
211
|
+
- ui/dist/main-4bdedd7fcff1351efaf6.css.gz
|
212
|
+
- ui/dist/main-4bdedd7fcff1351efaf6.js.gz
|
213
213
|
- ui/dist/manifest.json
|
214
214
|
homepage:
|
215
215
|
licenses:
|
Binary file
|
Binary file
|