Skip to content
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
.DS_Store
test/json/
test/test_insight_parser.cpp
.claude/settings.local.json
409 changes: 315 additions & 94 deletions card-config-readme.md

Large diffs are not rendered by default.

99 changes: 99 additions & 0 deletions html/portal.css
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,45 @@ select::-ms-expand {
font-style: italic;
}

/* Available services list styling - reuse card styles */
.available-service-item {
border: 1px solid var(--border-color);
border-radius: var(--radius);
padding: 1rem;
margin-bottom: 0.5rem;
background-color: var(--input-color);
}

.available-service-info {
margin-bottom: 1rem;
}

.available-service-name {
font-weight: 600;
margin-bottom: 0.25rem;
}

.available-service-description {
font-size: 0.9rem;
color: var(--label-color);
margin-bottom: 0.25rem;
}

.available-service-status {
font-size: 0.8rem;
color: var(--label-color);
font-style: italic;
}

.available-service-actions {
border-top: 1px solid var(--border-color);
padding-top: 1rem;
}

.save-service-btn {
margin-top: 1rem;
}

.available-card-actions {
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -366,4 +405,64 @@ select::-ms-expand {

.drag-handle:active {
cursor: grabbing;
}

/* Dynamic Configuration Fields */
.config-field {
margin-bottom: 1rem;
}

.config-field label {
display: block;
margin-bottom: 0.3rem;
font-weight: 600;
color: #333;
font-size: 0.9rem;
}

.config-field .config-input {
width: 100%;
box-sizing: border-box;
}

.config-field textarea.config-input {
min-height: 60px;
resize: vertical;
font-family: var(--default-font);
}

.config-field select.config-input {
width: 100%;
}

.checkbox-label {
display: flex !important;
align-items: center;
gap: 0.5rem;
cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
width: auto !important;
margin: 0;
}

.field-description {
display: block;
color: var(--label-color);
font-size: 0.8rem;
margin-top: 0.3rem;
line-height: 1.4;
}

.config-field input[required]:invalid,
.config-field textarea[required]:invalid,
.config-field select[required]:invalid {
border-color: #dc3545;
}

.config-field input[required]:valid,
.config-field textarea[required]:valid,
.config-field select[required]:valid {
border-color: #28a745;
}
32 changes: 5 additions & 27 deletions html/portal.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,34 +47,12 @@ <h2>Welcome to DeskHog</h2>
<p>DeskHog is a tiny platform for having fun with code, hardware and the internet. Check out the <a href="https://github.com/posthog/deskhog/blob/main/README.md" target="_blank">readme</a> to get hacking, especially the <a href="https://github.com/posthog/deskhog/blob/main/tech-details.md" target="_blank">tech details file</a>.</p>
</div>

<h2>PostHog API configuration</h2>

<h2>Configure services</h2>
<div class="config-section">
<form id="device-form" onsubmit="return saveDeviceConfig()">
<div class="form-group">
<label for="region">Region</label>
<select name="region" id="region" required>
<option value="">Select a region</option>
<option value="us">US</option>
<option value="eu">EU</option>
</select>
</div>
<div class="form-group">
<label for="teamId">Team ID</label>
<input type="text" name="teamId" id="teamId" min="-1" required>
<p class="tip">This is the numeral that appears at the end of the URL when you're looking at your <a href="https://app.posthog.com/" target="_blank">project's homepage dashboard</a>.</p>
</div>

<div class="form-group">
<label for="apiKey">API key</label>
<input type="text" name="apiKey" id="apiKey">
<p class="tip">Create a <a href="https://app.posthog.com/settings/user-api-keys" target="_blank">new API key in your project settings</a>. Give it read access to insights.</p>
</div>

<div class="button-container">
<button type="submit">Save API configuration</button>
</div>
</form>
<div id="available-services-list">
<!-- Will be populated by JavaScript -->
<p>Loading available services...</p>
</div>
</div>

<h2>Add cards</h2>
Expand Down
Loading