A To do card on server pages and in a device's drawer
- The open jobs about a server (or device) are listed on its page, with a line to add another already about it and a box to tick one off with Undo - GET /api/todos takes ?targetType=&targetId= to list only those about one thing - README and ROLES updated Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
18ceed62e8
commit
788b3e073c
10 files changed
+164
-9
No files matched your search
@@ -10,6 +10,7 @@ import SilenceButton from "../components/SilenceButton";
|
||||
import RunbookEntry from "../components/RunbookEntry";
|
||||
import NetworkDiagram from "../components/NetworkDiagram";
|
||||
import NotesCard from "../components/NotesCard";
|
||||
import TodosCard from "../components/TodosCard";
|
||||
import DetailDrawer from "../components/DetailDrawer";
|
||||
import CopyButton from "../components/CopyButton";
|
||||
import EmptyState, { EmptyRow } from "../components/EmptyState";
|
||||
@@ -368,6 +369,8 @@ export default function NetworkDevices({ user }: { user: CurrentUser }) {
|
||||
{noting && (
|
||||
<DetailDrawer title={noting.name} subtitle="Notes" onClose={() => setNoting(null)}>
|
||||
<NotesCard targetType="device" targetId={noting.id} canEdit={canAct} bare />
|
||||
<hr />
|
||||
<TodosCard targetType="device" targetId={noting.id} canEdit={canAct} bare />
|
||||
</DetailDrawer>
|
||||
)}
|
||||
</>
|
||||
|
||||
@@ -16,6 +16,7 @@ import ServerPorts from "../components/ServerPorts";
|
||||
import ServerTrends from "../components/ServerTrends";
|
||||
import UptimeHistory from "../components/UptimeHistory";
|
||||
import NotesCard from "../components/NotesCard";
|
||||
import TodosCard from "../components/TodosCard";
|
||||
import ServerActivity from "../components/ServerActivity";
|
||||
import TimeAgo from "../components/TimeAgo";
|
||||
import UptimeRibbon from "../components/UptimeRibbon";
|
||||
@@ -764,6 +765,7 @@ export default function ServerDetail({ user }: { user: CurrentUser }) {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<TodosCard targetType="server" targetId={server.id} canEdit={canEditTasks} />
|
||||
<NotesCard targetType="server" targetId={server.id} canEdit={canEditTasks} />
|
||||
<div className="card mb-3">
|
||||
<div className="card-header">
|
||||
|
||||
@@ -17,7 +17,7 @@ type Place = { type: "server" | "device"; id: number; name: string };
|
||||
|
||||
const today = () => new Date().toISOString().slice(0, 10);
|
||||
|
||||
function dueWords(t: TodoItem): { text: string; className: string } | null {
|
||||
export function dueWords(t: TodoItem): { text: string; className: string } | null {
|
||||
if (!t.dueDate) return null;
|
||||
const days = Math.round((Date.parse(`${t.dueDate}T00:00:00Z`) - Date.parse(`${today()}T00:00:00Z`)) / 86_400_000);
|
||||
if (t.doneAt) return { text: formatDate(new Date(`${t.dueDate}T12:00:00Z`)), className: "text-secondary" };
|
||||
|
||||
Reference in new issue
Block a user