Merge pull request #163 from getrebuild/shortkey-570

RB-570 short-key
This commit is contained in:
devezhao 2020-04-29 23:21:00 +08:00 committed by GitHub
commit 3ada6079a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 34 additions and 80 deletions

View file

@ -48,7 +48,7 @@ public class RadarChart extends ChartData {
indicator.add(JSONUtils.toJSONObject(
new String[] { "name", "max" },
new Object[] { item[0], calcMax(item) }));
new Object[] { wrapAxisValue(dim1, item[0]), calcMax(item) }));
for (int j = 0; j < nums.length; j++) {
Object[] data = seriesRotate.get(nums[j]);

View file

@ -1,19 +1,8 @@
/*
rebuild - Building your business-systems freely.
Copyright (C) 2018 devezhao <zhaofang123@gmail.com>
Copyright (c) REBUILD <https://getrebuild.com/> and its owners. All rights reserved.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
package com.rebuild.server.helper;

View file

@ -1,19 +1,8 @@
/*
rebuild - Building your business-systems freely.
Copyright (C) 2018-2019 devezhao <zhaofang123@gmail.com>
Copyright (c) REBUILD <https://getrebuild.com/> and its owners. All rights reserved.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
package com.rebuild.server.helper;
@ -87,7 +76,9 @@ public class KVStorage {
* @return
*/
protected static String getValue(final String key, boolean reload, Object defaultValue) {
String value = null;
if (Application.serversReady()) {
value = Application.getCommonCache().get(key);
if (value != null && !reload) {
@ -119,6 +110,7 @@ public class KVStorage {
Application.getCommonCache().put(key, value);
}
}
return value;
}
}

View file

@ -1,19 +1,8 @@
/*
rebuild - Building your business-systems freely.
Copyright (C) 2018 devezhao <zhaofang123@gmail.com>
Copyright (c) REBUILD <https://getrebuild.com/> and its owners. All rights reserved.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
package com.rebuild.utils;
@ -86,7 +75,7 @@ public class AES {
try {
return decrypt(input);
} catch (RebuildException ex) {
Application.LOG.warn("Decrypt error : " + input);
LOG.warn("Decrypting error (Use blank input) : " + input);
return StringUtils.EMPTY;
}
}
@ -110,20 +99,7 @@ public class AES {
}
return new String(output);
}
/**
* @param input
* @return
*/
public static String decryptNothrow(String input) {
try {
return decrypt(input);
} catch (RebuildException ex) {
LOG.warn("Decrypting error (Use blank input) : " + input);
return StringUtils.EMPTY;
}
}
/**
* 通过 `-Drbpass=KEY` 指定 AES 秘钥
*

View file

@ -235,7 +235,7 @@
<label class="col-md-12 col-xl-3 col-lg-4 col-form-label text-lg-right">分类数据</label>
<div class="col-md-12 col-xl-6 col-lg-8">
<div class="form-control-plaintext" id="useClassification">
<a title="查看/编辑分类数据" target="_blank" href="${baseUrl}/admin/entityhub/classifications">加载中</a>
<a title="查看/编辑分类数据" href="${baseUrl}/admin/entityhub/classifications">加载中</a>
<i class="zmdi zmdi-layers fs-14 ml-1 text-muted"></i>
</div>
</div>

View file

@ -16,7 +16,7 @@ class BaseChart extends React.Component {
render() {
const opers = (
<div className="chart-oper">
{!this.props.builtin && <a title="查看来源数据" target="_blank" href={`${rb.baseUrl}/dashboard/view-chart-sources?id=${this.props.id}`}><i className="zmdi zmdi-rss" /></a>}
{!this.props.builtin && <a title="查看来源数据" href={`${rb.baseUrl}/dashboard/view-chart-sources?id=${this.props.id}`}><i className="zmdi zmdi-rss" /></a>}
<a onClick={() => this.loadChartData()}><i className="zmdi zmdi-refresh" /></a>
{this.props.editable && (
<React.Fragment>
@ -560,7 +560,7 @@ class ApprovalList extends BaseChart {
<span className="cell-detail-description">{item[2]}</span>
</td>
<td className="cell-detail">
<a href={`${rb.baseUrl}/app/list-and-view?id=${item[3]}`} target="_blank">{item[4]}</a>
<a href={`${rb.baseUrl}/app/list-and-view?id=${item[3]}`}>{item[4]}</a>
<span className="cell-detail-description">{item[6]}</span>
</td>
<td className="actions text-right">
@ -643,7 +643,7 @@ class FeedsSchedule extends BaseChart {
return <tr key={'schedule-' + idx}>
<td>
<a title="查看详情" href={`${rb.baseUrl}/app/list-and-view?id=${item.id}`} target="_blank" className="content" dangerouslySetInnerHTML={{ __html: item.content }} />
<a title="查看详情" href={`${rb.baseUrl}/app/list-and-view?id=${item.id}`} className="content" dangerouslySetInnerHTML={{ __html: item.content }} />
</td>
<td className="cell-detail">
<div>{item.scheduleTime}</div>

View file

@ -414,7 +414,7 @@ function __renderRichContent(e) {
}
{e.relatedRecord && <div>
<span><i className={`icon zmdi zmdi-${e.relatedRecord.icon}`} /> {e.relatedRecord.entityLabel} : </span>
<a target="_blank" href={`${rb.baseUrl}/app/list-and-view?id=${e.relatedRecord.id}`} title="查看相关记录">{e.relatedRecord.text}</a>
<a href={`${rb.baseUrl}/app/list-and-view?id=${e.relatedRecord.id}`} title="查看相关记录">{e.relatedRecord.text}</a>
</div>
}
{e.type === 3 && <div>

View file

@ -58,7 +58,7 @@ class FilesList extends React.Component {
renderExtras(item) {
return <React.Fragment >
<span>{item.fileSize}</span>
{item.relatedRecord && <span><a target="_blank" title="点击查看相关记录" onClick={(e) => $stopEvent(e)} href={`${rb.baseUrl}/app/list-and-view?id=${item.relatedRecord[0]}`}>{item.relatedRecord[1]}</a></span>}
{item.relatedRecord && <span><a title="点击查看相关记录" onClick={(e) => $stopEvent(e)} href={`${rb.baseUrl}/app/list-and-view?id=${item.relatedRecord[0]}`}>{item.relatedRecord[1]}</a></span>}
</React.Fragment>
}

View file

@ -41,9 +41,13 @@ class MessageList extends React.Component {
{(this.state.page > 1 || msglist.length >= this.state.pageSize) &&
<div className="notification-page">
<ul className="pagination pagination-rounded mb-0">
<li className={`page-item ${this.state.page < 2 ? 'disabled' : ''}`}><a onClick={() => this.gotoPage(-1)} className="page-link"><i className="icon zmdi zmdi-chevron-left" /></a></li>
<li className={`page-item ${this.state.page < 2 ? 'disabled' : ''}`}>
<a onClick={() => this.gotoPage(-1)} className="page-link"><i className="icon zmdi zmdi-chevron-left" /></a>
</li>
<li className="page-no"><span>{this.state.page}</span></li>
<li className={`page-item ${msglist.length < this.state.pageSize ? 'disabled' : ''}`}><a onClick={() => this.gotoPage(1)} className="page-link"><i className="icon zmdi zmdi-chevron-right" /></a></li>
<li className={`page-item ${msglist.length < this.state.pageSize ? 'disabled' : ''}`}>
<a onClick={() => this.gotoPage(1)} className="page-link"><i className="icon zmdi zmdi-chevron-right" /></a>
</li>
</ul>
</div>}
</div>
@ -63,7 +67,8 @@ class MessageList extends React.Component {
<div className="text" dangerouslySetInnerHTML={{ __html: item[1] }}></div>
<div className="date">{item[2]}</div>
</div>
{append && <a title="查看相关记录" target="_blank" className="badge link" href={`${rb.baseUrl}/app/list-and-view?id=${item[5]}`}>查看</a>}
{append
&& <a title="查看相关记录" className="badge link" href={`${rb.baseUrl}/app/list-and-view?id=${item[5]}`}>查看</a>}
</span>
</li>
}
@ -79,22 +84,14 @@ class MessageList extends React.Component {
type: type || this.state.type
}, () => {
$.get(`/notification/messages?type=${this.state.type}&pageNo=${this.state.page}`, (res) => {
this.setState({ list: res.data || [] }, this.__loadAfter)
this.setState({ list: res.data || [] }, () => {
if (focusItem) setTimeout(() => $gotoSection($('.notification.focus').offset().top - 66), 200)
focusItem = null
})
})
})
}
__loadAfter = () => {
$(this._list).find('.notification-info a')
.attr('target', '_blank')
.addClass('link')
.click('click', (e) => {
if (e && e.stopPropagation) e.stopPropagation()
})
setTimeout(() => $gotoSection(), 200)
focusItem = null
}
gotoPage(p) {
if (p === -1 && this.state.page === 1) return
if (p === 1 && (this.state.list || []).length < this.state.pageSize) return
@ -127,7 +124,7 @@ class ApprovalList extends MessageList {
page: page || this.state.page
}, () => {
$.get(`/notification/approvals?pageNo=${this.state.page || 1}`, (res) => {
this.setState({ list: res.data || [] }, this.__loadAfter)
this.setState({ list: res.data || [] })
})
})
}