summaryrefslogtreecommitdiff
path: root/web/templates/agent-status.html
blob: a77bb97f7e5a32bce04012ae271a82b0519f1e04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Agent Status - {{.AgentName}}</title>
    <style>
        body { font-family: system-ui, sans-serif; max-width: 600px; margin: 40px auto; padding: 20px; background: #1a1a2e; color: #eee; }
        .card { background: #16213e; border-radius: 8px; padding: 24px; margin-bottom: 20px; }
        h1 { color: #e94560; margin-top: 0; }
        .label { color: #888; font-size: 0.9em; margin-bottom: 4px; }
        .value { font-family: monospace; background: #0f0f23; padding: 8px 12px; border-radius: 4px; word-break: break-all; margin-bottom: 16px; }
        .status { display: inline-block; padding: 4px 12px; border-radius: 12px; font-size: 0.9em; }
        .status-pending { background: #ffc107; color: #000; }
        .status-approved { background: #28a745; color: #fff; }
        .status-denied { background: #dc3545; color: #fff; }
        .status-expired { background: #6c757d; color: #fff; }
        .success-box { background: #155724; border: 1px solid #28a745; border-radius: 4px; padding: 16px; margin-top: 20px; }
        .instructions { background: #1a1a2e; border: 1px solid #333; border-radius: 4px; padding: 16px; font-size: 0.9em; }
        code { background: #0f0f23; padding: 2px 6px; border-radius: 3px; }
    </style>
</head>
<body>
    <script type="application/json" id="agent-data">
{
    "status": "{{.Status}}"{{if .SessionToken}},
    "session_token": "{{.SessionToken}}",
    "context_url": "{{.ContextURL}}",
    "expires_at": "{{.SessionExpiresAt}}"{{end}}
}
    </script>

    <div class="card">
        <h1>Agent Status</h1>
        <p>Status for agent <strong>{{.AgentName}}</strong></p>

        <div class="label">Status</div>
        <div><span class="status status-{{.Status}}">{{.Status}}</span></div>

        {{if eq .Status "approved"}}
        <div class="success-box">
            <strong>Access Granted!</strong>
            <p>Your session has been approved. Use the credentials below to access the context.</p>
        </div>

        <br>
        <div class="label">Session Token</div>
        <div class="value">{{.SessionToken}}</div>

        <div class="label">Context URL</div>
        <div class="value">{{.ContextURL}}</div>

        {{if .SessionExpiresAt}}
        <div class="label">Session Expires At</div>
        <div class="value">{{.SessionExpiresAt}}</div>
        {{end}}

        <div class="instructions">
            <strong>Next Step:</strong>
            <p>Fetch your timeline data by navigating to: <code>GET {{.ContextURL}}</code></p>
        </div>
        {{else if eq .Status "pending"}}
        <div class="instructions">
            <strong>Waiting for approval...</strong>
            <p>Refresh this page to check the current status.</p>
        </div>
        {{else if eq .Status "denied"}}
        <div class="instructions">
            <strong>Access Denied</strong>
            <p>Your request was denied by the dashboard owner.</p>
        </div>
        {{else if eq .Status "expired"}}
        <div class="instructions">
            <strong>Request Expired</strong>
            <p>Your authentication request has expired. Please initiate a new request.</p>
        </div>
        {{end}}
    </div>
</body>
</html>