Browse Source

Update document

pull/3135/head
liangshiwei 6 years ago
parent
commit
a69357c228
  1. 91
      docs/zh-Hans/Samples/Microservice-Demo.md
  2. 3
      docs/zh-Hans/UI/AspNetCore/Layout-Hooks.md
  3. 3
      docs/zh-Hans/UI/AspNetCore/Navigation-Menu.md
  4. 68
      docs/zh-Hans/UI/AspNetCore/Tag-Helpers/Buttons.md
  5. 27
      docs/zh-Hans/UI/AspNetCore/Tag-Helpers/Index.md
  6. 2
      docs/zh-Hans/UI/AspNetCore/Theming.md
  7. 3
      docs/zh-Hans/UI/AspNetCore/Toolbars.md
  8. BIN
      docs/zh-Hans/images/bookstore-added-brand-files.png
  9. BIN
      docs/zh-Hans/images/bookstore-added-logo.png
  10. BIN
      docs/zh-Hans/images/bookstore-added-role-js-file.png
  11. BIN
      docs/zh-Hans/images/bookstore-brand-area-highlighted.png
  12. BIN
      docs/zh-Hans/images/bookstore-global-css-file.png
  13. BIN
      docs/zh-Hans/images/bookstore-google-analytics-view-component.png
  14. BIN
      docs/zh-Hans/images/bookstore-menus-highlighted.png
  15. BIN
      docs/zh-Hans/images/bookstore-notification-icon-on-toolbar.png
  16. BIN
      docs/zh-Hans/images/bookstore-notification-view-component.png
  17. BIN
      docs/zh-Hans/images/bookstore-toolbar-highlighted.png
  18. BIN
      docs/zh-Hans/images/microservice-sample-diagram-3.png
  19. BIN
      docs/zh-Hans/images/microservice-sample-solution-2.png
  20. BIN
      docs/zh-Hans/images/overriding-login-cshtml.png

91
docs/zh-Hans/Samples/Microservice-Demo.md

