Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
TelcoDB
Web Frontend
Commits
8cc09498
Verified
Commit
8cc09498
authored
Oct 27, 2019
by
Elias Ojala
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfixes and other small improvements
parent
56945b52
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
14 deletions
+19
-14
src/app.ts
src/app.ts
+4
-3
src/controllers/net.controller.ts
src/controllers/net.controller.ts
+3
-3
src/controllers/search.controller.ts
src/controllers/search.controller.ts
+1
-1
views/docs/tor-relay-list.twig
views/docs/tor-relay-list.twig
+4
-3
views/net/show.twig
views/net/show.twig
+2
-2
views/tor-relay/list.twig
views/tor-relay/list.twig
+5
-2
No files found.
src/app.ts
View file @
8cc09498
...
...
@@ -279,13 +279,14 @@ function getCountryName(countryCode, returnSame?) {
*
* If "returnSame" is not "no" and country is not found, the query is returned
*/
twig
.
extendFunction
(
"
countryCode
"
,
(
countryCode
,
returnSame
?,
addParenthesis
?)
=>
{
twig
.
extendFunction
(
"
countryCode
"
,
(
countryCode
:
string
,
returnSame
?:
string
,
addParenthesis
?:
string
)
=>
{
returnSame
=
returnSame
?
returnSame
:
"
yes
"
;
addParenthesis
=
addParenthesis
?
addParenthesis
:
"
no
"
;
const
result
=
getCountryName
(
countryCode
,
returnSame
);
if
(
addParenthesis
===
"
yes
"
&&
result
!=
undefined
)
{
return
`(
${
result
}
)`
;
}
else
if
(
result
!=
undefined
)
{
return
;
}
return
result
;
...
...
src/controllers/net.controller.ts
View file @
8cc09498
...
...
@@ -40,17 +40,17 @@ router.get("/:zero/:one([0-9][0-9]?[0-9]?)", (req: Request, res: Response, next:
.
then
(
x
=>
{
const
announcements
=
x
[
0
];
let
addresses
=
{};
let
addresses
:
{}
=
{};
if
(
ipVersion
===
4
)
{
addresses
=
cidr
.
toArray
();
//
addresses = cidr.toArray();
}
res
.
render
(
"
net/show.twig
"
,
{
cidrNotation
,
ipVersion
,
// addresses:
addresses,
addresses
,
announcements
,
});
...
...
src/controllers/search.controller.ts
View file @
8cc09498
...
...
@@ -20,7 +20,7 @@ router.get("/", (req: Request, res: Response, next: NextFunction) => {
if
(
query
)
{
if
(
isIp
(
query
))
{
res
.
redirect
(
`/ip/
${
query
}
`
);
}
else
if
(
isAsn
(
query
))
{
}
else
if
(
isAsn
(
query
.
toUpperCase
()
))
{
res
.
redirect
(
`/
${
query
}
`
);
}
else
if
(
isCidr
(
query
))
{
res
.
redirect
(
`/net/
${
query
}
`
);
...
...
views/docs/tor-relay-list.twig
View file @
8cc09498
...
...
@@ -20,10 +20,11 @@
<li><a
href=
"https://api.telcodb.net/dl/tor-relay-list.json"
>
JSON format
</a></li>
</ul>
{#
<p class="mb-2">The JSON version currently has the following extra features that are not available on the origin:
<p
class=
"mb-2"
>
The JSON version currently has the following extra features that are not available on the origin
al/TXT version
:
<ul>
<li><a href="https://en.wikipedia.org/wiki/Reverse_DNS_lookup">Reverse DNS</a> records</li>
</ul></p> #}
<li>
Tor relay fingerprint
</li>
{# <li><a href="https://en.wikipedia.org/wiki/Reverse_DNS_lookup">Reverse DNS</a> records</li> #}
</ul></p>
<p>
The data is automatically updated to the forementioned endpoints,
see the
<a
href=
"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Last-Modified"
...
...
views/net/show.twig
View file @
8cc09498
...
...
@@ -12,7 +12,7 @@
<a
class=
"nav-link"
data-toggle=
"tab"
role=
"tab"
id=
"whois-tab"
href=
"#whois"
aria-controls=
"whois"
aria-selected=
"false"
>
Whois
</a>
</li>
{%
if
addresses
and
ipVersion
==
4
%}
{%
if
addresses
|
length
>
0
and
ipVersion
==
4
%}
<li
class=
"nav-item"
>
<a
class=
"nav-link"
data-toggle=
"tab"
role=
"tab"
id=
"dns-tab"
href=
"#dns"
aria-controls=
"dns"
aria-selected=
"false"
>
DNS
</a>
...
...
@@ -52,7 +52,7 @@
<div
class=
"tab-pane fade"
id=
"whois"
role=
"tabpanel"
aria-labelledby=
"whois-tab"
>
<pre
class=
"mt-2 mb-0"
><code
id=
"whoisInformation"
></code></pre>
</div>
{%
if
addresses
and
ipVersion
==
4
%}
{%
if
addresses
|
length
>
0
and
ipVersion
==
4
%}
<div
class=
"tab-pane fade"
id=
"dns"
role=
"tabpanel"
aria-labelledby=
"dns-tab"
>
<table
class=
"table w-auto"
>
<thead>
...
...
views/tor-relay/list.twig
View file @
8cc09498
{%
extends
'layouts/default.twig'
%}
{# TODO: .container-fluid instead of .container due to large width #}
{%
block
body_wide
%}
<h1>
{{
title
}}
</h1>
...
...
@@ -26,7 +25,11 @@
data-ip=
"
{{
compressIp
(
relay.ip
)
|
e
}}
"
>
{{
compressIp
(
relay.ip
)
|
e
}}
</a>
</td>
{# <td>{{ relay.reverse[0]|e }}</td> #}
<td>
{{
relay.name
|
e
}}
</td>
<td>
<a
href=
"/tor-relay/
{{
relay.fingerprint
|
e
}}
"
>
{{
relay.name
|
e
}}
</a>
</td>
<td>
{{
relay.router_port
|
e
}}
</td>
<td>
{{
relay.directory_port
|
e
}}
</td>
<td>
{{
relay.flags
|
e
}}
</td>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment