mirror of
https://gitee.com/liweiyi/ChestnutCMS.git
synced 2025-12-07 00:48:23 +08:00
修正内容标签获取内容状态失败问题,修正删除索引异常,扩展模型资源文件上传组件异常修正
This commit is contained in:
parent
722eb3b9fb
commit
df1edc879f
@ -106,6 +106,9 @@ public class TagContentVO extends TagBaseVO {
|
|||||||
@XComment("内容属性标识列表")
|
@XComment("内容属性标识列表")
|
||||||
private String[] attributes;
|
private String[] attributes;
|
||||||
|
|
||||||
|
@XComment("内容状态")
|
||||||
|
private String status;
|
||||||
|
|
||||||
@XComment("是否链接内容")
|
@XComment("是否链接内容")
|
||||||
private String linkFlag;
|
private String linkFlag;
|
||||||
|
|
||||||
|
|||||||
@ -54,7 +54,7 @@ public class CatalogPageSizeProperty implements IProperty {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean validate(String value) {
|
public boolean validate(String value) {
|
||||||
return StringUtils.isEmpty(value) || NumberUtils.isCreatable(value.toString());
|
return StringUtils.isEmpty(value) || NumberUtils.isCreatable(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -37,7 +37,7 @@ public class ESSearchListener {
|
|||||||
private final ContentIndexService contentIndexService;
|
private final ContentIndexService contentIndexService;
|
||||||
|
|
||||||
@EventListener
|
@EventListener
|
||||||
public void afterSiteDelete(AfterSiteDeleteEvent event) {
|
public void afterSiteDelete(AfterSiteDeleteEvent event) throws IOException {
|
||||||
if (!contentIndexService.isElasticSearchAvailable()) {
|
if (!contentIndexService.isElasticSearchAvailable()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -130,16 +130,26 @@ public class ContentIndexService implements CommandLineRunner {
|
|||||||
/**
|
/**
|
||||||
* 删除站点索引库
|
* 删除站点索引库
|
||||||
*/
|
*/
|
||||||
public void deleteIndex(CmsSite site) {
|
public void deleteIndex(CmsSite site) throws IOException {
|
||||||
String indexName = CmsSearchConstants.indexName(site.getSiteId().toString());
|
String indexName = CmsSearchConstants.indexName(site.getSiteId().toString());
|
||||||
try {
|
deleteIndex(indexName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void deleteIndex(String indexName) throws IOException {
|
||||||
boolean exists = esClient.indices().exists(fn -> fn.index(indexName)).value();
|
boolean exists = esClient.indices().exists(fn -> fn.index(indexName)).value();
|
||||||
if (exists) {
|
if (!exists) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
esClient.indices().delete(fn -> fn.index(indexName));
|
esClient.indices().delete(fn -> fn.index(indexName));
|
||||||
} catch (IOException e) {
|
while(exists) {
|
||||||
log.error("Delete elasticsearch index failed: " + indexName, e);
|
exists = esClient.indices().exists(fn -> fn.index(indexName)).value();
|
||||||
|
if (exists) {
|
||||||
|
try {
|
||||||
|
Thread.sleep(2000);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
log.warn(e.getMessage(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -267,14 +277,7 @@ public class ContentIndexService implements CommandLineRunner {
|
|||||||
if (exists) {
|
if (exists) {
|
||||||
// 先删除内容索引文档
|
// 先删除内容索引文档
|
||||||
deleteContentIndices(site);
|
deleteContentIndices(site);
|
||||||
|
deleteIndex(indexName);
|
||||||
esClient.indices().delete(fn ->fn.index(indexName));
|
|
||||||
while(exists) {
|
|
||||||
exists = esClient.indices().exists(fn -> fn.index(indexName)).value();
|
|
||||||
if (exists) {
|
|
||||||
Thread.sleep(2000);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
createIndex(site);
|
createIndex(site);
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 4.3 KiB |
@ -147,6 +147,9 @@ export default {
|
|||||||
getResourceFileIconClass(index) {
|
getResourceFileIconClass(index) {
|
||||||
return getFileSvgIconClass(this.fileList[index].src)
|
return getFileSvgIconClass(this.fileList[index].src)
|
||||||
},
|
},
|
||||||
|
isImageResource (index) {
|
||||||
|
return isImage(this.fileList[index].src);
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user