Skip to content

Commit 4b11bea

Browse files
committed
2 parents e1c72c6 + 6f64288 commit 4b11bea

File tree

28 files changed

+267
-30
lines changed

28 files changed

+267
-30
lines changed

angular/.angular-cli.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
33
"project": {
4-
"name": "abp-project-name-template"
4+
"name": "AbpProjectName"
55
},
66
"apps": [
77
{
@@ -14,6 +14,11 @@
1414
"glob": "abp.signalr.js",
1515
"input": "../node_modules/abp-web-resources/Abp/Framework/scripts/libs/",
1616
"output": "./assets/abp/"
17+
},
18+
{
19+
"glob": "abp.signalr-client.js",
20+
"input": "../node_modules/abp-web-resources/Abp/Framework/scripts/libs/",
21+
"output": "./assets/abp/"
1722
}
1823
],
1924
"index": "index.html",
@@ -43,6 +48,7 @@
4348
"../node_modules/lodash/lodash.min.js",
4449
"../node_modules/moment/min/moment.min.js",
4550
"../node_modules/signalr/jquery.signalR.js",
51+
"../node_modules/@aspnet/signalr-client/dist/browser/signalr-client.min.js",
4652
"../node_modules/toastr/toastr.js",
4753
"../node_modules/sweetalert/dist/sweetalert.min.js",
4854
"../node_modules/block-ui/jquery.blockUI.js",

angular/.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@aspnet:registry=https://dotnet.myget.org/f/aspnetcore-dev/npm/

angular/e2e/app.e2e-spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { AbpProjectNameTemplatePage } from './app.po';
22

3-
describe('abp-project-name-template App', function() {
3+
describe('AbpProjectName App', function() {
44
let page: AbpProjectNameTemplatePage;
55

66
beforeEach(() => {

angular/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "abp-project-name-template",
2+
"name": "AbpProjectName",
33
"version": "0.0.0",
44
"license": "MIT",
55
"angular-cli": {},
@@ -22,6 +22,7 @@
2222
"@angular/platform-browser": "^5.0.3",
2323
"@angular/platform-browser-dynamic": "^5.0.3",
2424
"@angular/router": "^5.0.3",
25+
"@aspnet/signalr-client": "1.0.0-preview1-27891",
2526
"@types/bootstrap": "^3.3.33",
2627
"@types/jquery": "^3.2.12",
2728
"@types/jquery.blockui": "0.0.28",
@@ -32,7 +33,7 @@
3233
"@types/signalr": "^2.2.33",
3334
"@types/toastr": "^2.1.33",
3435
"abp-ng2-module": "^1.3.0",
35-
"abp-web-resources": "^3.2.3",
36+
"abp-web-resources": "^3.3.0",
3637
"animate.css": "^3.5.2",
3738
"block-ui": "^2.70.1",
3839
"bootstrap": "^3.3.7",

angular/src/app/app.component.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { AppConsts } from '@shared/AppConsts';
33
import { AppComponentBase } from '@shared/app-component-base';
44

55
import { SignalRHelper } from '@shared/helpers/SignalRHelper';
6+
import { SignalRAspNetCoreHelper } from '@shared/helpers/SignalRAspNetCoreHelper';
67

78
@Component({
89
templateUrl: './app.component.html'
@@ -19,7 +20,11 @@ export class AppComponent extends AppComponentBase implements OnInit, AfterViewI
1920

2021
ngOnInit(): void {
2122
if (this.appSession.application.features['SignalR']) {
22-
SignalRHelper.initSignalR();
23+
if (this.appSession.application.features['SignalR.AspNetCore']) {
24+
SignalRAspNetCoreHelper.initSignalR();
25+
} else {
26+
SignalRHelper.initSignalR();
27+
}
2328
}
2429

2530
abp.event.on('abp.notifications.received', userNotification => {
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { AppConsts } from '@shared/AppConsts';
2+
import { UtilsService } from '@abp/utils/utils.service';
3+
4+
export class SignalRAspNetCoreHelper {
5+
static initSignalR(): void {
6+
7+
var encryptedAuthToken = new UtilsService().getCookieValue(AppConsts.authorization.encrptedAuthTokenName);
8+
9+
abp.signalr = {
10+
autoConnect: true,
11+
connect: undefined,
12+
hubs: undefined,
13+
qs: AppConsts.authorization.encrptedAuthTokenName + "=" + encodeURIComponent(encryptedAuthToken),
14+
url: AppConsts.remoteServiceBaseUrl + '/signalr'
15+
};
16+
17+
jQuery.getScript(AppConsts.appBaseUrl + '/assets/abp/abp.signalr-client.js');
18+
}
19+
}

aspnet-core/src/AbpCompanyName.AbpProjectName.Application/AbpCompanyName.AbpProjectName.Application.csproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@
1111
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
1212
<RootNamespace>AbpCompanyName.AbpProjectName</RootNamespace>
1313
</PropertyGroup>
14+
15+
<PropertyGroup Condition=" '$(TargetFramework)' == 'net461' ">
16+
<DefineConstants>FEATURE_SIGNALR</DefineConstants>
17+
</PropertyGroup>
18+
19+
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">
20+
<DefineConstants>FEATURE_SIGNALR_ASPNETCORE</DefineConstants>
21+
</PropertyGroup>
1422

1523
<ItemGroup>
1624
<ProjectReference Include="..\AbpCompanyName.AbpProjectName.Core\AbpCompanyName.AbpProjectName.Core.csproj" />

aspnet-core/src/AbpCompanyName.AbpProjectName.Application/Sessions/SessionAppService.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ public async Task<GetCurrentLoginInformationsOutput> GetCurrentLoginInformations
1919
ReleaseDate = AppVersionHelper.ReleaseDate,
2020
Features = new Dictionary<string, bool>
2121
{
22-
{ "SignalR", SignalRFeature.IsAvailable }
22+
{ "SignalR", SignalRFeature.IsAvailable },
23+
{ "SignalR.AspNetCore", SignalRFeature.IsAspNetCore }
2324
}
2425
}
2526
};

aspnet-core/src/AbpCompanyName.AbpProjectName.Application/SignalR/SignalRFeature.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,20 @@ public static bool IsAvailable
88
{
99
#if FEATURE_SIGNALR
1010
return true;
11+
#elif FEATURE_SIGNALR_ASPNETCORE
12+
return true;
13+
#else
14+
return false;
15+
#endif
16+
}
17+
}
18+
19+
public static bool IsAspNetCore
20+
{
21+
get
22+
{
23+
#if FEATURE_SIGNALR_ASPNETCORE
24+
return true;
1125
#else
1226
return false;
1327
#endif

aspnet-core/src/AbpCompanyName.AbpProjectName.Core/AbpCompanyName.AbpProjectName.Core.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
</ItemGroup>
1919

2020
<ItemGroup>
21-
<PackageReference Include="Abp.AutoMapper" Version="3.2.4" />
22-
<PackageReference Include="Abp.ZeroCore.EntityFrameworkCore" Version="3.2.4" />
21+
<PackageReference Include="Abp.AutoMapper" Version="3.3.0" />
22+
<PackageReference Include="Abp.ZeroCore.EntityFrameworkCore" Version="3.3.0" />
2323
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="2.0.0" />
2424
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.0.0" />
2525
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="2.0.0" />

0 commit comments

Comments
 (0)