Skip to content

Commit

Permalink
Merge pull request #19 from lijiahangmax/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
lijiahangmax authored Jun 3, 2024
2 parents d1c6e0c + 9386bfc commit 8dec984
Show file tree
Hide file tree
Showing 130 changed files with 1,398 additions and 492 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,16 @@ git clone https://github.com/lijiahangmax/orion-visor
cd orion-visor
# 启动
docker compose up -d
# 等待后端服务启动后 (2min±) 访问 http://localhost:1081/
```

## 项目文档

* [文档地址](https://lijiahangmax.github.io/orion-visor/#/)
* [docker安装](https://lijiahangmax.github.io/orion-visor/#/quickstart/docker-install)
* [普通安装](https://lijiahangmax.github.io/orion-visor/#/quickstart/install)
* [更新日志](https://lijiahangmax.github.io/orion-visor/#/about/change-log)
* [操作手册](https://lijiahangmax.github.io/orion-visor/#/operator/asset)
* [常见问题](https://lijiahangmax.github.io/orion-visor/#/quickstart/faq)
* [文档地址](https://lijiahangmax.github.io/open-orion/orion-visor/)
* [安装文档](https://lijiahangmax.github.io/open-orion/orion-visor/quickstart/docker.html)
* [更新日志](https://lijiahangmax.github.io/open-orion/orion-visor/update/change-log.html)
* [操作手册](https://lijiahangmax.github.io/open-orion/orion-visor/operator/asset.html)
* [常见问题](https://lijiahangmax.github.io/open-orion/orion-visor/support/faq.html)

## 技术栈

Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3.3'
services:
orion-visor-service:
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-service:2.0.3
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-service:2.0.4
ports:
- 1081:80
environment:
Expand All @@ -20,7 +20,7 @@ services:
- orion-visor-mysql
- orion-visor-redis
orion-visor-mysql:
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-mysql:2.0.3
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-mysql:2.0.4
privileged: true
ports:
- 3307:3306
Expand All @@ -34,7 +34,7 @@ services:
- /data/orion-visor-space/docker-volumes/orion-visor-mysql/var-lib-mysql-files:/var/lib/mysql-files
- /data/orion-visor-space/docker-volumes/orion-visor-mysql/etc-mysql:/etc/mysql
orion-visor-redis:
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-redis:2.0.3
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-redis:2.0.4
privileged: true
ports:
- 6380:6379
Expand Down
2 changes: 1 addition & 1 deletion docker/orion-visor-mysql/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#/bin/bash
version=2.0.3
version=2.0.4
cp -r ../../sql ./sql
docker build -t orion-visor-mysql:${version} .
rm -rf ./sql
Expand Down
2 changes: 1 addition & 1 deletion docker/orion-visor-redis/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#/bin/bash
version=2.0.3
version=2.0.4
docker build -t orion-visor-redis:${version} .
docker tag orion-visor-redis:${version} registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-redis:${version}
docker push registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-redis:${version}
2 changes: 1 addition & 1 deletion docker/orion-visor-service/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#/bin/bash
version=2.0.3
version=2.0.4
mv ../../orion-visor-launch/target/orion-visor-launch.jar ./orion-visor-launch.jar
mv ../../orion-visor-ui/dist ./dist
docker build -t orion-visor-service:${version} .
Expand Down
11 changes: 8 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@

------------------------------

<p><b>⛔⛔此页面已不再维护, 请跳转至
<a target="_blank" href="https://lijiahangmax.github.io/open-orion/orion-visor">这里</a>
查看最新文档 ❗</b></p>

------------------------------

**`orion-visor`** 提供一站式服务器运维解决方案。

* **资产管理**:支持对资产进行分组,实现对主机、密钥和身份的统一管理和授权。
Expand Down Expand Up @@ -70,9 +76,8 @@ docker compose up -d

## 项目文档

* [文档地址](https://lijiahangmax.github.io/orion-visor/#/)
* [docker安装](/quickstart/docker-install)
* [普通安装](/quickstart/install)
* [文档地址](/)
* [安装文档](/quickstart/docker-install)
* [更新日志](/about/change-log)
* [操作手册](/operator/asset)
* [常见问题](/quickstart/faq)
Expand Down
2 changes: 1 addition & 1 deletion docs/_coverpage.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# orion-visor <small>2.0.3</small>
# orion-visor

> 一款高颜值、现代化的智能运维&轻量堡垒机平台。
Expand Down
6 changes: 3 additions & 3 deletions orion-visor-dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
<url>https://github.com/lijiahangmax/orion-visor</url>

<properties>
<revision>2.0.3</revision>
<revision>2.0.4</revision>
<spring.boot.version>2.7.17</spring.boot.version>
<spring.boot.admin.version>2.7.15</spring.boot.admin.version>
<flatten.maven.plugin.version>1.5.0</flatten.maven.plugin.version>
<orion.kit.revision>1.0.7</orion.kit.revision>
<orion.kit.version>1.0.7</orion.kit.version>
<aspectj.version>1.9.7</aspectj.version>
<lombok.version>1.18.26</lombok.version>
<springdoc.version>1.6.15</springdoc.version>
Expand Down Expand Up @@ -50,7 +50,7 @@
<dependency>
<groupId>io.github.lijiahangmax</groupId>
<artifactId>orion-all</artifactId>
<version>${orion.kit.revision}</version>
<version>${orion.kit.version}</version>
<exclusions>
<exclusion>
<artifactId>orion-log</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public interface AppConst extends OrionConst {
/**
* 同 ${orion.version} 迭代时候需要手动更改
*/
String VERSION = "2.0.3";
String VERSION = "2.0.4";

String ORION_VISOR = "orion-visor";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ public List<CustomFile> doFilter() {
if (!table.isEnableCache()) {
files.removeIf(file -> isServerCacheFile(file.getTemplatePath()));
}
// 不生成导出文件
if (!table.isEnableExport()) {
files.removeIf(file -> isExportFile(file.getTemplatePath()));
}
// 不生成操作日志文件
if (!table.isEnableOperatorLog()) {
files.removeIf(file -> isOperatorLogFile(file.getTemplatePath()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,6 @@ public ServerTemplate enableProviderApi() {
return this;
}

// /**
// * 生成导出
// *
// * @return this
// */
// public ServerTemplate enableExport() {
// table.enableExport = true;
// return this;
// }

/**
* 不生成单元测试
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@ public class Table {
*/
protected boolean enableUnitTest;

/**
* 是否生成导出
*/
protected boolean enableExport;

/**
* 是否可缓存
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public VueTemplate(Table table) {
public VueTemplate(Table table, String module, String feature) {
super(table);
table.enableVue = true;
table.enableRowSelection = true;
table.module = module;
table.feature = feature;
}
Expand Down Expand Up @@ -54,12 +55,12 @@ public VueTemplate enableDrawerForm() {
}

/**
* 列表可多选
* 关闭列表可多选
*
* @return this
*/
public VueTemplate enableRowSelection() {
table.enableRowSelection = true;
public VueTemplate disableRowSelection() {
table.enableRowSelection = false;
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,5 @@ Authorization: {{token}}
${httpComment} ${apiComment.batchDelete}
DELETE {{baseUrl}}/${package.ModuleName}/${typeHyphen}/batch-delete?idList=1,2,3
Authorization: {{token}}
#if($meta.enableExport)


${httpComment} ${apiComment.export}
POST {{baseUrl}}/${package.ModuleName}/${typeHyphen}/export
Content-Type: application/json
Authorization: {{token}}

{
#foreach($field in ${table.fields})
"${field.propertyName}": ""#if($foreach.hasNext),#end
#end
}
#end

${httpComment}
Original file line number Diff line number Diff line change
Expand Up @@ -141,19 +141,6 @@ public class ${table.controllerName} {
public Integer batchDelete${type}(@RequestParam("idList") List<Long> idList) {
return ${typeLower}Service.delete${type}ByIdList(idList);
}
#if($meta.enableExport)

#if($meta.enableOperatorLog)
@OperatorLog(${type}OperatorType.EXPORT)
#end
@PostMapping("/export")
@Operation(summary = "${apiComment.export}")
@PreAuthorize("@ss.hasPermission('${package.ModuleName}:${typeHyphen}:export')")
public void export${type}(@Validated @RequestBody ${type}QueryRequest request,
HttpServletResponse response) throws IOException {
${typeLower}Service.export${type}(request, response);
}
#end

}

Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ public interface ${type}Convert {
${type}DO to(${type}QueryRequest request);

${type}VO to(${type}DO domain);
#if($meta.enableExport)

${type}Export toExport(${type}DO domain);
#end

List<${type}VO> to(List<${type}DO> list);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,13 @@ public class ${type}OperatorType extends InitializingOperatorTypes {
public static final String UPDATE = "${typeHyphen}:update";

public static final String DELETE = "${typeHyphen}:delete";
#if($meta.enableExport)

public static final String EXPORT = "${typeHyphen}:export";
#end

@Override
public OperatorType[] types() {
return new OperatorType[]{
new OperatorType(L, CREATE, "创建$!{table.comment}"),
new OperatorType(M, UPDATE, "更新$!{table.comment}"),
new OperatorType(H, DELETE, "删除$!{table.comment}"),
#if($meta.enableExport)
new OperatorType(M, EXPORT, "导出$!{table.comment}"),
#end
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.orion.lang.define.wrapper.DataGrid;
import com.orion.lang.utils.Strings;
import com.orion.lang.utils.collect.Lists;
#if($meta.enableExport)
import com.orion.office.excel.writer.exporting.ExcelExport;
#end
import com.orion.visor.framework.common.constant.ErrorMessage;
#if($meta.enableExport)
import com.orion.visor.framework.common.utils.FileNames;
#end
import com.orion.visor.framework.common.utils.Valid;
#if($meta.enableCache)
import com.orion.visor.framework.redis.core.utils.RedisMaps;
Expand All @@ -23,18 +17,11 @@ import ${pkg}.*;
import ${package.Entity}.${entity};
import ${package.Mapper}.${table.mapperName};
import ${package.Service}.${table.serviceName};
#if($meta.enableExport)
import com.orion.web.servlet.web.Servlets;
#end
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
#if($meta.enableExport)
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
#end
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
Expand All @@ -54,6 +41,7 @@ public class ${table.serviceImplName} implements ${table.serviceName} {
private ${type}DAO ${typeLower}DAO;

@Override
@Transactional(rollbackFor = Exception.class)
public Long create${type}(${type}CreateRequest request) {
log.info("${type}Service-create${type} request: {}", JSON.toJSONString(request));
// 转换
Expand All @@ -72,6 +60,7 @@ public class ${table.serviceImplName} implements ${table.serviceName} {
}

@Override
@Transactional(rollbackFor = Exception.class)
public Integer update${type}ById(${type}UpdateRequest request) {
Long id = Valid.notNull(request.getId(), ErrorMessage.ID_MISSING);
log.info("${type}Service-update${type}ById id: {}, request: {}", id, JSON.toJSONString(request));
Expand All @@ -93,6 +82,7 @@ public class ${table.serviceImplName} implements ${table.serviceName} {
}

@Override
@Transactional(rollbackFor = Exception.class)
public Integer update${type}(${type}QueryRequest query, ${type}UpdateRequest update) {
log.info("${type}Service.update${type} query: {}, update: {}", JSON.toJSONString(query), JSON.toJSONString(update));
// 条件
Expand Down Expand Up @@ -179,6 +169,7 @@ public class ${table.serviceImplName} implements ${table.serviceName} {
}

@Override
@Transactional(rollbackFor = Exception.class)
public Integer delete${type}ById(Long id) {
log.info("${type}Service-delete${type}ById id: {}", id);
// 检查数据是否存在
Expand All @@ -195,6 +186,7 @@ public class ${table.serviceImplName} implements ${table.serviceName} {
}

@Override
@Transactional(rollbackFor = Exception.class)
public Integer delete${type}ByIdList(List<Long> idList) {
log.info("${type}Service-delete${type}ByIdList idList: {}", idList);
int effect = ${typeLower}DAO.deleteBatchIds(idList);
Expand All @@ -207,6 +199,7 @@ public class ${table.serviceImplName} implements ${table.serviceName} {
}

@Override
@Transactional(rollbackFor = Exception.class)
public Integer delete${type}(${type}QueryRequest request) {
log.info("${type}Service.delete${type} request: {}", JSON.toJSONString(request));
// 条件
Expand All @@ -220,26 +213,6 @@ public class ${table.serviceImplName} implements ${table.serviceName} {
#end
return effect;
}
#if($meta.enableExport)

@Override
public void export${type}(${type}QueryRequest request, HttpServletResponse response) throws IOException {
log.info("${type}Service.export${type} request: {}", JSON.toJSONString(request));
// 条件
LambdaQueryWrapper<${type}DO> wrapper = this.buildQueryWrapper(request);
// 查询
List<${type}Export> rows = ${typeLower}DAO.of(wrapper).list(${type}Convert.MAPPER::toExport);
log.info("${type}Service.export${type} size: {}", rows.size());
// 导出
ByteArrayOutputStream out = new ByteArrayOutputStream();
ExcelExport.create(${type}Export.class)
.addRows(rows)
.write(out)
.close();
// 传输
Servlets.transfer(response, out.toByteArray(), FileNames.exportName(${type}Export.TITLE));
}
#end

/**
* 检查对象是否存在
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,5 @@ public interface ${table.serviceName} {
* @return effect
*/
Integer delete${type}(${type}QueryRequest request);
#if($meta.enableExport)

/**
* ${apiComment.export}
*
* @param request request
* @param response response
* @throws IOException IOException
*/
void export${type}(${type}QueryRequest request, HttpServletResponse response) throws IOException;
#end

}
Loading

0 comments on commit 8dec984

Please sign in to comment.