feat(docker): add Docker support and enhance dashboard data
- Add Dockerfile and docker-compose.yml for containerized deployment - Update server to listen on all network interfaces for Docker compatibility - Add .dockerignore to exclude unnecessary files from build context - Enhance dashboard controller with additional user data, trends, and suggestions - Update package.json scripts for proper Docker build workflow
This commit is contained in:
26
dist/dashboard/dashboard.controller.js
vendored
26
dist/dashboard/dashboard.controller.js
vendored
@@ -61,22 +61,42 @@ let DashboardController = class DashboardController {
|
||||
fat: goals.target_fat_g - nutrition.fat,
|
||||
water: goals.target_water_ml - water.total_ml,
|
||||
};
|
||||
const macroPercentages = this.utilsService.getMacroPercentages(nutrition.protein, nutrition.carbs, nutrition.fat);
|
||||
const macro_percentages = this.utilsService.getMacroPercentages(nutrition.protein, nutrition.carbs, nutrition.fat);
|
||||
const suggestions = this.utilsService.suggestFoodsForMacros(remaining.protein, remaining.carbs, remaining.fat);
|
||||
const calorie_trend = await this.utilsService.getCalorieTrend(req.user.id);
|
||||
const weight_trend = await this.utilsService.getWeightTrend(req.user.id);
|
||||
return {
|
||||
user: req.user,
|
||||
current_user: req.user,
|
||||
nutrition,
|
||||
water,
|
||||
goals,
|
||||
weightLogToday,
|
||||
weightChange,
|
||||
remaining,
|
||||
macroPercentages,
|
||||
macro_percentages,
|
||||
suggestions,
|
||||
calorie_trend,
|
||||
weight_trend,
|
||||
};
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
req.flash('error_msg', 'Error loading dashboard');
|
||||
return {};
|
||||
return {
|
||||
user: req.user,
|
||||
current_user: req.user,
|
||||
nutrition: { calories: 0, protein: 0, carbs: 0, fat: 0, meals: [] },
|
||||
water: { total_ml: 0, logs: [] },
|
||||
goals: null,
|
||||
weightLogToday: null,
|
||||
weightChange: null,
|
||||
remaining: { calories: 0, protein: 0, carbs: 0, fat: 0, water: 0 },
|
||||
macro_percentages: { protein: 0, carbs: 0, fat: 0 },
|
||||
suggestions: [],
|
||||
calorie_trend: [],
|
||||
weight_trend: [],
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user