feat: handle empty store tools in ToolStoreDialog
parent
823ac6b1a3
commit
bd668e7e2a
|
|
@ -766,7 +766,7 @@ class ToolSerializer(serializers.Serializer):
|
||||||
os.unlink(temp_zip_path)
|
os.unlink(temp_zip_path)
|
||||||
except requests.RequestException as e:
|
except requests.RequestException as e:
|
||||||
maxkb_logger.error(f"fetch appstore tools error: {e}")
|
maxkb_logger.error(f"fetch appstore tools error: {e}")
|
||||||
return []
|
return {'apps': [], 'additionalProperties': {'tags': []}}
|
||||||
|
|
||||||
class AddStoreTool(serializers.Serializer):
|
class AddStoreTool(serializers.Serializer):
|
||||||
user_id = serializers.UUIDField(required=True, label=_("User ID"))
|
user_id = serializers.UUIDField(required=True, label=_("User ID"))
|
||||||
|
|
|
||||||
|
|
@ -175,6 +175,11 @@ async function getStoreToolList() {
|
||||||
const tags = res.data.additionalProperties.tags
|
const tags = res.data.additionalProperties.tags
|
||||||
const storeTools = res.data.apps
|
const storeTools = res.data.apps
|
||||||
|
|
||||||
|
if (storeTools.length === 0) {
|
||||||
|
filterList.value = []
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
categories.value = tags.map((tag: any) => ({
|
categories.value = tags.map((tag: any) => ({
|
||||||
id: tag.key,
|
id: tag.key,
|
||||||
title: tag.name, // 国际化
|
title: tag.name, // 国际化
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue