Save before creating restore point: Periodic backup

Auto-saved at 2025-07-30 12:54:37

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Docker Config Backup
2025-07-30 12:54:37 +02:00
parent d390613a1c
commit 11aac2b8c2
3 changed files with 35 additions and 6 deletions

View File

@@ -365,6 +365,19 @@ export function TimeshiftSpreadsheet({ teamId, teamName }: TimeshiftSpreadsheetP
styles["A23"] = "font-weight: bold;" // "Pohotovost IT"
}
// Validate configuration before initializing
if (!data || data.length === 0) {
console.error("Data is empty or undefined:", data)
isInitializingRef.current = false
return
}
if (!columns || columns.length === 0) {
console.error("Columns is empty or undefined:", columns)
isInitializingRef.current = false
return
}
console.log("Initializing jspreadsheet with config:", {
dataRows: data.length,
dataCols: data[0]?.length,
@@ -372,9 +385,9 @@ export function TimeshiftSpreadsheet({ teamId, teamName }: TimeshiftSpreadsheetP
stylesCount: Object.keys(styles).length
})
jspreadsheetInstance.current = (jexcelLib as (el: HTMLElement, config: unknown) => unknown)(spreadsheetRef.current, {
data: data,
columns: columns,
const config = {
data: data || [],
columns: columns || [],
minDimensions: [data[0]?.length || 8, Math.max(data.length + 3, 10)],
allowInsertRow: true,
allowInsertColumn: false,
@@ -384,7 +397,7 @@ export function TimeshiftSpreadsheet({ teamId, teamName }: TimeshiftSpreadsheetP
tableOverflow: true,
tableWidth: "100%",
tableHeight: "500px",
style: styles,
style: styles || {},
onchange: (instance: any, cell: HTMLElement, x: number, y: number, value: string) => {
console.log("onChange triggered:", { x, y, value, isMerging: isMergingRef.current })
@@ -501,9 +514,19 @@ export function TimeshiftSpreadsheet({ teamId, teamName }: TimeshiftSpreadsheetP
})
}
}
})
}
console.log("Config validation passed, creating jspreadsheet instance...")
try {
jspreadsheetInstance.current = (jexcelLib as (el: HTMLElement, config: unknown) => unknown)(spreadsheetRef.current, config)
console.log("jspreadsheet initialized:", !!jspreadsheetInstance.current)
} catch (error) {
console.error("Error initializing jspreadsheet:", error)
console.error("Config that caused error:", config)
isInitializingRef.current = false
return
}
// Additional event listener for first row rotation as fallback
setTimeout(() => {

View File

@@ -173,3 +173,6 @@
2025-07-30 11:54:37 +02:00: 🔖 Creating restore point...
2025-07-30 11:54:53 +02:00: ✅ Restore point created
2025-07-30 12:24:37 +02:00: 🔖 Creating restore point...
2025-07-30 12:26:09 +02:00: ✅ Restore point created
2025-07-30 12:54:37 +02:00: 🔄 Hourly reset: Commit counter reset to 0
2025-07-30 12:54:37 +02:00: 🔖 Creating restore point...

View File

@@ -169,3 +169,6 @@
2025-07-30 11:54:37 +02:00: 🔖 Creating restore point...
2025-07-30 11:54:53 +02:00: ✅ Restore point created
2025-07-30 12:24:37 +02:00: 🔖 Creating restore point...
2025-07-30 12:26:09 +02:00: ✅ Restore point created
2025-07-30 12:54:37 +02:00: 🔄 Hourly reset: Commit counter reset to 0
2025-07-30 12:54:37 +02:00: 🔖 Creating restore point...