Much base work started
Some checks failed
CI / scan_ruby (push) Has been cancelled
CI / scan_js (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled
CI / system-test (push) Has been cancelled

This commit is contained in:
Dan Milne
2025-10-31 14:36:14 +11:00
parent 4a35bf6758
commit 88a906064f
97 changed files with 5333 additions and 2774 deletions

View File

@@ -0,0 +1,62 @@
module Admin
class StorageLocationsController < ApplicationController
before_action :set_storage_location, only: [:show, :edit, :update, :destroy]
def index
@storage_locations = StorageLocation.all
end
def show
end
def new
@storage_location = StorageLocation.new
end
def create
@storage_location = StorageLocation.new(storage_location_params)
if @storage_location.save
redirect_to [:admin, @storage_location], notice: "Storage location was successfully created."
else
render :new, status: :unprocessable_entity
end
end
def edit
end
def update
if @storage_location.update(storage_location_params)
redirect_to [:admin, @storage_location], notice: "Storage location was successfully updated."
else
render :edit, status: :unprocessable_entity
end
end
def destroy
@storage_location.destroy
redirect_to admin_storage_locations_url, notice: "Storage location was successfully destroyed."
end
def scan
# Placeholder for scan functionality
redirect_to [:admin, @storage_location], notice: "Scan functionality will be implemented."
end
def scan_status
# Placeholder for scan status
render json: { status: "idle" }
end
private
def set_storage_location
@storage_location = StorageLocation.find(params[:id])
end
def storage_location_params
params.require(:storage_location).permit(:name, :path, :location_type, :writable, :enabled, :scan_subdirectories, :priority, :settings)
end
end
end