Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions mysql8/initdb/02-maintain-init-data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Records of user_info
-- ----------------------------
INSERT INTO `user_info` VALUES (1, 'dca0f9e348384d23958e151bb4adb98f', '系统管理员', 'sysadmin', '{bcrypt-md5}$2a$10$dsfVEzh5NlfrgkcLFbrPLOuSsm5zJMJJwYqlQfTSWs3qKzwhQx5Ku', '', NULL, NULL, '+08:00', NULL, 0, 0, 100, 0, '', '系统账号', '2025-04-29 09:27:50', NULL, NULL, '2025-04-29 03:46:24', 0, NULL, '', 0, '2025-04-29 03:46:24', '2025-04-29 09:28:57');
INSERT INTO `user_info` VALUES (2, '25d19d8c917747ea', '组织管理员', 'tgadmin', '{bcrypt-md5}$2a$10$dsfVEzh5NlfrgkcLFbrPLOuSsm5zJMJJwYqlQfTSWs3qKzwhQx5Ku', '', NULL, NULL, '+08:00', NULL, 0, 0, 1, 0, '', NULL, '2025-04-30 08:04:22', NULL, NULL, '2025-04-30 07:35:32', 0, 110, '', 0, '2025-04-30 07:35:32', '2025-04-30 08:22:00');
INSERT INTO `user_info` VALUES (1, 'dca0f9e348384d23958e151bb4adb98f', 'sysadmin', 'sysadmin', '{bcrypt-md5}$2a$10$dsfVEzh5NlfrgkcLFbrPLOuSsm5zJMJJwYqlQfTSWs3qKzwhQx5Ku', '', NULL, NULL, '+08:00', NULL, 0, 0, 100, 0, '', '系统账号', '2025-04-29 09:27:50', NULL, NULL, '2025-04-29 03:46:24', 0, NULL, '', 0, '2025-04-29 03:46:24', '2025-04-29 09:28:57');
INSERT INTO `user_info` VALUES (2, '25d19d8c917747ea', 'tgadmin', 'tgadmin', '{bcrypt-md5}$2a$10$dsfVEzh5NlfrgkcLFbrPLOuSsm5zJMJJwYqlQfTSWs3qKzwhQx5Ku', '', NULL, NULL, '+08:00', NULL, 0, 0, 1, 0, '', NULL, '2025-04-30 08:04:22', NULL, NULL, '2025-04-30 07:35:32', 0, 110, '', 0, '2025-04-30 07:35:32', '2025-04-30 08:22:00');


-- ----------------------------
-- Records of organize_role
-- ----------------------------
INSERT INTO `organize_role` VALUES (221, '', '系统内部角色', 'engineer', '工程师', 1, '{\"Monitor\":[\"view\"],\"History\":[\"view\"],\"Safety\":[\"view\"],\"Tire\":[\"view\"]}', NULL, NULL, 'dca0f9e348384d23958e151bb4adb98f', '2025-04-29 03:46:24', '2025-04-29 03:46:24');
INSERT INTO `organize_role` VALUES (222, '', '系统内部角色', 'service', '客服', 1, '', NULL, NULL, 'dca0f9e348384d23958e151bb4adb98f', '2025-04-29 03:46:24', '2025-04-29 03:46:24');
INSERT INTO `organize_role` VALUES (221, '', 'System Internal Role', 'engineer', 'engineer', 1, '{\"Monitor\":[\"view\"],\"History\":[\"view\"],\"Safety\":[\"view\"],\"Tire\":[\"view\"]}', NULL, NULL, 'dca0f9e348384d23958e151bb4adb98f', '2025-04-29 03:46:24', '2025-04-29 03:46:24');
INSERT INTO `organize_role` VALUES (222, '', 'System Internal Role', 'service', 'service', 1, '', NULL, NULL, 'dca0f9e348384d23958e151bb4adb98f', '2025-04-29 03:46:24', '2025-04-29 03:46:24');

-- ----------------------------
-- Records of system_alarm_platform
Expand Down
46 changes: 42 additions & 4 deletions setup-services.sh
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,45 @@ if [ -n "$INPUT_IP" ]; then
fi
fi

echo -e "\nTo start services:"
echo -e "${BLUE}cd $TARGET_DIR${NC}"
echo -e "${BLUE}docker compose up -d${NC}"
echo -e "${BLUE}docker compose restart nginx${NC} (If SSL certs updated)"
# --- 6. Auto-start Services ---
echo -e "\n${BLUE}Service Startup${NC}"

START_SERVICES="n"

if [ "$AUTO_YES" == "true" ]; then
START_SERVICES="y"
echo -e "${YELLOW}Auto-starting services in non-interactive mode.${NC}"
else
read -p "Do you want to start the services now? (y/N) " START_SERVICES
fi

if [[ "$START_SERVICES" == "y" || "$START_SERVICES" == "Y" ]]; then
echo -e "${BLUE}Starting Docker services...${NC}"
cd "$TARGET_DIR" || { echo -e "${RED}Failed to change directory to $TARGET_DIR${NC}"; exit 1; }

# Check if docker-compose command is available (v2 vs v1)
if docker compose version &> /dev/null; then
DOCKER_CMD="docker compose"
elif docker-compose version &> /dev/null; then
DOCKER_CMD="docker-compose"
else
echo -e "${RED}Error: Neither 'docker compose' nor 'docker-compose' found.${NC}"
exit 1
fi

echo -e "${BLUE}Executing: $DOCKER_CMD up -d${NC}"
$DOCKER_CMD up -d

if [ $? -eq 0 ]; then
echo -e "${GREEN}Services started successfully!${NC}"
echo -e "${YELLOW}Note: Some services (like databases) may take a few moments to initialize completely.${NC}"
else
echo -e "${RED}Failed to start services.${NC}"
exit 1
fi
else
echo -e "\nTo start services manually:"
echo -e "${BLUE}cd $TARGET_DIR${NC}"
echo -e "${BLUE}docker compose up -d${NC}"
echo -e "${BLUE}docker compose restart nginx${NC} (If SSL certs updated)"
fi