marty 2.5.2 → 2.5.4
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 +5 -5
- data/.gitignore +4 -0
- data/.rubocop.yml +7 -0
- data/.rubocop_todo.yml +11 -589
- data/Gemfile +9 -9
- data/Gemfile.lock +1 -1
- data/Rakefile +1 -3
- data/app/components/marty/api_auth_view.rb +3 -3
- data/app/components/marty/api_config_view.rb +8 -8
- data/app/components/marty/api_log_view.rb +16 -20
- data/app/components/marty/auth_app.rb +6 -6
- data/app/components/marty/base_rule_view.rb +27 -19
- data/app/components/marty/config_view.rb +12 -9
- data/app/components/marty/data_grid_view.rb +26 -26
- data/app/components/marty/delorean_rule_view.rb +0 -1
- data/app/components/marty/event_view.rb +27 -27
- data/app/components/marty/extras/layout.rb +26 -26
- data/app/components/marty/extras/misc.rb +2 -2
- data/app/components/marty/grid.rb +13 -13
- data/app/components/marty/grid_append_only.rb +0 -1
- data/app/components/marty/import_type_view.rb +13 -13
- data/app/components/marty/import_view.rb +17 -16
- data/app/components/marty/log_view.rb +16 -14
- data/app/components/marty/main_auth_app.rb +59 -59
- data/app/components/marty/main_auth_app/client/main_auth_app.js +3 -3
- data/app/components/marty/mcfly_grid_panel.rb +10 -10
- data/app/components/marty/new_posting_form.rb +11 -11
- data/app/components/marty/new_posting_window.rb +0 -1
- data/app/components/marty/posting_grid.rb +12 -13
- data/app/components/marty/promise_view.rb +6 -6
- data/app/components/marty/report_form.rb +50 -53
- data/app/components/marty/report_select.rb +27 -27
- data/app/components/marty/reporting.rb +4 -4
- data/app/components/marty/script_form.rb +40 -42
- data/app/components/marty/script_grid.rb +24 -24
- data/app/components/marty/script_tester.rb +40 -42
- data/app/components/marty/scripting.rb +25 -27
- data/app/components/marty/simple_app.rb +24 -9
- data/app/components/marty/tag_grid.rb +12 -13
- data/app/components/marty/user_view.rb +35 -35
- data/app/controllers/marty/application_controller.rb +3 -4
- data/app/controllers/marty/components_controller.rb +1 -1
- data/app/controllers/marty/delayed_job_controller.rb +1 -0
- data/app/controllers/marty/diagnostic/controller.rb +4 -6
- data/app/controllers/marty/job_controller.rb +6 -6
- data/app/controllers/marty/report_controller.rb +11 -11
- data/app/controllers/marty/rpc_controller.rb +15 -16
- data/app/helpers/marty/script_set.rb +4 -4
- data/app/models/marty/api_auth.rb +4 -5
- data/app/models/marty/api_config.rb +1 -1
- data/app/models/marty/base.rb +9 -8
- data/app/models/marty/base_rule.rb +18 -13
- data/app/models/marty/config.rb +4 -5
- data/app/models/marty/data_grid.rb +157 -181
- data/app/models/marty/delorean_rule.rb +63 -62
- data/app/models/marty/enum.rb +1 -1
- data/app/models/marty/event.rb +56 -59
- data/app/models/marty/helper.rb +38 -6
- data/app/models/marty/import_type.rb +6 -6
- data/app/models/marty/log.rb +3 -2
- data/app/models/marty/name_validator.rb +3 -2
- data/app/models/marty/pg_enum.rb +3 -4
- data/app/models/marty/posting.rb +20 -24
- data/app/models/marty/promise.rb +28 -30
- data/app/models/marty/script.rb +30 -28
- data/app/models/marty/tag.rb +8 -8
- data/app/models/marty/token.rb +2 -2
- data/app/models/marty/user.rb +24 -23
- data/app/models/marty/vw_promise.rb +10 -11
- data/config/routes.rb +2 -2
- data/delorean/blame_report.dl +268 -0
- data/{spec/dummy/delorean/fields.dl → delorean/marty_fields.dl} +8 -0
- data/delorean/table_report.dl +34 -0
- data/docker-compose.dummy.yml +2 -3
- data/lib/marty/aws/base.rb +8 -8
- data/lib/marty/aws/request.rb +4 -4
- data/lib/marty/cache_adapters/mcfly_ruby_cache.rb +1 -0
- data/lib/marty/content_handler.rb +25 -25
- data/lib/marty/data_change.rb +49 -71
- data/lib/marty/data_conversion.rb +20 -28
- data/lib/marty/data_exporter.rb +25 -28
- data/lib/marty/data_importer.rb +25 -27
- data/lib/marty/engine.rb +1 -2
- data/lib/marty/json_schema.rb +22 -24
- data/lib/marty/logger.rb +6 -9
- data/lib/marty/mcfly_model.rb +20 -24
- data/lib/marty/migrations.rb +37 -35
- data/lib/marty/monkey.rb +33 -33
- data/lib/marty/permissions.rb +18 -18
- data/lib/marty/promise_job.rb +17 -17
- data/lib/marty/promise_proxy.rb +6 -6
- data/lib/marty/relation.rb +6 -7
- data/lib/marty/rpc_call.rb +13 -12
- data/lib/marty/rule_script_set.rb +32 -28
- data/lib/marty/schema_helper.rb +37 -51
- data/lib/marty/util.rb +25 -24
- data/lib/marty/version.rb +1 -1
- data/lib/marty/xl.rb +121 -115
- data/make-dummy.mk +3 -0
- data/marty.gemspec +21 -21
- data/other/marty/api/base.rb +34 -35
- data/other/marty/diagnostic/aws/ec2_instance.rb +8 -8
- data/other/marty/diagnostic/base.rb +13 -14
- data/other/marty/diagnostic/collection.rb +2 -1
- data/other/marty/diagnostic/connections.rb +8 -6
- data/other/marty/diagnostic/database.rb +1 -0
- data/other/marty/diagnostic/delayed_job_version.rb +7 -9
- data/other/marty/diagnostic/delayed_job_worker_total_count.rb +1 -1
- data/other/marty/diagnostic/delayed_job_workers.rb +1 -1
- data/other/marty/diagnostic/environment_variables.rb +17 -15
- data/other/marty/diagnostic/fatal.rb +1 -1
- data/other/marty/diagnostic/node.rb +5 -9
- data/other/marty/diagnostic/nodes.rb +7 -5
- data/other/marty/diagnostic/packer.rb +7 -7
- data/other/marty/diagnostic/reporter.rb +24 -27
- data/other/marty/diagnostic/version.rb +3 -5
- data/script/rails +2 -1
- data/spec/controllers/application_controller_spec.rb +6 -6
- data/spec/controllers/delayed_job_controller_spec.rb +4 -4
- data/spec/controllers/diagnostic/controller_spec.rb +59 -60
- data/spec/controllers/job_controller_spec.rb +68 -69
- data/spec/controllers/rpc_controller_spec.rb +353 -359
- data/spec/controllers/rpc_import_spec.rb +15 -16
- data/spec/dummy/delorean/blame_report.dl +110 -15
- data/spec/dummy/delorean/data_report.dl +4 -4
- data/spec/dummy/delorean/marty_fields.dl +63 -0
- data/spec/dummy/delorean/table_report.dl +34 -0
- data/spec/features/auth_app_spec.rb +1 -2
- data/spec/features/data_import_spec.rb +2 -3
- data/spec/features/enum_spec.rb +42 -46
- data/spec/features/jobs_dashboard_spec.rb +14 -8
- data/spec/features/log_view_spec.rb +40 -43
- data/spec/features/reporting_spec.rb +15 -15
- data/spec/features/rule_spec.rb +195 -190
- data/spec/features/scripting_spec.rb +17 -20
- data/spec/features/scripting_test_spec.rb +32 -33
- data/spec/features/user_view_spec.rb +15 -17
- data/spec/job_helper.rb +11 -11
- data/spec/lib/data_blame_spec.rb +82 -0
- data/spec/lib/data_exporter_spec.rb +31 -32
- data/spec/lib/data_importer_spec.rb +382 -395
- data/spec/lib/delorean_query_spec.rb +117 -119
- data/spec/lib/json_schema_spec.rb +382 -392
- data/spec/lib/logger_spec.rb +23 -24
- data/spec/lib/mcfly_model_spec.rb +112 -109
- data/spec/lib/migrations_spec.rb +10 -10
- data/spec/lib/struct_compare_spec.rb +6 -6
- data/spec/lib/table_report_spec.rb +90 -0
- data/spec/lib/xl_spec.rb +63 -65
- data/spec/lib/xl_styles_spec.rb +16 -19
- data/spec/models/api_auth_spec.rb +30 -30
- data/spec/models/config_spec.rb +32 -32
- data/spec/models/data_grid_spec.rb +642 -655
- data/spec/models/event_spec.rb +96 -88
- data/spec/models/import_type_spec.rb +20 -20
- data/spec/models/posting_spec.rb +35 -35
- data/spec/models/promise_spec.rb +5 -5
- data/spec/models/rule_spec.rb +280 -269
- data/spec/models/script_spec.rb +27 -18
- data/spec/models/user_spec.rb +9 -9
- data/spec/other/diagnostic/base_spec.rb +20 -19
- data/spec/other/diagnostic/collection_spec.rb +6 -5
- data/spec/other/diagnostic/delayed_job_version_spec.rb +1 -1
- data/spec/other/diagnostic/delayed_job_workers_spec.rb +8 -8
- data/spec/other/diagnostic/reporter_spec.rb +31 -33
- data/spec/spec_helper.rb +5 -5
- data/spec/support/chromedriver.rb +3 -5
- data/spec/support/components/netzke_combobox.rb +1 -1
- data/spec/support/components/netzke_grid.rb +17 -17
- data/spec/support/custom_matchers.rb +2 -2
- data/spec/support/download_helper.rb +1 -1
- data/spec/support/helper.rb +1 -2
- data/spec/support/netzke.rb +31 -31
- data/spec/support/performance_helper.rb +8 -8
- data/spec/support/post_run_logger.rb +1 -2
- data/spec/support/setup.rb +1 -4
- data/spec/support/shared_connection.rb +2 -2
- data/spec/support/structure_compare.rb +21 -22
- data/spec/support/suite.rb +1 -2
- data/spec/support/users.rb +5 -6
- metadata +32 -26
|
@@ -1,31 +1,30 @@
|
|
|
1
1
|
class Marty::Scripting < Netzke::Base
|
|
2
|
-
|
|
3
2
|
def configure(c)
|
|
4
3
|
super
|
|
5
4
|
|
|
6
5
|
c.items =
|
|
7
6
|
[
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
7
|
+
:script_form,
|
|
8
|
+
{
|
|
9
|
+
xtype: 'tabpanel',
|
|
10
|
+
active_tab: 0,
|
|
11
|
+
region: :center,
|
|
12
|
+
split: true,
|
|
13
|
+
items: [
|
|
14
|
+
{
|
|
15
|
+
title: I18n.t('script.selection'),
|
|
16
|
+
layout: {
|
|
17
|
+
type: :vbox,
|
|
18
|
+
align: :stretch,
|
|
19
|
+
},
|
|
20
|
+
items: [
|
|
21
|
+
:tag_grid,
|
|
22
|
+
:script_grid,
|
|
23
|
+
],
|
|
24
|
+
},
|
|
25
|
+
:script_tester,
|
|
26
|
+
],
|
|
27
|
+
},
|
|
29
28
|
]
|
|
30
29
|
end
|
|
31
30
|
|
|
@@ -49,19 +48,19 @@ class Marty::Scripting < Netzke::Base
|
|
|
49
48
|
c.width = 400
|
|
50
49
|
c.height = 300
|
|
51
50
|
c.load_inline_data = false
|
|
52
|
-
c.title = I18n.t(
|
|
51
|
+
c.title = I18n.t('script.selection_history')
|
|
53
52
|
end
|
|
54
53
|
|
|
55
54
|
component :script_grid do |c|
|
|
56
55
|
c.width = 400
|
|
57
56
|
c.klass = Marty::ScriptGrid
|
|
58
|
-
c.title = I18n.t(
|
|
57
|
+
c.title = I18n.t('script.selection_list')
|
|
59
58
|
c.flex = 1
|
|
60
59
|
end
|
|
61
60
|
|
|
62
61
|
component :script_form do |c|
|
|
63
62
|
c.klass = Marty::ScriptForm
|
|
64
|
-
c.title = I18n.t(
|
|
63
|
+
c.title = I18n.t('script.detail')
|
|
65
64
|
c.flex = 1
|
|
66
65
|
c.split = true
|
|
67
66
|
c.region = :west
|
|
@@ -69,10 +68,9 @@ class Marty::Scripting < Netzke::Base
|
|
|
69
68
|
|
|
70
69
|
component :script_tester do |c|
|
|
71
70
|
c.klass = Marty::ScriptTester
|
|
72
|
-
c.title = I18n.t(
|
|
71
|
+
c.title = I18n.t('script.tester')
|
|
73
72
|
c.flex = 1
|
|
74
73
|
end
|
|
75
|
-
|
|
76
74
|
end
|
|
77
75
|
|
|
78
76
|
Scripting = Marty::Scripting
|
|
@@ -6,13 +6,23 @@
|
|
|
6
6
|
# * AJAX activity indicator
|
|
7
7
|
#
|
|
8
8
|
# == Extending SimpleApp
|
|
9
|
-
# You may want to extend SimpleApp to provide a custom layout.
|
|
9
|
+
# You may want to extend SimpleApp to provide a custom layout.
|
|
10
|
+
# Make sure you create three regions with predefined itemId's
|
|
11
|
+
# that will be used by SimpleApp.
|
|
12
|
+
# You can use the following methods defined by SimpleApp:
|
|
13
|
+
# main_panel_config, status_bar_config, and menu_bar_config,
|
|
14
|
+
# e.g.:
|
|
10
15
|
#
|
|
11
16
|
# class MySimpleApp < Netzke::Basepack::SimpleApp
|
|
12
17
|
#
|
|
13
18
|
# def configuration
|
|
14
19
|
# super.merge(
|
|
15
|
-
# :items => [
|
|
20
|
+
# :items => [
|
|
21
|
+
# my_custom_navigation_config,
|
|
22
|
+
# main_panel_config,
|
|
23
|
+
# menu_bar_config,
|
|
24
|
+
# status_bar_config
|
|
25
|
+
# ]
|
|
16
26
|
# )
|
|
17
27
|
# end
|
|
18
28
|
#
|
|
@@ -27,12 +37,17 @@
|
|
|
27
37
|
# ...
|
|
28
38
|
# end
|
|
29
39
|
#
|
|
30
|
-
# The JS side of the component will have those regions referenced as
|
|
40
|
+
# The JS side of the component will have those regions referenced as
|
|
41
|
+
# this.mainPanel, this.statusBar, and this.menuBar.
|
|
31
42
|
class Marty::SimpleApp < Netzke::Base
|
|
32
43
|
client_class do |c|
|
|
33
|
-
c.extend =
|
|
44
|
+
c.extend = 'Ext.container.Viewport'
|
|
34
45
|
c.layout = :border
|
|
35
|
-
c.require
|
|
46
|
+
c.require(
|
|
47
|
+
Netzke::Core.ext_path.join('packages/ux/classic/src/statusbar/StatusBar.js'),
|
|
48
|
+
:statusbar_ext
|
|
49
|
+
)
|
|
50
|
+
|
|
36
51
|
c.include :simple_app
|
|
37
52
|
end
|
|
38
53
|
|
|
@@ -43,7 +58,7 @@ class Marty::SimpleApp < Netzke::Base
|
|
|
43
58
|
|
|
44
59
|
# In Ext 4.1 calling `render` on a viewport causes an error
|
|
45
60
|
def js_component_render
|
|
46
|
-
|
|
61
|
+
''
|
|
47
62
|
end
|
|
48
63
|
|
|
49
64
|
# Override for custom menu
|
|
@@ -68,8 +83,8 @@ class Marty::SimpleApp < Netzke::Base
|
|
|
68
83
|
:region => 'south',
|
|
69
84
|
:statusAlign => 'right',
|
|
70
85
|
:busyText => 'Busy...',
|
|
71
|
-
:default_text =>
|
|
72
|
-
:default_icon_cls =>
|
|
86
|
+
:default_text => 'Ready',
|
|
87
|
+
:default_icon_cls => ''
|
|
73
88
|
}.merge(overrides)
|
|
74
89
|
end
|
|
75
90
|
|
|
@@ -77,7 +92,7 @@ class Marty::SimpleApp < Netzke::Base
|
|
|
77
92
|
def menu_bar_config(overrides = {})
|
|
78
93
|
{
|
|
79
94
|
:itemId => 'menu_bar',
|
|
80
|
-
:layout => {overflow_handler: 'Menu'},
|
|
95
|
+
:layout => { overflow_handler: 'Menu' },
|
|
81
96
|
:xtype => 'toolbar',
|
|
82
97
|
:region => 'north',
|
|
83
98
|
:items => menu
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
class Marty::TagGrid < Marty::Grid
|
|
2
2
|
has_marty_permissions \
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
read: :any,
|
|
4
|
+
create: :dev
|
|
5
5
|
|
|
6
6
|
def configure(c)
|
|
7
7
|
super
|
|
8
8
|
|
|
9
9
|
c.header = false
|
|
10
|
-
c.model =
|
|
10
|
+
c.model = 'Marty::Tag'
|
|
11
11
|
c.multi_select = false
|
|
12
12
|
|
|
13
13
|
c.attributes ||= [:name, :created_dt, :user__name, :comment]
|
|
14
14
|
|
|
15
|
-
c.store_config.merge!(
|
|
16
|
-
direction: 'DESC'}]
|
|
15
|
+
c.store_config.merge!(sorters: [{ property: :created_dt,
|
|
16
|
+
direction: 'DESC' }])
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
endpoint :add_window__add_form__submit do |params|
|
|
20
20
|
data = ActiveSupport::JSON.decode(params[:data])
|
|
21
21
|
|
|
22
|
-
return client.netzke_notify(
|
|
22
|
+
return client.netzke_notify('Permission Denied') if
|
|
23
23
|
!config[:permissions][:create]
|
|
24
24
|
|
|
25
25
|
# FIXME: disallow tag creation when no script has been modified?
|
|
26
26
|
|
|
27
|
-
tag = Marty::Tag.do_create(nil, data[
|
|
27
|
+
tag = Marty::Tag.do_create(nil, data['comment'])
|
|
28
28
|
|
|
29
29
|
if tag.valid?
|
|
30
30
|
client.success = true
|
|
@@ -36,9 +36,9 @@ class Marty::TagGrid < Marty::Grid
|
|
|
36
36
|
end
|
|
37
37
|
|
|
38
38
|
action :add_in_form do |a|
|
|
39
|
-
a.text = I18n.t(
|
|
40
|
-
a.tooltip = I18n.t(
|
|
41
|
-
a.icon_cls =
|
|
39
|
+
a.text = I18n.t('tag_grid.new')
|
|
40
|
+
a.tooltip = I18n.t('tag_grid.new')
|
|
41
|
+
a.icon_cls = 'fa fa-clock glyph'
|
|
42
42
|
a.disabled = !config[:permissions][:create]
|
|
43
43
|
end
|
|
44
44
|
|
|
@@ -58,8 +58,8 @@ class Marty::TagGrid < Marty::Grid
|
|
|
58
58
|
end
|
|
59
59
|
|
|
60
60
|
attribute :created_dt do |c|
|
|
61
|
-
c.text =
|
|
62
|
-
c.format =
|
|
61
|
+
c.text = 'Date/Time'
|
|
62
|
+
c.format = 'Y-m-d H:i'
|
|
63
63
|
c.hidden = true
|
|
64
64
|
end
|
|
65
65
|
|
|
@@ -71,7 +71,6 @@ class Marty::TagGrid < Marty::Grid
|
|
|
71
71
|
c.width = 100
|
|
72
72
|
c.flex = 1
|
|
73
73
|
end
|
|
74
|
-
|
|
75
74
|
end
|
|
76
75
|
|
|
77
76
|
TagGrid = Marty::TagGrid
|
|
@@ -7,11 +7,11 @@ module Marty; class UserView < Marty::Grid
|
|
|
7
7
|
# list of columns to be displayed in the grid view
|
|
8
8
|
def self.user_columns
|
|
9
9
|
[
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
:login,
|
|
11
|
+
:firstname,
|
|
12
|
+
:lastname,
|
|
13
|
+
:active,
|
|
14
|
+
:roles,
|
|
15
15
|
]
|
|
16
16
|
end
|
|
17
17
|
|
|
@@ -19,12 +19,12 @@ module Marty; class UserView < Marty::Grid
|
|
|
19
19
|
super
|
|
20
20
|
|
|
21
21
|
c.attributes ||= self.class.user_columns
|
|
22
|
-
c.title ||= I18n.t('users', default:
|
|
23
|
-
c.model =
|
|
22
|
+
c.title ||= I18n.t('users', default: 'Users')
|
|
23
|
+
c.model = 'Marty::User'
|
|
24
24
|
c.editing = :in_form
|
|
25
25
|
c.paging = :pagination
|
|
26
26
|
c.multi_select = false
|
|
27
|
-
c.store_config.merge!(sorters: [{property: :login,
|
|
27
|
+
c.store_config.merge!(sorters: [{ property: :login,
|
|
28
28
|
direction: 'ASC',
|
|
29
29
|
}]) if c.attributes.include?(:login)
|
|
30
30
|
c.scope = ->(arel) { arel.includes(:roles) }
|
|
@@ -39,22 +39,22 @@ module Marty; class UserView < Marty::Grid
|
|
|
39
39
|
end
|
|
40
40
|
|
|
41
41
|
# set new roles
|
|
42
|
-
user.roles = Role.select {
|
|
43
|
-
|
|
42
|
+
user.roles = Role.select { |r|
|
|
43
|
+
roles.include? I18n.t("roles.#{r.name}")
|
|
44
44
|
}
|
|
45
45
|
end
|
|
46
46
|
|
|
47
47
|
def self.create_edit_user(data)
|
|
48
48
|
# Creates initial place-holder user object and validate
|
|
49
|
-
user = data[
|
|
49
|
+
user = data['id'].nil? ? User.new : User.find(data['id'])
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
user_columns.each do |c|
|
|
52
|
+
user.send("#{c}=", data[c.to_s]) unless c == :roles
|
|
53
|
+
end
|
|
54
54
|
|
|
55
55
|
if user.valid?
|
|
56
56
|
user.save
|
|
57
|
-
set_roles(data[
|
|
57
|
+
set_roles(data['roles'], user)
|
|
58
58
|
end
|
|
59
59
|
|
|
60
60
|
user
|
|
@@ -66,10 +66,10 @@ module Marty; class UserView < Marty::Grid
|
|
|
66
66
|
endpoint :add_window__add_form__submit do |params|
|
|
67
67
|
data = ActiveSupport::JSON.decode(params[:data])
|
|
68
68
|
|
|
69
|
-
data[
|
|
69
|
+
data['id'] = nil
|
|
70
70
|
|
|
71
71
|
unless self.class.can_perform_action?(:create)
|
|
72
|
-
client.netzke_notify
|
|
72
|
+
client.netzke_notify 'Permission Denied'
|
|
73
73
|
return
|
|
74
74
|
end
|
|
75
75
|
|
|
@@ -85,7 +85,7 @@ module Marty; class UserView < Marty::Grid
|
|
|
85
85
|
endpoint :edit_window__edit_form__submit do |params|
|
|
86
86
|
data = ActiveSupport::JSON.decode(params[:data])
|
|
87
87
|
unless self.class.can_perform_action?(:update)
|
|
88
|
-
client.netzke_notify
|
|
88
|
+
client.netzke_notify 'Permission Denied'
|
|
89
89
|
return
|
|
90
90
|
end
|
|
91
91
|
|
|
@@ -100,19 +100,19 @@ module Marty; class UserView < Marty::Grid
|
|
|
100
100
|
|
|
101
101
|
action :add do |a|
|
|
102
102
|
super(a)
|
|
103
|
-
a.text = I18n.t(
|
|
104
|
-
a.tooltip = I18n.t(
|
|
105
|
-
a.icon_cls =
|
|
103
|
+
a.text = I18n.t('user_grid.new')
|
|
104
|
+
a.tooltip = I18n.t('user_grid.new')
|
|
105
|
+
a.icon_cls = 'fa fa-user-plus glyph'
|
|
106
106
|
end
|
|
107
107
|
|
|
108
108
|
action :edit do |a|
|
|
109
109
|
super(a)
|
|
110
|
-
a.icon_cls =
|
|
110
|
+
a.icon_cls = 'fa fa-user-cog glyph'
|
|
111
111
|
end
|
|
112
112
|
|
|
113
113
|
action :delete do |a|
|
|
114
114
|
super(a)
|
|
115
|
-
a.icon_cls =
|
|
115
|
+
a.icon_cls = 'fa fa-user-minus glyph'
|
|
116
116
|
end
|
|
117
117
|
|
|
118
118
|
def default_context_menu
|
|
@@ -121,46 +121,46 @@ module Marty; class UserView < Marty::Grid
|
|
|
121
121
|
|
|
122
122
|
attribute :login do |c|
|
|
123
123
|
c.width = 100
|
|
124
|
-
c.label = I18n.t(
|
|
124
|
+
c.label = I18n.t('user_grid.login')
|
|
125
125
|
end
|
|
126
126
|
|
|
127
127
|
attribute :firstname do |c|
|
|
128
128
|
c.width = 100
|
|
129
|
-
c.label = I18n.t(
|
|
129
|
+
c.label = I18n.t('user_grid.firstname')
|
|
130
130
|
end
|
|
131
131
|
|
|
132
132
|
attribute :lastname do |c|
|
|
133
133
|
c.width = 100
|
|
134
|
-
c.label = I18n.t(
|
|
134
|
+
c.label = I18n.t('user_grid.lastname')
|
|
135
135
|
end
|
|
136
136
|
|
|
137
137
|
attribute :active do |c|
|
|
138
138
|
c.width = 60
|
|
139
|
-
c.label = I18n.t(
|
|
139
|
+
c.label = I18n.t('user_grid.active')
|
|
140
140
|
end
|
|
141
141
|
|
|
142
142
|
attribute :roles do |c|
|
|
143
143
|
c.width = 100
|
|
144
144
|
c.flex = 1
|
|
145
|
-
c.label = I18n.t(
|
|
145
|
+
c.label = I18n.t('user_grid.roles')
|
|
146
146
|
c.type = :string,
|
|
147
147
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
148
|
+
c.getter = lambda do |r|
|
|
149
|
+
r.roles.map { |ur| I18n.t("roles.#{ur.name}") }.sort
|
|
150
|
+
end
|
|
151
151
|
|
|
152
152
|
c.editor_config = {
|
|
153
153
|
multi_select: true,
|
|
154
|
-
empty_text: I18n.t(
|
|
155
|
-
store: Role.pluck(:name).map {|n| I18n.t("roles.#{n}")}.sort,
|
|
154
|
+
empty_text: I18n.t('user_grid.select_roles'),
|
|
155
|
+
store: Role.pluck(:name).map { |n| I18n.t("roles.#{n}") }.sort,
|
|
156
156
|
type: :string,
|
|
157
157
|
xtype: :combo,
|
|
158
158
|
}
|
|
159
159
|
end
|
|
160
160
|
|
|
161
161
|
attribute :created_dt do |c|
|
|
162
|
-
c.label = I18n.t(
|
|
163
|
-
c.format =
|
|
162
|
+
c.label = I18n.t('user_grid.created_dt')
|
|
163
|
+
c.format = 'Y-m-d H:i'
|
|
164
164
|
c.read_only = true
|
|
165
165
|
end
|
|
166
166
|
end; end
|
|
@@ -12,7 +12,7 @@ class Marty::ApplicationController < ActionController::Base
|
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
before_action :session_expiration,
|
|
15
|
-
|
|
15
|
+
:user_setup
|
|
16
16
|
|
|
17
17
|
def get_conf
|
|
18
18
|
Rails.configuration.marty
|
|
@@ -101,7 +101,7 @@ class Marty::ApplicationController < ActionController::Base
|
|
|
101
101
|
cookies.delete :autologin
|
|
102
102
|
Marty::Token.where(user_id: Marty::User.current.id).delete_all unless
|
|
103
103
|
Marty::Util.db_in_recovery?
|
|
104
|
-
|
|
104
|
+
set_user(nil)
|
|
105
105
|
end
|
|
106
106
|
end
|
|
107
107
|
|
|
@@ -120,7 +120,6 @@ class Marty::ApplicationController < ActionController::Base
|
|
|
120
120
|
def successful_authentication(user)
|
|
121
121
|
logger.info("Successful authentication for '#{user.login}' " +
|
|
122
122
|
"from #{request.remote_ip} at #{Time.now.utc}")
|
|
123
|
-
|
|
123
|
+
set_user(user)
|
|
124
124
|
end
|
|
125
|
-
|
|
126
125
|
end
|
|
@@ -8,7 +8,7 @@ class Marty::ComponentsController < Marty::ApplicationController
|
|
|
8
8
|
|
|
9
9
|
return redirect_to root_path unless component
|
|
10
10
|
|
|
11
|
-
cname = component.gsub(
|
|
11
|
+
cname = component.gsub('::', '_').underscore
|
|
12
12
|
render layout: true,
|
|
13
13
|
inline: "<%= netzke :#{cname}, class_name: '#{component}', height: 650 %>"
|
|
14
14
|
end
|
|
@@ -6,16 +6,14 @@ module Marty::Diagnostic; class Controller < ActionController::Base
|
|
|
6
6
|
end
|
|
7
7
|
|
|
8
8
|
def op
|
|
9
|
-
begin
|
|
10
9
|
@result = Reporter.run(request)
|
|
11
|
-
|
|
10
|
+
rescue NameError
|
|
12
11
|
render file: 'public/400', formats: [:html], status: 400, layout: false
|
|
13
|
-
|
|
12
|
+
else
|
|
14
13
|
respond_to do |format|
|
|
15
|
-
format.html {@result = display_parameters}
|
|
16
|
-
format.json {render json: process_result_for_api}
|
|
14
|
+
format.html { @result = display_parameters }
|
|
15
|
+
format.json { render json: process_result_for_api }
|
|
17
16
|
end
|
|
18
|
-
end
|
|
19
17
|
end
|
|
20
18
|
|
|
21
19
|
def process_result_for_api
|