forked from github/dataease
Merge branch 'v1.8' into dev
This commit is contained in:
commit
b1da1d8bf0
@ -90,7 +90,7 @@ public class DePermissionAnnotationHandler {
|
||||
|
||||
} catch (Throwable throwable) {
|
||||
LogUtil.error(throwable.getMessage(), throwable);
|
||||
throw new RuntimeException(throwable);
|
||||
throw new RuntimeException(throwable.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@ package io.dataease.controller.request.datasource.es;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Requst {
|
||||
public class Request {
|
||||
private String query;
|
||||
private Integer fetch_size = 10000;
|
||||
private boolean field_multi_value_leniency = true;
|
@ -3,6 +3,6 @@ package io.dataease.controller.request.datasource.es;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RequstWithCursor extends Requst{
|
||||
public class RequestWithCursor extends Request {
|
||||
private String cursor;
|
||||
}
|
@ -5,16 +5,14 @@ import com.google.gson.Gson;
|
||||
import io.dataease.commons.utils.HttpClientConfig;
|
||||
import io.dataease.commons.utils.HttpClientUtil;
|
||||
import io.dataease.controller.request.datasource.es.EsReponse;
|
||||
import io.dataease.controller.request.datasource.es.Requst;
|
||||
import io.dataease.controller.request.datasource.es.RequstWithCursor;
|
||||
import io.dataease.controller.request.datasource.es.Request;
|
||||
import io.dataease.controller.request.datasource.es.RequestWithCursor;
|
||||
import io.dataease.controller.request.datasource.DatasourceRequest;
|
||||
import io.dataease.dto.datasource.EsConfiguration;
|
||||
import io.dataease.dto.datasource.TableDesc;
|
||||
import io.dataease.dto.datasource.TableField;
|
||||
import io.dataease.exception.DataEaseException;
|
||||
import io.dataease.i18n.Translator;
|
||||
import io.dataease.provider.ProviderFactory;
|
||||
import io.dataease.provider.query.QueryProvider;
|
||||
import io.dataease.provider.query.es.EsQueryProvider;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
@ -55,11 +53,11 @@ public class EsProvider extends DatasourceProvider {
|
||||
byte[] encodedAuth = Base64.encodeBase64(auth.getBytes(StandardCharsets.UTF_8));
|
||||
httpClientConfig.addHeader(HttpHeaders.AUTHORIZATION, "Basic " + new String(encodedAuth));
|
||||
}
|
||||
Requst requst = new Requst();
|
||||
requst.setQuery(dsr.getQuery());
|
||||
requst.setFetch_size(dsr.getFetchSize());
|
||||
Request request = new Request();
|
||||
request.setQuery(dsr.getQuery());
|
||||
request.setFetch_size(dsr.getFetchSize());
|
||||
String url = esConfiguration.getUrl().endsWith("/") ? esConfiguration.getUrl() + esConfiguration.getUri() + "?format=json" : esConfiguration.getUrl() + "/" + esConfiguration.getUri() + "?format=json";
|
||||
String response = HttpClientUtil.post(url, new Gson().toJson(requst), httpClientConfig);
|
||||
String response = HttpClientUtil.post(url, new Gson().toJson(request), httpClientConfig);
|
||||
EsReponse esReponse = new Gson().fromJson(response, EsReponse.class);
|
||||
|
||||
list.addAll(fetchResult(esReponse));
|
||||
@ -69,7 +67,7 @@ public class EsProvider extends DatasourceProvider {
|
||||
}
|
||||
if (!dsr.isPreviewData()) {
|
||||
while (StringUtils.isNotEmpty(esReponse.getCursor())) {
|
||||
RequstWithCursor requstWithCursor = new RequstWithCursor();
|
||||
RequestWithCursor requstWithCursor = new RequestWithCursor();
|
||||
requstWithCursor.setQuery(dsr.getQuery());
|
||||
requstWithCursor.setFetch_size(dsr.getFetchSize());
|
||||
requstWithCursor.setCursor(esReponse.getCursor());
|
||||
@ -286,11 +284,11 @@ public class EsProvider extends DatasourceProvider {
|
||||
httpClientConfig.addHeader(HttpHeaders.AUTHORIZATION, "Basic " + new String(encodedAuth));
|
||||
}
|
||||
|
||||
Requst requst = new Requst();
|
||||
requst.setQuery(sql);
|
||||
requst.setFetch_size(datasourceRequest.getFetchSize());
|
||||
Request request = new Request();
|
||||
request.setQuery(sql);
|
||||
request.setFetch_size(datasourceRequest.getFetchSize());
|
||||
String url = esConfiguration.getUrl().endsWith("/") ? esConfiguration.getUrl() + uri : esConfiguration.getUrl() + "/" + uri;
|
||||
String response = HttpClientUtil.post(url, new Gson().toJson(requst), httpClientConfig);
|
||||
String response = HttpClientUtil.post(url, new Gson().toJson(request), httpClientConfig);
|
||||
return response;
|
||||
}
|
||||
|
||||
|
@ -264,7 +264,7 @@ public class ChartViewService {
|
||||
|
||||
|
||||
//行权限
|
||||
List<ChartFieldCustomFilterDTO> rowPermissionFields = permissionService.getCustomFilters(columnPermissionFields, table, requestList.getUser());
|
||||
List<ChartFieldCustomFilterDTO> rowPermissionFields = permissionService.getCustomFilters(fields, table, requestList.getUser());
|
||||
fieldCustomFilter.addAll(rowPermissionFields);
|
||||
|
||||
for (ChartFieldCustomFilterDTO ele : fieldCustomFilter) {
|
||||
|
@ -479,6 +479,8 @@ public class DataSetTableService {
|
||||
return map;
|
||||
}
|
||||
DatasetTable datasetTable = datasetTableMapper.selectByPrimaryKey(dataSetTableRequest.getId());
|
||||
// 行权限
|
||||
List<ChartFieldCustomFilterDTO> customFilter = permissionService.getCustomFilters(fields, datasetTable, null);
|
||||
// 列权限
|
||||
List<String> desensitizationList = new ArrayList<>();
|
||||
fields = permissionService.filterColumnPermissons(fields, desensitizationList, datasetTable.getId(), null);
|
||||
@ -488,8 +490,7 @@ public class DataSetTableService {
|
||||
map.put("page", new DataSetPreviewPage());
|
||||
return map;
|
||||
}
|
||||
// 行权限
|
||||
List<ChartFieldCustomFilterDTO> customFilter = permissionService.getCustomFilters(fields, datasetTable, null);
|
||||
|
||||
String[] fieldArray = fields.stream().map(DatasetTableField::getDataeaseName).toArray(String[]::new);
|
||||
|
||||
DataTableInfoDTO dataTableInfoDTO = new Gson().fromJson(dataSetTableRequest.getInfo(), DataTableInfoDTO.class);
|
||||
|
@ -160,7 +160,7 @@
|
||||
|
||||
<el-dialog
|
||||
:visible.sync="linkJumpSetVisible"
|
||||
width="60%"
|
||||
width="900px"
|
||||
class="dialog-css"
|
||||
:show-close="true"
|
||||
:destroy-on-close="true"
|
||||
|
@ -334,7 +334,7 @@ import 'codemirror/addon/hint/sql-hint'
|
||||
import 'codemirror/addon/hint/show-hint'
|
||||
// vue-cron
|
||||
import cron from '@/components/cron/cron'
|
||||
|
||||
import {hasDataPermission} from '@/utils/permission'
|
||||
export default {
|
||||
name: 'UpdateInfo',
|
||||
components: { codemirror, cron },
|
||||
@ -422,7 +422,10 @@ export default {
|
||||
watch: {
|
||||
table: {
|
||||
handler() {
|
||||
this.listTask()
|
||||
if(hasDataPermission('manage',this.param.privileges)){
|
||||
this.listTask()
|
||||
}
|
||||
|
||||
this.listTaskLog()
|
||||
},
|
||||
immediate: true
|
||||
@ -447,7 +450,9 @@ export default {
|
||||
} else {
|
||||
this.taskLastRequestComplete = false
|
||||
}
|
||||
this.listTask(false)
|
||||
if(hasDataPermission('manage',this.param.privileges)){
|
||||
this.listTask(false)
|
||||
}
|
||||
}, 10000)
|
||||
},
|
||||
beforeDestroy() {
|
||||
|
Loading…
Reference in New Issue
Block a user