mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
FIX: ip lookup not working
Also add a powered by line so it is clear this makes an external service call
This commit is contained in:
@ -7,6 +7,7 @@
|
|||||||
<div class="location-box">
|
<div class="location-box">
|
||||||
<a class="close pull-right" {{action "hide"}}>{{d-icon "times"}}</a>
|
<a class="close pull-right" {{action "hide"}}>{{d-icon "times"}}</a>
|
||||||
<h4>{{i18n 'ip_lookup.title'}}</h4>
|
<h4>{{i18n 'ip_lookup.title'}}</h4>
|
||||||
|
<p class='powered-by'>{{{i18n 'ip_lookup.powered_by'}}}</p>
|
||||||
<dl>
|
<dl>
|
||||||
{{#if location}}
|
{{#if location}}
|
||||||
{{#if location.hostname}}
|
{{#if location.hostname}}
|
||||||
|
@ -193,6 +193,13 @@ td.flaggers td {
|
|||||||
background-color: $secondary;
|
background-color: $secondary;
|
||||||
padding: 12px 12px 5px;
|
padding: 12px 12px 5px;
|
||||||
|
|
||||||
|
.powered-by {
|
||||||
|
font-size: 0.80em;
|
||||||
|
position: absolute;
|
||||||
|
bottom: -10px;
|
||||||
|
left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
.other-accounts {
|
.other-accounts {
|
||||||
margin: 5px 0 0;
|
margin: 5px 0 0;
|
||||||
max-height: 200px;
|
max-height: 200px;
|
||||||
|
@ -292,7 +292,7 @@ class Admin::UsersController < Admin::AdminController
|
|||||||
ip = params[:ip]
|
ip = params[:ip]
|
||||||
|
|
||||||
# should we cache results in redis?
|
# should we cache results in redis?
|
||||||
location = Excon.get("http://ipinfo.io/#{ip}/json", read_timeout: 30, connect_timeout: 30).body rescue nil
|
location = Excon.get("https://ipinfo.io/#{ip}/json", read_timeout: 10, connect_timeout: 10).body rescue nil
|
||||||
|
|
||||||
render json: location
|
render json: location
|
||||||
end
|
end
|
||||||
|
@ -550,6 +550,7 @@ en:
|
|||||||
topics_entered: "topics entered"
|
topics_entered: "topics entered"
|
||||||
post_count: "# posts"
|
post_count: "# posts"
|
||||||
confirm_delete_other_accounts: "Are you sure you want to delete these accounts?"
|
confirm_delete_other_accounts: "Are you sure you want to delete these accounts?"
|
||||||
|
powered_by: "powered by <a href='https://ipinfo.io'>ipinfo.io</a>"
|
||||||
|
|
||||||
user_fields:
|
user_fields:
|
||||||
none: "(select an option)"
|
none: "(select an option)"
|
||||||
|
Reference in New Issue
Block a user