-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1068 from colinin/ip-location
Ip location
- Loading branch information
Showing
38 changed files
with
631 additions
and
210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 98 additions & 0 deletions
98
apps/vben5/packages/@abp/identity/src/components/security-logs/SecurityLogDrawer.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
<script setup lang="ts"> | ||
import type { SecurityLogDto } from '../../types/security-logs'; | ||
import { ref } from 'vue'; | ||
import { useVbenDrawer } from '@vben/common-ui'; | ||
import { $t } from '@vben/locales'; | ||
import { formatToDateTime } from '@abp/core'; | ||
import { Descriptions } from 'ant-design-vue'; | ||
import { getApi } from '../../api/security-logs'; | ||
defineOptions({ | ||
name: 'SecurityLogDrawer', | ||
}); | ||
const DescriptionsItem = Descriptions.Item; | ||
const formModel = ref<SecurityLogDto>({} as SecurityLogDto); | ||
const [Drawer, drawerApi] = useVbenDrawer({ | ||
class: 'w-auto', | ||
onCancel() { | ||
drawerApi.close(); | ||
}, | ||
onConfirm: async () => {}, | ||
onOpenChange: async (isOpen: boolean) => { | ||
formModel.value = {} as SecurityLogDto; | ||
if (isOpen) { | ||
try { | ||
drawerApi.setState({ loading: true }); | ||
const dto = drawerApi.getData<SecurityLogDto>(); | ||
await onGet(dto.id); | ||
} finally { | ||
drawerApi.setState({ loading: false }); | ||
} | ||
} | ||
}, | ||
title: $t('AbpAuditLogging.SecurityLog'), | ||
}); | ||
/** 查询审计日志 */ | ||
async function onGet(id: string) { | ||
const dto = await getApi(id); | ||
formModel.value = dto; | ||
} | ||
</script> | ||
|
||
<template> | ||
<Drawer> | ||
<div style="width: 800px"> | ||
<Descriptions :colon="false" :column="2" bordered size="small"> | ||
<DescriptionsItem :label="$t('AbpAuditLogging.ApplicationName')"> | ||
{{ formModel.applicationName }} | ||
</DescriptionsItem> | ||
<DescriptionsItem :label="$t('AbpAuditLogging.CreationTime')"> | ||
{{ formatToDateTime(formModel.creationTime) }} | ||
</DescriptionsItem> | ||
<DescriptionsItem :label="$t('AbpAuditLogging.Identity')"> | ||
{{ formModel.identity }} | ||
</DescriptionsItem> | ||
<DescriptionsItem :label="$t('AbpAuditLogging.TenantName')"> | ||
{{ formModel.tenantName }} | ||
</DescriptionsItem> | ||
<DescriptionsItem :label="$t('AbpAuditLogging.Actions')"> | ||
{{ formModel.action }} | ||
</DescriptionsItem> | ||
<DescriptionsItem :label="$t('AbpAuditLogging.CorrelationId')"> | ||
{{ formModel.correlationId }} | ||
</DescriptionsItem> | ||
<DescriptionsItem :label="$t('AbpAuditLogging.UserId')"> | ||
{{ formModel.userId }} | ||
</DescriptionsItem> | ||
<DescriptionsItem :label="$t('AbpAuditLogging.UserName')"> | ||
{{ formModel.userName }} | ||
</DescriptionsItem> | ||
<DescriptionsItem :label="$t('AbpAuditLogging.ClientId')"> | ||
{{ formModel.clientId }} | ||
</DescriptionsItem> | ||
<DescriptionsItem :label="$t('AbpAuditLogging.ClientIpAddress')"> | ||
{{ formModel.clientIpAddress }} | ||
</DescriptionsItem> | ||
<DescriptionsItem | ||
:label="$t('AbpAuditLogging.BrowserInfo')" | ||
:label-style="{ width: '110px' }" | ||
:span="2" | ||
> | ||
{{ formModel.browserInfo }} | ||
</DescriptionsItem> | ||
<DescriptionsItem :label="$t('AbpAuditLogging.Additional')" :span="2"> | ||
{{ formModel.extraProperties }} | ||
</DescriptionsItem> | ||
</Descriptions> | ||
</div> | ||
</Drawer> | ||
</template> | ||
|
||
<style scoped></style> |
7 changes: 0 additions & 7 deletions
7
apps/vben5/packages/@abp/identity/src/components/security-logs/SecurityLogModal.vue
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 7 additions & 7 deletions
14
...2Region/AbpAuditLoggingIP2RegionModule.cs → ...cation/AbpAuditLoggingIPLocationModule.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
using LINGYUN.Abp.IP2Region; | ||
using LINGYUN.Abp.IP.Location; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Microsoft.Extensions.DependencyInjection.Extensions; | ||
using Volo.Abp.Auditing; | ||
using Volo.Abp.Modularity; | ||
using Volo.Abp.SecurityLog; | ||
|
||
namespace LINGYUN.Abp.AuditLogging.IP2Region; | ||
namespace LINGYUN.Abp.AuditLogging.IP.Location; | ||
|
||
[DependsOn( | ||
typeof(AbpIP2RegionModule), | ||
typeof(AbpIPLocationModule), | ||
typeof(AbpAuditLoggingModule))] | ||
public class AbpAuditLoggingIP2RegionModule : AbpModule | ||
public class AbpAuditLoggingIPLocationModule : AbpModule | ||
{ | ||
public override void PostConfigureServices(ServiceConfigurationContext context) | ||
{ | ||
var configuration = context.Services.GetConfiguration(); | ||
|
||
Configure<AbpAuditLoggingIP2RegionOptions>(configuration.GetSection("AuditLogging:IP2Region")); | ||
Configure<AbpAuditLoggingIPLocationOptions>(configuration.GetSection("AuditLogging:IPLocation")); | ||
|
||
context.Services.Replace( | ||
ServiceDescriptor.Transient<IAuditingStore, IP2RegionAuditingStore>()); | ||
ServiceDescriptor.Transient<IAuditingStore, IPLocationAuditingStore>()); | ||
context.Services.Replace( | ||
ServiceDescriptor.Transient<ISecurityLogStore, IP2RegionSecurityLogStore>()); | ||
ServiceDescriptor.Transient<ISecurityLogStore, IPLocationSecurityLogStore>()); | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
...ging.IP.Location/LINGYUN/Abp/AuditLogging/IP/Location/AbpAuditLoggingIPLocationOptions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
namespace LINGYUN.Abp.AuditLogging.IP.Location; | ||
public class AbpAuditLoggingIPLocationOptions | ||
{ | ||
public bool IsEnabled { get; set; } | ||
} |
Oops, something went wrong.