@ -24,82 +24,15 @@ ABP框架的主要目标之一就是提供[便捷的基础设施来创建微服
下图展示了该系统:
![microservice-sample-diagram](../images/microservice-sample-diagram-2.png)
![microservice-sample-diagram](../images/microservice-sample-diagram-3.png)
### 源码
你可以从[GitHub仓库](https://github.com/abpframework/abp/tree/master/samples/MicroserviceDemo)获取源码.
### 状态
该示例的初始版本已完成.其他改进仍在开发中.
## 运行解决方案
您可以从 **源代码** 或者预先配置好的 **docker-compose** 文件运行.
### 使用Docker容器
#### 预先要求
由于所有依赖项都已预先配置, 因此作为Docker容器运行更容易. 你只需要安装[最新的docker](https://docs.docker.com/compose/install/).
#### 运行容器
- 克隆或下载 [ABP仓库](https://github.com/abpframework/abp).
- 在存储库的`samples/MicroserviceDemo`文件夹中打开命令行.
- 从Docker Hub中拉取image:
```
docker-compose -f docker-compose.yml -f docker-compose.migrations.yml pull
```
- 如果要在本地构建映像, 可以跳过上述步骤, 使用build命令:
```
docker-compose -f docker-compose.yml -f docker-compose.migrations.yml build
```
根据你的电脑配置, 构建image可能需要**很长时间**.
- 还原 SQL Server 数据库:
```
docker-compose -f docker-compose.yml -f docker-compose.migrations.yml run restore-database
```
- 启动容器:
```
docker-compose up -d
```
- 将此行添加到`hosts`文件的末尾:
```
127.0.0.1 auth-server
```
hosts文件位于Windows上的`C:\Windows\System32\Drivers\etc\hosts`文件夹, Linux/MacOS的`/etc/hosts`中.
#### 运行应用程序
你可能想要了解容器中运行一些应用程序:
* 后端管理应用程序 (BackendAdminApp.Host): `http://localhost:51512`
*(用于管理系统中的用户和产品)*
* 公共网站 (PublicWebsite.Host): `http://localhost:51513`
*(用于列出产品并运行/管理博客模块)*
* 认证服务器 (AuthServer.Host): `http://auth-server:51511/`
*(用作使用IdentityServer4构建的单点登录和身份验证服务器)*
* Kibana UI: `http://localhost:51510`
*(用于显示/跟踪所有服务/应用程序/网关写入的日志)*
### 从源代码运行
#### 预先要求
### 预先要求
为了能够从源代码运行解决方案, 应在你的计算机上安装并运行以下工具:
@ -110,19 +43,19 @@ ABP框架的主要目标之一就是提供[便捷的基础设施来创建微服
* [ElasticSearch](https://www.elastic.co/downloads/elasticsearch) 6.6+
* [Kibana](https://www.elastic.co/downloads/kibana) 6.6+ (可选,建议显示日志)
#### 打开并构建Visual Studio解决方案
### 打开并构建Visual Studio解决方案
* 在Visual Studio 2017 (15.9.0+)中打开`samples\MicroserviceDemo\MicroserviceDemo.sln`.
* 在`samples\MicroserviceDemo`文件夹中的命令行运行`dotnet restore`命令.
* 在Visual Studio中构建解决方案.
#### 创建数据库
### 创建数据库
MongoDB 数据库是动态创建的,但是你需要创建 SQL server 数据库的结构。其实你可以很轻松的创建数据库,因为这个解决方案配置了使用 Entity Core Code First 来做迁移。
这个解决方案中有两个 SQL server 数据库。
##### MsDemo_Identity 数据库
#### MsDemo_Identity 数据库
* 右键 `AuthServer.Host` 项目,然后点击 `设置为启动项目`.
* 打开 **程序包管理器控制台** (工具 -> NuGet 包管理器 -> 程序包管理器控制台)
@ -131,7 +64,7 @@ MongoDB 数据库是动态创建的,但是你需要创建 SQL server 数据库
![microservice-sample-update-database-authserver](../images/microservice-sample-update-database-authserver.png)
##### MsDemo_ProductManagement
#### MsDemo_ProductManagement
* 右键 `ProductService.Host` 项目,然后点击 `设置为启动项目`.
* 打开 **程序包管理器控制台** (工具 -> NuGet 包管理器 -> 程序包管理器控制台)
@ -140,12 +73,13 @@ MongoDB 数据库是动态创建的,但是你需要创建 SQL server 数据库
![microservice-sample-update-database-products](../images/microservice-sample-update-database-products.png)
#### 运行项目
### 运行项目
按以下顺序运行项目(右键单击每个项目设置为启动项目,按Ctrl+F5运行,无需调试):
* AuthServer.Host
* IdentityService.Host
* TenantManagementService.Host
* BloggingService.Host
* ProductService.Host
* InternalGateway.Host
@ -158,7 +92,7 @@ MongoDB 数据库是动态创建的,但是你需要创建 SQL server 数据库
Visual Studio解决方案由多个项目组成,每个项目在系统中具有不同的角色:
![microservice-sample-solution](../images/microservice-sample-solution.png)
![microservice-sample-solution](../images/microservice-sample-solution-2.png)
### 应用程序(Applications)
@ -182,6 +116,7 @@ Visual Studio解决方案由多个项目组成,每个项目在系统中具有不
微服务没有UI,但暴露了一些REST API.
- **IdentityService.Host**: 托管用于管理用户和角色的ABP Identity模块. 它没有其他服务,仅托管Identity模块的API.
- **TenantManagementService.Host**: 托管用于管理角色的ABP租户管理模块. 它没有其他服务,仅托管租户管理模块的API.
- **BloggingService.Host**: 托管ABP博客模块,该模块用于管理博客和帖子(典型的博客应用程序). 它没有其他服务,仅托管Blogging模块的API.
- **ProductService.Host**: 托管用于管理产品的产品模块(位于解决方案内). 它还包含用于创建/更新产品管理数据库架构的EF Core迁移.
@ -193,7 +128,7 @@ Visual Studio解决方案由多个项目组成,每个项目在系统中具有不
此解决方案使用多个数据库:
* **MsDemo_Identity**: 一个SQL数据库. 默认使用**SQL Server**,但可以是EF Core支持的任何DBMS. 由AuthServer和IdentityService共享. 审计日志,权限和设置也存储在此数据库中(虽然它们可以轻松拥有自己的数据库,共享相同的数据库以保持简单).
* **MsDemo_Identity**: 一个SQL数据库. 默认使用**SQL Server**,但可以是EF Core支持的任何DBMS. 由AuthServer,IdentityService和TenantManagementService共享. 审计日志,权限和设置也存储在此数据库中(虽然它们可以轻松拥有自己的数据库,共享相同的数据库以保持简单).
* **MsDemo_ProductManagement**: 一个SQL数据库. 同样默认使用 **SQL Server**,但可以是EF Core支持的任何DBMS. 由ProductService用作专用数据库.
* **MsDemo_Blogging**: **MongoDB**数据库. 由BloggingService使用.
* **Elasticsearch**: 用于在Serilog上写日志.
@ -1474,3 +1409,7 @@ ABP提供自动审计日志记录,详细保存每个请求(当前用户,浏览
所有服务和应用程序都配置为编写审核日志. 审核日志将保存到MsDemo_Identity SQL数据库中. 因此,您可以从单个点查询所有应用程序的所有审核日志.
审核日志记录具有`CorrelationId`属性,可用于跟踪请求. 当服务在单个Web请求中调用另一个服务时,它们都会使用相同的`CorrelationId`保存审核日志. 请参阅数据库中的`AbpAuditLogs`表.
### 多租户
该解决方案已配置提供[多租户](../Multi-Tenancy.md)系统,其中每个租户可以拥有其隔离的用户,角色,权限和其他数据.

3
docs/zh-Hans/UI/AspNetCore/Layout-Hooks.md

@ -0,0 +1,3 @@
# Layout Hooks
TODO

3
docs/zh-Hans/UI/AspNetCore/Navigation-Menu.md

@ -0,0 +1,3 @@
# Navigation Menu
TODO

68
docs/zh-Hans/UI/AspNetCore/Tag-Helpers/Buttons.md

@ -1,30 +1,26 @@
# 按钮
ABP框架定义了Tag Helper用于简单的创建bootstrap按钮.
## 介绍
`<abp-button>`
`abp-button` 是创建按钮的主要元素.
## 属性
基本用法:
`<abp-button>` 有7个不同的属性.
````xml
<abp-button button-type="Primary">Click Me</abp-button>
````
* [`button-type`](#button-type)
* [`size`](#size)
* [`busy-text`](#busy-text)
* [`text`](#text)
* [`icon`](#icon)
* [`disabled`](#disabled)
* [`icon-type`](#icon-type)
## Demo
### `button-type`
参阅 [按钮Demo页面](https://bootstrap-taghelpers.abp.io/Components/Buttons) 查看示例.
`button-type` 是一个可选参数. 它的默认值是 `Default`.
## Attributes
`<abp-button button-type="Primary">Button</abp-button>`
### `button-type`
你可以为按钮选择以下按钮类型:
指定按钮的主样式/类型. 应为以下值之一:
* `Default`
* `Default` (default value)
* `Primary`
* `Secondary`
* `Success`
@ -45,11 +41,7 @@ ABP框架定义了Tag Helper用于简单的创建bootstrap按钮.
### `size`
`size` 是一个可选参数. 它的默认值是 `Default`.
`<abp-button size="Default">Button</abp-button>`
你可以为按钮选择以下size类型:
指定按钮的大小. 应为以下值之一:
* `Default`
* `Small`
@ -62,33 +54,33 @@ ABP框架定义了Tag Helper用于简单的创建bootstrap按钮.
### `busy-text`
`busy-text` 是一个字符串类型参数. 当按钮繁忙时设置该文本.
当按钮busy时显示的文本.
### `text`
`text` 是一个字符串类型参数,显示在按钮上.
### `icon`
按钮的文本. 如果你只想为为按钮设置文本,这是一种快捷方式. 例:
`icon` 是一个字符串类型参数. 它的值取决于[`icon-type`](#`icon-type`). 默认情况下,我们对图标使用[Font Awesome](https://fontawesome.com/). 要使用它,你需要将 `icon` 参数设置为图标名称.
````xml
<abp-button button-type="Primary" text="Click Me" />
````
##### 示例
在这个示例中,你可以使用 self-closing 标签将其缩短.
[fa-address-card](https://fontawesome.com/icons/address-card): ![fa-address-card](fa-address-card.png "Address Card")
`<abp-button icon="address-card" text="Address" />`
> 不要忘记: 你不需要写前缀,如果你没有更改 `icon-type` ,它会为[Font Awesome](https://fontawesome.com/)图标自动添加 `fa` 前缀.
### `icon`
### `disabled`
设置按钮的图标. 默认情况下它使用[Font Awesome](https://fontawesome.com/)图标库. 例:
`disabled` 是一个布尔类型参数. 如果你设值为 `true`, 按钮会被禁用.
````xml
<abp-button icon="address-card" text="Address" />
````
### `icon-type`
`icon-type` 是一个可选参数。它的默认值是 `FontAwesome`. 你可以创建自己的图标类型提供程序并更改它.
如果你不想使用font-awesome,你有两个选项:
1. 设置 `icon-type``Other`,并为你的按钮编写图标样式.
2. 如果你不使用图标,请手动使用opening和closing标签,并在标签内写任何代码.
你可以为按钮选择以下图标类型:
### `disabled`
* `FontAwesome`
* `Other`
设置为 `true` 禁用按钮.

27
docs/zh-Hans/UI/AspNetCore/Tag-Helpers/Index.md

@ -1,3 +1,26 @@
## ABP Tag Helpers
# ABP Tag Helpers
"ABP tag helpers" 文档还在创建中. 你现在可以参阅[组件演示](http://bootstrap-taghelpers.abp.io/).
ABP框架定义了一组**标签助手组件**. 简化开发ASP.NET Core (MVC / Razor Pages) 应用程序界面.
## bootstrap 组件包装
大多数标签助手是[Bootstrap](https://getbootstrap.com/) (v4+)的包装. 编写bootstrap代码并不是那么简单,其中包含太多的重复HTML标签并且也没有类型安全. ABP标签助手使其 **简单** 并且 **类型安全**.
我们的目标并不是100%的包装bootstrap组件. 仍然可以编写 **原生bootstrap代码** (实际上标签助手生成的也是原生的bootstrap代码), 但我们建议尽量使用标签助手.
ABP框架还向标准bootstrap组件添加了一些**实用的功能**.
这里是ABP框架包装的组件列表:
* [Buttons](Buttons.md)
* ...
> 在为所有的标签助手完成文档之前,你可以访问 https://bootstrap-taghelpers.abp.io/ 查看在线示例.
## 表单元素
参阅 [demo](https://bootstrap-taghelpers.abp.io/Components/FormElements).
## 动态表单
参阅 [demo](https://bootstrap-taghelpers.abp.io/Components/DynamicForms).

2
docs/zh-Hans/UI/AspNetCore/Theming.md

@ -1,3 +1,3 @@
# Theming
# ASP.NET Core MVC / Razor Pages 主题
TODO

3
docs/zh-Hans/UI/AspNetCore/Toolbars.md

@ -0,0 +1,3 @@
# Toolbars
TODO

BIN
docs/zh-Hans/images/bookstore-added-brand-files.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
docs/zh-Hans/images/bookstore-added-logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

BIN
docs/zh-Hans/images/bookstore-added-role-js-file.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
docs/zh-Hans/images/bookstore-brand-area-highlighted.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
docs/zh-Hans/images/bookstore-global-css-file.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
docs/zh-Hans/images/bookstore-google-analytics-view-component.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
docs/zh-Hans/images/bookstore-menus-highlighted.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

BIN
docs/zh-Hans/images/bookstore-notification-icon-on-toolbar.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

BIN
docs/zh-Hans/images/bookstore-notification-view-component.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
docs/zh-Hans/images/bookstore-toolbar-highlighted.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

BIN
docs/zh-Hans/images/microservice-sample-diagram-3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 KiB

BIN
docs/zh-Hans/images/microservice-sample-solution-2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

BIN
docs/zh-Hans/images/overriding-login-cshtml.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Loading…
Cancel
Save