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
fadcbdbd
Unverified
Commit
fadcbdbd
authored
Jun 19, 2023
by
zhu-mingye
Committed by
GitHub
Jun 19, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Feature][resource]added resource layout (#2094)
parent
7950c5f9
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
303 additions
and
4 deletions
+303
-4
routes.ts
dinky-web/config/routes.ts
+6
-0
global.less
dinky-web/src/global.less
+1
-0
global.ts
dinky-web/src/locales/en-US/global.ts
+0
-2
menu.ts
dinky-web/src/locales/en-US/menu.ts
+1
-0
pages.ts
dinky-web/src/locales/en-US/pages.ts
+4
-0
global.ts
dinky-web/src/locales/zh-CN/global.ts
+0
-2
menu.ts
dinky-web/src/locales/zh-CN/menu.ts
+1
-0
pages.ts
dinky-web/src/locales/zh-CN/pages.ts
+6
-0
index.tsx
...rc/pages/RegCenter/Resource/components/FileShow/index.tsx
+58
-0
index.tsx
...rc/pages/RegCenter/Resource/components/FileTree/index.tsx
+69
-0
index.tsx
.../RegCenter/Resource/components/ResourceOverView/index.tsx
+129
-0
index.tsx
dinky-web/src/pages/RegCenter/Resource/index.tsx
+28
-0
No files found.
dinky-web/config/routes.ts
View file @
fadcbdbd
...
@@ -155,6 +155,12 @@ export default [
...
@@ -155,6 +155,12 @@ export default [
icon
:
'ToolOutlined'
,
icon
:
'ToolOutlined'
,
component
:
'./RegCenter/UDF'
,
component
:
'./RegCenter/UDF'
,
},
},
{
path
:
'/registration/resource'
,
name
:
'resource'
,
icon
:
'FileZipOutlined'
,
component
:
'./RegCenter/Resource'
,
},
],
],
},
},
{
{
...
...
dinky-web/src/global.less
View file @
fadcbdbd
...
@@ -284,6 +284,7 @@ ol {
...
@@ -284,6 +284,7 @@ ol {
*/
*/
.needWrap {
.needWrap {
white-space: pre-wrap;
white-space: pre-wrap;
align-content: center;
}
}
.query-form{
.query-form{
...
...
dinky-web/src/locales/en-US/global.ts
View file @
fadcbdbd
...
@@ -90,9 +90,7 @@ export default {
...
@@ -90,9 +90,7 @@ export default {
'tips.selected'
:
'Selected {total} Item'
,
'tips.selected'
:
'Selected {total} Item'
,
'tips.notSelected'
:
'Not Select'
,
'tips.notSelected'
:
'Not Select'
,
'tips.enter'
:
'Please Enter'
,
'tips.enter'
:
'Please Enter'
,
'tips.confirm.logout.session'
:
'Confirm logout session [{sessionName}] ?'
,
'tips.confirm.delete.table'
:
' Are you sure you want to delete table [{tableName}]?'
,
'tips.confirm.delete.table'
:
' Are you sure you want to delete table [{tableName}]?'
,
'tips.create.session.success'
:
'Create Session [{session}] success!'
,
'status.enabled'
:
'Enabled'
,
'status.enabled'
:
'Enabled'
,
'status.disabled'
:
'Disabled'
,
'status.disabled'
:
'Disabled'
,
...
...
dinky-web/src/locales/en-US/menu.ts
View file @
fadcbdbd
...
@@ -51,6 +51,7 @@ export default {
...
@@ -51,6 +51,7 @@ export default {
'menu.registration.fragment'
:
'Global Variable'
,
'menu.registration.fragment'
:
'Global Variable'
,
'menu.registration.gitprojects'
:
'Git Project(Beta)'
,
'menu.registration.gitprojects'
:
'Git Project(Beta)'
,
'menu.registration.udf'
:
'UDF Template'
,
'menu.registration.udf'
:
'UDF Template'
,
'menu.registration.resource'
:
'Resource'
,
'menu.auth'
:
'Auth Center'
,
'menu.auth'
:
'Auth Center'
,
'menu.auth.user'
:
'User'
,
'menu.auth.user'
:
'User'
,
'menu.auth.role'
:
'Role'
,
'menu.auth.role'
:
'Role'
,
...
...
dinky-web/src/locales/en-US/pages.ts
View file @
fadcbdbd
...
@@ -507,6 +507,10 @@ export default {
...
@@ -507,6 +507,10 @@ export default {
'rc.template.create'
:
'Create UDF Template'
,
'rc.template.create'
:
'Create UDF Template'
,
'rc.template.modify'
:
'Modify UDF Template'
,
'rc.template.modify'
:
'Modify UDF Template'
,
// resource
'rc.resource.click'
:
'Click left file to view details'
,
'rc.resource.noResource'
:
'
\
t
\
tNo resources
\
nPlease Click the button above to upload folders/files'
,
'rc.resource.upload'
:
'Upload Files/Folders'
,
//-------------------------------- setting center --------------------------------
//-------------------------------- setting center --------------------------------
//setting
//setting
...
...
dinky-web/src/locales/zh-CN/global.ts
View file @
fadcbdbd
...
@@ -91,9 +91,7 @@ export default {
...
@@ -91,9 +91,7 @@ export default {
'tips.selected'
:
'已选择 {total} 项'
,
'tips.selected'
:
'已选择 {total} 项'
,
'tips.notSelected'
:
'未选'
,
'tips.notSelected'
:
'未选'
,
'tips.enter'
:
'请输入'
,
'tips.enter'
:
'请输入'
,
'tips.confirm.logout.session'
:
'确认注销会话【{sessionName}】 吗?'
,
'tips.confirm.delete.table'
:
'确定删除表【{tableName}】吗?'
,
'tips.confirm.delete.table'
:
'确定删除表【{tableName}】吗?'
,
'tips.create.session.success'
:
'创建会话【{session}】成功!'
,
'status.enabled'
:
'启用'
,
'status.enabled'
:
'启用'
,
'status.disabled'
:
'禁用'
,
'status.disabled'
:
'禁用'
,
...
...
dinky-web/src/locales/zh-CN/menu.ts
View file @
fadcbdbd
...
@@ -51,6 +51,7 @@ export default {
...
@@ -51,6 +51,7 @@ export default {
'menu.registration.fragment'
:
'全局变量'
,
'menu.registration.fragment'
:
'全局变量'
,
'menu.registration.gitprojects'
:
'Git 项目(Beta)'
,
'menu.registration.gitprojects'
:
'Git 项目(Beta)'
,
'menu.registration.udf'
:
'UDF 模板'
,
'menu.registration.udf'
:
'UDF 模板'
,
'menu.registration.resource'
:
'资源'
,
'menu.auth'
:
'认证中心'
,
'menu.auth'
:
'认证中心'
,
'menu.auth.user'
:
'用户'
,
'menu.auth.user'
:
'用户'
,
'menu.auth.role'
:
'角色'
,
'menu.auth.role'
:
'角色'
,
...
...
dinky-web/src/locales/zh-CN/pages.ts
View file @
fadcbdbd
...
@@ -507,6 +507,12 @@ export default {
...
@@ -507,6 +507,12 @@ export default {
'rc.template.create'
:
'创建 UDF 模板'
,
'rc.template.create'
:
'创建 UDF 模板'
,
'rc.template.modify'
:
'修改 UDF 模板'
,
'rc.template.modify'
:
'修改 UDF 模板'
,
// resource
'rc.resource.click'
:
'点击左侧文件查看详情'
,
'rc.resource.noResource'
:
'
\
t
\
t暂无资源
\
n请点击上方按钮上传文件夹/文件'
,
'rc.resource.upload'
:
'上传文件夹/文件'
,
//-------------------------------- setting center --------------------------------
//-------------------------------- setting center --------------------------------
//setting
//setting
...
...
dinky-web/src/pages/RegCenter/Resource/components/FileShow/index.tsx
0 → 100644
View file @
fadcbdbd
/*
*
* 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.
*
*/
import
React
from
"react"
;
import
{
l
}
from
"@/utils/intl"
;
import
CodeShow
from
"@/components/CustomEditor/CodeShow"
;
import
{
Empty
}
from
"antd"
;
const
CodeEditProps
=
{
height
:
"82vh"
,
width
:
"100%"
,
lineNumbers
:
"on"
,
language
:
"java"
,
};
type
FileShowProps
=
{
code
:
string
;
refreshLogCallback
:
()
=>
void
;
}
const
FileShow
:
React
.
FC
<
FileShowProps
>
=
(
props
)
=>
{
const
{
code
,
refreshLogCallback
}
=
props
;
const
restLogsShowProps
=
{
showFloatButton
:
true
,
code
,
refreshLogCallback
,
};
return
<>
{
code
?
<
CodeShow
{
...
restLogsShowProps
}
{
...
CodeEditProps
}
/>
:
<
Empty
className=
{
"code-content-empty"
}
description=
{
l
(
'rc.resource.click'
)
}
/>
}
</>;
}
export
default
FileShow
;
\ No newline at end of file
dinky-web/src/pages/RegCenter/Resource/components/FileTree/index.tsx
0 → 100644
View file @
fadcbdbd
/*
*
* 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.
*
*/
import
React
from
"react"
;
import
{
buildTreeData
}
from
"@/utils/function"
;
import
{
Button
,
Tree
,
Typography
,
Upload
}
from
"antd"
;
import
{
UploadOutlined
}
from
"@ant-design/icons"
;
import
{
l
}
from
"@/utils/intl"
;
const
{
DirectoryTree
}
=
Tree
;
const
{
Text
}
=
Typography
;
type
FileTreeProps
=
{
treeData
:
Partial
<
any
>
[];
onNodeClick
:
(
info
:
any
)
=>
void
onRightClick
:
(
info
:
any
)
=>
void
}
const
FileTree
:
React
.
FC
<
FileTreeProps
>
=
(
props
)
=>
{
const
{
treeData
,
onNodeClick
,
onRightClick
}
=
props
;
return
<>
<
DirectoryTree
onSelect=
{
(
_
,
info
)
=>
onNodeClick
(
info
)
}
onRightClick=
{
info
=>
onRightClick
(
info
)
}
treeData=
{
buildTreeData
(
treeData
)
}
/>
{
(
treeData
.
length
>
0
)
?
<
DirectoryTree
onSelect=
{
(
_
,
info
)
=>
onNodeClick
(
info
)
}
treeData=
{
buildTreeData
(
treeData
)
}
/>
:
<>
<
div
style=
{
{
marginTop
:
'40vh'
,
marginLeft
:
'1vw'
}
}
>
<
Upload
action=
"https://www.mocky.io/v2/5cc8019d300000980a055e76"
directory
>
<
Button
icon=
{
<
UploadOutlined
/>
}
>
{
l
(
'rc.resource.upload'
)
}
</
Button
>
</
Upload
><
br
/>
</
div
>
<
Text
className=
{
'needWrap'
}
type=
"warning"
>
{
l
(
'rc.resource.noResource'
)
}
</
Text
>
</>
}
</>;
}
export
default
FileTree
;
\ No newline at end of file
dinky-web/src/pages/RegCenter/Resource/components/ResourceOverView/index.tsx
0 → 100644
View file @
fadcbdbd
/*
*
* 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.
*
*/
import
React
,
{
useState
}
from
"react"
;
import
{
ProCard
}
from
"@ant-design/pro-components"
;
import
FileTree
from
"@/pages/RegCenter/Resource/components/FileTree"
;
import
FileShow
from
"@/pages/RegCenter/Resource/components/FileShow"
;
import
{
Dropdown
,
Menu
}
from
"antd"
;
import
{
DeleteOutlined
,
UploadOutlined
}
from
"@ant-design/icons"
;
import
{
MenuInfo
}
from
"rc-menu/es/interface"
;
import
{
l
}
from
"@/utils/intl"
;
const
ResourceOverView
:
React
.
FC
=
()
=>
{
const
[
treeData
,
setTreeData
]
=
useState
<
Partial
<
any
>
[]
>
([]);
const
handleNodeClick
=
async
(
info
:
any
)
=>
{
const
{
node
:
{
path
,
isLeaf
}}
=
info
;
if
(
isLeaf
)
{
console
.
log
(
path
)
// setClickFileName(path);
// await queryLogContent(path);
}
};
const
[
rightClickedNode
,
setRightClickedNode
]
=
useState
(
null
);
const
handleRightClick
=
(
info
:
any
)
=>
{
// 阻止默认的右键菜单事件
info
.
event
.
preventDefault
();
// 获取右键点击的节点信息
const
{
node
}
=
info
;
setRightClickedNode
(
node
);
};
const
handleUpload
=
()
=>
{
if
(
rightClickedNode
)
{
// todo: upload
}
};
const
handleDelete
=
()
=>
{
if
(
rightClickedNode
)
{
// todo: delete
}
};
const
handleMenuClick
=
(
node
:
MenuInfo
)
=>
{
switch
(
node
.
key
)
{
case
'upload'
:
handleUpload
();
break
;
case
'delete'
:
handleDelete
();
break
;
default
:
break
;
}
};
const
contextMenuItems
=
[
{
key
:
'upload'
,
icon
:
<
UploadOutlined
/>,
label
:
l
(
'button.upload'
),
},
{
key
:
'delete'
,
icon
:
<
DeleteOutlined
/>,
label
:
l
(
'button.delete'
),
},
]
const
renderContextMenu
=
()
=>
{
return
(
<
Menu
disabledOverflow
onClick=
{
handleMenuClick
}
items=
{
contextMenuItems
}
/>
);
};
return
<>
<
ProCard
>
<
ProCard
hoverable
colSpan=
{
'18%'
}
className=
{
"schemaTree"
}
>
<
Dropdown
overlay=
{
renderContextMenu
}
>
<
FileTree
treeData=
{
treeData
}
onRightClick=
{
handleRightClick
}
onNodeClick=
{
(
info
:
any
)
=>
handleNodeClick
(
info
)
}
/>
</
Dropdown
>
</
ProCard
>
<
ProCard
.
Divider
type=
{
"vertical"
}
/>
<
ProCard
hoverable
className=
{
"schemaTree"
}
>
<
FileShow
code=
{
''
}
refreshLogCallback=
{
()
=>
{
}
}
/>
</
ProCard
>
</
ProCard
>
</>
}
export
default
ResourceOverView
;
dinky-web/src/pages/RegCenter/Resource/index.tsx
0 → 100644
View file @
fadcbdbd
/*
*
* 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.
*
*/
import
ResourceOverView
from
"@/pages/RegCenter/Resource/components/ResourceOverView"
;
export
default
()
=>
{
return
<>
<
ResourceOverView
/>
</>
}
\ No newline at end of file
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