Skip to content

Commit dd4a7aa

Browse files
committed
add watermark
1 parent 6d62b8e commit dd4a7aa

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

client/html/index.tmpl

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,15 @@
2020
<link rel="shortcut icon" href="{[{ .favicon }]}" />
2121
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
2222
<link rel="stylesheet" href="/resources/site.css"/>
23+
{[{ if .brand }]}
2324
<style type="text/css">
25+
.watermark-brand {
26+
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' version='1.1' height='100px' width='300px' opacity='0.1'><text transform='translate(20, 100) rotate(-25)' fill='rgb(245,45,45)' font-size='46'>{[{ .brand }]}</text></svg>");
27+
}
2428
</style>
29+
{[{ end }]}
2530
</head>
26-
<body>
31+
<body class="watermark-brand">
2732
<div id="main" class="container">
2833
<h3 class="mt-3">{[{ .description }]}</h3>
2934
{[{ if .logo }]}
@@ -69,9 +74,13 @@
6974
</h3>
7075
<div id="collapseAddrbook" class="accordion-collapse collapse show" aria-labelledby="headingAddrbook" data-bs-parent="#accordionMain">
7176
<div class="card card-body">
77+
{[{ if gt .livePeersCount 0 }]}
7278
<p>Download: <a href="/download/addrbook.json">addrbook.json</a></p>
7379
<pre class="border p-2"><code>wget -O addrbook.json https://{[{ .host }]}/download/addrbook.json --inet4-only
7480
mv addrbook.json $HOME/{[{ .generalNodeHomeName }]}/config</code></pre>
81+
{[{ else }]}
82+
<h3 class="text-danger">Addrbook temporary not available</h3>
83+
{[{ end }]}
7584
</div>
7685
</div>
7786
</div>
@@ -162,7 +171,7 @@ s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$SNAP_RPC,$SNAP_RPC\"| ; \
162171
s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \
163172
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"|" $HOME/{[{ .generalNodeHomeName }]}/config/config.toml</code></pre>
164173
{[{ if gt .livePeersCount 0 }]}
165-
<p>Consider adding {[{ .livePeersCount }]} live-peers above to <b>`persistent_peers`</b> in <b>`config.toml`</b></p>
174+
<p>Consider adding {[{ .livePeersCount }]} live-peers above to <b>`persistent_peers`</b> in <b>`config.toml`</b> and download <b>`addrbook.json`</b></p>
166175
{[{ end }]}
167176
<p>Stop the node</p>
168177
<pre class="border p-2"><code>sudo systemctl stop {[{ .generalBinaryName }]}</code></pre>

client/html/resources/site.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99

1010
.cursor-pointer {
1111
cursor: pointer;
12-
}
12+
}

services/web_server/handle_web_page.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ func HandleWebIndex(c *gin.Context) {
4747

4848
c.HTML(http.StatusOK, "index.tmpl", gin.H{
4949
"host": c.Request.Host,
50+
"brand": cfg.Brand,
5051
"title": fmt.Sprintf("%s snapshot by %s", cfg.ChainName, cfg.Brand),
5152
"description": fmt.Sprintf("Snapshot data, live-peers for %s (%s) by %s", cfg.ChainName, cfg.ChainID, cfg.Brand),
5253
"chainName": cfg.ChainName,

0 commit comments

Comments
 (0)