Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dinky
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangpeng
dinky
Commits
81689c18
Unverified
Commit
81689c18
authored
Feb 27, 2024
by
Zzm0809
Committed by
GitHub
Feb 27, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Featue] support resource file copy path (#3188)
Co-authored-by:
Zzm0809
<
Zzm0809@users.noreply.github.com
>
parent
4ffb9336
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
43 additions
and
26 deletions
+43
-26
db-h2-ddl.sql
dinky-admin/src/main/resources/db/db-h2-ddl.sql
+1
-1
pages.ts
dinky-web/src/locales/en-US/pages.ts
+2
-0
pages.ts
dinky-web/src/locales/zh-CN/pages.ts
+1
-0
function.tsx
...pages/RegCenter/Resource/components/FileTree/function.tsx
+21
-7
index.tsx
...rc/pages/RegCenter/Resource/components/FileTree/index.tsx
+1
-1
index.tsx
.../RegCenter/Resource/components/ResourceOverView/index.tsx
+4
-4
dinky-mysql.sql
script/sql/dinky-mysql.sql
+12
-12
dinky-pg.sql
script/sql/dinky-pg.sql
+1
-1
dinky_ddl.sql
script/sql/upgrade/1.0.0_schema/mysql/dinky_ddl.sql
+0
-0
No files found.
dinky-admin/src/main/resources/db/db-h2-ddl.sql
View file @
81689c18
...
...
@@ -469,7 +469,7 @@ CREATE TABLE `dinky_resources` (
`type`
tinyint
(
4
)
DEFAULT
null
COMMENT
'resource type,0:FILE,1:UDF'
,
`size`
bigint
(
20
)
DEFAULT
null
COMMENT
'resource size'
,
`pid`
int
(
11
)
DEFAULT
null
,
`full_name`
varchar
(
128
)
DEFAULT
null
,
`full_name`
text
DEFAULT
null
,
`is_directory`
tinyint
(
4
)
DEFAULT
null
,
`create_time`
datetime
NOT
null
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'create time'
,
`update_time`
datetime
NOT
null
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'update time'
,
...
...
dinky-web/src/locales/en-US/pages.ts
View file @
81689c18
...
...
@@ -975,6 +975,8 @@ export default {
'Support for a single or bulk upload. Strictly prohibited from uploading company data or
\
n other banned files.'
,
'rc.resource.filelist'
:
'File list'
,
'rc.resource.sync'
:
'Sync remote files'
,
'rc.resource.copy'
:
'Copy as: {fillValue}'
,
'rc.template.codeType'
:
'Code Type'
,
'rc.template.codeTypePlaceholder'
:
'Please select code type! '
,
'rc.template.create'
:
'Create UDF Template'
,
...
...
dinky-web/src/locales/zh-CN/pages.ts
View file @
81689c18
...
...
@@ -934,6 +934,7 @@ export default {
'rc.resource.upload.tip2'
:
'支持单个或批量上传。严禁上传公司数据或其他禁止上传的文件。'
,
'rc.resource.filelist'
:
'文件列表'
,
'rc.resource.sync'
:
'同步目录结构'
,
'rc.resource.copy'
:
'复制为: {fillValue}'
,
'rc.template.codeType'
:
'代码类型'
,
'rc.template.codeTypePlaceholder'
:
'请选择代码类型!'
,
...
...
dinky-web/src/pages/RegCenter/Resource/components/FileTree/function.tsx
View file @
81689c18
...
...
@@ -21,11 +21,22 @@ import { TagAlignCenter } from '@/components/StyledComponents';
import
{
ResourceInfo
}
from
'@/types/RegCenter/data'
;
import
{
parseByteStr
,
renderIcon
}
from
'@/utils/function'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
Typography
}
from
'antd'
;
const
buildTitleLabel
=
(
showCopy
=
false
,
item
:
ResourceInfo
)
=>
{
const
fillValue
=
`ADD FILE 'rs:
${
item
.
fullName
}
';`
;
const
buildTitleLabel
=
(
item
:
ResourceInfo
)
=>
{
return
(
<>
{
item
.
fileName
}
{
!
item
.
isDirectory
&&
showCopy
?
(
<
Typography
.
Text
copyable=
{
{
text
:
fillValue
,
tooltips
:
l
(
'rc.resource.copy'
,
''
,
{
fillValue
})
}
}
>
{
item
.
fileName
}
</
Typography
.
Text
>
)
:
(
item
.
fileName
)
}
{
!
item
.
isDirectory
&&
(
<
span
style=
{
{
color
:
'gray'
}
}
>
{
' '
}
...
...
@@ -79,9 +90,10 @@ function filterEmpty(
}
export
const
buildResourceTreeData
=
(
data
:
ResourceInfo
[],
data
:
ResourceInfo
[]
=
[]
,
isFilterEmptyChildren
=
false
,
filterSuffixList
:
string
[]
=
[]
filterSuffixList
:
string
[]
=
[],
showCopy
:
boolean
=
false
):
any
=>
data
.
filter
((
item
:
ResourceInfo
)
=>
filterEmpty
(
isFilterEmptyChildren
,
item
,
filterSuffixList
))
...
...
@@ -90,13 +102,15 @@ export const buildResourceTreeData = (
isLeaf
:
!
item
.
isDirectory
,
name
:
item
.
fileName
,
parentId
:
item
.
pid
,
label
:
item
.
f
ullName
+
'/'
+
item
.
f
ileName
,
label
:
item
.
fileName
,
icon
:
<
TagAlignCenter
>
{
renderIcon
(
item
.
fileName
,
'.'
,
item
.
isDirectory
)
}
</
TagAlignCenter
>,
path
:
item
.
fullName
,
title
:
buildTitleLabel
(
item
),
title
:
buildTitleLabel
(
showCopy
,
item
),
fullInfo
:
item
,
key
:
item
.
id
,
id
:
item
.
id
,
children
:
item
.
children
&&
buildResourceTreeData
(
item
.
children
,
isFilterEmptyChildren
)
children
:
item
.
children
&&
buildResourceTreeData
(
item
.
children
,
isFilterEmptyChildren
,
filterSuffixList
,
showCopy
)
};
});
dinky-web/src/pages/RegCenter/Resource/components/FileTree/index.tsx
View file @
81689c18
...
...
@@ -50,7 +50,7 @@ const FileTree: React.FC<FileTreeProps> = (props) => {
selectedKeys=
{
selectedKeys
}
onSelect=
{
(
_
,
info
)
=>
onNodeClick
(
info
)
}
onRightClick=
{
(
info
)
=>
onRightClick
(
info
)
}
treeData=
{
buildResourceTreeData
(
treeData
)
}
treeData=
{
buildResourceTreeData
(
treeData
,
false
,
[],
true
)
}
/>
)
:
(
<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
/>
...
...
dinky-web/src/pages/RegCenter/Resource/components/ResourceOverView/index.tsx
View file @
81689c18
...
...
@@ -248,15 +248,15 @@ const ResourceOverView: React.FC = () => {
<
ProCard
ghost
size=
{
'small'
}
bodyStyle=
{
{
height
:
parent
.
innerHeight
-
80
}
}
>
<
SplitPane
split=
{
'vertical'
}
defaultSizes=
{
[
15
0
,
500
]
}
minSize=
{
15
0
}
defaultSizes=
{
[
20
0
,
500
]
}
minSize=
{
20
0
}
className=
{
'split-pane'
}
>
<
Pane
className=
{
'split-pane'
}
forwardRef=
{
refObject
}
minSize=
{
1
00
}
size=
{
1
00
}
minSize=
{
2
00
}
size=
{
2
00
}
split=
{
'horizontal'
}
>
<
ProCard
...
...
script/sql/dinky-mysql.sql
View file @
81689c18
...
...
@@ -1651,7 +1651,7 @@ CREATE TABLE `dinky_git_project` (
`operator`
int
(
11
)
DEFAULT
NULL
COMMENT
'operator'
,
PRIMARY
KEY
(
`id`
)
USING
BTREE
,
KEY
`tenant_id`
(
`tenant_id`
)
USING
BTREE
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
3
DEFAULT
CHARSET
=
utf8mb4
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
3
DEFAULT
CHARSET
=
utf8mb4
COLLATE
=
utf8mb4_general_ci
COMMENT
=
'git project'
ROW_FORMAT
=
DYNAMIC
;
-- ----------------------------
-- Records of dinky_git_project
...
...
@@ -1678,7 +1678,7 @@ CREATE TABLE `dinky_metrics` (
`create_time`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'create time'
,
`update_time`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'update time'
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'metrics layout'
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1
DEFAULT
CHARSET
=
utf8mb4
CO
LLATE
=
utf8mb4_general_ci
CO
MMENT
=
'metrics layout'
;
-- ----------------------------
-- Table structure for dinky_resources
...
...
@@ -1686,13 +1686,13 @@ CREATE TABLE `dinky_metrics` (
DROP
TABLE
IF
EXISTS
dinky_resources
;
CREATE
TABLE
`dinky_resources`
(
`id`
int
(
11
)
NOT
NULL
AUTO_INCREMENT
COMMENT
'key'
,
`file_name`
varchar
(
64
)
COLLATE
utf8
_bin
DEFAULT
NULL
COMMENT
'file name'
,
`description`
varchar
(
255
)
COLLATE
utf8
_bin
DEFAULT
NULL
,
`file_name`
varchar
(
64
)
COLLATE
utf8
mb4_general_ci
DEFAULT
NULL
COMMENT
'file name'
,
`description`
varchar
(
255
)
COLLATE
utf8
mb4_general_ci
DEFAULT
NULL
,
`user_id`
int
(
11
)
DEFAULT
NULL
COMMENT
'user id'
,
`type`
tinyint
(
4
)
DEFAULT
NULL
COMMENT
'resource type,0:FILE,1:UDF'
,
`size`
bigint
(
20
)
DEFAULT
NULL
COMMENT
'resource size'
,
`pid`
int
(
11
)
DEFAULT
NULL
,
`full_name`
varchar
(
128
)
COLLATE
utf8_bin
DEFAULT
NULL
,
`full_name`
text
COLLATE
utf8mb4_general_ci
DEFAULT
NULL
,
`is_directory`
tinyint
(
4
)
DEFAULT
NULL
,
`create_time`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'create time'
,
`update_time`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'update time'
,
...
...
@@ -1700,7 +1700,7 @@ CREATE TABLE `dinky_resources` (
`updater`
int
(
11
)
DEFAULT
NULL
COMMENT
'updater'
,
PRIMARY
KEY
(
`id`
),
UNIQUE
KEY
`dinky_resources_un`
(
`full_name`
,
`type`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1
DEFAULT
CHARSET
=
utf8
COLLATE
=
utf8_bin
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1
DEFAULT
CHARSET
=
utf8
mb4
COLLATE
=
utf8mb4_general_ci
;
-- ----------------------------
-- Records of dinky_resources
-- ----------------------------
...
...
@@ -1770,7 +1770,7 @@ create table `dinky_sys_menu` (
`update_time`
datetime
not
null
default
current_timestamp
on
update
current_timestamp
comment
'modify time'
,
`note`
varchar
(
255
)
COLLATE
utf8mb4_general_ci
DEFAULT
NULL
,
primary
key
(
`id`
)
using
btree
)
engine
=
innodb
auto_increment
=
1
default
charset
=
utf8mb4
collate
=
utf8mb4_general_ci
;
)
engine
=
innodb
auto_increment
=
1
default
charset
=
utf8mb4
collate
=
utf8mb4_general_ci
comment
=
'system menu'
row_format
=
dynamic
;
-- ----------------------------
-- Records of dinky_sys_menu
...
...
@@ -1942,7 +1942,7 @@ CREATE TABLE `dinky_sys_role_menu` (
`update_time`
datetime
not
null
default
current_timestamp
on
update
current_timestamp
comment
'modify time'
,
PRIMARY
KEY
(
`id`
)
USING
BTREE
,
UNIQUE
KEY
`un_role_menu_inx`
(
`role_id`
,
`menu_id`
)
USING
BTREE
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1
DEFAULT
CHARSET
=
utf8mb4
COLLATE
=
utf8mb4_general_ci
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1
DEFAULT
CHARSET
=
utf8mb4
COLLATE
=
utf8mb4_general_ci
ROW_FORMAT
=
DYNAMIC
COMMENT
=
'role menu'
;
-- ----------------------------
-- Table structure dinky_sys_alert
...
...
@@ -1958,7 +1958,7 @@ CREATE TABLE `dinky_alert_template` (
`creator`
int
(
11
)
DEFAULT
NULL
COMMENT
'create user id'
,
`updater`
int
(
11
)
DEFAULT
NULL
COMMENT
'update user id'
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1
DEFAULT
CHARSET
=
utf8mb4
COLLATE
=
utf8mb4_general_ci
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1
DEFAULT
CHARSET
=
utf8mb4
COLLATE
=
utf8mb4_general_ci
ROW_FORMAT
=
DYNAMIC
COMMENT
=
'alert template'
;
...
...
@@ -1978,7 +1978,7 @@ CREATE TABLE `dinky_alert_rules` (
`updater`
int
(
11
)
DEFAULT
NULL
COMMENT
'update user id'
,
PRIMARY
KEY
(
`id`
),
UNIQUE
KEY
`name`
(
`name`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1
DEFAULT
CHARSET
=
utf8mb4
COLLATE
=
utf8mb4_general_ci
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1
DEFAULT
CHARSET
=
utf8mb4
COLLATE
=
utf8mb4_general_ci
ROW_FORMAT
=
DYNAMIC
COMMENT
=
'alert rule'
;
...
...
@@ -2020,7 +2020,7 @@ CREATE TABLE `dinky_udf_manage` (
`updater`
int
(
11
)
DEFAULT
NULL
COMMENT
'update user id'
,
PRIMARY
KEY
(
`id`
)
USING
BTREE
,
KEY
`name,resources_id`
(
`name`
,
`resources_id`
)
USING
BTREE
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
3
DEFAULT
CHARSET
=
utf8mb4
ROW_FORMAT
=
DYNAMIC
COMMENT
=
'udf'
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
3
DEFAULT
CHARSET
=
utf8mb4
COLLATE
=
utf8mb4_general_ci
ROW_FORMAT
=
DYNAMIC
COMMENT
=
'udf'
;
-- ----------------------------
-- Table structure dinky_sys_token
...
...
@@ -2043,6 +2043,6 @@ CREATE TABLE `dinky_sys_token` (
PRIMARY
KEY
(
`id`
),
UNIQUE
KEY
`token_value`
(
`token_value`
)
USING
BTREE
,
KEY
`source`
(
`source`
)
USING
HASH
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
22
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'token management'
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1
DEFAULT
CHARSET
=
utf8mb4
ROW_FORMAT
=
DYNAMIC
collate
=
utf8mb4_general_ci
COMMENT
=
'token management'
;
SET
FOREIGN_KEY_CHECKS
=
1
;
script/sql/dinky-pg.sql
View file @
81689c18
...
...
@@ -3418,7 +3418,7 @@ CREATE TABLE "public"."dinky_resources"
"type"
int2
,
"size"
int8
,
"pid"
int4
,
"full_name"
varchar
(
128
)
COLLATE
"pg_catalog"
.
"default"
,
"full_name"
text
COLLATE
"pg_catalog"
.
"default"
,
"is_directory"
int2
,
"create_time"
timestamp
(
6
)
NOT
null
,
"update_time"
timestamp
(
6
)
NOT
null
,
...
...
script/sql/upgrade/1.0.0_schema/mysql/dinky_ddl.sql
View file @
81689c18
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment