motor-admin 0.1.46 → 0.1.47
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 +122 -8
- data/app/mailers/motor/alerts_mailer.rb +2 -2
- data/app/views/motor/alerts_mailer/alert_email.html.erb +1 -1
- data/lib/motor/build_schema/find_display_column.rb +1 -0
- data/lib/motor/build_schema/find_icon.rb +8 -7
- data/lib/motor/version.rb +1 -1
- data/ui/dist/{main-c0cfd92d021794d8cf13.css.gz → main-5cac10cadc5aa16e9b69.css.gz} +0 -0
- data/ui/dist/main-5cac10cadc5aa16e9b69.js.gz +0 -0
- data/ui/dist/manifest.json +5 -5
- metadata +4 -4
- data/ui/dist/main-c0cfd92d021794d8cf13.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: bb7c564e999344d1cd2b2939b095e1e5c0b27d441b176365192275f623a1a887
|
4
|
+
data.tar.gz: 748ecbf8188b5375efb7b957503f1d0986144e0fd394956edf81677623a73a59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8faab90b6e21873a78e2eab889d2a328550c4533b922040662011930d89e6d9e515ba1eb860ed2978033ab339b0cd686250994cf8ee8a70b89223fb66337ecb5
|
7
|
+
data.tar.gz: f51c89fdcd5f453793b89a37b4868f282ed2bb5d457cd4cb50b0a786592ccbceb8d0d458a98fa19a3b176698a1787b1845e7321a18ad5d3d11bbd94dd4684ca2
|
data/README.md
CHANGED
@@ -1,9 +1,10 @@
|
|
1
|
-
# Motor
|
1
|
+
# ⚡ Motor Admin
|
2
2
|
|
3
|
-
Admin
|
3
|
+
Low-code Admin panel and Business intelligence Rails engine **(no DSL - configurable from the UI)**.
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
🤓 [Demo App](https://motor-admin-demo.herokuapp.com)
|
6
|
+
|
7
|
+
[](https://motor-admin-demo.herokuapp.com)
|
7
8
|
|
8
9
|
## Installation
|
9
10
|
Add this line to your application's Gemfile:
|
@@ -17,16 +18,129 @@ And then execute:
|
|
17
18
|
$ bundle install
|
18
19
|
```
|
19
20
|
|
20
|
-
|
21
|
+
Create and run migration:
|
21
22
|
```bash
|
22
|
-
$
|
23
|
+
$ rails generate motor:install && rake db:migrate
|
23
24
|
```
|
24
25
|
|
25
|
-
|
26
|
+
## Features
|
27
|
+
|
28
|
+
* [Customizable CRUD](#customizable-crud)
|
29
|
+
* [Custom actions](#custom-actions)
|
30
|
+
* [Forms builder](#forms-builder)
|
31
|
+
* [SQL queries](#sql-queries)
|
32
|
+
* [Data visualization](#data-visualization)
|
33
|
+
* [Dashboards](#dashboards)
|
34
|
+
* [Email alerts](#email-alerts)
|
35
|
+
* [Intelligence search](#intelligence-search)
|
36
|
+
* [Optimized for mobile](#optimized-for-mobile)
|
37
|
+
* [Configurations sync between environments](#configurations-sync)
|
38
|
+
|
39
|
+
### Customizable CRUD
|
40
|
+
|
41
|
+

|
42
|
+
|
43
|
+

|
44
|
+
|
45
|
+
Everything in the admin panel can be configured using the intuitive settings that can be opened via the icon in the top right corner.
|
46
|
+
|
47
|
+
Data displayed on the resource page can be completely custimized 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).
|
48
|
+
|
49
|
+
### Custom Actions
|
50
|
+
|
51
|
+

|
52
|
+
|
53
|
+
Custom resource actions can be added via Active Record method call, API endpoint, or [custom forms](#forms-builder). Also, it's possible to override default Create/Update/Delete actions.
|
54
|
+
|
55
|
+
### Forms Builder
|
56
|
+
|
57
|
+

|
58
|
+
|
59
|
+
Values from the form fields can be used in API path via `{field_name}` syntax: `/api/some-endpoint/{field_name}/apply`
|
60
|
+
|
61
|
+
### SQL Queries
|
62
|
+
|
63
|
+

|
64
|
+
|
65
|
+
Queries can include embeded variables via `{{variable}}` syntax ([mustache](https://mustache.github.io)). `{{#variable}} ... {{/variable}}` syntax allows to decide if conditions inside the scope should be included in the query.
|
66
|
+
|
67
|
+
### Data Visualization
|
68
|
+
|
69
|
+

|
70
|
+
|
71
|
+
Data from the SQL query can be represented as: [table](https://motor-admin-demo.herokuapp.com/queries/12), [number](https://motor-admin-demo.herokuapp.com/queries/6), [line chart](https://motor-admin-demo.herokuapp.com/queries/3), [bar chart](https://motor-admin-demo.herokuapp.com/queries/1), [pie chart](https://motor-admin-demo.herokuapp.com/queries/9), [funnel](https://motor-admin-demo.herokuapp.com/queries/7), [markdown](https://motor-admin-demo.herokuapp.com/queries/8)
|
72
|
+
|
73
|
+
### Dashboards
|
74
|
+
|
75
|
+

|
76
|
+
|
77
|
+
SQL queries can be organized into dashboards to create a convenient representation of the data.
|
78
|
+
|
79
|
+
### Email Alerts
|
80
|
+
|
81
|
+

|
82
|
+
|
83
|
+
Query data can be sent via email periodically using the alerts feature. Interval of the alert email can be specified using natural language, e.g. `every day at midnight`, `every Monday at 8 PM`, `every weekday at 6AM and 6PM`, `every minute`.
|
84
|
+
|
85
|
+
The sender address can be specified using `MOTOR_ADMIN_FROM_ADDRESS` environment variable.
|
86
|
+
|
87
|
+
### Intelligence Search
|
88
|
+
|
89
|
+

|
90
|
+
|
91
|
+
Intelligence search can be opened from the top right corner or using <kbd>Cmd</kbd> + <kbd>P</kbd> shortcut.
|
92
|
+
|
93
|
+
|
94
|
+
### Optimized for Mobile
|
95
|
+
|
96
|
+

|
97
|
+
|
98
|
+
|
99
|
+
### Configurations Sync
|
100
|
+
|
101
|
+
All admin panel configurations are automatically stored in the `config/motor.yml` file. It's recommended to include this file in the application git repository to always have the admin panel configurations in sync across different local and remote environments.
|
102
|
+
|
103
|
+
It's possible to sync local development admin panel configurations with remote production application via `rake motor:sync` task:
|
104
|
+
|
26
105
|
```bash
|
27
|
-
|
106
|
+
MOTOR_SYNC_REMOTE_URL=https://remote-app-url/ MOTOR_SYNC_API_KEY=secure-random-string rake motor:sync
|
28
107
|
```
|
29
108
|
|
109
|
+
|
110
|
+
## Authentication
|
111
|
+
|
112
|
+
Admin panel can be secured with 'Basic authentication' by specifying `MOTOR_AUTH_USERNAME` and `MOTOR_AUTH_PASSWORD` environment variables.
|
113
|
+
|
114
|
+
Alternatively, it can be secured with [devise](https://github.com/heartcombo/devise/wiki/How-To:-Define-resource-actions-that-require-authentication-using-routes.rb) or any other authentication library used by the application:
|
115
|
+
|
116
|
+
```ruby
|
117
|
+
authenticate :admin_user do
|
118
|
+
mount Motor::Admin => '/admin'
|
119
|
+
end
|
120
|
+
```
|
121
|
+
|
122
|
+
## Development
|
123
|
+
|
124
|
+
Start webpack dev server:
|
125
|
+
|
126
|
+
```bash
|
127
|
+
yarn install && yarn serve
|
128
|
+
```
|
129
|
+
|
130
|
+
Start example application in development mode:
|
131
|
+
|
132
|
+
```bash
|
133
|
+
MOTOR_DEVELOPMENT=true rails s
|
134
|
+
```
|
135
|
+
|
136
|
+
## Comming Soon
|
137
|
+
|
138
|
+
* User groups
|
139
|
+
* Row-level permissions
|
140
|
+
* Multiple databases
|
141
|
+
* NoSQL data sources
|
142
|
+
* Pro Bussines intelligence features
|
143
|
+
|
30
144
|
## License
|
31
145
|
|
32
146
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
@@ -32,7 +32,7 @@ module Motor
|
|
32
32
|
from ||= mailer_config_from_address
|
33
33
|
from ||= "reports@#{ENV['HOST'].sub(/\Awww\./, '')}" if ENV['HOST'].present?
|
34
34
|
|
35
|
-
from
|
35
|
+
from || 'reports@example.com'
|
36
36
|
end
|
37
37
|
|
38
38
|
def application_mailer_default_from
|
@@ -42,7 +42,7 @@ module Motor
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def mailer_config_from_address
|
45
|
-
return if Rails.application.config.action_mailer.default_url_options
|
45
|
+
return if Rails.application.config.action_mailer.default_url_options&.dig(:host).blank?
|
46
46
|
|
47
47
|
"reports@#{Rails.application.config.action_mailer.default_url_options[:host].sub(/\Awww\./, '')}"
|
48
48
|
end
|
@@ -92,7 +92,7 @@
|
|
92
92
|
<th><%= column[:name] %></th>
|
93
93
|
<% end %>
|
94
94
|
</tr>
|
95
|
-
<% @query_result.data.first(
|
95
|
+
<% @query_result.data.first(40).each do |row| %>
|
96
96
|
<tr>
|
97
97
|
<% row.each do |col| %>
|
98
98
|
<td><%= col.respond_to?(:strftime) ? l(col, format: :long) : col.to_s.truncate(100) %></th>
|
@@ -3,6 +3,12 @@
|
|
3
3
|
module Motor
|
4
4
|
module FindIcon
|
5
5
|
ICONS_MAP = {
|
6
|
+
'audit' => 'history',
|
7
|
+
'block' => 'ban',
|
8
|
+
'blocked' => 'ban',
|
9
|
+
'blacklisted' => 'ban',
|
10
|
+
'blocklisted' => 'ban',
|
11
|
+
'banned' => 'ban',
|
6
12
|
'website' => 'world',
|
7
13
|
'location' => 'gps',
|
8
14
|
'photo' => 'photo',
|
@@ -28,7 +34,6 @@ module Motor
|
|
28
34
|
'token' => 'key',
|
29
35
|
'secret' => 'lock',
|
30
36
|
'automation' => 'manual-gearbox',
|
31
|
-
'email' => 'mail',
|
32
37
|
'relationship' => 'hierarchy',
|
33
38
|
'person' => 'user',
|
34
39
|
'people' => 'users',
|
@@ -43,7 +48,6 @@ module Motor
|
|
43
48
|
'rule' => 'manual-gearbox',
|
44
49
|
'tracking' => 'zoom-question',
|
45
50
|
'github' => 'brand-github',
|
46
|
-
'block' => 'ban',
|
47
51
|
'tag' => 'hash',
|
48
52
|
'category' => 'hash',
|
49
53
|
'label' => 'hash',
|
@@ -60,15 +64,11 @@ module Motor
|
|
60
64
|
'model' => 'hash',
|
61
65
|
'taxon' => 'hash',
|
62
66
|
'affiliate' => 'affiliate',
|
63
|
-
'blocked' => 'ban',
|
64
|
-
'blacklisted' => 'ban',
|
65
|
-
'blocklisted' => 'ban',
|
66
67
|
'chat' => 'message-circle',
|
67
68
|
'message' => 'messages',
|
68
69
|
'poll' => 'messages',
|
69
70
|
'feedpack' => 'messages',
|
70
71
|
'attachment' => 'paperclip',
|
71
|
-
'banned' => 'ban',
|
72
72
|
'certificate' => 'certificate',
|
73
73
|
'approval' => 'certificate',
|
74
74
|
'bank' => 'building-bank',
|
@@ -105,7 +105,8 @@ module Motor
|
|
105
105
|
'subscriber' => 'user-plus',
|
106
106
|
'product' => 'building-store',
|
107
107
|
'html' => 'code',
|
108
|
-
'stripe' => 'brand-stripe'
|
108
|
+
'stripe' => 'brand-stripe',
|
109
|
+
'email' => 'mail'
|
109
110
|
}.freeze
|
110
111
|
|
111
112
|
DEFAULT_ICON = 'database'
|
data/lib/motor/version.rb
CHANGED
Binary file
|
Binary file
|
data/ui/dist/manifest.json
CHANGED
@@ -2068,11 +2068,11 @@
|
|
2068
2068
|
"mail-opened.svg": "icons/mail-opened.svg",
|
2069
2069
|
"mail.svg": "icons/mail.svg",
|
2070
2070
|
"mailbox.svg": "icons/mailbox.svg",
|
2071
|
-
"main-
|
2072
|
-
"main-
|
2073
|
-
"main-
|
2074
|
-
"main.css": "main-
|
2075
|
-
"main.js": "main-
|
2071
|
+
"main-5cac10cadc5aa16e9b69.css.gz": "main-5cac10cadc5aa16e9b69.css.gz",
|
2072
|
+
"main-5cac10cadc5aa16e9b69.js.LICENSE.txt": "main-5cac10cadc5aa16e9b69.js.LICENSE.txt",
|
2073
|
+
"main-5cac10cadc5aa16e9b69.js.gz": "main-5cac10cadc5aa16e9b69.js.gz",
|
2074
|
+
"main.css": "main-5cac10cadc5aa16e9b69.css",
|
2075
|
+
"main.js": "main-5cac10cadc5aa16e9b69.js",
|
2076
2076
|
"man.svg": "icons/man.svg",
|
2077
2077
|
"manual-gearbox.svg": "icons/manual-gearbox.svg",
|
2078
2078
|
"map-2.svg": "icons/map-2.svg",
|
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.47
|
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-05-
|
11
|
+
date: 2021-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord-filter
|
@@ -1480,8 +1480,8 @@ files:
|
|
1480
1480
|
- ui/dist/icons/zoom-money.svg.gz
|
1481
1481
|
- ui/dist/icons/zoom-out.svg.gz
|
1482
1482
|
- ui/dist/icons/zoom-question.svg.gz
|
1483
|
-
- ui/dist/main-
|
1484
|
-
- ui/dist/main-
|
1483
|
+
- ui/dist/main-5cac10cadc5aa16e9b69.css.gz
|
1484
|
+
- ui/dist/main-5cac10cadc5aa16e9b69.js.gz
|
1485
1485
|
- ui/dist/manifest.json
|
1486
1486
|
homepage:
|
1487
1487
|
licenses:
|
Binary file
|