|
| 1 | +# For more information regarding these settings check out our docs https://docs.avohq.io |
| 2 | +# The values disaplayed here are the default ones. Uncomment and change them to fit your needs. |
| 3 | +Avo.configure do |config| |
| 4 | + ## == Routing == |
| 5 | + config.root_path = "/avo" |
| 6 | + # used only when you have custom `map` configuration in your config.ru |
| 7 | + # config.prefix_path = "/internal" |
| 8 | + |
| 9 | + # Where should the user be redirected when visiting the `/avo` url |
| 10 | + # config.home_path = nil |
| 11 | + |
| 12 | + ## == Licensing == |
| 13 | + # config.license_key = ENV['AVO_LICENSE_KEY'] |
| 14 | + |
| 15 | + ## == Set the context == |
| 16 | + config.set_context do |
| 17 | + # Return a context object that gets evaluated within Avo::ApplicationController |
| 18 | + end |
| 19 | + |
| 20 | + ## == Authentication == |
| 21 | + # This app has no `current_user` helper — sessions are resolved into Current.user. |
| 22 | + config.current_user_method do |
| 23 | + Current.user |
| 24 | + end |
| 25 | + |
| 26 | + # Avo's controllers don't run the app's Authentication/SetCurrentOrganization |
| 27 | + # concerns, so Current is empty here. Resume the session from the signed cookie |
| 28 | + # (same lookup as Authentication#resume_session), then allow only super_admins. |
| 29 | + # Everyone else is sent back to the app's home page via main_app. |
| 30 | + config.authenticate_with do |
| 31 | + Current.session ||= Session.find_by_cookie(cookies) |
| 32 | + |
| 33 | + redirect_to main_app.root_path unless Current.user&.super_admin? |
| 34 | + end |
| 35 | + |
| 36 | + ## == Authorization == |
| 37 | + # config.is_admin_method = :is_admin |
| 38 | + # config.is_developer_method = :is_developer |
| 39 | + # config.authorization_methods = { |
| 40 | + # index: 'index?', |
| 41 | + # show: 'show?', |
| 42 | + # edit: 'edit?', |
| 43 | + # new: 'new?', |
| 44 | + # update: 'update?', |
| 45 | + # create: 'create?', |
| 46 | + # destroy: 'destroy?', |
| 47 | + # search: 'search?', |
| 48 | + # } |
| 49 | + # config.raise_error_on_missing_policy = false |
| 50 | + config.authorization_client = nil |
| 51 | + config.explicit_authorization = true |
| 52 | + |
| 53 | + ## == Localization == |
| 54 | + # config.locale = 'en-US' |
| 55 | + |
| 56 | + ## == Resource options == |
| 57 | + # config.resource_row_controls_config = { |
| 58 | + # placement: :right, |
| 59 | + # float: false, |
| 60 | + # show_on_hover: false |
| 61 | + # }.freeze |
| 62 | + # config.model_resource_mapping = {} |
| 63 | + # config.default_view_type = :table |
| 64 | + # config.per_page = 24 |
| 65 | + # config.per_page_steps = [12, 24, 48, 72] |
| 66 | + # config.via_per_page = 8 |
| 67 | + # config.id_links_to_resource = false |
| 68 | + # config.pagination = -> do |
| 69 | + # { |
| 70 | + # type: :default, |
| 71 | + # size: 9, # `[1, 2, 2, 1]` for pagy < 9.0 |
| 72 | + # } |
| 73 | + # end |
| 74 | + |
| 75 | + ## == Response messages dismiss time == |
| 76 | + # config.alert_dismiss_time = 5000 |
| 77 | + |
| 78 | + |
| 79 | + ## == Number of search results to display == |
| 80 | + # config.search_results_count = 8 |
| 81 | + |
| 82 | + ## == Associations lookup list limit == |
| 83 | + # config.associations_lookup_list_limit = 1000 |
| 84 | + |
| 85 | + ## == Cache options == |
| 86 | + ## Provide a lambda to customize the cache store used by Avo. |
| 87 | + ## We compute the cache store by default, this is NOT the default, just an example. |
| 88 | + # config.cache_store = -> { |
| 89 | + # ActiveSupport::Cache.lookup_store(:solid_cache_store) |
| 90 | + # } |
| 91 | + # config.cache_resources_on_index_view = true |
| 92 | + |
| 93 | + ## == Turbo options == |
| 94 | + # config.turbo = -> do |
| 95 | + # { |
| 96 | + # instant_click: true |
| 97 | + # } |
| 98 | + # end |
| 99 | + |
| 100 | + ## == Logger == |
| 101 | + # config.logger = -> { |
| 102 | + # file_logger = ActiveSupport::Logger.new(Rails.root.join("log", "avo.log")) |
| 103 | + # |
| 104 | + # file_logger.datetime_format = "%Y-%m-%d %H:%M:%S" |
| 105 | + # file_logger.formatter = proc do |severity, time, progname, msg| |
| 106 | + # "[Avo] #{time}: #{msg}\n".tap do |i| |
| 107 | + # puts i |
| 108 | + # end |
| 109 | + # end |
| 110 | + # |
| 111 | + # file_logger |
| 112 | + # } |
| 113 | + |
| 114 | + ## == Customization == |
| 115 | + config.click_row_to_view_record = true |
| 116 | + # config.app_name = 'Avocadelicious' |
| 117 | + # config.timezone = 'UTC' |
| 118 | + # config.currency = 'USD' |
| 119 | + # config.hide_layout_when_printing = false |
| 120 | + # config.full_width_container = false |
| 121 | + # config.full_width_index_view = false |
| 122 | + # config.search_debounce = 300 |
| 123 | + # config.view_component_path = "app/components" |
| 124 | + # config.display_license_request_timeout_error = true |
| 125 | + # config.disabled_features = [] |
| 126 | + # config.buttons_on_form_footers = true |
| 127 | + # config.field_wrapper_layout = true |
| 128 | + # config.resource_parent_controller = "Avo::ResourcesController" |
| 129 | + # config.first_sorting_option = :desc # :desc or :asc |
| 130 | + # config.exclude_from_status = [] |
| 131 | + # config.model_generator_hook = true |
| 132 | + |
| 133 | + ## == Branding == |
| 134 | + # config.branding = { |
| 135 | + # colors: { |
| 136 | + # background: "248 246 242", |
| 137 | + # 100 => "#CEE7F8", |
| 138 | + # 400 => "#399EE5", |
| 139 | + # 500 => "#0886DE", |
| 140 | + # 600 => "#066BB2", |
| 141 | + # }, |
| 142 | + # chart_colors: ["#0B8AE2", "#34C683", "#2AB1EE", "#34C6A8"], |
| 143 | + # logo: "/avo-assets/logo.png", |
| 144 | + # logomark: "/avo-assets/logomark.png", |
| 145 | + # placeholder: "/avo-assets/placeholder.svg", |
| 146 | + # favicon: "/avo-assets/favicon.ico" |
| 147 | + # } |
| 148 | + |
| 149 | + ## == Breadcrumbs == |
| 150 | + # config.display_breadcrumbs = true |
| 151 | + # config.set_initial_breadcrumbs do |
| 152 | + # add_breadcrumb "Home", '/avo' |
| 153 | + # end |
| 154 | + |
| 155 | + ## == Menus == |
| 156 | + # config.main_menu = -> { |
| 157 | + # section "Dashboards", icon: "avo/dashboards" do |
| 158 | + # all_dashboards |
| 159 | + # end |
| 160 | + |
| 161 | + # section "Resources", icon: "avo/resources" do |
| 162 | + # all_resources |
| 163 | + # end |
| 164 | + |
| 165 | + # section "Tools", icon: "avo/tools" do |
| 166 | + # all_tools |
| 167 | + # end |
| 168 | + # } |
| 169 | + # config.profile_menu = -> { |
| 170 | + # link "Profile", path: "/avo/profile", icon: "heroicons/outline/user-circle" |
| 171 | + # } |
| 172 | +end |
0 commit comments