╭ changed ──╮ │src/web.zig│ ╰───────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │144 if (std.mem.eql(u8, path, "/repo/new")) return handleRepoNew(io, request, allocator, path, server.admin_repo_path, server.users_dir, server.session_store); │ │145 // likewise the home page's new user form │ │146 if (std.mem.eql(u8, path, "/user/new")) return handleUserNew(io, request, allocator, path, server.admin_repo_path, server.users_dir, server.session_store); │ │147 - const PostRoute = enum { login, logout, ansi, @"new-repo", @"new-user", new, edit, remove, open, close, resolve, publish, merge, squash, attach, undo, clear };│ │147 + const PostRoute = enum { login, logout, @"new-repo", @"new-user", new, edit, remove, open, close, resolve, publish, merge, squash, attach, undo, clear }; │ │148 inline for (@typeInfo(PostRoute).@"enum".fields) |field| { │ │149 const suffix = "/" ++ field.name; │ │150 if (std.mem.endsWith(u8, path, suffix)) { │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │152 return switch (@field(PostRoute, field.name)) { │ │153 .login => handleLogin(io, request, allocator, base, server.admin_repo_path, server.session_store), │ │154 .logout => handleLogout(request, base, server.session_store), │ │155 - .ansi => handleAnsi(io, request, allocator, base, server.admin_repo_path, server.users_dir, server.session_store), │ │155 .@"new-repo" => handleRepoNew(io, request, allocator, path, server.admin_repo_path, server.users_dir, server.session_store),│ │156 .@"new-user" => handleUserNew(io, request, allocator, path, server.admin_repo_path, server.users_dir, server.session_store),│ │157 .new => handleNew(io, request, allocator, base, host), │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │471 }, │ │472 }); │ │473 } │ │475 - │ │476 -fn handleAnsi( │ │477 - io: std.Io, │ │478 - request: *std.http.Server.Request, │ │479 - allocator: std.mem.Allocator, │ │480 - base: []const u8, │ │481 - admin_repo_path: []const u8, │ │482 - users_dir: []const u8, │ │483 - session_store: SessionStore, │ │484 -) !void { │ │485 - // the toggle re-emits the user's own event, so it takes a logged-in user │ │486 - var user_id: [evt.event_id_size]u8 = undefined; │ │487 - const token = getCookieValue(request, cookie_name) orelse return respondLoginRequired(request);│ │488 - if (!session_store.lookup(token, &user_id)) return respondLoginRequired(request); │ │474 │ │490 - { │ │491 - const Repo = rp.Repo(.xit, evt.admin_repo_opts); │ │492 - var repo = try Repo.open(io, allocator, .{ .path = admin_repo_path }); │ │493 - defer repo.deinit(io, allocator); │ │494 - │ │495 - try evt.User.toggleAnsi(evt.admin_repo_opts, io, allocator, &repo, users_dir, &user_id); │ │496 - } │ │497 - │ │498 - // return to the auth tab the toggle came from so the change is visible. │ │499 - const location = try std.fmt.allocPrint(allocator, "{s}/auth", .{base}); │ │500 - defer allocator.free(location); │ │501 - │ │502 - // like logout, this is a bodyless POST, so close the connection rather than │ │503 - // letting the keep-alive path try to discard a body that isn't framed. │ │504 - try request.respond("", .{ │ │505 - .status = .see_other, │ │506 - .keep_alive = false, │ │507 - .extra_headers = &.{ │ │508 - .{ .name = "location", .value = location }, │ │509 - }, │ │510 - }); │ │511 -} │ │512 - │ │475 // the actor for a write to the repo `repo_base` names with at least `min_role`, │ │476 // or null once the refusal has been sent. local mode always writes. │ │477 fn authorizeWrite( │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1973 switch (root.*) { │ │1974 .background => |*background| { │ │1975 if (background.art.getGrid()) |art| { │ │2014 - var position_buf: [64]u8 = undefined; │ │2015 - try out.appendSlice(allocator, try std.fmt.bufPrint(&position_buf, "<div class=\"ansi-art\" aria-hidden=\"true\" style=\"left:{d}ch\">", .{grid.size.width -| art.size.width})); │ │1976 + try out.print(allocator, "<div class=\"ansi-art\" aria-hidden=\"true\" style=\"left:{d}ch;opacity:{d}%\">", .{ grid.size.width -| art.size.width, ui.widget.AnsiBackground.art_opacity });│ │1977 try renderPanel(allocator, &out, background.art.getFocus(), art, session, root_focus); │ │1978 try out.appendSlice(allocator, "</div>"); │ │1979 } │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