Skip to content

Commit

Permalink
[Feature][scaleph-security] replace scaleph-security by carp security…
Browse files Browse the repository at this point in the history
… module (#743)

* feature: replace security module

* feature: update README

* feature: update README

* feature: update admin security-role web

* feature: update admin security-role web

* feature: update admin security-role web

* feature: update admin security-role web

* feature: update admin security-user web

* feature: replace security module

* feature: update admin security-user web

* feature: update admin security-user web

* feature: update admin security-user web

---------

Co-authored-by: wangqi <wangqi@xinxuan.net>
  • Loading branch information
kalencaya and wangqi authored Aug 6, 2024
1 parent 5570016 commit 76e4de3
Show file tree
Hide file tree
Showing 48 changed files with 978 additions and 1,192 deletions.
25 changes: 1 addition & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,7 @@ Scaleph is driven by personal interest and evolves actively through faithful dev

## Documentation

Whenever people want to explore Scaleph system, they want a running Scaleph application, then people can interact with Scaleph through Scaleph Admin.

Firstly, read documentation website [quick start](https://flowerfine.github.io/scaleph-repress-site/quick-start/) and begin to bootstrap scaleph.

Secondly, take followed steps.

* **Install Docker and Kubernetes on your machine**. Reference: [Prepare](https://flowerfine.github.io/scaleph-repress-site/quick-start/prepare/index.html)
* Clone the repository
* Use Docker Compose and Scaleph Docker image quickly install and run Scaleph.

```shell
git clone https://github.com/flowerfine/scaleph.git --depth 1

cd scaleph
git fetch origin 2.0.5
git checkout 2.0.5

# 将镜像 tag 切换到 v2.0.5。latest 为开发中的最新版本
# 注意替换 MINIO_ENDPOINT 中的 IP
cd scaleph/tools/docker/deploy/scaleph
docker-compose up
```

Once all containers have started, the UI is ready to go at [http://localhost:8096](http://localhost:8096/), user can login by `sys_admin/123456`.
Learn more about Scaleph at https://github.com/flowerfine/scaleph

## Code of Conduct

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
<okhttp.version>4.10.0</okhttp.version>
<guava.version>32.1.3-jre</guava.version>
<minio.version>8.3.8</minio.version>
<carp.version>0.0.1</carp.version>
<carp.version>0.0.3</carp.version>
<milky.version>1.0.13</milky.version>
<sakura.version>1.0.2</sakura.version>
<hadoop.version>3.3.4</hadoop.version>
Expand Down
2 changes: 1 addition & 1 deletion scaleph-api/src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ spring:
driver-class-name: com.mysql.cj.jdbc.Driver
jdbc-url: jdbc:mysql://${MYSQL_HOST:127.0.0.1}:${MYSQL_PORT:3306}/scaleph?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useAffectedRows=true
username: ${MYSQL_USERNAME:root}
password: 123456
password: ${MYSQL_PASSWORD:123456}
sakura:
driver-class-name: com.mysql.cj.jdbc.Driver
jdbc-url: jdbc:mysql://${MYSQL_HOST:127.0.0.1}:${MYSQL_PORT:3306}/sakura?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useAffectedRows=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public boolean access(Supplier<Authentication> authentication, RequestAuthorizat
}

public boolean validate(String... privileges) {
return carpSecurityValidateService.validate(privileges);
return true;
// return carpSecurityValidateService.validate(privileges);
}
}
51 changes: 29 additions & 22 deletions scaleph-ui-react/config/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,31 +432,38 @@ export default [
routes: [
{
path: '/admin',
redirect: '/admin/dept',
redirect: '/admin/security/dept',
},
{
name: 'dept',
path: '/admin/dept',
name: 'security',
path: '/admin/security',
icon: 'apartment',
component: './Admin/Dept',
},
{
name: 'role',
path: '/admin/role',
icon: 'safety',
component: './Admin/Role',
},
{
name: 'user',
path: '/admin/user',
icon: 'user',
component: './Admin/User',
},
{
name: 'resource.web',
path: '/admin/resource/web',
icon: 'team',
component: './Admin/Resource/Web',
routes: [
{
name: 'dept',
path: '/admin/security/dept',
icon: 'apartment',
component: './Admin/Security/Dept',
},
{
name: 'role',
path: '/admin/security/role',
icon: 'safety',
component: './Admin/Security/Role',
},
{
name: 'user',
path: '/admin/security/user',
icon: 'user',
component: './Admin/Security/User',
},
{
name: 'resource.web',
path: '/admin/security/resource/web',
icon: 'team',
component: './Admin/Security/Resource/Web',
},
]
},
{
name: 'quartz',
Expand Down
6 changes: 3 additions & 3 deletions scaleph-ui-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
"not ie <= 10"
],
"dependencies": {
"@ant-design/icons": "^4.7.0",
"@ant-design/pro-components": "^2.7.10",
"@ant-design/icons": "^5.4.0",
"@ant-design/pro-components": "^2.7.14",
"@antv/xflow": "^2.0.4",
"@antv/xflow-diff": "^1.0.0",
"@antv/layout": "^0.3.2",
Expand All @@ -59,7 +59,7 @@
"@umijs/route-utils": "^2.1.3",
"ag-grid-community": "^29.2.0",
"ag-grid-react": "^29.2.0",
"antd": "^5.0.0",
"antd": "^5.20.0",
"classnames": "^2.3.2",
"highlight.js": "^10.7.3",
"lodash": "^4.17.21",
Expand Down
2 changes: 1 addition & 1 deletion scaleph-ui-react/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {errorConfig} from "./requestErrorConfig";
import {USER_AUTH} from "@/constants";
import Icon from './icon';
import {OnlineUserInfo, ResponseBody} from "@/typings";
import {UserService} from "@/services/admin/user.service";
import {UserService} from "@/services/admin/security/user.service";
import {AuthService} from "@/services/auth";
import {AuthenticationService} from "@/services/admin/security/authentication.service";

Expand Down
11 changes: 6 additions & 5 deletions scaleph-ui-react/src/locales/zh-CN/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,12 @@ export default {
'menu.stdata.refdataMap': '数据映射',

'menu.admin': '系统管理',
'menu.admin.dept': '部门管理',
'menu.admin.role': '角色管理',
'menu.admin.user': '用户管理',
'menu.admin.privilege': '权限管理',
'menu.admin.resource.web': 'Web 资源',
'menu.admin.security': '安全管理',
'menu.admin.security.dept': '部门管理',
'menu.admin.security.role': '角色管理',
'menu.admin.security.user': '用户管理',
'menu.admin.security.privilege': '权限管理',
'menu.admin.security.resource.web': 'Web 资源',
'menu.admin.quartz': '系统任务',
'menu.admin.dict': '数据字典',
'menu.admin.setting': '系统设置',
Expand Down
19 changes: 13 additions & 6 deletions scaleph-ui-react/src/locales/zh-CN/pages/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,17 @@ export default {
'pages.admin.user': '用户',
'pages.admin.user.type': '用户类型',
'pages.admin.user.userName': '用户名',
'pages.admin.user.password': '密码',
'pages.admin.user.nickName': '昵称',
'pages.admin.user.avatar': '头像',
'pages.admin.user.email': '邮箱',
'pages.admin.user.phone': '手机',
'pages.admin.user.gender': '性别',
'pages.admin.user.address': '地址',
'pages.admin.user.summary': '简介',
'pages.admin.user.status': '状态',
'pages.admin.user.order': '排序号',
'pages.admin.user.awaitGrant': '待授权',
'pages.admin.user.granted': '已授权',

'pages.admin.role': '角色管理',
'pages.admin.role': '角色',
'pages.admin.role.code': '角色编码',
'pages.admin.role.name': '角色名称',
'pages.admin.role.type': '角色类型',
Expand All @@ -30,9 +29,17 @@ export default {
'pages.admin.resource': '资源管理',
'pages.admin.resource.type': '资源类型',
'pages.admin.resource.web': 'Web 资源',
'pages.admin.resource.web.value': '标识',
'pages.admin.resource.web.label': '名称',
'pages.admin.resource.web.path': '路径',
'pages.admin.resource.web.order': '排序',
'pages.admin.resource.web.status': '状态',



'pages.admin.resource.web.name': '名称',
'pages.admin.resource.web.menuName': '目录',
'pages.admin.resource.web.path': '路径',

'pages.admin.resource.web.redirect': 'Redirect',
'pages.admin.resource.web.layout': 'Layout',
'pages.admin.resource.web.icon': 'Icon',
Expand All @@ -44,7 +51,7 @@ export default {
'pages.admin.resource.pid': '父级资源',
'pages.admin.resource.data': '数据资源',


'pages.admin.security.authorization.role2users': '角色分配用户',

'pages.admin.dept': '部门管理',
'pages.admin.dept.deptName': '名称',
Expand Down
2 changes: 2 additions & 0 deletions scaleph-ui-react/src/locales/zh-CN/pages/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export default {
'app.common.operate.label': '操作',
'app.common.operate.success': '操作成功',
'app.common.operate.new.label': '新增',

'app.common.operate.new.roles': '分配角色',
'app.common.operate.new.rolesUser': '角色分配用户',
'app.common.operate.new.rolesWeb': '角色配置web资源',
Expand All @@ -28,6 +29,7 @@ export default {
'app.common.operate.new.notAccreditUser': '未授权用户',
'app.common.operate.new.notAccreditRoles': '未授权角色',
'app.common.operate.new.assets': '权限配置',

'app.common.operate.new.success': '新增成功',
'app.common.operate.new.failure': '新增失败',
'app.common.operate.new.directive': '没有?去创建',
Expand Down
114 changes: 0 additions & 114 deletions scaleph-ui-react/src/pages/Admin/Dept/components/DeptForm.tsx

This file was deleted.

Loading

0 comments on commit 76e4de3

Please sign in to comment.