Merge branch 'Dev' of https://github.com/dotnet/eShopOnContainers into Dev
This commit is contained in:
commit
e8c3a14717
@ -1,19 +0,0 @@
|
|||||||
param([switch]$Elevated)
|
|
||||||
function Check-Admin {
|
|
||||||
$currentUser = New-Object Security.Principal.WindowsPrincipal $([Security.Principal.WindowsIdentity]::GetCurrent())
|
|
||||||
$currentUser.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)
|
|
||||||
}
|
|
||||||
if ((Check-Admin) -eq $false) {
|
|
||||||
if ($elevated)
|
|
||||||
{
|
|
||||||
# could not elevate, quit
|
|
||||||
}
|
|
||||||
|
|
||||||
else {
|
|
||||||
|
|
||||||
Start-Process powershell.exe -Verb RunAs -ArgumentList ('-noprofile -noexit -file "{0}" -elevated' -f ($myinvocation.MyCommand.Definition))
|
|
||||||
}
|
|
||||||
exit
|
|
||||||
}
|
|
||||||
|
|
||||||
ac -Encoding UTF8 C:\Windows\system32\drivers\etc\hosts "127.0.0.1 identity.service"
|
|
@ -11,7 +11,7 @@ services:
|
|||||||
|
|
||||||
webmvc:
|
webmvc:
|
||||||
environment:
|
environment:
|
||||||
- CatalogUrl=http://catalog.api
|
- CatalogUrl=http://catalog.api:5101
|
||||||
- OrderingUrl=http://ordering.api:5102
|
- OrderingUrl=http://ordering.api:5102
|
||||||
#- IdentityUrl=http://13.88.8.119:5105 #Remote: VM Needs to have public access at 5105.
|
#- IdentityUrl=http://13.88.8.119:5105 #Remote: VM Needs to have public access at 5105.
|
||||||
- IdentityUrl=http://10.0.75.1:5105 #Local: You need to open windows firewall at range 5100-5105.
|
- IdentityUrl=http://10.0.75.1:5105 #Local: You need to open windows firewall at range 5100-5105.
|
||||||
@ -22,14 +22,14 @@ services:
|
|||||||
|
|
||||||
webspa:
|
webspa:
|
||||||
environment:
|
environment:
|
||||||
- CatalogUrl=http://catalog.api
|
- CatalogUrl=http://catalog.api:5101
|
||||||
- OrderingUrl=http://ordering.api
|
- OrderingUrl=http://ordering.api:5102
|
||||||
#- IdentityUrl=http://13.88.8.119:5105 #Remote: VM Needs to have public access at 5105.
|
#- IdentityUrl=http://13.88.8.119:5105 #Remote: VM Needs to have public access at 5105.
|
||||||
#- IdentityUrl=http://identity.service:5105 #Local: You need a entry in windows host file to run identity in local docker.
|
#- IdentityUrl=http://identity.service:5105 #Local: You need a entry in windows host file to run identity in local docker.
|
||||||
- IdentityUrl=http://10.0.75.1:5105 #Local: You need to open windows firewall at range 5100-5105.
|
- IdentityUrl=http://10.0.75.1:5105 #Local: You need to open windows firewall at range 5100-5105.
|
||||||
- BasketUrl=http://basket.api:5103
|
- BasketUrl=http://basket.api:5103
|
||||||
ports:
|
ports:
|
||||||
- "5104:80"
|
- "5104:5104"
|
||||||
|
|
||||||
basket.api:
|
basket.api:
|
||||||
environment:
|
environment:
|
||||||
@ -44,7 +44,7 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
- ConnectionString=Server=sql.data;Database=Microsoft.eShopOnContainers.Services.CatalogDb;User Id=sa;Password=Pass@word
|
- ConnectionString=Server=sql.data;Database=Microsoft.eShopOnContainers.Services.CatalogDb;User Id=sa;Password=Pass@word
|
||||||
ports:
|
ports:
|
||||||
- "5101:80"
|
- "5101:5101"
|
||||||
|
|
||||||
ordering.api:
|
ordering.api:
|
||||||
environment:
|
environment:
|
||||||
|
@ -57,7 +57,7 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API.Controllers
|
|||||||
.Take(pageSize)
|
.Take(pageSize)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
itemsOnPage = ComposePicUri(itemsOnPage);
|
//itemsOnPage = ComposePicUri(itemsOnPage);
|
||||||
|
|
||||||
var model = new PaginatedItemsViewModel<CatalogItem>(
|
var model = new PaginatedItemsViewModel<CatalogItem>(
|
||||||
pageIndex, pageSize, totalItems, itemsOnPage);
|
pageIndex, pageSize, totalItems, itemsOnPage);
|
||||||
@ -90,7 +90,7 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API.Controllers
|
|||||||
.Take(pageSize)
|
.Take(pageSize)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
itemsOnPage = ComposePicUri(itemsOnPage);
|
//itemsOnPage = ComposePicUri(itemsOnPage);
|
||||||
|
|
||||||
var model = new PaginatedItemsViewModel<CatalogItem>(
|
var model = new PaginatedItemsViewModel<CatalogItem>(
|
||||||
pageIndex, pageSize, totalItems, itemsOnPage);
|
pageIndex, pageSize, totalItems, itemsOnPage);
|
||||||
|
@ -47,6 +47,7 @@
|
|||||||
"publishOptions": {
|
"publishOptions": {
|
||||||
"include": [
|
"include": [
|
||||||
"wwwroot",
|
"wwwroot",
|
||||||
|
"Pics",
|
||||||
"Views",
|
"Views",
|
||||||
"Areas/**/Views",
|
"Areas/**/Views",
|
||||||
"settings.json",
|
"settings.json",
|
||||||
|
0
src/Web/WebMVC/wwwroot/css/site.min.css
vendored
Normal file
0
src/Web/WebMVC/wwwroot/css/site.min.css
vendored
Normal file
@ -11,15 +11,17 @@ import { SecurityService } from '../../shared/services/security.service';
|
|||||||
templateUrl: './basket-status.component.html'
|
templateUrl: './basket-status.component.html'
|
||||||
})
|
})
|
||||||
export class BasketStatusComponent implements OnInit {
|
export class BasketStatusComponent implements OnInit {
|
||||||
subscription: Subscription;
|
basketItemAddedSubscription: Subscription;
|
||||||
authSubscription: Subscription;
|
authSubscription: Subscription;
|
||||||
|
basketDroppedSubscription: Subscription;
|
||||||
|
|
||||||
badge: number = 0;
|
badge: number = 0;
|
||||||
|
|
||||||
constructor(private service: BasketService, private basketEvents: BasketWrapperService, private authService: SecurityService) { }
|
constructor(private service: BasketService, private basketEvents: BasketWrapperService, private authService: SecurityService) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
// Subscribe to Add Basket Observable:
|
// Subscribe to Add Basket Observable:
|
||||||
this.subscription = this.basketEvents.addItemToBasket$.subscribe(
|
this.basketItemAddedSubscription = this.basketEvents.addItemToBasket$.subscribe(
|
||||||
item => {
|
item => {
|
||||||
this.service.setBasket(item).subscribe(res => {
|
this.service.setBasket(item).subscribe(res => {
|
||||||
this.service.getBasket().subscribe(basket => {
|
this.service.getBasket().subscribe(basket => {
|
||||||
@ -28,6 +30,13 @@ export class BasketStatusComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Subscribe to Drop Basket Observable:
|
||||||
|
this.basketDroppedSubscription = this.service.basketDroped$.subscribe(res =>
|
||||||
|
this.service.getBasket().subscribe(basket => {
|
||||||
|
this.badge = basket.items.length;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
// Subscribe to login and logout observable
|
// Subscribe to login and logout observable
|
||||||
this.authSubscription = this.authService.authenticationChallenge$.subscribe(res => {
|
this.authSubscription = this.authService.authenticationChallenge$.subscribe(res => {
|
||||||
this.service.getBasket().subscribe(basket => {
|
this.service.getBasket().subscribe(basket => {
|
||||||
|
@ -14,6 +14,7 @@ import 'rxjs/add/observable/throw';
|
|||||||
import { Observer } from 'rxjs/Observer';
|
import { Observer } from 'rxjs/Observer';
|
||||||
import 'rxjs/add/operator/map';
|
import 'rxjs/add/operator/map';
|
||||||
import 'rxjs/add/operator/catch';
|
import 'rxjs/add/operator/catch';
|
||||||
|
import { Subject } from 'rxjs/Subject';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class BasketService {
|
export class BasketService {
|
||||||
@ -23,6 +24,10 @@ export class BasketService {
|
|||||||
items: []
|
items: []
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//observable that is fired when the basket is dropped
|
||||||
|
private basketDropedSource = new Subject();
|
||||||
|
basketDroped$ = this.basketDropedSource.asObservable();
|
||||||
|
|
||||||
constructor(private service: DataService, private authService: SecurityService, private basketEvents: BasketWrapperService, private router: Router) {
|
constructor(private service: DataService, private authService: SecurityService, private basketEvents: BasketWrapperService, private router: Router) {
|
||||||
this.basket.items = [];
|
this.basket.items = [];
|
||||||
|
|
||||||
@ -55,7 +60,7 @@ export class BasketService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dropBasket() {
|
dropBasket() {
|
||||||
console.log('drop basket!');
|
|
||||||
this.service.delete(this.basketUrl + '/' + this.basket.buyerId);
|
this.service.delete(this.basketUrl + '/' + this.basket.buyerId);
|
||||||
|
this.basketDropedSource.next();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -17,7 +17,7 @@ namespace eShopConContainers.WebSPA
|
|||||||
.UseKestrel()
|
.UseKestrel()
|
||||||
.UseConfiguration(config)
|
.UseConfiguration(config)
|
||||||
.UseContentRoot(Directory.GetCurrentDirectory())
|
.UseContentRoot(Directory.GetCurrentDirectory())
|
||||||
.UseUrls("http://localhost:5104/")
|
.UseUrls("http://0.0.0.0:5104")
|
||||||
.UseIISIntegration()
|
.UseIISIntegration()
|
||||||
.UseStartup<Startup>()
|
.UseStartup<Startup>()
|
||||||
.Build();
|
.Build();
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
"IIS Express": {
|
"IIS Express": {
|
||||||
"commandName": "IISExpress",
|
"commandName": "IISExpress",
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
"ASPNETCORE_ENVIRONMENT": "Production"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,4 @@
|
|||||||
{
|
{
|
||||||
"ConnectionStrings": {
|
|
||||||
"DefaultConnection": "Data Source=AspNetCore.db"
|
|
||||||
},
|
|
||||||
"Logging": {
|
"Logging": {
|
||||||
"IncludeScopes": false,
|
"IncludeScopes": false,
|
||||||
"LogLevel": {
|
"LogLevel": {
|
||||||
@ -9,39 +6,5 @@
|
|||||||
"System": "Information",
|
"System": "Information",
|
||||||
"Microsoft": "Information"
|
"Microsoft": "Information"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"Email": {
|
|
||||||
"From": "",
|
|
||||||
"Subject": "",
|
|
||||||
"SendGrid": {
|
|
||||||
"Username": "",
|
|
||||||
"Password": ""
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Authentication": {
|
|
||||||
"Google": {
|
|
||||||
"ClientId": "",
|
|
||||||
"ClientSecret": ""
|
|
||||||
},
|
|
||||||
"Facebook": {
|
|
||||||
"AppId": "",
|
|
||||||
"AppSecret": ""
|
|
||||||
},
|
|
||||||
"Microsoft": {
|
|
||||||
"ClientId": "",
|
|
||||||
"ClientSecret": ""
|
|
||||||
},
|
|
||||||
"Twitter": {
|
|
||||||
"ConsumerKey": "",
|
|
||||||
"ConsumerSecret": ""
|
|
||||||
},
|
|
||||||
"Github": {
|
|
||||||
"ClientId": "",
|
|
||||||
"ClientSecret": ""
|
|
||||||
},
|
|
||||||
"LinkedIn": {
|
|
||||||
"ClientId": "",
|
|
||||||
"ClientSecret": ""
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -97,8 +97,7 @@
|
|||||||
"web.config",
|
"web.config",
|
||||||
"config",
|
"config",
|
||||||
"wwwroot",
|
"wwwroot",
|
||||||
"dockerfile",
|
"dockerfile"
|
||||||
"wait-for-it.sh"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user