147 lines
3.4 KiB
YAML
147 lines
3.4 KiB
YAML
# Database Render Application Configuration
|
|
# Copy this file to config.yaml and modify as needed
|
|
|
|
app:
|
|
name: "Database Render"
|
|
port: 8080
|
|
debug: false
|
|
|
|
database:
|
|
# Database type: sqlite, mysql, postgres
|
|
type: "sqlite"
|
|
|
|
# SQLite configuration (used when type is sqlite)
|
|
path: "data/app.db"
|
|
|
|
# MySQL configuration (used when type is mysql)
|
|
# host: "localhost"
|
|
# port: 3306
|
|
# user: "root"
|
|
# password: "password"
|
|
# db_name: "database_render"
|
|
|
|
# PostgreSQL configuration (used when type is postgres)
|
|
# host: "localhost"
|
|
# port: 5432
|
|
# user: "postgres"
|
|
# password: "password"
|
|
# db_name: "database_render"
|
|
# dsn: "host=localhost port=5432 user=postgres password=password dbname=database_render sslmode=disable"
|
|
|
|
# Table configurations
|
|
tables:
|
|
- name: "posts"
|
|
alias: "文章管理"
|
|
description: "博客文章管理"
|
|
default: true
|
|
layout: "cards" # cards or list
|
|
columns:
|
|
- name: "id"
|
|
alias: "ID"
|
|
type: "int"
|
|
primary: true
|
|
hidden: true
|
|
- name: "title"
|
|
alias: "标题"
|
|
type: "string"
|
|
searchable: true
|
|
- name: "content"
|
|
alias: "内容"
|
|
type: "text"
|
|
render_type: "markdown"
|
|
searchable: true
|
|
- name: "category"
|
|
alias: "分类"
|
|
type: "string"
|
|
searchable: true
|
|
render_type: "tag"
|
|
values:
|
|
technology:
|
|
label: "技术"
|
|
color: "#3b82f6"
|
|
life:
|
|
label: "生活"
|
|
color: "#10b981"
|
|
work:
|
|
label: "工作"
|
|
color: "#f59e0b"
|
|
- name: "tags"
|
|
alias: "标签"
|
|
type: "string"
|
|
searchable: true
|
|
- name: "created_at"
|
|
alias: "创建时间"
|
|
type: "datetime"
|
|
render_type: "time"
|
|
- name: "updated_at"
|
|
alias: "更新时间"
|
|
type: "datetime"
|
|
render_type: "time"
|
|
|
|
- name: "users"
|
|
alias: "用户管理"
|
|
description: "系统用户管理"
|
|
layout: "list"
|
|
columns:
|
|
- name: "id"
|
|
alias: "ID"
|
|
type: "int"
|
|
primary: true
|
|
hidden: true
|
|
- name: "username"
|
|
alias: "用户名"
|
|
type: "string"
|
|
searchable: true
|
|
- name: "email"
|
|
alias: "邮箱"
|
|
type: "string"
|
|
searchable: true
|
|
- name: "full_name"
|
|
alias: "姓名"
|
|
type: "string"
|
|
searchable: true
|
|
- name: "status"
|
|
alias: "状态"
|
|
type: "string"
|
|
render_type: "tag"
|
|
values:
|
|
active:
|
|
label: "激活"
|
|
color: "#10b981"
|
|
inactive:
|
|
label: "未激活"
|
|
color: "#ef4444"
|
|
pending:
|
|
label: "待审核"
|
|
color: "#f59e0b"
|
|
- name: "created_at"
|
|
alias: "创建时间"
|
|
type: "datetime"
|
|
render_type: "time"
|
|
|
|
# Logging configuration
|
|
logging:
|
|
level: "info" # debug, info, warn, error
|
|
format: "json" # json, text
|
|
output: "stdout" # stdout, stderr, file
|
|
file: "logs/app.log" # Only used when output is file
|
|
|
|
# Server configuration
|
|
server:
|
|
read_timeout: 30s
|
|
write_timeout: 30s
|
|
idle_timeout: 60s
|
|
|
|
# Security configuration
|
|
security:
|
|
cors:
|
|
enabled: true
|
|
allow_origins: ["*"]
|
|
allow_methods: ["GET", "POST", "PUT", "DELETE", "OPTIONS"]
|
|
allow_headers: ["Origin", "Content-Type", "Accept", "Authorization"]
|
|
|
|
# Cache configuration
|
|
cache:
|
|
enabled: false
|
|
ttl: 5m
|
|
max_size: 100 |