Auto-save: Updated components/timeshift-spreadsheet.tsx
Auto-saved at 2025-07-29 14:35:46 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
103
PM2-QUICK-REFERENCE.md
Normal file
103
PM2-QUICK-REFERENCE.md
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
# PM2 Auto-Commit Service - Quick Reference
|
||||||
|
|
||||||
|
## ✅ Service Status: RUNNING
|
||||||
|
The auto-commit watcher is now running as a PM2 background service!
|
||||||
|
|
||||||
|
## 🚀 Quick Commands
|
||||||
|
|
||||||
|
### Service Management
|
||||||
|
```bash
|
||||||
|
# Check service status
|
||||||
|
npm run pm2:status
|
||||||
|
|
||||||
|
# View auto-commit logs
|
||||||
|
npm run services:logs
|
||||||
|
|
||||||
|
# Stop auto-commit service
|
||||||
|
npm run services:stop
|
||||||
|
|
||||||
|
# Start auto-commit service
|
||||||
|
npm run services:start
|
||||||
|
|
||||||
|
# Restart auto-commit service
|
||||||
|
./start-services.sh restart
|
||||||
|
```
|
||||||
|
|
||||||
|
### Manual Operations
|
||||||
|
```bash
|
||||||
|
# Save changes immediately
|
||||||
|
npm run save "Your message"
|
||||||
|
|
||||||
|
# Create restore point
|
||||||
|
npm run restore-point "Before big changes"
|
||||||
|
|
||||||
|
# List restore points
|
||||||
|
./auto-commit.sh list
|
||||||
|
```
|
||||||
|
|
||||||
|
## 📊 Monitoring
|
||||||
|
|
||||||
|
### Real-time Monitoring
|
||||||
|
```bash
|
||||||
|
# PM2 monitoring dashboard
|
||||||
|
npm run pm2:monit
|
||||||
|
|
||||||
|
# Live log streaming
|
||||||
|
pm2 logs timeshift-auto-commit
|
||||||
|
```
|
||||||
|
|
||||||
|
### Log Files
|
||||||
|
- **Output**: `/home/klas/timeshift/logs/auto-commit.out.log`
|
||||||
|
- **Errors**: `/home/klas/timeshift/logs/auto-commit.error.log`
|
||||||
|
- **Combined**: `/home/klas/timeshift/logs/auto-commit.log`
|
||||||
|
|
||||||
|
## ⚙️ How It Works
|
||||||
|
|
||||||
|
1. **File Watching**: Monitors `components/`, `app/`, `lib/` directories
|
||||||
|
2. **Smart Delay**: Waits 30 seconds after last change
|
||||||
|
3. **Auto-Commit**: Creates timestamped git commits
|
||||||
|
4. **Rate Limiting**: Max 10 commits per hour
|
||||||
|
5. **Restore Points**: Creates backup branches every 30 minutes
|
||||||
|
|
||||||
|
## 🛡️ Backup & Recovery
|
||||||
|
|
||||||
|
### Automatic Backups
|
||||||
|
- ✅ Auto-commits every 30 seconds when files change
|
||||||
|
- ✅ Restore points every 30 minutes
|
||||||
|
- ✅ Session restore point on startup
|
||||||
|
|
||||||
|
### Manual Recovery
|
||||||
|
```bash
|
||||||
|
# See all restore points
|
||||||
|
./auto-commit.sh list
|
||||||
|
|
||||||
|
# Restore to specific point
|
||||||
|
git checkout restore-point-20250729-142449
|
||||||
|
|
||||||
|
# Go back to main
|
||||||
|
git checkout main
|
||||||
|
|
||||||
|
# See recent auto-commits
|
||||||
|
git log --oneline -10
|
||||||
|
```
|
||||||
|
|
||||||
|
## 🔧 Process Info
|
||||||
|
- **Service Name**: `timeshift-auto-commit`
|
||||||
|
- **Process ID**: Check with `npm run pm2:status`
|
||||||
|
- **Auto-restart**: Yes (if crashes)
|
||||||
|
- **Max Memory**: 200MB limit
|
||||||
|
- **Log Rotation**: Managed by PM2
|
||||||
|
|
||||||
|
## 🎯 Benefits Achieved
|
||||||
|
|
||||||
|
✅ **No more lost work** - Changes saved every 30 seconds
|
||||||
|
✅ **Claude restart proof** - Survives session restarts
|
||||||
|
✅ **Background operation** - Runs independently
|
||||||
|
✅ **Auto-recovery** - PM2 restarts if crashes
|
||||||
|
✅ **Full monitoring** - Logs and status tracking
|
||||||
|
✅ **Easy management** - Simple npm commands
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**🎉 Success**: Your work is now automatically protected!
|
||||||
|
The service is running in the background and will continue even if Claude restarts.
|
||||||
@@ -240,6 +240,12 @@ export function TimeshiftSpreadsheet({ teamId, teamName }: TimeshiftSpreadsheetP
|
|||||||
// Generate styles for day/night shifts based on the Excel pattern
|
// Generate styles for day/night shifts based on the Excel pattern
|
||||||
const styles: Record<string, string> = {}
|
const styles: Record<string, string> = {}
|
||||||
if (selectedMonth && selectedYear) {
|
if (selectedMonth && selectedYear) {
|
||||||
|
// Make first row (row 1) taller - 97px
|
||||||
|
for (let col = 0; col < (data[0]?.length || 0); col++) {
|
||||||
|
const colLetter = getExcelColumnName(col)
|
||||||
|
styles[`${colLetter}1`] = "height: 97px;"
|
||||||
|
}
|
||||||
|
|
||||||
// Make day names row (row 2) taller
|
// Make day names row (row 2) taller
|
||||||
for (let col = 0; col < (data[0]?.length || 0); col++) {
|
for (let col = 0; col < (data[0]?.length || 0); col++) {
|
||||||
const colLetter = getExcelColumnName(col)
|
const colLetter = getExcelColumnName(col)
|
||||||
|
|||||||
@@ -26,3 +26,7 @@
|
|||||||
2025-07-29 14:30:38 +02:00: 📝 File changed: components/test-component.tsx (change)
|
2025-07-29 14:30:38 +02:00: 📝 File changed: components/test-component.tsx (change)
|
||||||
2025-07-29 14:31:08 +02:00: 🔄 Performing auto-commit...
|
2025-07-29 14:31:08 +02:00: 🔄 Performing auto-commit...
|
||||||
2025-07-29 14:31:08 +02:00: ✅ Auto-commit successful
|
2025-07-29 14:31:08 +02:00: ✅ Auto-commit successful
|
||||||
|
2025-07-29 14:35:16 +02:00: 📝 File changed: components/timeshift-spreadsheet.tsx (change)
|
||||||
|
2025-07-29 14:35:16 +02:00: 📝 File changed: components/timeshift-spreadsheet.tsx (change)
|
||||||
|
2025-07-29 14:35:16 +02:00: 📝 File changed: components/timeshift-spreadsheet.tsx (change)
|
||||||
|
2025-07-29 14:35:46 +02:00: 🔄 Performing auto-commit...
|
||||||
|
|||||||
@@ -24,3 +24,7 @@
|
|||||||
2025-07-29 14:30:38 +02:00: 📝 File changed: components/test-component.tsx (change)
|
2025-07-29 14:30:38 +02:00: 📝 File changed: components/test-component.tsx (change)
|
||||||
2025-07-29 14:31:08 +02:00: 🔄 Performing auto-commit...
|
2025-07-29 14:31:08 +02:00: 🔄 Performing auto-commit...
|
||||||
2025-07-29 14:31:08 +02:00: ✅ Auto-commit successful
|
2025-07-29 14:31:08 +02:00: ✅ Auto-commit successful
|
||||||
|
2025-07-29 14:35:16 +02:00: 📝 File changed: components/timeshift-spreadsheet.tsx (change)
|
||||||
|
2025-07-29 14:35:16 +02:00: 📝 File changed: components/timeshift-spreadsheet.tsx (change)
|
||||||
|
2025-07-29 14:35:16 +02:00: 📝 File changed: components/timeshift-spreadsheet.tsx (change)
|
||||||
|
2025-07-29 14:35:46 +02:00: 🔄 Performing auto-commit...
|
||||||
|
|||||||
Reference in New Issue
Block a user