Module | ApplicationHelper |
In: |
app/helpers/application_helper.rb
|
Methods added to this helper will be available to all templates in the application.
Restart the application
# File app/helpers/application_helper.rb, line 76 76: def self.restart_application(app_name) 77: ctl = Control.new(app_name) 78: reply = nil 79: begin 80: reply = ctl.restart 81: rescue Exception => e 82: reply = "An error occurred while sending 'stop' request for application '#{app_name}'. Please refer the Admin Panel log file for details." 83: end 84: return reply 85: end
Start the application
# File app/helpers/application_helper.rb, line 50 50: def self.start_application(app_name) 51: ctl = Control.new(app_name) 52: reply = nil 53: err_obj = nil 54: begin 55: reply = ctl.add 56: rescue Exception => e 57: err_obj = e 58: reply = "An error occurred while sending 'start' request for application '#{app_name}'. Please refer the Admin Panel log file for details." 59: end 60: return reply, e 61: end
Stop the application
# File app/helpers/application_helper.rb, line 64 64: def self.stop_application(app_name) 65: ctl = Control.new(app_name) 66: reply = nil 67: begin 68: reply = ctl.delete 69: rescue Exception => e 70: reply = "An error occurred while sending 'stop' request for application '#{app_name}'. Please refer the Admin Panel log file for details." 71: end 72: return reply 73: end
This method is used to get the tabs image for the differnt tabs in the admin panel.
# File app/helpers/application_helper.rb, line 24 24: def get_tab_class_name(controller_name,action_name) 25: tab1 = ["home","home_ov"] 26: tab2 = ["configuration","configuration_ov"] 27: tab3 = ["analytics","analytics_ov"] 28: tab4 = ["exceptions","exceptions_ov"] 29: tab5 = ["settings","settings_ov"] 30: if controller_name == 'admin' 31: case action_name 32: when "home" 33: tab1 = ["home_ov",""] 34: when "change_password_form" 35: tab5 = ["settings_ov",""] 36: when "change_password" 37: tab5 = ["settings_ov",""] 38: else 39: tab2 = ["configuration_ov",""] 40: end 41: elsif controller_name == 'graph' 42: tab3 = ["analytics_ov",""] 43: elsif controller_name == 'exceptions' 44: tab4 = ["exceptions_ov",""] 45: end 46: return tab1,tab2,tab3,tab4,tab5 47: end