diff --git a/README.md b/README.md
index 30ca1abd..cc21b1ae 100644
--- a/README.md
+++ b/README.md
@@ -16,7 +16,7 @@ consistency between process cache and Redis.
> Kotlin DSL
``` kotlin
- val governVersion = "0.9.12";
+ val governVersion = "0.9.13";
implementation("me.ahoo.govern:spring-cloud-starter-config:${governVersion}")
implementation("me.ahoo.govern:spring-cloud-starter-discovery:${governVersion}")
```
@@ -33,7 +33,7 @@ consistency between process cache and Redis.
4.0.0
demo
- 0.9.12
+ 0.9.13
@@ -74,31 +74,31 @@ spring:
#### Option 1:Download the executable file
-> Download [rest-api-server](https://github.com/Ahoo-Wang/govern-service/releases/download/0.9.12/rest-api-0.9.12.tar)
+> Download [rest-api-server](https://github.com/Ahoo-Wang/govern-service/releases/download/0.9.13/rest-api-0.9.13.tar)
-> tar *rest-api-0.9.12.tar*
+> tar *rest-api-0.9.13.tar*
```shell
-cd rest-api-0.9.12
-# Working directory: rest-api-0.9.12
+cd rest-api-0.9.13
+# Working directory: rest-api-0.9.13
bin/rest-api --server.port=8080 --govern.redis.uri=redis://localhost:6379
```
#### Option 2:Docker run
```shell
-docker pull ahoowang/govern-service:0.9.12
-docker run --name govern-service -d -p 8080:8080 --link redis -e GOVERN_REDIS_URI=redis://redis:6379 ahoowang/govern-service:0.9.12
+docker pull ahoowang/govern-service:0.9.13
+docker run --name govern-service -d -p 8080:8080 --link redis -e GOVERN_REDIS_URI=redis://redis:6379 ahoowang/govern-service:0.9.13
```
---
> MacBook Pro (M1)
>
-> Please use *ahoowang/govern-service:0.9.12-armv7*
+> Please use *ahoowang/govern-service:0.9.13-armv7*
```shell
-docker pull ahoowang/govern-service:0.9.12-armv7
-docker run --name govern-service -d -p 8080:8080 --link redis -e GOVERN_REDIS_URI=redis://redis:6379 ahoowang/govern-service:0.9.12-armv7
+docker pull ahoowang/govern-service:0.9.13-armv7
+docker run --name govern-service -d -p 8080:8080 --link redis -e GOVERN_REDIS_URI=redis://redis:6379 ahoowang/govern-service:0.9.13-armv7
```
---
diff --git a/README.zh-CN.md b/README.zh-CN.md
index 996076c3..d0c66eda 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -11,7 +11,7 @@
> Kotlin DSL
``` kotlin
- val governVersion = "0.9.12";
+ val governVersion = "0.9.13";
implementation("me.ahoo.govern:spring-cloud-starter-config:${governVersion}")
implementation("me.ahoo.govern:spring-cloud-starter-discovery:${governVersion}")
```
@@ -28,7 +28,7 @@
4.0.0
demo
- 0.9.12
+ 0.9.13
@@ -73,31 +73,31 @@ logging:
#### 方式一:下载可执行文件
-> 下载 [rest-api-server](https://github.com/Ahoo-Wang/govern-service/releases/download/0.9.12/rest-api-0.9.12.tar)
+> 下载 [rest-api-server](https://github.com/Ahoo-Wang/govern-service/releases/download/0.9.13/rest-api-0.9.13.tar)
-> 解压 *rest-api-0.9.12.tar*
+> 解压 *rest-api-0.9.13.tar*
```shell
-cd rest-api-0.9.12
-# 工作目录: rest-api-0.9.12
+cd rest-api-0.9.13
+# 工作目录: rest-api-0.9.13
bin/rest-api --server.port=8080 --govern.redis.uri=redis://localhost:6379
```
#### 方式二:Docker run
```shell
-docker pull ahoowang/govern-service:0.9.12
-docker run --name govern-service -d -p 8080:8080 --link redis -e GOVERN_REDIS_URI=redis://redis:6379 ahoowang/govern-service:0.9.12
+docker pull ahoowang/govern-service:0.9.13
+docker run --name govern-service -d -p 8080:8080 --link redis -e GOVERN_REDIS_URI=redis://redis:6379 ahoowang/govern-service:0.9.13
```
---
> MacBook Pro (M1)
>
-> 请使用 *ahoowang/govern-service:0.9.12-armv7*
+> 请使用 *ahoowang/govern-service:0.9.13-armv7*
```shell
-docker pull ahoowang/govern-service:0.9.12-armv7
-docker run --name govern-service -d -p 8080:8080 --link redis -e GOVERN_REDIS_URI=redis://redis:6379 ahoowang/govern-service:0.9.12-armv7
+docker pull ahoowang/govern-service:0.9.13-armv7
+docker run --name govern-service -d -p 8080:8080 --link redis -e GOVERN_REDIS_URI=redis://redis:6379 ahoowang/govern-service:0.9.13-armv7
```
---
diff --git a/dashboard/angular.json b/dashboard/angular.json
index 203099fa..716c5e6f 100644
--- a/dashboard/angular.json
+++ b/dashboard/angular.json
@@ -36,7 +36,8 @@
"glob": "**/*",
"input": "./node_modules/@ant-design/icons-angular/src/inline-svg/",
"output": "/assets/"
- }
+ },
+ { "glob": "**/*", "input": "node_modules/ngx-monaco-editor/assets/monaco", "output": "./assets/monaco/" }
],
"styles": [
"./node_modules/ng-zorro-antd/ng-zorro-antd.min.css",
diff --git a/dashboard/package.json b/dashboard/package.json
index 97a98e30..54556523 100644
--- a/dashboard/package.json
+++ b/dashboard/package.json
@@ -19,7 +19,9 @@
"@angular/platform-browser": "~11.2.13",
"@angular/platform-browser-dynamic": "~11.2.13",
"@angular/router": "~11.2.13",
+ "monaco-editor": "^0.24.0",
"ng-zorro-antd": "^11.4.1",
+ "ngx-monaco-editor": "^9.0.0",
"rxjs": "~6.6.0",
"tslib": "^2.0.0",
"zone.js": "~0.11.3"
diff --git a/dashboard/src/app/api/config/Configs.ts b/dashboard/src/app/api/config/Configs.ts
index f7dacfb9..295ebc25 100644
--- a/dashboard/src/app/api/config/Configs.ts
+++ b/dashboard/src/app/api/config/Configs.ts
@@ -23,4 +23,45 @@ export class Configs {
opTime: 0
};
}
+
+ static extAsLang(configExt: string): string {
+ switch (configExt) {
+ case 'yml': {
+ return 'yaml';
+ }
+ default:
+ return configExt;
+ }
+ }
}
+
+export type ConfigExt = 'text' | 'json' | 'xml' | 'yaml' | 'properties';
+
+export class ConfigName {
+ name: string;
+ ext: string;
+
+ constructor(name: string, ext: string) {
+ this.name = name;
+ this.ext = ext;
+ }
+
+ static of(configId: string): ConfigName {
+ const idx = configId.lastIndexOf('.');
+ if (idx < 0) {
+ return new ConfigName(configId, '');
+ }
+ const name = configId.substring(0, idx);
+ const ext = configId.substring(idx + 1);
+
+ return new ConfigName(name, ext);
+ }
+
+ toId(): string {
+ if (this.ext.length === 0) {
+ return this.name;
+ }
+ return `${this.name}.${this.ext}`;
+ }
+}
+
diff --git a/dashboard/src/app/app.module.ts b/dashboard/src/app/app.module.ts
index 6cd3af3f..d38a79e3 100644
--- a/dashboard/src/app/app.module.ts
+++ b/dashboard/src/app/app.module.ts
@@ -27,6 +27,7 @@ import {NzSwitchModule} from 'ng-zorro-antd/switch';
import {NzDropDownModule} from 'ng-zorro-antd/dropdown';
import {NzStatisticModule} from 'ng-zorro-antd/statistic';
import {NzUploadModule} from 'ng-zorro-antd/upload';
+import {MonacoEditorModule} from 'ngx-monaco-editor';
import {NamespaceSelectorComponent} from './components/namespace/namespace-selector/namespace-selector.component';
import {NamespaceComponent} from './components/namespace/namespace.component';
@@ -82,7 +83,9 @@ registerLocaleData(zh);
NzSwitchModule,
NzDropDownModule,
NzStatisticModule,
- NzUploadModule
+ NzUploadModule,
+ MonacoEditorModule,
+ MonacoEditorModule.forRoot()
],
providers: [{provide: NZ_I18N, useValue: zh_CN}],
bootstrap: [AppComponent]
diff --git a/dashboard/src/app/components/config/config-editor.service.ts b/dashboard/src/app/components/config/config-editor.service.ts
index a6fdda2b..13f97296 100644
--- a/dashboard/src/app/components/config/config-editor.service.ts
+++ b/dashboard/src/app/components/config/config-editor.service.ts
@@ -24,7 +24,7 @@ export class ConfigEditorService {
}
const drawerRef = this.drawerService.create({
nzTitle: editorTitle,
- nzWidth: '40%',
+ nzWidth: '880px',
nzContent: ConfigEditorComponent,
nzContentParams: {
configId
@@ -65,7 +65,7 @@ export class ConfigEditorService {
const drawerRef = this.drawerService.create({
nzTitle: `Config [${configId}] Version [${version}]`,
- nzWidth: '40%',
+ nzWidth: '880px',
nzContent: ConfigVersionComponent,
nzContentParams: {
configId,
diff --git a/dashboard/src/app/components/config/config-editor/config-editor.component.html b/dashboard/src/app/components/config/config-editor/config-editor.component.html
index e42378c2..102e398e 100644
--- a/dashboard/src/app/components/config/config-editor/config-editor.component.html
+++ b/dashboard/src/app/components/config/config-editor/config-editor.component.html
@@ -1,16 +1,28 @@