update lms app runtime integration

This commit is contained in:
2026-07-06 16:41:48 +09:00
parent 1c2d5f24ef
commit 9a1eec48e9
6 changed files with 75 additions and 11 deletions
+24 -3
View File
@@ -3185,6 +3185,22 @@ function createSplashWindow(): void {
})
}
function updateSplashStatus(message: string): void {
if (!splashWindow || splashWindow.isDestroyed()) return
const safeMessage = JSON.stringify(message)
splashWindow.webContents.executeJavaScript(
`window.setSplashStatus && window.setSplashStatus(${safeMessage})`
).catch(() => undefined)
}
function closeSplashAndShowMain(): void {
if (mainWindow && !mainWindow.isDestroyed() && !mainWindow.isVisible()) {
splashWindow?.close()
splashWindow = null
mainWindow.show()
}
}
function createWindow(): void {
const { width, height } = screen.getPrimaryDisplay().workAreaSize
@@ -3210,10 +3226,9 @@ function createWindow(): void {
suppressSystemContextMenu(mainWindow)
mainWindow.once('ready-to-show', () => {
setTimeout(() => {
splashWindow?.close()
splashWindow = null
mainWindow?.show()
updateSplashStatus('로그인 세션 확인 중...')
}, 1100)
setTimeout(closeSplashAndShowMain, 8000)
})
mainWindow.on('closed', () => {
mainWindow = null
@@ -3227,6 +3242,12 @@ function createWindow(): void {
}
function registerLocalWorkspaceHandlers(): void {
ipcMain.on('lms-boot-status', (_event, message: string) => {
updateSplashStatus(message)
})
ipcMain.on('lms-boot-done', () => {
closeSplashAndShowMain()
})
ipcMain.handle('local-workspace:modules:list', (_event, workspaceRoot?: string | null, courseModules?: CourseModuleInput[] | null) => collectAvailableModules(workspaceRoot, courseModules))
ipcMain.handle('local-workspace:modules:install', (_event, moduleName: string, workspaceRoot?: string | null, folderName?: string | null, templateRepositoryUrl?: string | null, studentRepositoryUrl?: string | null, options?: ModuleInstallOptions | null) => installModuleFromCache(moduleName, workspaceRoot, folderName, templateRepositoryUrl, studentRepositoryUrl, options))
ipcMain.handle('local-workspace:modules:delete', (_event, moduleName: string, workspaceRoot?: string | null, folderName?: string | null) => deleteWorkspaceModule(moduleName, workspaceRoot, folderName))