feat: unterstütze Einzeldatei-Import, verbessere Fortschrittsanzeige und Logging im ZNS-Import
Signed-off-by: StefanMoCoAt <stefan.mo.co@gmail.com>
This commit is contained in:
+6
-6
@@ -30,9 +30,9 @@ data class ImportStartResponse(val jobId: String)
|
||||
internal data class JobStatusResponse(
|
||||
val jobId: String,
|
||||
val status: String,
|
||||
val progress: Int = 0,
|
||||
val progressDetail: String = "",
|
||||
val errors: List<String> = emptyList(),
|
||||
val fortschritt: Int = 0,
|
||||
val meldungen: List<String> = emptyList(),
|
||||
val fehler: List<String> = emptyList(),
|
||||
)
|
||||
|
||||
private val TERMINAL_STATES = setOf("ABGESCHLOSSEN", "FEHLER")
|
||||
@@ -111,9 +111,9 @@ class ZnsImportViewModel(
|
||||
val status = json.decodeFromString<JobStatusResponse>(response.bodyAsText())
|
||||
state = state.copy(
|
||||
jobStatus = status.status,
|
||||
progress = status.progress,
|
||||
progressDetail = status.progressDetail,
|
||||
errors = status.errors.takeLast(MAX_VISIBLE_ERRORS),
|
||||
progress = status.fortschritt,
|
||||
progressDetail = status.meldungen.lastOrNull() ?: "",
|
||||
errors = status.fehler.takeLast(MAX_VISIBLE_ERRORS),
|
||||
isFinished = status.status in TERMINAL_STATES,
|
||||
)
|
||||
if (status.status in TERMINAL_STATES) break
|
||||
|
||||
Reference in New Issue
Block a user