╭ changed ────╮ │src/serve.zig│ ╰─────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────────────────────────╮ │10 ssh_listen: []const u8 = "127.0.0.1:8081",│ │11 wui_listen: []const u8 = "127.0.0.1:8082",│ │12 data_dir: []const u8 = ".", │ │13 - tui: bool = false, │ │13 }; │ │14 │ │15 const ListenAddress = struct { │ ╰──────────────────────────────────────────────────╯ ╭──────────────────────────────╮ │25 cwd_path: []const u8, │ │26 options: Options, │ │27 err: *std.Io.Writer, │ │28 + runnable: anytype, │ │29 ) !void { │ │30 // create the data dir│ │31 │ ╰──────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────╮ │41 defer allocator.free(repo_root_path); │ │42 │ │43 try std.Io.Dir.cwd().createDirPath(io, repo_root_path); │ │44 + │ │45 + // the admin repo path is where the user/repo metadata events live; │ │46 + // web.zig opens it per request to render the server-side TUI │ │47 + │ │48 + const admin_repo_path = try std.fs.path.resolve(allocator, &.{ data_dir_path, "admin" });│ │49 + defer allocator.free(admin_repo_path); │ │50 │ │51 // create http listener │ │52 │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────╮ │89 try err.print("serving web UI on http://{s}/\n", .{options.wui_listen});│ │90 try err.flush(); │ │91 │ │86 - web.run(io, allocator, &wui_server, &tasks, err); │ │92 + web.run(io, allocator, &wui_server, &tasks, admin_repo_path, err); │ │93 │ │88 - if (options.tui) { │ │89 - try ui.run(io, allocator); │ │94 + if (@TypeOf(runnable) != void) { │ │95 + try runnable.run(); │ │96 } else { │ │97 try tasks.await(io); │ │98 } │ ╰────────────────────────────────────────────────────────────────────────────────╯