Browse Source

add footer links settings, implement nodes registry with database download list

main
ghost 1 year ago
parent
commit
9087c4b0d7
  1. 55
      example/config.json
  2. 28
      src/webui/index.php

55
example/config.json

@ -43,6 +43,61 @@ @@ -43,6 +43,61 @@
{
"enabled":false
}
},
"footer":
{
"links":
[
{
"text":"0200::/7",
"attributes":
{
"title":"Serch in 0200::/7 IPv6",
"href":"http://[201:23b4:991a:634d:8359:4521:5576:15b7]/yo/",
"target":"_blank"
},
"index":
[
"http://[201:23b4:991a:634d:8359:4521:5576:15b7]/yo/index.sql"
]
},
{
"text":"yo.ygg",
"attributes":
{
"title":"Search in .ygg zone",
"href":"http://yo.ygg",
"target":"_blank"
},
"index":
[
"http://yo.ygg/index.sql"
]
},
{
"text":"ygg.yo.index",
"attributes":
{
"title":"Search in .ygg zone",
"href":"http://ygg.yo.index",
"target":"_blank"
},
"index":
[
"http://ygg.yo.index/index.sql"
]
},
{
"text":"GitHub",
"attributes":
{
"title":"Source code",
"href":"https://github.com/YGGverse/Yo",
"target":"_blank"
},
"index":[]
}
]
}
},
"cli":

28
src/webui/index.php

@ -131,16 +131,27 @@ $placeholder = sprintf( @@ -131,16 +131,27 @@ $placeholder = sprintf(
font-size: 12px;
}
footer > a, a:visited,
footer > a,
footer > a:visited,
footer > a:active {
color: #9ba2ac;
font-size: 12px;
}
footer > a > svg,
footer > a:visited > svg,
footer > a:active > svg {
fill: #9ba2ac;
}
footer > a:hover {
color: #54a3f7;
}
footer > a:hover svg {
fill: #54a3f7;
}
footer > a,
footer > a:visited,
footer > a:active {
@ -303,7 +314,20 @@ $placeholder = sprintf( @@ -303,7 +314,20 @@ $placeholder = sprintf(
</main>
<!-- css animation : end -->
<footer>
<a href="https://github.com/YGGverse/Yo"><?php echo _('GitHub') ?></a>
<?php foreach ($config->webui->footer->links as $i => $link) { ?>
<?php if ($i) echo '|' ?>
<a <?php foreach ($link->attributes as $name => $value) { echo sprintf(' %s="%s"', $name, $value); } ?>>
<?php echo _($link->text) ?>
</a>
<?php foreach ($link->index as $index) { ?>
<a rel="nofollow" href="<?php echo $index ?>" title="<?php echo sprintf(_('Download %s database'), $link->text) ?>">
<svg xmlns="http://www.w3.org/2000/svg" width="11" height="11" viewBox="0 0 16 16">
<path d="M12.5 9a3.5 3.5 0 1 1 0 7 3.5 3.5 0 0 1 0-7m.354 5.854 1.5-1.5a.5.5 0 0 0-.708-.708l-.646.647V10.5a.5.5 0 0 0-1 0v2.793l-.646-.647a.5.5 0 0 0-.708.708l1.5 1.5a.5.5 0 0 0 .708 0ZM8 1c-1.573 0-3.022.289-4.096.777C2.875 2.245 2 2.993 2 4s.875 1.755 1.904 2.223C4.978 6.711 6.427 7 8 7s3.022-.289 4.096-.777C13.125 5.755 14 5.007 14 4s-.875-1.755-1.904-2.223C11.022 1.289 9.573 1 8 1"/>
<path d="M2 7v-.839c.457.432 1.004.751 1.49.972C4.722 7.693 6.318 8 8 8s3.278-.307 4.51-.867c.486-.22 1.033-.54 1.49-.972V7c0 .424-.155.802-.411 1.133a4.51 4.51 0 0 0-4.815 1.843A12.31 12.31 0 0 1 8 10c-1.573 0-3.022-.289-4.096-.777C2.875 8.755 2 8.007 2 7m6.257 3.998L8 11c-1.682 0-3.278-.307-4.51-.867-.486-.22-1.033-.54-1.49-.972V10c0 1.007.875 1.755 1.904 2.223C4.978 12.711 6.427 13 8 13h.027a4.552 4.552 0 0 1 .23-2.002m-.002 3L8 14c-1.682 0-3.278-.307-4.51-.867-.486-.22-1.033-.54-1.49-.972V13c0 1.007.875 1.755 1.904 2.223C4.978 15.711 6.427 16 8 16c.536 0 1.058-.034 1.555-.097a4.507 4.507 0 0 1-1.3-1.905"/>
</svg>
</a>
<?php } ?>
<?php } ?>
</footer>
</body>
</html>
Loading…
Cancel
Save