Browse Source

Completed the moving configuration

Ready for PR
pull/96/head
malik masis 5 years ago
parent
commit
f3cbd2720c
  1. 5
      apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbpPublicWebModule.cs
  2. 14
      apps/public-web/src/EShopOnAbp.PublicWeb/Options/RemoteServices.cs
  3. 5
      apps/public-web/src/EShopOnAbp.PublicWeb/Pages/Index.cshtml
  4. 2
      apps/public-web/src/EShopOnAbp.PublicWeb/appsettings.json
  5. BIN
      apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/beats.jpg
  6. BIN
      apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/bluecat.jpg
  7. BIN
      apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/lego.jpg
  8. BIN
      apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/nikon.jpg
  9. BIN
      apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/noimage.jpg
  10. BIN
      apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/oki.jpg
  11. BIN
      apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/playstation.jpg
  12. BIN
      apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/rampage.jpg
  13. BIN
      apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/sunny.jpg

5
apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbpPublicWebModule.cs

@ -41,6 +41,7 @@ using EShopOnAbp.PaymentService.PaymentMethods;
using EShopOnAbp.PublicWeb.AnonymousUser;
using Microsoft.Extensions.Configuration;
using Volo.Abp.VirtualFileSystem;
using EShopOnAbp.PublicWeb.Options;
namespace EShopOnAbp.PublicWeb;
@ -93,6 +94,8 @@ public class EShopOnAbpPublicWebModule : AbpModule
);
});
Configure<RemoteServices>(options => { options.Default.BaseUrl = configuration["RemoteServices:Default:BaseUrl"]; });
Configure<AbpMultiTenancyOptions>(options => { options.IsEnabled = true; });
Configure<AbpDistributedCacheOptions>(options => { options.KeyPrefix = "EShopOnAbp:"; });
@ -167,7 +170,7 @@ public class EShopOnAbpPublicWebModule : AbpModule
context.Services.AddStaticHttpClientProxies(
typeof(BasketServiceContractsModule).Assembly, remoteServiceConfigurationName: BasketServiceConstants.RemoteServiceName
);
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<EShopOnAbpPublicWebModule>();

14
apps/public-web/src/EShopOnAbp.PublicWeb/Options/RemoteServices.cs

@ -0,0 +1,14 @@
namespace EShopOnAbp.PublicWeb.Options
{
public class RemoteServices
{
public Default Default { get; set; } = new();
}
public class Default
{
public string BaseUrl { get; set; }
}
}

5
apps/public-web/src/EShopOnAbp.PublicWeb/Pages/Index.cshtml

@ -1,9 +1,12 @@
@page
@using EShopOnAbp.Localization
@using EShopOnAbp.PublicWeb.Options
@using Microsoft.Extensions.Localization
@using System.Globalization
@using Microsoft.Extensions.Options
@model EShopOnAbp.PublicWeb.Pages.IndexModel
@inject IStringLocalizer<EShopOnAbpResource> L
@inject IOptions<RemoteServices> options
@{
const int productsColumnSize = 4; // TODO: update abp-column helper to plain html for proper row and columns css
@ -38,7 +41,7 @@
{
var product = Model.Products[(i * productsColumnSize) + j];
var productPrice = product.Price.ToString("C", new CultureInfo("en-US"));
string productImage = !product.ImageName.IsNullOrEmpty() ? $"/product-images/{product.ImageName}" : "/product-images/@product.ImageName";
string productImage = !product.ImageName.IsNullOrEmpty() ? $"{options.Value.Default.BaseUrl}product-images/{product.ImageName}" : $"{options.Value.Default.BaseUrl}product-images/@product.ImageName";
string buyText = L["Index:AddToBasket"];
<div class="product-list-item" data-product-id="@product.Id.ToString()">
<div class="col">

2
apps/public-web/src/EShopOnAbp.PublicWeb/appsettings.json

@ -12,7 +12,7 @@
"AllowedHosts": "*",
"RemoteServices": {
"Default": {
"BaseUrl": "https://localhost:44354/"
"BaseUrl": "https://localhost:44373/"
}
},
"StringEncryption": {

BIN
apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/beats.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

BIN
apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/bluecat.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

BIN
apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/lego.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

BIN
apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/nikon.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

BIN
apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/noimage.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

BIN
apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/oki.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

BIN
apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/playstation.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

BIN
apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/rampage.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

BIN
apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/sunny.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

Loading…
Cancel
Save