diff --git a/api/src/Sozsoft.Platform.DbMigrator/Seeds/HostData.json b/api/src/Sozsoft.Platform.DbMigrator/Seeds/HostData.json index 905e267..f4da501 100644 --- a/api/src/Sozsoft.Platform.DbMigrator/Seeds/HostData.json +++ b/api/src/Sozsoft.Platform.DbMigrator/Seeds/HostData.json @@ -1054,16 +1054,16 @@ ], "BackgroundWorkers": [ { - "name": "Notification Worker", + "name": "Session Cleanup Worker", "cron": "*/5 * * * *", - "workerType": "NotificationWorker", + "workerType": "SessionCleanupWorker", "isActive": true, "dataSourceCode": "Default" }, { - "name": "Session Cleanup Worker", + "name": "Notification Worker", "cron": "*/5 * * * *", - "workerType": "SessionCleanupWorker", + "workerType": "NotificationWorker", "isActive": true, "dataSourceCode": "Default" } @@ -2271,4 +2271,4 @@ "IsActive": false } ] -} \ No newline at end of file +} diff --git a/api/src/Sozsoft.Platform.DbMigrator/Seeds/LanguagesData.json b/api/src/Sozsoft.Platform.DbMigrator/Seeds/LanguagesData.json index 74a542b..90bc637 100644 --- a/api/src/Sozsoft.Platform.DbMigrator/Seeds/LanguagesData.json +++ b/api/src/Sozsoft.Platform.DbMigrator/Seeds/LanguagesData.json @@ -1074,6 +1074,12 @@ "en": "Audit Logs", "tr": "Denetim Geçmişi" }, + { + "resourceName": "Platform", + "key": "App.IdentityManagement.Sessions", + "en": "Sessions", + "tr": "Oturumlar" + }, { "resourceName": "Platform", "key": "App.EntityChanges", @@ -13598,6 +13604,24 @@ "en": "Id", "tr": "Kimlik" }, + { + "resourceName": "Platform", + "key": "App.Listform.ListformField.SessionId", + "en": "Session Id", + "tr": "Oturum Kimliği" + }, + { + "resourceName": "Platform", + "key": "App.Listform.ListformField.Device", + "en": "Device", + "tr": "Cihaz" + }, + { + "resourceName": "Platform", + "key": "App.Listform.ListformField.DeviceInfo", + "en": "Device Info", + "tr": "Cihaz Bilgisi" + }, { "resourceName": "Platform", "key": "App.Listform.ListformField.Identifier", @@ -13700,6 +13724,12 @@ "en": "Email Confirmed", "tr": "E-posta Doğrulandı" }, + { + "resourceName": "Platform", + "key": "App.Listform.ListformField.Email", + "en": "Email", + "tr": "E-posta" + }, { "resourceName": "Platform", "key": "App.Listform.ListformField.TwoFactorEnabled", @@ -15668,6 +15698,24 @@ "en": "User Name", "tr": "Kullanıcı Adı" }, + { + "resourceName": "Platform", + "key": "App.Listform.ListformField.ClientId", + "en": "Client ID", + "tr": "Müşteri ID" + }, + { + "resourceName": "Platform", + "key": "App.Listform.ListformField.IpAddress", + "en": "IP Address", + "tr": "IP Adresi" + }, + { + "resourceName": "Platform", + "key": "App.Listform.ListformField.SignedIn", + "en": "Signed In", + "tr": "Giriş Tarihi" + }, { "resourceName": "Platform", "key": "App.Listform.ListformField.ValidFrom", diff --git a/api/src/Sozsoft.Platform.DbMigrator/Seeds/ListFormSeeder_Administration.cs b/api/src/Sozsoft.Platform.DbMigrator/Seeds/ListFormSeeder_Administration.cs index 9e08558..ced3fce 100644 --- a/api/src/Sozsoft.Platform.DbMigrator/Seeds/ListFormSeeder_Administration.cs +++ b/api/src/Sozsoft.Platform.DbMigrator/Seeds/ListFormSeeder_Administration.cs @@ -1211,7 +1211,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep CultureName = LanguageCodes.En, SourceDbType = DbType.String, FieldName = "UserName", - CaptionName = "App.Listform.ListformField.UserName", + CaptionName = "App.Listform.ListformField.UserName", Width = 150, ListOrderNo = 5, Visible = true, @@ -2110,6 +2110,189 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep #endregion } #endregion + + #region Sessions + listFormName = AppCodes.IdentityManagement.Sessions; + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) + { + var listForm = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + PageSize = 10, + ExportJson = DefaultExportJson, + IsSubForm = false, + ShowNote = true, + LayoutJson = DefaultLayoutJson(), + CultureName = LanguageCodes.En, + ListFormCode = listFormName, + Name = listFormName, + Title = listFormName, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = listFormName, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = "AbpSessions", + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + SortMode = GridOptions.SortModeSingle, + FilterRowJson = DefaultFilterRowJson, + HeaderFilterJson = DefaultHeaderFilterJson, + SearchPanelJson = DefaultSearchPanelJson, + GroupPanelJson = DefaultGroupPanelJson, + SelectionJson = DefaultSelectionSingleJson, + ColumnOptionJson = DefaultColumnOptionJson(), + PermissionJson = DefaultPermissionJson(listFormName), + PagerOptionJson = DefaultPagerOptionJson, + } + ); + + #region Sessions Fields + await _listFormFieldRepository.InsertManyAsync([ + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + CaptionName = "App.Listform.ListformField.Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "SessionId", + CaptionName = "App.Listform.ListformField.SessionId", + Width = 250, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Device", + CaptionName = "App.Listform.ListformField.Device", + Width = 100, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() + { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "DeviceInfo", + CaptionName = "App.Listform.ListformField.DeviceInfo", + Width = 500, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() + { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "UserId", + CaptionName = "App.Listform.ListformField.UserName", + Width = 250, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = $"SELECT \"Id\" AS \"Key\", \"UserName\" AS \"Name\" FROM \"AbpUsers\"", + }), + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() + { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "ClientId", + CaptionName = "App.Listform.ListformField.ClientId", + Width = 150, + ListOrderNo = 6, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() + { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "IpAddresses", + CaptionName = "App.Listform.ListformField.IpAddress", + Width = 150, + ListOrderNo = 7, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() + { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.DateTime, + FieldName = "SignedIn", + CaptionName = "App.Listform.ListformField.SignedIn", + Width = 150, + ListOrderNo = 8, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + ]); + #endregion + } + #endregion } } diff --git a/api/src/Sozsoft.Platform.DbMigrator/Seeds/ListFormSeeder_Saas.cs b/api/src/Sozsoft.Platform.DbMigrator/Seeds/ListFormSeeder_Saas.cs index f639fa7..1b6c157 100644 --- a/api/src/Sozsoft.Platform.DbMigrator/Seeds/ListFormSeeder_Saas.cs +++ b/api/src/Sozsoft.Platform.DbMigrator/Seeds/ListFormSeeder_Saas.cs @@ -140,7 +140,8 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency }), FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new() { FieldName = "IsActive", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value }, - new() { FieldName = "Country", FieldDbType = DbType.String, Value = "Türkiye", CustomValueType = FieldCustomValueTypeEnum.Value } + new() { FieldName = "Country", FieldDbType = DbType.String, Value = "Türkiye", CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { FieldName = "MaxConcurrentUsers", FieldDbType = DbType.Int32, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value } }), SubFormsJson =JsonSerializer.Serialize(new List() { new { diff --git a/api/src/Sozsoft.Platform.DbMigrator/Seeds/MenusData.json b/api/src/Sozsoft.Platform.DbMigrator/Seeds/MenusData.json index 3c62fff..1ddedc3 100644 --- a/api/src/Sozsoft.Platform.DbMigrator/Seeds/MenusData.json +++ b/api/src/Sozsoft.Platform.DbMigrator/Seeds/MenusData.json @@ -1047,6 +1047,16 @@ "RequiredPermissionName": "App.IdentityManagement.AuditLogs", "IsDisabled": false }, + { + "ParentCode": "Abp.Identity", + "Code": "App.IdentityManagement.Sessions", + "DisplayName": "App.IdentityManagement.Sessions", + "Order": 8, + "Url": "/admin/list/App.IdentityManagement.Sessions", + "Icon": "FcPrivacy", + "RequiredPermissionName": "App.IdentityManagement.Sessions", + "IsDisabled": false + }, { "ParentCode": "App.Administration", "Code": "App.Reports.Management", diff --git a/api/src/Sozsoft.Platform.DbMigrator/Seeds/PermissionsData.json b/api/src/Sozsoft.Platform.DbMigrator/Seeds/PermissionsData.json index f418855..51dbc80 100644 --- a/api/src/Sozsoft.Platform.DbMigrator/Seeds/PermissionsData.json +++ b/api/src/Sozsoft.Platform.DbMigrator/Seeds/PermissionsData.json @@ -2944,6 +2944,51 @@ "MultiTenancySide": 3, "MenuGroup": "Erp|Kurs" }, + { + "GroupName": "App.Administration", + "Name": "App.IdentityManagement.Sessions", + "ParentName": null, + "DisplayName": "App.IdentityManagement.Sessions", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp|Kurs" + }, + { + "GroupName": "App.Administration", + "Name": "App.IdentityManagement.Sessions.Create", + "ParentName": "App.IdentityManagement.Sessions", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp|Kurs" + }, + { + "GroupName": "App.Administration", + "Name": "App.IdentityManagement.Sessions.Delete", + "ParentName": "App.IdentityManagement.Sessions", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp|Kurs" + }, + { + "GroupName": "App.Administration", + "Name": "App.IdentityManagement.Sessions.Export", + "ParentName": "App.IdentityManagement.Sessions", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp|Kurs" + }, + { + "GroupName": "App.Administration", + "Name": "App.IdentityManagement.Sessions.Update", + "ParentName": "App.IdentityManagement.Sessions", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Erp|Kurs" + }, { "GroupName": "App.Administration", "Name": "App.Reports.Categories", diff --git a/api/src/Sozsoft.Platform.Domain/Data/SeedConsts.cs b/api/src/Sozsoft.Platform.Domain/Data/SeedConsts.cs index 6f63816..476a54e 100644 --- a/api/src/Sozsoft.Platform.Domain/Data/SeedConsts.cs +++ b/api/src/Sozsoft.Platform.Domain/Data/SeedConsts.cs @@ -433,6 +433,8 @@ public static class SeedConsts public const string ClaimTypes = Default + ".ClaimType"; public const string AuditLogs = Default + ".AuditLogs"; + public const string Sessions = Default + ".Sessions"; + } public static class Reports