forked from ManageIQ/manageiq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_diagnostics_database_tab.html.haml
131 lines (122 loc) · 6.61 KB
/
_diagnostics_database_tab.html.haml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
- @angularForm = true
%form#form_div.form-horizontal{:name => "angularForm", 'ng-controller' => "diagnosticsDatabaseFormController", 'ng-show' => "afterGet", 'data-db-backup-form-field-changed-url' => "/#{controller_name}/db_backup_form_field_changed/", 'data-submit-url' => "/#{controller_name}/db_backup/"}
- if @sb[:active_tab] == "diagnostics_database"
-# created div with different name so database validation flash message can be shown in it's own box
= render :partial => "layouts/flash_msg", :locals => {:div_num => "database"}
%h3
= _("Basic Info")
.form-group
%label.col-md-2.control-label
= _("Type")
.col-md-8
%p.form-control-static
= h(@database[:display_name])
.form-group
%label.col-md-2.control-label
= _("Hostname")
.col-md-8
%p.form-control-static
= h(@database[:host])
.form-group
%label.col-md-2.control-label
= _("Database Name")
.col-md-8
%p.form-control-static
= h(@database[:database])
.form-group
%label.col-md-2.control-label
= _("Username")
.col-md-8
%p.form-control-static
= h(@database[:username])
- if DatabaseBackup.backup_supported?
%hr/
%h3
= _("Run a Database Backup Now")
%fieldset
%h3
= _("Backup Schedules")
.form-group
%label.col-md-2.control-label
= _("Fetch settings from a schedule")
.col-md-8
- if @backup_schedules.length < 1
%p.form-control-static
= _("No Backup Schedules are defined")
- else
- default_option = [_("<Choose>"), nil]
- schedules_ary = Array(@backup_schedules.invert)
- schedules_ary.sort_by! { |name, _id| name }
- options = options_for_select([default_option] + schedules_ary)
= select_tag('backup_schedule_type',
options,
"ng-model" => "diagnosticsDatabaseModel.backup_schedule_type",
"ng-change" => "backupScheduleTypeChanged()",
"checkchange" => "log_protocol,depot_name,uri,log_userid,log_password,log_verify")
%h3
= _("Database Backup Settings")
.form-group
%label.col-md-2.control-label
= _("Type")
.col-md-8
- default_option = [_("<No Depot>"), nil]
= select_tag('log_protocol', options_for_select([default_option] + @database_backup_options_for_select),
"ng-model" => "diagnosticsDatabaseModel.log_protocol",
"ng-change" => "miqDBBackupService.logProtocolChanged(diagnosticsDatabaseModel)",
"ng-required" => "miqDBBackupService.logProtocolNotSelected(diagnosticsDatabaseModel)",
"checkchange" => "",
:class => "selectpicker")
:javascript
miqInitSelectPicker();
miqSelectPickerEvent('log_protocol');
= render :partial => "layouts/angular/edit_log_depot_settings_angular",
:locals => {:ng_show => "miqDBBackupService.logProtocolSelected(diagnosticsDatabaseModel)",
:ng_reqd_depot_name => "miqDBBackupService.dbRequired(diagnosticsDatabaseModel, diagnosticsDatabaseModel.depot_name)",
:ng_model_depot_name => "diagnosticsDatabaseModel.depot_name",
:ng_reqd_uri => "miqDBBackupService.dbRequired(diagnosticsDatabaseModel, diagnosticsDatabaseModel.uri)",
:ng_model_uri => "diagnosticsDatabaseModel.uri",
:ng_model_uri_prefix => "diagnosticsDatabaseModel.uri_prefix",
:uri_prefix_display => "{{diagnosticsDatabaseModel.uri_prefix}}://"}
= render :partial => "layouts/angular/auth_credentials_angular",
:locals => {:ng_show => "miqDBBackupService.sambaBackup(diagnosticsDatabaseModel)",
:ng_model => "diagnosticsDatabaseModel",
:ng_reqd_userid => "miqDBBackupService.sambaRequired(diagnosticsDatabaseModel, diagnosticsDatabaseModel.log_userid)",
:ng_reqd_password => "miqDBBackupService.sambaRequired(diagnosticsDatabaseModel, diagnosticsDatabaseModel.log_password)",
:ng_reqd_verify => "miqDBBackupService.sambaRequired(diagnosticsDatabaseModel, diagnosticsDatabaseModel.log_verify)",
:validate_url => "log_depot_validate",
:id => nil,
:valtype => "log",
:basic_info_needed => true}
%input{:type => "hidden", :value => "db_backup", :name => "action_typ"}
%table{:width => "100%"}
%tr
%td{:align => "right"}
- caption = _("Run a Database Backup Now")
- confirm = _("Are you sure you want to Run a Database Backup Now?")
= button_tag(_("Submit"),
:class => "btn btn-primary",
:title => caption,
"ng-class" => "{'btn-disabled': !angularForm.$valid}",
"ng-disabled" => "!miqService.saveable(angularForm)",
"ng-show" => true,
"ng-click" => "submitButtonClicked('#{confirm}')")
- if DatabaseBackup.gc_supported?
%hr/
%h3
= _("Run Database Garbage Collection Now")
.form-group
.col-md-8
= _("Press submit to start the Database Vacuum process")
%table{:width => "100%"}
%tr
%td{:align => "right"}
#gc_submit_on
- caption = _("Run Database Garbage Collection Now")
- submit = button_tag(_("Submit"), :class => "btn btn-primary", :alt => caption)
= link_to(submit, {:action => 'db_gc_collection'}, |
"data-miq_sparkle_on" => true, |
:confirm => _("Are you sure you want to Run Database Garbage Collection Now?"), |
:remote => true, |
:title => caption) |
:javascript
angular.bootstrap(jQuery('#form_div'), ['ManageIQ.angularApplication'], { strictDi: true });