Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
53fc3333
提交
53fc3333
authored
8月 19, 2021
作者:
taojinlong
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' of github.com:dataease/dataease into dev
上级
371750f7
154b4cea
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
81 行增加
和
4 行删除
+81
-4
LinkApi.java
...c/main/java/io/dataease/controller/panel/api/LinkApi.java
+5
-0
LinkServer.java
.../java/io/dataease/controller/panel/server/LinkServer.java
+7
-0
PanelLinkService.java
...main/java/io/dataease/service/panel/PanelLinkService.java
+28
-1
V24__new_demo_panel.sql
...d/src/main/resources/db/migration/V24__new_demo_panel.sql
+0
-0
index.js
frontend/src/api/link/index.js
+8
-0
en.js
frontend/src/lang/en.js
+2
-0
tw.js
frontend/src/lang/tw.js
+2
-0
zh.js
frontend/src/lang/zh.js
+2
-0
DatasetChartDetail.vue
frontend/src/views/dataset/common/DatasetChartDetail.vue
+8
-1
index.vue
frontend/src/views/link/generate/index.vue
+19
-2
没有找到文件。
backend/src/main/java/io/dataease/controller/panel/api/LinkApi.java
浏览文件 @
53fc3333
...
...
@@ -2,6 +2,7 @@ package io.dataease.controller.panel.api;
import
com.github.xiaoymin.knife4j.annotations.ApiSupport
;
import
io.dataease.controller.ResultHolder
;
import
io.dataease.controller.request.chart.ChartExtRequest
;
import
io.dataease.controller.request.panel.link.EnablePwdRequest
;
import
io.dataease.controller.request.panel.link.LinkRequest
;
...
...
@@ -51,4 +52,8 @@ public interface LinkApi {
@ApiOperation
(
"视图详息"
)
@PostMapping
(
"/viewDetail/{viewId}"
)
Object
viewDetail
(
@PathVariable
String
viewId
,
@RequestBody
ChartExtRequest
requestList
)
throws
Exception
;
@ApiOperation
(
"压缩链接"
)
@PostMapping
(
"/shortUrl"
)
ResultHolder
shortUrl
(
@RequestBody
Map
<
String
,
String
>
param
);
}
backend/src/main/java/io/dataease/controller/panel/server/LinkServer.java
浏览文件 @
53fc3333
...
...
@@ -3,6 +3,7 @@ package io.dataease.controller.panel.server;
import
com.google.gson.Gson
;
import
io.dataease.base.domain.PanelLink
;
import
io.dataease.controller.ResultHolder
;
import
io.dataease.controller.panel.api.LinkApi
;
import
io.dataease.controller.request.chart.ChartExtRequest
;
import
io.dataease.controller.request.panel.link.EnablePwdRequest
;
...
...
@@ -90,4 +91,10 @@ public class LinkServer implements LinkApi {
public
Object
viewDetail
(
String
viewId
,
ChartExtRequest
requestList
)
throws
Exception
{
return
chartViewService
.
getData
(
viewId
,
requestList
);
}
@Override
public
ResultHolder
shortUrl
(
Map
<
String
,
String
>
param
)
{
String
url
=
param
.
get
(
"url"
);
return
panelLinkService
.
getShortUrl
(
url
);
}
}
backend/src/main/java/io/dataease/service/panel/PanelLinkService.java
浏览文件 @
53fc3333
package
io
.
dataease
.
service
.
panel
;
import
cn.hutool.http.HttpUtil
;
import
com.google.gson.Gson
;
import
io.dataease.auth.config.RsaProperties
;
import
io.dataease.auth.util.JWTUtils
;
...
...
@@ -9,6 +10,7 @@ import io.dataease.base.domain.PanelLink;
import
io.dataease.base.mapper.PanelGroupMapper
;
import
io.dataease.base.mapper.PanelLinkMapper
;
import
io.dataease.commons.utils.ServletUtils
;
import
io.dataease.controller.ResultHolder
;
import
io.dataease.controller.request.panel.link.EnablePwdRequest
;
import
io.dataease.controller.request.panel.link.LinkRequest
;
import
io.dataease.controller.request.panel.link.PasswordRequest
;
...
...
@@ -28,9 +30,15 @@ public class PanelLinkService {
private
static
final
String
baseUrl
=
"/link.html?link="
;
@Value
(
"${public-link-salt:DataEaseLinkSalt}"
)
@Value
(
"${
dataease.
public-link-salt:DataEaseLinkSalt}"
)
private
String
salt
;
@Value
(
"${dataease.short-url-site:https://dh6.ink/}"
)
private
String
shortUrlSite
;
@Value
(
"${dataease.short-url-api:api/url/add}"
)
private
String
shortUrlApi
;
@Resource
private
PanelLinkMapper
mapper
;
...
...
@@ -156,4 +164,23 @@ public class PanelLinkService {
}
public
ResultHolder
getShortUrl
(
String
url
)
{
Gson
gson
=
new
Gson
();
Map
param
=
new
HashMap
<>();
param
.
put
(
"diy"
,
false
);
param
.
put
(
"link"
,
url
);
param
.
put
(
"sort"
,
""
);
String
post
=
HttpUtil
.
post
(
shortUrlSite
+
shortUrlApi
,
param
);
try
{
Map
map
=
gson
.
fromJson
(
post
,
Map
.
class
);
Map
data
=
(
Map
)
map
.
get
(
"data"
);
String
sort
=
shortUrlSite
+
data
.
get
(
"sort"
).
toString
();
ResultHolder
success
=
ResultHolder
.
success
(
sort
);
return
success
;
}
catch
(
Exception
e
)
{
ResultHolder
error
=
ResultHolder
.
error
(
e
.
getMessage
());
return
error
;
}
}
}
backend/src/main/resources/db/migration/V24__new_demo_panel.sql
0 → 100644
浏览文件 @
53fc3333
This source diff could not be displayed because it is too large. You can
view the blob
instead.
frontend/src/api/link/index.js
浏览文件 @
53fc3333
...
...
@@ -65,3 +65,11 @@ export function viewInfo(id, data) {
data
})
}
export
function
shortUrl
(
data
)
{
return
request
({
url
:
'api/link/shortUrl'
,
method
:
'post'
,
data
})
}
frontend/src/lang/en.js
浏览文件 @
53fc3333
...
...
@@ -1082,6 +1082,8 @@ export default {
drag_here
:
'Please drag the left field here'
,
copy_link_passwd
:
'Copy link and password'
,
copy_link
:
'Copy link'
,
copy_short_link
:
'Copy short link'
,
copy_short_link_passwd
:
'Copy short link and password'
,
passwd_protect
:
'Password Protect'
,
link
:
'Link'
,
link_share
:
'Share Link'
,
...
...
frontend/src/lang/tw.js
浏览文件 @
53fc3333
...
...
@@ -1081,6 +1081,8 @@ export default {
drag_here
:
'請將左側字段拖至此處'
,
copy_link_passwd
:
'複製鏈接及密碼'
,
copy_link
:
'複製鏈接'
,
copy_short_link
:
'複製短鏈接'
,
copy_short_link_passwd
:
'複製短鏈接及密碼'
,
passwd_protect
:
'密碼保護'
,
link
:
'鏈接'
,
link_share
:
'鏈接分享'
,
...
...
frontend/src/lang/zh.js
浏览文件 @
53fc3333
...
...
@@ -1083,6 +1083,8 @@ export default {
drag_here
:
'请将左侧字段拖至此处'
,
copy_link_passwd
:
'复制链接及密码'
,
copy_link
:
'复制链接'
,
copy_short_link
:
'复制短链接'
,
copy_short_link_passwd
:
'复制短链接及密码'
,
passwd_protect
:
'密码保护'
,
link
:
'链接'
,
link_share
:
'链接分享'
,
...
...
frontend/src/views/dataset/common/DatasetChartDetail.vue
浏览文件 @
53fc3333
...
...
@@ -40,6 +40,10 @@
<p
v-if=
"detail.table.type === 'excel'"
class=
"info-content"
>
{{
$t
(
'dataset.excel_data'
)
}}
</p>
<p
v-if=
"detail.table.type === 'custom'"
class=
"info-content"
>
{{
$t
(
'dataset.custom_data'
)
}}
</p>
</el-col>
<el-col
v-show=
"detail.table.type === 'db'"
class=
"info-item"
>
<p
class=
"info-title"
>
{{
$t
(
'dataset.table'
)
}}
</p>
<p
class=
"info-content"
>
{{
info
.
table
}}
</p>
</el-col>
<el-col
v-if=
"detail.table.type === 'db' || detail.table.type === 'sql'"
class=
"info-item"
>
<p
class=
"info-title"
>
{{
$t
(
'dataset.mode'
)
}}
</p>
<p
v-if=
"detail.table.mode === 0"
class=
"info-content"
>
{{
$t
(
'dataset.direct_connect'
)
}}
</p>
...
...
@@ -105,7 +109,8 @@ export default {
chart
:
{},
table
:
{},
datasource
:
{}
}
},
info
:
{}
}
},
watch
:
{
...
...
@@ -128,10 +133,12 @@ export default {
if
(
this
.
type
===
'dataset'
)
{
post
(
'/dataset/table/datasetDetail/'
+
this
.
data
.
id
,
null
).
then
(
res
=>
{
this
.
detail
=
res
.
data
this
.
info
=
JSON
.
parse
(
res
.
data
.
table
.
info
)
})
}
else
if
(
this
.
type
===
'chart'
)
{
post
(
'/chart/view/chartDetail/'
+
this
.
data
.
id
,
null
).
then
(
res
=>
{
this
.
detail
=
res
.
data
this
.
info
=
JSON
.
parse
(
res
.
data
.
table
.
info
)
})
}
}
...
...
frontend/src/views/link/generate/index.vue
浏览文件 @
53fc3333
...
...
@@ -32,6 +32,8 @@
<div
v-if=
"valid"
class=
"auth-root-class"
>
<span
slot=
"footer"
>
<el-button
v-if=
"newUrl && !form.enablePwd"
v-clipboard:copy=
"newUrl"
v-clipboard:success=
"onCopy"
v-clipboard:error=
"onError"
size=
"mini"
type=
"primary"
>
{{
$t
(
'panel.copy_short_link'
)
}}
</el-button>
<el-button
v-if=
"newUrl && form.enablePwd"
v-clipboard:copy=
"newUrl + ' Password: '+ form.pwd"
v-clipboard:success=
"onCopy"
v-clipboard:error=
"onError"
size=
"mini"
type=
"primary"
>
{{
$t
(
'panel.copy_short_link_passwd'
)
}}
</el-button>
<el-button
v-if=
"!form.enablePwd"
v-clipboard:copy=
"form.uri"
v-clipboard:success=
"onCopy"
v-clipboard:error=
"onError"
size=
"mini"
type=
"primary"
>
{{
$t
(
'panel.copy_link'
)
}}
</el-button>
<el-button
v-if=
"form.enablePwd"
v-clipboard:copy=
"form.uri + ' Password: '+ form.pwd"
v-clipboard:success=
"onCopy"
v-clipboard:error=
"onError"
size=
"mini"
type=
"primary"
>
{{
$t
(
'panel.copy_link_passwd'
)
}}
</el-button>
...
...
@@ -43,9 +45,8 @@
</
template
>
<
script
>
import
{
loadGenerate
,
setPwd
,
switchValid
,
switchEnablePwd
}
from
'@/api/link'
import
{
loadGenerate
,
setPwd
,
switchValid
,
switchEnablePwd
,
shortUrl
}
from
'@/api/link'
import
{
encrypt
,
decrypt
}
from
'@/utils/rsaEncrypt'
export
default
{
name
:
'LinkGenerate'
,
...
...
@@ -63,6 +64,7 @@ export default {
pwdNums
:
4
,
valid
:
false
,
form
:
{},
newUrl
:
null
,
defaultForm
:
{
enablePwd
:
false
,
pwd
:
null
,
uri
:
null
}
}
},
...
...
@@ -84,6 +86,7 @@ export default {
this
.
form
.
uri
=
uri
?
(
this
.
origin
+
uri
)
:
uri
// 返回的密码是共钥加密后的 所以展示需要私钥解密一波
pwd
&&
(
this
.
form
.
pwd
=
decrypt
(
pwd
))
this
.
requestShort
()
})
},
...
...
@@ -135,6 +138,20 @@ export default {
switchValid
(
param
).
then
(
res
=>
{
})
},
requestShort
()
{
const
url
=
this
.
form
.
uri
if
(
!
url
)
return
// if (this.origin.includes('localhost') || this.origin.includes('127.0.0.1')) {
// console.log('本地无法生成短链接')
// this.$warning('本地无法生成短链接')
// return
// }
shortUrl
({
url
}).
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
newUrl
=
res
.
data
}
})
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论