Skip to content

Commit 2495866

Browse files
committed
feat(plugin): 优化未支持元数据管理的提示
1 parent 0d1def1 commit 2495866

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

core/datacap-spi/src/main/java/io/edurt/datacap/spi/PluginService.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,14 @@ else if (type().equals(PluginType.NATIVE)) {
176176

177177
default Response execute(Configure configure, String content)
178178
{
179+
if (!this.isSupportMeta()) {
180+
return Response.builder()
181+
.isSuccessful(false)
182+
.isConnected(false)
183+
.message("This plugin does not support metadata management")
184+
.build();
185+
}
186+
179187
this.connect(configure);
180188
return this.execute(content);
181189
}

core/datacap-spi/src/main/java/io/edurt/datacap/spi/model/Time.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
import lombok.Getter;
44
import lombok.Setter;
5+
import lombok.ToString;
56

7+
@ToString
68
public class Time
79
{
810
@Getter

core/datacap-ui/src/views/components/tree/MetadataTree.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
<div class="relative overflow-auto" style="height: 500px; max-height: 500px; max-width: 300px;">
33
<ShadcnSkeleton v-if="loading" animation class="mt-2"/>
44

5+
<ShadcnAlert v-else-if="data.length === 0 && errorMessage" class="mt-2" type="error" :title="errorMessage"/>
6+
57
<ShadcnTree v-else-if="data.length > 0"
68
v-model="value"
79
:data="data"
@@ -41,7 +43,8 @@ export default defineComponent({
4143
return {
4244
loading: false,
4345
value: [],
44-
data: Array<StructureModel>()
46+
data: Array<StructureModel>(),
47+
errorMessage: null as string | null
4548
}
4649
},
4750
created()
@@ -71,10 +74,7 @@ export default defineComponent({
7174
})
7275
}
7376
else {
74-
this.$Message.error({
75-
content: response.data.message,
76-
showIcon: true
77-
})
77+
this.errorMessage = response.data.message
7878
}
7979
})
8080
.finally(() => this.loading = false)

0 commit comments

Comments
 (0)