commit
8d3819f31e
@ -196,6 +196,11 @@ public class AuthServer implements AuthApi {
|
|||||||
}
|
}
|
||||||
if (user.getIsAdmin() && user.getPassword().equals("40b8893ea9ebc2d631c4bb42bb1e8996")) {
|
if (user.getIsAdmin() && user.getPassword().equals("40b8893ea9ebc2d631c4bb42bb1e8996")) {
|
||||||
result.put("passwordModified", false);
|
result.put("passwordModified", false);
|
||||||
|
result.put("defaultPwd", "dataease");
|
||||||
|
}
|
||||||
|
if (!user.getIsAdmin() && user.getPassword().equals("83d923c9f1d8fcaa46cae0ed2aaa81b5")) {
|
||||||
|
result.put("passwordModified", false);
|
||||||
|
result.put("defaultPwd", DEFAULT_PWD);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -17,6 +17,7 @@ public class ApiDefinition {
|
|||||||
private List<DatasetTableFieldDTO> fields;
|
private List<DatasetTableFieldDTO> fields;
|
||||||
private ApiDefinitionRequest request;
|
private ApiDefinitionRequest request;
|
||||||
private String dataPath;
|
private String dataPath;
|
||||||
|
private Integer queryTimeout;
|
||||||
private String status;
|
private String status;
|
||||||
private List<Map<String,String>> data = new ArrayList<>();
|
private List<Map<String,String>> data = new ArrayList<>();
|
||||||
private List<JSONObject> jsonFields = new ArrayList<>();
|
private List<JSONObject> jsonFields = new ArrayList<>();
|
||||||
|
|||||||
@ -58,7 +58,7 @@ public class SysPluginController {
|
|||||||
@RequiresPermissions("plugin:upload")
|
@RequiresPermissions("plugin:upload")
|
||||||
public Map<String, Object> update(@PathVariable("pluginId") Long pluginId, @RequestParam("file") MultipartFile file) throws Exception {
|
public Map<String, Object> update(@PathVariable("pluginId") Long pluginId, @RequestParam("file") MultipartFile file) throws Exception {
|
||||||
DeFileUtils.validateFile(file);
|
DeFileUtils.validateFile(file);
|
||||||
if (pluginService.uninstall(pluginId)) {
|
if (pluginService.uninstallForUpdate(pluginId, true)) {
|
||||||
return pluginService.localInstall(file);
|
return pluginService.localInstall(file);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@ -37,14 +37,10 @@ public class ApiProvider extends Provider {
|
|||||||
|
|
||||||
private static String path = "['%s']";
|
private static String path = "['%s']";
|
||||||
|
|
||||||
@Resource
|
|
||||||
private SystemParameterService systemParameterService;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String[]> getData(DatasourceRequest datasourceRequest) throws Exception {
|
public List<String[]> getData(DatasourceRequest datasourceRequest) throws Exception {
|
||||||
BasicInfo basicInfo = systemParameterService.basicInfo();
|
|
||||||
ApiDefinition apiDefinition = checkApiDefinition(datasourceRequest);
|
ApiDefinition apiDefinition = checkApiDefinition(datasourceRequest);
|
||||||
String response = execHttpRequest(apiDefinition, StringUtils.isNotBlank(basicInfo.getFrontTimeOut()) ? Integer.parseInt(basicInfo.getFrontTimeOut()) : 10);
|
String response = execHttpRequest(apiDefinition, apiDefinition.getQueryTimeout() == null || apiDefinition.getQueryTimeout()<=0 ? 30 : apiDefinition.getQueryTimeout());
|
||||||
return fetchResult(response, apiDefinition);
|
return fetchResult(response, apiDefinition);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,12 +64,11 @@ public class ApiProvider extends Provider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, List> fetchResultAndField(DatasourceRequest datasourceRequest) throws Exception {
|
public Map<String, List> fetchResultAndField(DatasourceRequest datasourceRequest) throws Exception {
|
||||||
BasicInfo basicInfo = systemParameterService.basicInfo();
|
|
||||||
Map<String, List> result = new HashMap<>();
|
Map<String, List> result = new HashMap<>();
|
||||||
List<String[]> dataList = new ArrayList<>();
|
List<String[]> dataList = new ArrayList<>();
|
||||||
List<TableField> fieldList = new ArrayList<>();
|
List<TableField> fieldList = new ArrayList<>();
|
||||||
ApiDefinition apiDefinition = checkApiDefinition(datasourceRequest);
|
ApiDefinition apiDefinition = checkApiDefinition(datasourceRequest);
|
||||||
String response = execHttpRequest(apiDefinition, StringUtils.isNotBlank(basicInfo.getFrontTimeOut()) ? Integer.parseInt(basicInfo.getFrontTimeOut()) : 10);
|
String response = execHttpRequest(apiDefinition, apiDefinition.getQueryTimeout() == null || apiDefinition.getQueryTimeout()<=0 ? 30 : apiDefinition.getQueryTimeout());
|
||||||
|
|
||||||
fieldList = getTableFields(apiDefinition);
|
fieldList = getTableFields(apiDefinition);
|
||||||
result.put("fieldList", fieldList);
|
result.put("fieldList", fieldList);
|
||||||
|
|||||||
@ -73,7 +73,7 @@ public class DorisDDLProvider extends DDLProviderImpl {
|
|||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
if(datasetTableField.getType().equalsIgnoreCase("DECIMAL") && datasetTableField.getAccuracy() != 0){
|
if(datasetTableField.getType().equalsIgnoreCase("DECIMAL") && datasetTableField.getAccuracy() != 0){
|
||||||
Column_Fields.append("DECIMAL(" + datasetTableField.getSize() + "," + datasetTableField.getAccuracy() + ")").append(",`");
|
Column_Fields.append("DecimalV3(" + datasetTableField.getSize() + "," + datasetTableField.getAccuracy() + ")").append(",`");
|
||||||
}else {
|
}else {
|
||||||
Column_Fields.append("DOUBLE").append(",`");
|
Column_Fields.append("DOUBLE").append(",`");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -221,6 +221,10 @@ public class PluginService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Boolean uninstall(Long pluginId) {
|
public Boolean uninstall(Long pluginId) {
|
||||||
|
return uninstallForUpdate(pluginId, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean uninstallForUpdate(Long pluginId, boolean forUpdate) {
|
||||||
MyPlugin myPlugin = myPluginMapper.selectByPrimaryKey(pluginId);
|
MyPlugin myPlugin = myPluginMapper.selectByPrimaryKey(pluginId);
|
||||||
if (ObjectUtils.isEmpty(myPlugin)) {
|
if (ObjectUtils.isEmpty(myPlugin)) {
|
||||||
String msg = "当前插件不存在";
|
String msg = "当前插件不存在";
|
||||||
@ -232,7 +236,7 @@ public class PluginService {
|
|||||||
CacheUtils.removeAll(AuthConstants.USER_ROLE_CACHE_NAME);
|
CacheUtils.removeAll(AuthConstants.USER_ROLE_CACHE_NAME);
|
||||||
CacheUtils.removeAll(AuthConstants.USER_PERMISSION_CACHE_NAME);
|
CacheUtils.removeAll(AuthConstants.USER_PERMISSION_CACHE_NAME);
|
||||||
|
|
||||||
if (myPlugin.getCategory().equalsIgnoreCase("datasource")) {
|
if (myPlugin.getCategory().equalsIgnoreCase("datasource") && !forUpdate) {
|
||||||
if (CollectionUtils.isNotEmpty(datasourceService.selectByType(myPlugin.getDsType()))) {
|
if (CollectionUtils.isNotEmpty(datasourceService.selectByType(myPlugin.getDsType()))) {
|
||||||
DEException.throwException(Translator.get("i18n_plugin_not_allow_delete"));
|
DEException.throwException(Translator.get("i18n_plugin_not_allow_delete"));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,7 +13,7 @@
|
|||||||
:title="$t('user.change_password')"
|
:title="$t('user.change_password')"
|
||||||
:show-close="false"
|
:show-close="false"
|
||||||
>
|
>
|
||||||
<PasswordUpdateForm old-pwd="dataease" />
|
<PasswordUpdateForm :old-pwd=defaultPwd />
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -28,7 +28,8 @@ export default {
|
|||||||
components: { PluginCom, PasswordUpdateForm },
|
components: { PluginCom, PasswordUpdateForm },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
showPasswordModifiedDialog: false
|
showPasswordModifiedDialog: false,
|
||||||
|
defaultPwd: 'dataease'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -46,6 +47,7 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
const passwordModified = JSON.parse(localStorage.getItem('passwordModified'))
|
const passwordModified = JSON.parse(localStorage.getItem('passwordModified'))
|
||||||
|
this.defaultPwd = localStorage.getItem('defaultPwd')
|
||||||
if (typeof passwordModified === 'boolean') {
|
if (typeof passwordModified === 'boolean') {
|
||||||
this.$store.commit('user/SET_PASSWORD_MODIFIED', passwordModified)
|
this.$store.commit('user/SET_PASSWORD_MODIFIED', passwordModified)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -86,6 +86,9 @@ const actions = {
|
|||||||
if (Object.prototype.hasOwnProperty.call(data, 'passwordModified')) {
|
if (Object.prototype.hasOwnProperty.call(data, 'passwordModified')) {
|
||||||
passwordModified = data.passwordModified
|
passwordModified = data.passwordModified
|
||||||
}
|
}
|
||||||
|
if (Object.prototype.hasOwnProperty.call(data, 'defaultPwd')) {
|
||||||
|
localStorage.setItem('defaultPwd', data.defaultPwd)
|
||||||
|
}
|
||||||
commit('SET_PASSWORD_MODIFIED', passwordModified)
|
commit('SET_PASSWORD_MODIFIED', passwordModified)
|
||||||
localStorage.setItem('passwordModified', passwordModified)
|
localStorage.setItem('passwordModified', passwordModified)
|
||||||
resolve()
|
resolve()
|
||||||
|
|||||||
@ -368,7 +368,7 @@ export default {
|
|||||||
this.showParams = true
|
this.showParams = true
|
||||||
this.isRangeParamWidget = this.widget.isRangeParamWidget && this.widget.isRangeParamWidget()
|
this.isRangeParamWidget = this.widget.isRangeParamWidget && this.widget.isRangeParamWidget()
|
||||||
}
|
}
|
||||||
if ('timeYearWidget,timeMonthWidget,timeDateWidget,textSelectWidget,numberSelectWidget'.indexOf(this.widget.name) !== -1) {
|
if ('textInputWidget,timeYearWidget,timeMonthWidget,timeDateWidget,textSelectWidget,numberSelectWidget'.indexOf(this.widget.name) !== -1) {
|
||||||
this.showParams = true
|
this.showParams = true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -525,6 +525,20 @@
|
|||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item
|
||||||
|
:label="$t('datasource.query_timeout')"
|
||||||
|
prop="apiQueryTimeout"
|
||||||
|
>
|
||||||
|
<el-input
|
||||||
|
v-model="apiItem.queryTimeout"
|
||||||
|
autocomplete="off"
|
||||||
|
type="number"
|
||||||
|
:min="0"
|
||||||
|
>
|
||||||
|
<template slot="append">{{ $t('panel.second') }}</template>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
<div v-loading="loading">
|
<div v-loading="loading">
|
||||||
<div class="row-rules mr40">
|
<div class="row-rules mr40">
|
||||||
<span>{{ $t('datasource.req_param') }}</span>
|
<span>{{ $t('datasource.req_param') }}</span>
|
||||||
@ -981,6 +995,13 @@ export default {
|
|||||||
trigger: 'blur'
|
trigger: 'blur'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
'apiQueryTimeout': [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: i18n.t('datasource.please_input_query_timeout'),
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
|
],
|
||||||
dataPath: [
|
dataPath: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
@ -1001,6 +1022,7 @@ export default {
|
|||||||
name: '',
|
name: '',
|
||||||
url: '',
|
url: '',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
|
queryTimeout: 30,
|
||||||
request: {
|
request: {
|
||||||
headers: [{}],
|
headers: [{}],
|
||||||
arguments: [],
|
arguments: [],
|
||||||
@ -1018,6 +1040,7 @@ export default {
|
|||||||
url: '',
|
url: '',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
dataPath: '',
|
dataPath: '',
|
||||||
|
queryTimeout: 30,
|
||||||
request: {
|
request: {
|
||||||
headers: [],
|
headers: [],
|
||||||
arguments: [],
|
arguments: [],
|
||||||
|
|||||||
@ -15,7 +15,7 @@ public enum DatasourceTypes {
|
|||||||
pg("pg", "PostgreSQL", "\"", "\"", "\"", "\"", "", true, DatasourceCalculationMode.DIRECT_AND_SYNC, null, null,true, DatabaseClassification.OLTP),
|
pg("pg", "PostgreSQL", "\"", "\"", "\"", "\"", "", true, DatasourceCalculationMode.DIRECT_AND_SYNC, null, null,true, DatabaseClassification.OLTP),
|
||||||
kingbase("kingbase", "KingBase", "\"", "\"", "\"", "\"", "", false, DatasourceCalculationMode.DIRECT, null,null,true, DatabaseClassification.OLTP),
|
kingbase("kingbase", "KingBase", "\"", "\"", "\"", "\"", "", false, DatasourceCalculationMode.DIRECT, null,null,true, DatabaseClassification.OLTP),
|
||||||
sqlServer("sqlServer", "SQL Server", "\"", "\"", "\"", "\"", "", true, DatasourceCalculationMode.DIRECT_AND_SYNC, null, null,true, DatabaseClassification.OLTP),
|
sqlServer("sqlServer", "SQL Server", "\"", "\"", "\"", "\"", "", true, DatasourceCalculationMode.DIRECT_AND_SYNC, null, null,true, DatabaseClassification.OLTP),
|
||||||
oracle("oracle", "Oracle", "\"", "\"", "\"", "\"", "", true, DatasourceCalculationMode.DIRECT_AND_SYNC, Arrays.asList("Default", "GBK", "BIG5", "ISO-8859-1", "UTF-8", "UTF-16", "CP850", "EUC_JP", "EUC_KR"), Arrays.asList("Default", "GBK", "UTF-8"),true, DatabaseClassification.OLTP),
|
oracle("oracle", "Oracle", "\"", "\"", "\"", "\"", "", true, DatasourceCalculationMode.DIRECT_AND_SYNC, Arrays.asList("Default", "GBK", "BIG5", "ISO-8859-1", "UTF-8", "UTF-16", "CP850", "EUC_JP", "EUC_KR", "US7ASCII", "AL32UTF8"), Arrays.asList("Default", "GBK", "UTF-8"),true, DatabaseClassification.OLTP),
|
||||||
mongo("mongo", "MongoDB", "`", "`", "\"", "\"", "rebuildschema=true&authSource=admin", true, DatasourceCalculationMode.DIRECT, null, null,true, DatabaseClassification.OLTP),
|
mongo("mongo", "MongoDB", "`", "`", "\"", "\"", "rebuildschema=true&authSource=admin", true, DatasourceCalculationMode.DIRECT, null, null,true, DatabaseClassification.OLTP),
|
||||||
ck("ck", "ClickHouse", "`", "`", "", "", "", true, DatasourceCalculationMode.DIRECT, null, null,true, DatabaseClassification.OLAP),
|
ck("ck", "ClickHouse", "`", "`", "", "", "", true, DatasourceCalculationMode.DIRECT, null, null,true, DatabaseClassification.OLAP),
|
||||||
db2("db2", "Db2", "\"", "\"", "\"", "\"", "", true, DatasourceCalculationMode.DIRECT_AND_SYNC, null, null,true, DatabaseClassification.OLTP),
|
db2("db2", "Db2", "\"", "\"", "\"", "\"", "", true, DatasourceCalculationMode.DIRECT_AND_SYNC, null, null,true, DatabaseClassification.OLTP),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user