Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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 .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ jobs:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: APP_VERSION=${{ steps.ver.outputs.tag }}
cache-from: type=gha
cache-to: type=gha,mode=max

Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
FROM nginx:alpine

ARG APP_VERSION=dev
ENV APP_VERSION=${APP_VERSION}

COPY www/index.html /usr/share/nginx/html/index.html.template
COPY www/favicon.svg /usr/share/nginx/html/favicon.svg
COPY www/manifest.json /usr/share/nginx/html/manifest.json
Expand Down
2 changes: 1 addition & 1 deletion docker-entrypoint.d/40-envsubst-html.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
envsubst '${PH_HOSTS} ${PH_PASSWORD}' \
envsubst '${PH_HOSTS} ${PH_PASSWORD} ${APP_VERSION}' \
< /usr/share/nginx/html/index.html.template \
> /usr/share/nginx/html/index.html
18 changes: 14 additions & 4 deletions www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,16 @@
white-space: nowrap;
}

.instance-host a {
color: inherit;
text-decoration: none;
}

.instance-host a:hover {
text-decoration: underline;
color: var(--md-primary);
}

.instance-stats {
display: grid;
grid-template-columns: 1fr 1fr;
Expand Down Expand Up @@ -680,7 +690,7 @@ <h1>Pi-hole toggle sync</h1>

<footer>
<a href="https://github.com/bartekmp/pihole-toggle-sync" target="_blank">pihole-toggle-sync</a>
&mdash; MIT license
${APP_VERSION} &mdash; MIT license
</footer>

<script>
Expand Down Expand Up @@ -823,7 +833,7 @@ <h1>Pi-hole toggle sync</h1>
card.innerHTML = `
<div class="instance-header">
<div class="instance-dot offline"></div>
<div class="instance-host">${hostLabel(host)}</div>
<div class="instance-host"><a href="${cleanHost(host)}/admin" target="_blank" rel="noopener noreferrer">${hostLabel(host)}</a></div>
</div>
<div class="instance-error">
<span>error</span>Unable to reach instance
Expand All @@ -842,7 +852,7 @@ <h1>Pi-hole toggle sync</h1>
card.innerHTML = `
<div class="instance-header">
<div class="instance-dot online"></div>
<div class="instance-host">${hostLabel(host)}</div>
<div class="instance-host"><a href="${cleanHost(host)}/admin" target="_blank" rel="noopener noreferrer">${hostLabel(host)}</a></div>
</div>
<div class="instance-subheader">
<span class="instance-blocking-badge ${isBlocking ? 'on' : 'off'}">
Expand Down Expand Up @@ -956,7 +966,7 @@ <h1>Pi-hole toggle sync</h1>
}

async function apiCall(host, enable, timer) {
const body = enable ? { blocking: true } : { blocking: false, timer: timer || 0 };
const body = enable ? { blocking: true } : (timer ? { blocking: false, timer } : { blocking: false });
const sid = await getSid(host);
const headers = { 'Content-Type': 'application/json' };
if (sid) headers['X-FTL-SID'] = sid;
Expand Down
Loading