Update 2026-06-23 10:40:10
Build and Push Docker Images / Build Backend Image (push) Has been cancelled
Build and Push Docker Images / Build Frontend Image (push) Has been cancelled
Build and Push Docker Images / Notify Build Complete (push) Has been cancelled

This commit is contained in:
yi
2026-06-23 10:40:10 +08:00
parent 864efb7f9d
commit e9bff9beb3
56 changed files with 295 additions and 292 deletions
+4 -4
View File
@@ -1,4 +1,4 @@
# IDC设备管理系统 - 环境配置
# 云睿资产管理系统 - 环境配置
# 生成时间: 2026-02-26T05:07:19.876Z
# ==============================================
@@ -19,16 +19,16 @@ NODE_ENV=development
DB_TYPE=sqlite
# SQLite 配置(当 DB_TYPE=sqlite 时使用)
DB_PATH=./idc_management.db
DB_PATH=./yunrui_management.db
# MySQL 配置(当 DB_TYPE=mysql 时使用)
# 注意:使用 MySQL 前请确保 MySQL 服务已安装并创建相应的数据库
# 数据库创建命令:CREATE DATABASE idc_management CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
# 数据库创建命令:CREATE DATABASE yunrui_management CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
MYSQL_HOST=localhost
MYSQL_PORT=3306
MYSQL_USERNAME=root
MYSQL_PASSWORD=
MYSQL_DATABASE=idc_management
MYSQL_DATABASE=yunrui_management
# ==============================================
# 安全配置
+1 -1
View File
@@ -1,5 +1,5 @@
# ============================================
# IDC 设备管理系统 - 后端 Dockerfile
# 云睿资产管理系统 - 后端 Dockerfile
# 基于 Node.js 20 Alpine 构建
# ============================================
+2 -2
View File
@@ -17,7 +17,7 @@ const sqlLogger = (msg) => logger.debug(msg);
if (DB_TYPE === 'mysql') {
// MySQL 配置
sequelize = new Sequelize(
process.env.MYSQL_DATABASE || 'idc_management',
process.env.MYSQL_DATABASE || 'yunrui_management',
process.env.MYSQL_USERNAME || 'root',
process.env.MYSQL_PASSWORD || '',
{
@@ -38,7 +38,7 @@ if (DB_TYPE === 'mysql') {
} else {
sequelize = new Sequelize({
dialect: 'sqlite',
storage: process.env.DB_PATH || './idc_management.db',
storage: process.env.DB_PATH || './yunrui_management.db',
logging: sqlLogger,
pool: {
max: 5,
+1 -1
View File
@@ -84,7 +84,7 @@ function ensureJwtSecret() {
fs.writeFileSync(ENV_FILE_PATH, updatedContent, 'utf-8');
console.log('✓ JWT_SECRET 已自动生成并保存到 .env 文件');
} else {
const defaultContent = `# IDC设备管理系统 - 环境配置
const defaultContent = `# 云睿资产管理系统 - 环境配置
# 自动生成时间: ${new Date().toISOString()}
JWT_SECRET=${newSecret}
+2 -2
View File
@@ -1,11 +1,11 @@
{
"name": "idc-backend",
"name": "yunrui-backend",
"version": "2.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "idc-backend",
"name": "yunrui-backend",
"version": "2.0.0",
"dependencies": {
"all": "^0.0.0",
+2 -2
View File
@@ -1,7 +1,7 @@
{
"name": "idc-backend",
"name": "yunrui_asset-backend",
"version": "2.1.1",
"description": "IDC设备管理系统后端",
"description": "云睿资产管理系统后端",
"scripts": {
"start": "node server.js",
"dev": "nodemon server.js",
+5 -5
View File
@@ -31,7 +31,7 @@ const initDefaultSettings = async () => {
// 基本设置 - 站点信息
{
settingKey: 'site_name',
settingValue: JSON.stringify('机柜管理系统'),
settingValue: JSON.stringify('云睿资产管理系统'),
settingType: 'string',
category: 'general',
description: '网站名称',
@@ -133,7 +133,7 @@ const initDefaultSettings = async () => {
},
{
settingKey: 'system_description',
settingValue: JSON.stringify('机柜管理系统 - 专业的数据中心设备管理解决方案'),
settingValue: JSON.stringify('云睿资产管理系统 - 专业的数据中心设备管理解决方案'),
settingType: 'string',
category: 'about',
description: '系统描述',
@@ -374,7 +374,7 @@ router.post('/reset/:key', async (req, res) => {
}
const defaultValues = {
site_name: '机柜管理系统',
site_name: '云睿资产管理系统',
site_logo: '',
idle_timeout: 30,
max_login_attempts: 5,
@@ -385,7 +385,7 @@ router.post('/reset/:key', async (req, res) => {
contact_email: '',
contact_phone: '',
company_address: '',
system_description: '机柜管理系统 - 专业的数据中心设备管理解决方案',
system_description: '云睿资产管理系统 - 专业的数据中心设备管理解决方案',
};
const defaultValue = defaultValues[key];
@@ -682,7 +682,7 @@ router.get('/system/info', async (req, res) => {
res.json({
system: {
name: '机柜管理系统',
name: '云睿资产管理系统',
version: APP_VERSION,
uptime: process.uptime(),
nodeVersion: process.version,
+1 -1
View File
@@ -5,7 +5,7 @@ const Device = require('../models/Device');
async function migrate() {
console.log('========================================');
console.log(' IDC管理系统 - 数据库迁移脚本 v2.0 ');
console.log(' 云睿资产管理系统 - 数据库迁移脚本 v2.0 ');
console.log('========================================');
console.log('');
+1 -1
View File
@@ -62,7 +62,7 @@ for (let i = 0; i < args.length; i++) {
async function runBackup() {
console.log('========================================');
console.log(' IDC设备管理系统 - 数据备份工具');
console.log(' 云睿资产管理系统 - 数据备份工具');
console.log('========================================\n');
try {
+2 -2
View File
@@ -46,7 +46,7 @@ const defaultSettings = [
// 全局配置
{
settingKey: 'site_name',
settingValue: JSON.stringify('机柜管理系统'),
settingValue: JSON.stringify('云睿资产管理系统'),
settingType: 'string',
category: 'general',
description: '网站名称',
@@ -210,7 +210,7 @@ const defaultSettings = [
},
{
settingKey: 'system_description',
settingValue: JSON.stringify('机柜管理系统 - 专业的数据中心设备管理解决方案'),
settingValue: JSON.stringify('云睿资产管理系统 - 专业的数据中心设备管理解决方案'),
settingType: 'string',
category: 'about',
description: '系统描述',
+2 -2
View File
@@ -1,5 +1,5 @@
/**
* IDC管理系统 - 数据库迁移汇总脚本
* 云睿资产管理系统 - 数据库迁移汇总脚本
* 按顺序执行所有数据库迁移
* 支持幂等执行(重复执行不会出错)
* 支持 SQLite 和 MySQL
@@ -142,7 +142,7 @@ const migrations = [
async function runMigrations() {
console.log('========================================');
console.log(' IDC管理系统 - 数据库迁移汇总脚本 ');
console.log(' 云睿资产管理系统 - 数据库迁移汇总脚本 ');
console.log('========================================');
console.log(`数据库类型: ${DB_TYPE}`);
console.log(`迁移数量: ${migrations.length}`);
+1 -1
View File
@@ -72,7 +72,7 @@ if (!options.file) {
async function runRestore() {
console.log('========================================');
console.log(' IDC设备管理系统 - 数据恢复工具');
console.log(' 云睿资产管理系统 - 数据恢复工具');
console.log('========================================\n');
const backupFile = path.resolve(options.file);
+2 -2
View File
@@ -1,9 +1,9 @@
/**
* 示例数据种子脚本
* 为 IDC 设备资产管理系统写入演示数据(幂等,可重复执行)
* 为 云睿资产管理系统写入演示数据(幂等,可重复执行)
*
* 本地:node scripts/seed-example-data.js
* Dockerdocker exec idc_assest-backend node scripts/seed-example-data.js
* Dockerdocker exec yunrui_asset-backend node scripts/seed-example-data.js
*/
require('dotenv').config({ path: require('path').join(__dirname, '..', '.env') });
+2 -2
View File
@@ -336,7 +336,7 @@ app.use(
swaggerUi.serve,
swaggerUi.setup(specs, {
customCss: customCSS,
customSiteTitle: 'IDC设备管理系统 API文档',
customSiteTitle: '云睿资产管理系统 API文档',
swaggerOptions: {
persistAuthorization: true,
displayRequestDuration: true,
@@ -358,7 +358,7 @@ app.get('/api-docs.json', (req, res) => {
app.get('/api', (req, res) => {
res.json({
name: 'IDC设备管理系统 API',
name: '云睿资产管理系统 API',
version: '1.0.0',
description: '数据中心设备管理平台后端服务',
endpoints: {
+2 -2
View File
@@ -2,7 +2,7 @@ const swaggerJsdoc = require('swagger-jsdoc');
const customCSS = `
/* ========================================
IDC设备管理系统 - Swagger UI 翠竹绿风格定制
云睿资产管理系统 - Swagger UI 翠竹绿风格定制
======================================== */
/* 隐藏默认顶部栏 */
@@ -511,7 +511,7 @@ const options = {
definition: {
openapi: '3.0.0',
info: {
title: 'IDC设备管理系统 API',
title: '云睿资产管理系统 API',
version: '1.0.0',
description: '数据中心设备管理平台后端服务 API 文档',
contact: {
+3 -3
View File
@@ -1,9 +1,9 @@
openapi: 3.0.0
info:
title: IDC设备管理系统 API
title: 云睿资产管理系统 API
version: 1.0.0
description: |
IDC设备管理系统后端API文档
云睿资产管理系统后端API文档
## 认证说明
除健康检查接口外,所有接口都需要在请求头中携带JWT Token:
@@ -107,7 +107,7 @@ paths:
example: ok
message:
type: string
example: IDC设备管理系统后端服务正常运行
example: 云睿资产管理系统后端服务正常运行
/api-docs:
get:
+1 -1
View File
@@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>IDC设备管理系统 API文档</title>
<title>云睿资产管理系统 API文档</title>
<link rel="stylesheet" href="https://unpkg.com/swagger-ui-dist@5.10.5/swagger-ui.css">
<style>
.swagger-ui .topbar { display: none }
+1 -1
View File
@@ -150,7 +150,7 @@ const performHealthCheck = async () => {
status: overallStatus,
timestamp: new Date().toISOString(),
service: {
name: 'IDC设备管理系统',
name: '云睿资产管理系统',
version: '1.0.0',
},
checks: allChecks,
+2 -2
View File
@@ -110,7 +110,7 @@ async function uploadViaWebDAV(config, localFilePath, remotePath) {
password: config.password,
authType: config.authType || 'password',
headers: {
'User-Agent': 'IDC-Backup-Client/1.0',
'User-Agent': 'YunRui-Backup-Client/1.0',
},
});
@@ -262,7 +262,7 @@ async function testRemoteConnection(config) {
console.log(`测试远端连接 [${config.protocol}]...`);
try {
const testContent = `IDC Backup Connection Test - ${new Date().toISOString()}`;
const testContent = `YunRui Backup Connection Test - ${new Date().toISOString()}`;
const testFile = path.join(require('os').tmpdir(), `backup-test-${Date.now()}.txt`);
fs.writeFileSync(testFile, testContent);