motor-admin 0.2.12 β 0.2.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +18 -5
- data/app/controllers/motor/data_controller.rb +8 -4
- data/app/controllers/motor/sessions_controller.rb +13 -0
- data/config/locales/en.yml +10 -0
- data/config/locales/es.yml +10 -0
- data/config/locales/pt.yml +10 -0
- data/config/routes.rb +1 -0
- data/lib/generators/motor/templates/install.rb +1 -1
- data/lib/motor/active_record_utils/types.rb +1 -0
- data/lib/motor/active_record_utils.rb +12 -0
- data/lib/motor/build_schema/active_storage_attachment_schema.rb +1 -1
- data/lib/motor/build_schema/load_from_rails.rb +2 -1
- data/lib/motor/build_schema/merge_schema_configs.rb +1 -1
- data/lib/motor/resources.rb +1 -1
- data/lib/motor/version.rb +1 -1
- data/ui/dist/{main-192e078f9e813b1ffe93.css.gz β main-01a0523dc0c6602d6c7a.css.gz} +0 -0
- data/ui/dist/main-01a0523dc0c6602d6c7a.js.gz +0 -0
- data/ui/dist/manifest.json +5 -5
- metadata +5 -4
- data/ui/dist/main-192e078f9e813b1ffe93.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: 61f88afa9ad5347e0bb47c719212c895b42d687b78e128d2812d15b8099415e9
|
4
|
+
data.tar.gz: f7cdd045280ea0105d6d8022414e627d6cc8bff8519e554349735f55d2d58bf9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ae3737a3554d2ba6c5881a18dd3afc3b62bc3f728f73ed2b04ed10ec0ac8abc1790d08dca8c3e8752512a08dea606123c810b0d0f06e3c4d08d486fa16f565f
|
7
|
+
data.tar.gz: 409ec127ab1510c9e6c652e89ccfcff859050f62960fa738f4b803981f506956eac55960a1bc18a4e652e4019aaa343db5ce5cb89d9cacbe62b657cf908541d0
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Low-code Admin panel and Business intelligence Rails engine **(no DSL - configurable from the UI)**.
|
4
4
|
|
5
|
-
π€ [Demo App](https://motor-admin.herokuapp.com/demo) | π [Features overview](https://www.youtube.com/watch?v=ngVoci8Hll4&list=PLu7llEMh0KcOkR3Uy_RJT0cXPZQKAYVsq&index=1) | β [
|
5
|
+
π€ [Demo App](https://motor-admin.herokuapp.com/demo) | π [Features overview](https://www.youtube.com/watch?v=ngVoci8Hll4&list=PLu7llEMh0KcOkR3Uy_RJT0cXPZQKAYVsq&index=1) | β [Pro](https://www.getmotoradmin.com/pro)
|
6
6
|
|
7
7
|
[![Admin Panel](https://user-images.githubusercontent.com/5418788/119318538-1f30e300-bc82-11eb-94a4-107c31c93b13.png)](https://motor-admin.herokuapp.com/demo)
|
8
8
|
|
@@ -39,6 +39,19 @@ $ rails motor:install && rake db:migrate
|
|
39
39
|
* [Optimized for mobile](#optimized-for-mobile)
|
40
40
|
* [Configurations sync between environments](#configurations-sync)
|
41
41
|
|
42
|
+
## [Pro](https://www.getmotoradmin.com/pro)
|
43
|
+
|
44
|
+
* Multiple databases support
|
45
|
+
* Audit log
|
46
|
+
* Live collaboration
|
47
|
+
* Multi-factor authentication
|
48
|
+
* Custom styling
|
49
|
+
* Personalized report alerts via Slack
|
50
|
+
* Full-text search
|
51
|
+
* Stripe integration
|
52
|
+
* Shareable forms and reports
|
53
|
+
* [learn more](https://www.getmotoradmin.com/pro)
|
54
|
+
|
42
55
|
### Customizable CRUD
|
43
56
|
|
44
57
|
![Resource settings](https://user-images.githubusercontent.com/5418788/119318569-2a840e80-bc82-11eb-9ba3-f3964eb6f997.png)
|
@@ -49,7 +62,7 @@ Everything in the admin panel can be configured using the intuitive settings UI,
|
|
49
62
|
|
50
63
|
Data displayed on the resource page can be completely customized via [SQL queries](#sql-queries) and [dashboards](#dashboards) attached to the resource as a tab. Usually, queries used to display resource data should contain `{{resource_name_id}}` [variable](#sql-queries).
|
51
64
|
|
52
|
-
[Learn more about resource customizations](https://github.com/
|
65
|
+
[Learn more about resource customizations](https://github.com/motor-admin/motor-admin-rails/blob/master/guides/customizing_resource_table.md)
|
53
66
|
|
54
67
|
### Custom Actions
|
55
68
|
|
@@ -79,7 +92,7 @@ end
|
|
79
92
|
|
80
93
|
Values from the form fields can be used in API path via `{field_name}` syntax: `/api/some-endpoint/{resource_id}/apply`.
|
81
94
|
|
82
|
-
[Learn more about custom forms builder](https://github.com/
|
95
|
+
[Learn more about custom forms builder](https://github.com/motor-admin/motor-admin-rails/blob/master/guides/building_custom_forms.md)
|
83
96
|
|
84
97
|
### SQL Queries
|
85
98
|
|
@@ -115,7 +128,7 @@ Intelligence search can be opened via the top right corner button or using <kbd>
|
|
115
128
|
|
116
129
|
### Authorization
|
117
130
|
|
118
|
-
Motor Admin allows to set row-level and column-level permissions via [cancan](https://github.com/CanCanCommunity/cancancan) gem. Admin UI permissions should be defined in `app/models/motor/ability.rb` file in `Motor::Ability` class. See [Motor Admin guide](https://github.com/
|
131
|
+
Motor Admin allows to set row-level and column-level permissions via [cancan](https://github.com/CanCanCommunity/cancancan) gem. Admin UI permissions should be defined in `app/models/motor/ability.rb` file in `Motor::Ability` class. See [Motor Admin guide](https://github.com/motor-admin/motor-admin-rails/blob/master/guides/defining_permissions.md) and [CanCan documentation](https://github.com/CanCanCommunity/cancancan/blob/develop/docs/Defining-Abilities.md) to learn how to define user permissions.
|
119
132
|
|
120
133
|
### I18n
|
121
134
|
|
@@ -186,4 +199,4 @@ MOTOR_DEVELOPMENT=true rails s
|
|
186
199
|
|
187
200
|
## License
|
188
201
|
|
189
|
-
The gem is available as open source under the terms of the [MIT License](https://github.com/
|
202
|
+
The gem is available as open source under the terms of the [MIT License](https://github.com/motor-admin/motor-admin-rails/blob/master/LICENSE).
|
@@ -10,10 +10,14 @@ module Motor
|
|
10
10
|
def index
|
11
11
|
@resources = Motor::ApiQuery.call(@resources, params)
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
if params[:format] == 'csv'
|
14
|
+
render plain: Motor::ActiveRecordUtils.generate_csv_for_relation(@resources, reset_limit: true)
|
15
|
+
else
|
16
|
+
render json: {
|
17
|
+
data: Motor::ApiQuery::BuildJson.call(@resources, params, current_ability),
|
18
|
+
meta: Motor::ApiQuery::BuildMeta.call(@resources, params)
|
19
|
+
}
|
20
|
+
end
|
17
21
|
end
|
18
22
|
|
19
23
|
def show
|
data/config/locales/en.yml
CHANGED
@@ -266,3 +266,13 @@ en:
|
|
266
266
|
video: Video
|
267
267
|
display_column: Display column
|
268
268
|
not_authorized_to_perform_action: You are not authorized to perform this action.
|
269
|
+
download: Download
|
270
|
+
alert: Alert
|
271
|
+
downloading: Downloading
|
272
|
+
display_id: Display ID
|
273
|
+
display_settings: Display settings
|
274
|
+
sign_out: Sign out
|
275
|
+
header: Header
|
276
|
+
user_dropdown: User dropdown
|
277
|
+
upload: Upload
|
278
|
+
there_is_nothing_here_yet: There is nothing here yet π€·ββοΈ
|
data/config/locales/es.yml
CHANGED
@@ -266,6 +266,16 @@ es:
|
|
266
266
|
video: Video
|
267
267
|
display_column: Columna de visualizaciΓ³n
|
268
268
|
not_authorized_to_perform_action: No estΓ‘ autorizado a realizar esta acciΓ³n.
|
269
|
+
download: Descargar
|
270
|
+
alert: Alerta
|
271
|
+
downloading: Descargando
|
272
|
+
display_id: Visualizar ID
|
273
|
+
display_settings: ConfiguraciΓ³n de la pantalla
|
274
|
+
sign_out: Firmar la salida
|
275
|
+
header: Cabecera
|
276
|
+
user_dropdown: Despliegue del usuario
|
277
|
+
upload: Subir a
|
278
|
+
there_is_nothing_here_yet: TodavΓa no hay nada aquΓ π€·ββοΈ
|
269
279
|
i:
|
270
280
|
locale: es
|
271
281
|
select:
|
data/config/locales/pt.yml
CHANGED
@@ -262,6 +262,16 @@ pt:
|
|
262
262
|
video: VΓdeo
|
263
263
|
display_column: Coluna de exibição
|
264
264
|
not_authorized_to_perform_action: Não estÑ autorizado a realizar esta acção.
|
265
|
+
download: Descarregar
|
266
|
+
alert: Alerta
|
267
|
+
downloading: Descarregamento
|
268
|
+
display_id: Mostrar ID
|
269
|
+
display_settings: Definiçáes de visualização
|
270
|
+
sign_out: Sair
|
271
|
+
header: Cabeçalho
|
272
|
+
user_dropdown: DesistΓͺncia do utilizador
|
273
|
+
upload: Carregar
|
274
|
+
there_is_nothing_here_yet: Ainda nΓ£o hΓ‘ nada aqui π€·ββοΈ
|
265
275
|
i:
|
266
276
|
locale: pt
|
267
277
|
select:
|
data/config/routes.rb
CHANGED
@@ -19,6 +19,7 @@ Motor::Admin.routes.draw do
|
|
19
19
|
resources :icons, only: %i[index]
|
20
20
|
resources :active_storage_attachments, only: %i[create], path: 'data/active_storage__attachments'
|
21
21
|
resources :audits, only: %i[index]
|
22
|
+
resource :session, only: %i[destroy]
|
22
23
|
resources :resources, path: '/data/:resource',
|
23
24
|
only: %i[index show update create destroy],
|
24
25
|
controller: 'data',
|
@@ -150,7 +150,7 @@ class <%= migration_class_name %> < ActiveRecord::Migration[<%= ActiveRecord::Mi
|
|
150
150
|
|
151
151
|
model.create!(key: 'header.links', value: [{
|
152
152
|
name: 'βΒ Star on GitHub',
|
153
|
-
path: 'https://github.com/
|
153
|
+
path: 'https://github.com/motor-admin/motor-admin-rails'
|
154
154
|
}].to_json)
|
155
155
|
end
|
156
156
|
|
@@ -12,6 +12,18 @@ module Motor
|
|
12
12
|
ActiveRecord::Base.connection.reset_sequence!(model.table_name, 'id')
|
13
13
|
end
|
14
14
|
end
|
15
|
+
|
16
|
+
def generate_csv_for_relation(relation, reset_limit: false)
|
17
|
+
relation = relation.limit(nil).offset(nil) if reset_limit
|
18
|
+
|
19
|
+
result = relation.klass.connection.exec_query(relation.to_sql)
|
20
|
+
|
21
|
+
CSV.generate do |csv|
|
22
|
+
csv << result.columns
|
23
|
+
|
24
|
+
result.rows.each { |row| csv << row }
|
25
|
+
end
|
26
|
+
end
|
15
27
|
end
|
16
28
|
end
|
17
29
|
|
@@ -12,7 +12,7 @@ module Motor
|
|
12
12
|
{
|
13
13
|
name: model.name.underscore,
|
14
14
|
slug: Utils.slugify(model),
|
15
|
-
class_name: model.
|
15
|
+
class_name: model.name,
|
16
16
|
table_name: model.table_name,
|
17
17
|
primary_key: model.primary_key,
|
18
18
|
display_name: model.model_name.human(count: 2, default: 'Attachments'),
|
@@ -135,7 +135,7 @@ module Motor
|
|
135
135
|
access_type: ColumnAccessTypes::READ_ONLY,
|
136
136
|
column_source: ColumnSources::QUERY,
|
137
137
|
virtual: false
|
138
|
-
)
|
138
|
+
).with_indifferent_access
|
139
139
|
end
|
140
140
|
|
141
141
|
reflection_columns = columns_index.values.select { |c| c[:column_source] == ColumnSources::REFLECTION }
|
data/lib/motor/resources.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module Motor
|
4
4
|
module Resources
|
5
|
-
RESOURCE_ATTRS = %w[display_name display_column icon custom_sql visible].freeze
|
5
|
+
RESOURCE_ATTRS = %w[display_name display_column icon custom_sql visible display_primary_key].freeze
|
6
6
|
COLUMN_ATTRS = %w[name display_name column_type access_type default_value reference virtual format].freeze
|
7
7
|
ASSOCIATION_ATTRS = %w[name display_name model_name icon visible foreign_key primary_key options virtual
|
8
8
|
polymorphic slug].freeze
|
data/lib/motor/version.rb
CHANGED
Binary file
|
Binary file
|
data/ui/dist/manifest.json
CHANGED
@@ -2601,9 +2601,9 @@
|
|
2601
2601
|
"icons/zoom-out.svg.gz": "icons/zoom-out.svg.gz",
|
2602
2602
|
"icons/zoom-question.svg": "icons/zoom-question.svg",
|
2603
2603
|
"icons/zoom-question.svg.gz": "icons/zoom-question.svg.gz",
|
2604
|
-
"main-
|
2605
|
-
"main-
|
2606
|
-
"main-
|
2607
|
-
"main.css": "main-
|
2608
|
-
"main.js": "main-
|
2604
|
+
"main-01a0523dc0c6602d6c7a.css.gz": "main-01a0523dc0c6602d6c7a.css.gz",
|
2605
|
+
"main-01a0523dc0c6602d6c7a.js.LICENSE.txt": "main-01a0523dc0c6602d6c7a.js.LICENSE.txt",
|
2606
|
+
"main-01a0523dc0c6602d6c7a.js.gz": "main-01a0523dc0c6602d6c7a.js.gz",
|
2607
|
+
"main.css": "main-01a0523dc0c6602d6c7a.css",
|
2608
|
+
"main.js": "main-01a0523dc0c6602d6c7a.js"
|
2609
2609
|
}
|
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.2.
|
4
|
+
version: 0.2.16
|
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-10-
|
11
|
+
date: 2021-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord-filter
|
@@ -130,6 +130,7 @@ files:
|
|
130
130
|
- app/controllers/motor/run_queries_controller.rb
|
131
131
|
- app/controllers/motor/schema_controller.rb
|
132
132
|
- app/controllers/motor/send_alerts_controller.rb
|
133
|
+
- app/controllers/motor/sessions_controller.rb
|
133
134
|
- app/controllers/motor/tags_controller.rb
|
134
135
|
- app/controllers/motor/ui_controller.rb
|
135
136
|
- app/jobs/motor/alert_sending_job.rb
|
@@ -1524,8 +1525,8 @@ files:
|
|
1524
1525
|
- ui/dist/icons/zoom-money.svg.gz
|
1525
1526
|
- ui/dist/icons/zoom-out.svg.gz
|
1526
1527
|
- ui/dist/icons/zoom-question.svg.gz
|
1527
|
-
- ui/dist/main-
|
1528
|
-
- ui/dist/main-
|
1528
|
+
- ui/dist/main-01a0523dc0c6602d6c7a.css.gz
|
1529
|
+
- ui/dist/main-01a0523dc0c6602d6c7a.js.gz
|
1529
1530
|
- ui/dist/manifest.json
|
1530
1531
|
homepage:
|
1531
1532
|
licenses:
|
Binary file
|