Skip to content

Commit

Permalink
🎨 - Add dynamic page title configuration, through the application.pro…
Browse files Browse the repository at this point in the history
…perties can specify the content of the page title, in the multi-environment state can be friendly and intuitive to distinguish between environments

- Adjusted maven profile to simplify ui-build to ui
  • Loading branch information
tonycody committed Nov 28, 2023
1 parent d81fdc7 commit c7cc172
Show file tree
Hide file tree
Showing 11 changed files with 402 additions and 289 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
spring.profiles.active=dev

server.port=38080
dubbo.protocol.port=30880
Expand Down Expand Up @@ -84,4 +85,4 @@ spring.datasource.password=
# id generate type
mybatis-plus.global-config.db-config.id-type=none

dubbo.application.logger=slf4j
dubbo.application.logger=slf4j
14 changes: 12 additions & 2 deletions dubbo-admin-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>com.ecwid.consul</groupId>
<artifactId>consul-api</artifactId>
Expand Down Expand Up @@ -234,6 +233,10 @@
<artifactId>logback-core</artifactId>
<version>1.2.8</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -307,10 +310,17 @@
</profile>

<profile>
<id>ui-build</id>
<id>ui</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<dependencies>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-admin-ui</artifactId>
<version>${revision}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package org.apache.dubbo.admin.controller;

import org.apache.dubbo.admin.model.dto.AppConfigDTO;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
* There is no description.
*
* @author XS <[email protected]>
* @version 1.0
* @date 2023/11/28 13:47
*/
@RestController
@RequestMapping("/api/{env}/common")
public class CommonController {

/**
* Admin Title
*/
@Value("${admin.title:Dubbo Admin}")
private String adminTitle;

/**
* @return {@link AppConfigDTO}
*/
@GetMapping(value = "/app/config")
public AppConfigDTO appConfig() {
return AppConfigDTO.builder().adminTitle(adminTitle).build();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package org.apache.dubbo.admin.model.dto;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
* There is no description.
*
* @author XS <[email protected]>
* @version 1.0
* @date 2023/11/28 13:48
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class AppConfigDTO {

/**
* Admin Title
*/
private String adminTitle;
}
24 changes: 24 additions & 0 deletions dubbo-admin-server/src/main/resources/application-dev.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

admin.title=Dubbo Admin(dev)

# centers in dubbo2.7
admin.registry.address=zookeeper://127.0.0.1:2181
admin.config-center=zookeeper://127.0.0.1:2181
admin.metadata.address=zookeeper://127.0.0.1:2181
admin.check.authority=false
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# limitations under the License.
#

admin.title=Dubbo Admin(test)

# centers in dubbo2.7
admin.registry.address=zookeeper://127.0.0.1:2181
admin.config-center=zookeeper://127.0.0.1:2181
Expand Down
3 changes: 2 additions & 1 deletion dubbo-admin-server/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
spring.profiles.active=dev

server.port=38080
dubbo.protocol.port=30880
Expand Down Expand Up @@ -84,4 +85,4 @@ spring.datasource.password=
# id generate type
mybatis-plus.global-config.db-config.id-type=none

dubbo.application.logger=slf4j
dubbo.application.logger=slf4j
Loading

0 comments on commit c7cc172

Please sign in to comment.