Merge pull request #12587 from dataease/dev

merge v1.18.25
This commit is contained in:
fit2cloudrd 2024-10-09 14:35:46 +08:00 committed by GitHub
commit 3243b41855
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 45 additions and 9 deletions

View File

@ -21,4 +21,6 @@ public class DatasetTaskGridRequest extends KeywordRequest {
private String id; private String id;
private Long userId; private Long userId;
private String datasetId;
} }

View File

@ -5,12 +5,18 @@ import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import java.net.URLDecoder;
import java.util.Arrays;
import java.util.List;
@Getter @Getter
@Setter @Setter
public class PgConfiguration extends JdbcConfiguration { public class PgConfiguration extends JdbcConfiguration {
private String driver = "org.postgresql.Driver"; private String driver = "org.postgresql.Driver";
private String extraParams = ""; private String extraParams = "";
private List<String> illegalParameters = Arrays.asList("socketFactory", "socketFactoryArg", "sslfactory", "sslfactoryarg", "loggerLevel", "loggerFile", "allowUrlInLocalInfile", "allowLoadLocalInfileInPath");
public String getJdbc() { public String getJdbc() {
if (StringUtils.isEmpty(extraParams.trim())) { if (StringUtils.isEmpty(extraParams.trim())) {
@ -27,6 +33,11 @@ public class PgConfiguration extends JdbcConfiguration {
.replace("SCHEMA", getSchema().trim()); .replace("SCHEMA", getSchema().trim());
} }
} else { } else {
for (String illegalParameter : illegalParameters) {
if (getExtraParams().toLowerCase().contains(illegalParameter.toLowerCase()) || URLDecoder.decode(getExtraParams()).contains(illegalParameter.toLowerCase())) {
throw new RuntimeException("Illegal parameter: " + illegalParameter);
}
}
return "jdbc:postgresql://HOSTNAME:PORT/DATABASE?EXTRA_PARAMS" return "jdbc:postgresql://HOSTNAME:PORT/DATABASE?EXTRA_PARAMS"
.replace("HOSTNAME", getHost().trim()) .replace("HOSTNAME", getHost().trim())
.replace("PORT", getPort().toString().trim()) .replace("PORT", getPort().toString().trim())

View File

@ -23,6 +23,8 @@ public interface ExtDataSetTaskMapper {
List<DataSetTaskDTO> userTaskList(DatasetTaskGridRequest request); List<DataSetTaskDTO> userTaskList(DatasetTaskGridRequest request);
String datasetPrivileges(DatasetTaskGridRequest request);
List<DataSetTaskDTO> taskWithTriggers(DatasetTaskGridRequest request); List<DataSetTaskDTO> taskWithTriggers(DatasetTaskGridRequest request);
List<DataSetTaskDTO> findByPanelId(@Param("panelId") String panelId); List<DataSetTaskDTO> findByPanelId(@Param("panelId") String panelId);

View File

@ -136,9 +136,12 @@
</select> </select>
<select id="datasetPrivileges" resultType="String" parameterType="io.dataease.controller.dataset.request.DatasetTaskGridRequest">
SELECT get_auths(#{datasetId}, 'dataset', #{userId})
</select>
<select id="userTaskList" resultMap="TaskResult" parameterType="io.dataease.controller.dataset.request.DatasetTaskGridRequest"> <select id="userTaskList" resultMap="TaskResult" parameterType="io.dataease.controller.dataset.request.DatasetTaskGridRequest">
SELECT dataset_table.name as table_name, get_auths(dataset_table_task.table_id,'dataset', #{userId}) as SELECT dataset_table.name as table_name,dataset_table_task.* , qrtz_triggers.NEXT_FIRE_TIME
`privileges`,dataset_table_task.* , qrtz_triggers.NEXT_FIRE_TIME
FROM dataset_table_task FROM dataset_table_task
left join dataset_table on dataset_table.id=dataset_table_task.table_id left join dataset_table on dataset_table.id=dataset_table_task.table_id
left join qrtz_triggers on dataset_table_task.id=qrtz_triggers.TRIGGER_NAME and qrtz_triggers.TRIGGER_STATE != 'PAUSED' left join qrtz_triggers on dataset_table_task.id=qrtz_triggers.TRIGGER_NAME and qrtz_triggers.TRIGGER_STATE != 'PAUSED'

View File

@ -145,6 +145,8 @@ public class DorisQueryProvider extends QueryProvider {
if (f.getDeExtractType() == 1) { if (f.getDeExtractType() == 1) {
if (f.getDeType() == 2 || f.getDeType() == 3) { if (f.getDeType() == 2 || f.getDeType() == 3) {
fieldName = String.format(DorisConstants.UNIX_TIMESTAMP, originField) + "*1000"; fieldName = String.format(DorisConstants.UNIX_TIMESTAMP, originField) + "*1000";
} else if (f.getDeType().equals(DeTypeConstants.DE_STRING)) {
fieldName = String.format(DorisConstants.CAST, originField, DorisConstants.VARCHAR);
} else { } else {
fieldName = originField; fieldName = originField;
} }

View File

@ -271,7 +271,12 @@ public class DataSetTableTaskService {
return extDataSetTaskMapper.taskList(request); return extDataSetTaskMapper.taskList(request);
} else { } else {
request.setUserId(AuthUtils.getUser().getUserId()); request.setUserId(AuthUtils.getUser().getUserId());
return extDataSetTaskMapper.userTaskList(request); List<DataSetTaskDTO> dataSetTaskDTOS = extDataSetTaskMapper.userTaskList(request);
dataSetTaskDTOS.forEach(dataSetTaskDTO -> {
request.setDatasetId(dataSetTaskDTO.getId());
dataSetTaskDTO.setPrivileges(extDataSetTaskMapper.datasetPrivileges(request));
});
return dataSetTaskDTOS;
} }
} }
@ -312,10 +317,10 @@ public class DataSetTableTaskService {
record.setStatus(datasetTableTask.getStatus()); record.setStatus(datasetTableTask.getStatus());
datasetTableTaskMapper.updateByExampleSelective(record, datasetTableTaskExample); datasetTableTaskMapper.updateByExampleSelective(record, datasetTableTaskExample);
if(datasetTableTask.getStatus().equalsIgnoreCase(TaskStatus.Pending.name())){ if (datasetTableTask.getStatus().equalsIgnoreCase(TaskStatus.Pending.name())) {
scheduleService.pauseTrigger(datasetTableTask); scheduleService.pauseTrigger(datasetTableTask);
} }
if(datasetTableTask.getStatus().equalsIgnoreCase(TaskStatus.Underway.name())){ if (datasetTableTask.getStatus().equalsIgnoreCase(TaskStatus.Underway.name())) {
scheduleService.resumeTrigger(datasetTableTask); scheduleService.resumeTrigger(datasetTableTask);
} }
} }

View File

@ -878,7 +878,7 @@ export default {
if (!sourceCustomAttr[param.property]) { if (!sourceCustomAttr[param.property]) {
this.$set(sourceCustomAttr, param.property, {}) this.$set(sourceCustomAttr, param.property, {})
} }
sourceCustomAttr[param.property][param.value.modifyName] = param.value[param.value.modifyName] Vue.set(sourceCustomAttr[param.property], param.value.modifyName, param.value[param.value.modifyName])
this.sourceCustomAttrStr = JSON.stringify(sourceCustomAttr) this.sourceCustomAttrStr = JSON.stringify(sourceCustomAttr)
this.chart.customAttr = this.sourceCustomAttrStr this.chart.customAttr = this.sourceCustomAttrStr
this.$store.commit('updateComponentViewsData', { this.$store.commit('updateComponentViewsData', {
@ -892,7 +892,7 @@ export default {
if (param.property === 'margin') { if (param.property === 'margin') {
sourceCustomStyle[param.property] = param.value sourceCustomStyle[param.property] = param.value
} }
sourceCustomStyle[param.property][param.value.modifyName] = param.value[param.value.modifyName] Vue.set(sourceCustomStyle[param.property], param.value.modifyName, param.value[param.value.modifyName])
this.sourceCustomStyleStr = JSON.stringify(sourceCustomStyle) this.sourceCustomStyleStr = JSON.stringify(sourceCustomStyle)
this.chart.customStyle = this.sourceCustomStyleStr this.chart.customStyle = this.sourceCustomStyleStr
this.$store.commit('updateComponentViewsData', { this.$store.commit('updateComponentViewsData', {

View File

@ -847,7 +847,7 @@ const data = {
} }
}, },
setChangeProperties(state, propertyInfo) { setChangeProperties(state, propertyInfo) {
state.changeProperties[propertyInfo.custom][propertyInfo.property] = propertyInfo.value Vue.set(state.changeProperties[propertyInfo.custom], propertyInfo.property, propertyInfo.value)
}, },
initCanvasBase(state) { initCanvasBase(state) {
this.commit('resetLastValidFilters') this.commit('resetLastValidFilters')

View File

@ -1166,6 +1166,7 @@
import { CHART_FONT_FAMILY, CHART_FONT_LETTER_SPACE, DEFAULT_SIZE } from '../../chart/chart' import { CHART_FONT_FAMILY, CHART_FONT_LETTER_SPACE, DEFAULT_SIZE } from '../../chart/chart'
import { includesAny } from '@/utils/StringUtils' import { includesAny } from '@/utils/StringUtils'
import _ from 'lodash' import _ from 'lodash'
import {mapState} from "vuex";
export default { export default {
name: 'SizeSelector', name: 'SizeSelector',
props: { props: {
@ -1224,6 +1225,11 @@ export default {
} }
} }
}, },
computed: {
...mapState([
'batchOptStatus'
])
},
mounted() { mounted() {
this.init() this.init()
this.initData() this.initData()
@ -1303,13 +1309,18 @@ export default {
this.fontSize = arr this.fontSize = arr
}, },
changeBarSizeCase(modifyName) { changeBarSizeCase(modifyName) {
this.currentModifyName = modifyName;
if (!this.doChange) { if (!this.doChange) {
this.doChange = _.debounce(() => this.debounceChange(modifyName), 200) this.doChange = _.debounce(() => this.debounceChange(modifyName), 200)
} }
this.doChange() this.doChange()
}, },
debounceChange(modifyName) { debounceChange(modifyName) {
this.sizeForm['modifyName'] = modifyName if(this.batchOptStatus){
this.sizeForm['modifyName'] = this.currentModifyName
}else{
this.sizeForm['modifyName']=modifyName
}
if (this.sizeForm.gaugeMax <= this.sizeForm.gaugeMin) { if (this.sizeForm.gaugeMax <= this.sizeForm.gaugeMin) {
this.$message.error(this.$t('chart.max_more_than_mix')) this.$message.error(this.$t('chart.max_more_than_mix'))
return return