Tidy up homepage and navigation

This commit is contained in:
Dan Milne
2025-11-09 20:58:13 +11:00
parent c9e2992fe0
commit 1f4428348d
56 changed files with 2822 additions and 955 deletions

View File

@@ -18,7 +18,10 @@ postgres_default: &postgres_default
development:
primary:
<<: *postgres_default
database: baffle_hub_development
host: localhost
user: dev_user
password: password
database: baffle-dev
cache:
<<: *sqlite_default
database: storage/development_cache.sqlite3
@@ -66,4 +69,4 @@ production:
cable:
<<: *sqlite_default
database: storage/production_cable.sqlite3
migrations_paths: db/cable_migrate
migrations_paths: db/cable_migrate

View File

@@ -1,6 +1,9 @@
# frozen_string_literal: true
# Pagy configuration
# require 'pagy'
# Initialize Pagy with default settings after it's loaded
# Pagy::VARS[:items] = 50 # default items per page
Rails.application.config.after_initialize do
# Set default items per page
Pagy::VARS[:items] = 25 if defined?(Pagy::VARS)
end

View File

@@ -11,6 +11,14 @@ Rails.application.routes.draw do
# Admin user management (admin only)
resources :users, only: [:index, :show, :edit, :update]
# DSN management (admin only)
resources :dsns do
member do
post :disable
post :enable
end
end
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
# Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500.
@@ -20,24 +28,22 @@ Rails.application.routes.draw do
# WAF API
namespace :api, defaults: { format: :json } do
# Event ingestion (PRIMARY method - includes rule updates in response)
post ":project_id/events", to: "events#create"
post "events", to: "events#create"
# Rule synchronization (SECONDARY - for admin/debugging only)
# Note: Agents should use event responses for rule synchronization
get ":public_key/rules/version", to: "rules#version"
get ":public_key/rules", to: "rules#index"
get "rules/version", to: "rules#version"
get "rules", to: "rules#index"
end
# Root path - projects dashboard
root "projects#index"
# Analytics dashboard
get "analytics", to: "analytics#index"
# Project management
resources :projects, only: [:index, :new, :create, :show, :edit, :update] do
resources :events, only: [:index]
member do
get :analytics
end
end
# Root path - analytics dashboard
root "analytics#index"
# Event management
resources :events, only: [:index]
# Network range management
resources :network_ranges, only: [:index, :show, :new, :create, :edit, :update, :destroy] do