114 lines
3.5 KiB
Handlebars
Raw Normal View History

{{#if this.ip}}
2022-12-28 12:28:11 +00:00
<DButton
@action={{this.lookup}}
2022-12-28 12:28:11 +00:00
@icon="globe"
@label="admin.user.ip_lookup"
class="btn-default"
2022-12-28 12:28:11 +00:00
/>
{{/if}}
{{#if this.show}}
<div class="location-box">
2022-12-28 12:28:11 +00:00
<a href class="close pull-right" {{on "click" this.hide}}>{{d-icon
"times"
}}</a>
{{#if this.copied}}
2022-12-28 12:28:11 +00:00
<DButton
@icon="copy"
@label="ip_lookup.copied"
class="btn-hover pull-right"
2022-12-28 12:28:11 +00:00
/>
{{else}}
<DButton @action={{this.copy}} @icon="copy" class="pull-right no-text" />
{{/if}}
2019-01-22 15:09:04 +01:00
<h4>{{i18n "ip_lookup.title"}}</h4>
<p class="powered-by">{{html-safe (i18n "ip_lookup.powered_by")}}</p>
<dl>
{{#if this.location}}
{{#if this.location.hostname}}
2019-01-22 15:09:04 +01:00
<dt>{{i18n "ip_lookup.hostname"}}</dt>
<dd>{{this.location.hostname}}</dd>
{{/if}}
2019-01-22 15:09:04 +01:00
<dt>{{i18n "ip_lookup.location"}}</dt>
<dd>
{{#if this.location.location}}
2022-12-28 12:28:11 +00:00
<a
href="https://maps.google.com/maps?q={{this.location.latitude}},{{this.location.longitude}}"
rel="noopener noreferrer"
target="_blank"
>
{{this.location.location}}
2019-01-22 15:09:04 +01:00
</a>
{{else}}
2019-01-22 15:09:04 +01:00
{{i18n "ip_lookup.location_not_found"}}
{{/if}}
</dd>
{{#if this.location.organization}}
2019-01-22 15:09:04 +01:00
<dt>{{i18n "ip_lookup.organisation"}}</dt>
<dd>{{this.location.organization}}</dd>
{{/if}}
{{else}}
{{loading-spinner size="small"}}
{{/if}}
<dt>
2019-01-22 15:09:04 +01:00
{{i18n "ip_lookup.other_accounts"}}
<strong>{{this.totalOthersWithSameIP}}</strong>
{{#if this.other_accounts.length}}
2022-12-28 12:28:11 +00:00
<DButton
@action={{this.deleteOtherAccounts}}
2022-12-28 12:28:11 +00:00
@icon="exclamation-triangle"
@translatedLabel={{i18n
"ip_lookup.delete_other_accounts"
count=this.otherAccountsToDelete
}}
class="btn-danger pull-right"
2022-12-28 12:28:11 +00:00
/>
{{/if}}
</dt>
2019-01-22 15:09:04 +01:00
2022-12-28 12:28:11 +00:00
<ConditionalLoadingSpinner
@size="small"
@condition={{this.otherAccountsLoading}}
>
{{#if this.other_accounts.length}}
<dd class="other-accounts">
<table class="table table-condensed table-hover">
<thead>
<tr>
2019-01-22 15:09:04 +01:00
<th>{{i18n "ip_lookup.username"}}</th>
<th>{{i18n "ip_lookup.trust_level"}}</th>
<th>{{i18n "ip_lookup.read_time"}}</th>
<th>{{i18n "ip_lookup.topics_entered"}}</th>
<th>{{i18n "ip_lookup.post_count"}}</th>
</tr>
</thead>
<tbody>
{{#each this.other_accounts as |a|}}
<tr>
2019-01-22 15:09:04 +01:00
<td>
<LinkTo @route="adminUser" @model={{a}}>
2022-12-28 12:28:11 +00:00
{{avatar
a
usernamePath="user.username"
imageSize="small"
}}
2019-01-22 15:09:04 +01:00
&nbsp;
<span>{{a.username}}</span>
</LinkTo>
2019-01-22 15:09:04 +01:00
</td>
2014-12-12 13:28:20 -05:00
<td>{{a.trustLevel.id}}</td>
<td>{{a.time_read}}</td>
<td>{{a.topics_entered}}</td>
<td>{{a.post_count}}</td>
</tr>
{{/each}}
</tbody>
</table>
</dd>
{{/if}}
</ConditionalLoadingSpinner>
</dl>
</div>
2022-12-28 12:28:11 +00:00
{{/if}}