Henry_Du 95893a5431 refactor(web): 重构全站界面与事件日志,优化功能与样式
1. 重构并统一票务、IC卡的事件日志格式化展示逻辑,替换原有零散的格式化函数,提升事件展示的一致性与可读性
2. 为AI助手面板新增折叠按钮与折叠逻辑,支持收起/展开面板,优化界面空间利用率
3. 移除多个页面的冗余介绍、提醒区块,精简页面结构
4. 修复IC卡购卡页面的充值选项按钮布局问题,将button元素改为div适配样式规范
5. 新增移动端卡片布局的横向滚动适配,优化小屏设备上的卡片展示与浏览体验
6. 更新后台管理页面的导航样式、文案与统计数据展示,新增车票、凭证的统计卡片
7. 统一全站品牌文案与页面格式,修复部分页面的DOCTYPE多余空格问题
8. 简化车票订单页面的地图加载逻辑,修复原有的冗余代码与加载异常问题
2026-07-05 14:55:12 +08:00
2026-06-21 10:00:13 +08:00
2026-06-21 10:00:13 +08:00
2026-06-21 10:00:13 +08:00
2026-06-21 10:00:13 +08:00
2026-06-21 10:00:13 +08:00
2026-06-21 10:00:13 +08:00
2026-06-21 10:00:13 +08:00
2026-06-21 10:00:13 +08:00

FTC Ticketing System (Refactored)

A comprehensive ticketing solution for Minecraft (CC:Tweaked) with a modern Web Control Panel.

Features

  • Ticket Machine (Lua): Issue tickets, print receipts, write to floppy disks.
  • Gate (Lua): Validate tickets, control redstone doors, track entries/exits.
  • Web Console:
    • Real-time Dashboard: Live updates of sales and passenger flow via Socket.IO.
    • Visual Line Editor: Manage stations and lines with an interactive SVG map.
    • Fare Management: Configure fares with a visual fare chart.
    • Logs: Track ticket usage and system operations.
    • System Settings: Configure API endpoints and promotions.
    • File Manager: Upload and manage audio files (.dfpwm) for devices.

Project Structure

  • server/: Node.js Backend (Express + Socket.IO).
    • services/: Data and logic handling.
    • routes/: API endpoints.
  • web/: Frontend (Vue 3 + Socket.IO Client).
    • index.html: The new Control Panel.
    • index.js: Vue 3 logic.
  • Lua/: CC:Tweaked scripts.

Installation

  1. Prerequisites: Node.js 16+.
  2. Install Dependencies:
    npm install
    

Running the Server

Development

npm start

Access the console at http://localhost:23333.

Production (PM2)

This project includes an ecosystem.config.js for PM2.

# Start
pm2 start ecosystem.config.js

# View logs
pm2 logs ticket-machine

# Restart
pm2 restart ticket-machine

Configuration

  • Server Port: Default 23333. Set PORT environment variable to change.
  • Data Storage: All data is stored in web/data/.
  • CC:Tweaked Devices:
    • Run install_machine.lua or install_gate.lua on your turtles/computers.
    • Point them to your server's IP (e.g., http://YOUR_IP:23333/api).

API

  • /api: Admin API (Stations, Lines, Fares, Logs).
  • /api/public: Public API for devices (Ticket queries, Orders).
  • WebSocket: Connect to / for real-time events (stations:updated, stats:ticket:updated, etc.).

Troubleshooting

Error: bind EADDRINUSE 0.0.0.0:23333

This means the port 23333 is already occupied.

  1. Stop the PM2 process: pm2 stop ticket-machine
  2. Find the process holding the port: lsof -i :23333 or netstat -tunlp | grep 23333
  3. Kill the process: kill -9 <PID>
  4. Restart PM2: pm2 restart ticket-machine

Error: Cannot find module 'express'

Run npm install in the project directory to install dependencies.

License

MIT

S
Description
No description provided
Readme
13 MiB
Languages
JavaScript 48.4%
HTML 22.6%
Lua 19.6%
CSS 9.4%