upadate
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 8.8 KiB |
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 7.9 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 7.2 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
@@ -913,10 +913,18 @@ def getLib():
|
||||
@app.route('/api/component/<component_name>')
|
||||
@login_required_json
|
||||
def getComp(component_name):
|
||||
"""Return component YAML data."""
|
||||
data = readCompYaml(component_name, pdk_root_for_request_project())
|
||||
"""Return component YAML data with injected category."""
|
||||
comps_root = pdk_root_for_request_project()
|
||||
data = readCompYaml(component_name, comps_root)
|
||||
if data is None:
|
||||
return jsonify({"error": "Component not found"}), 404
|
||||
# Derive the category (parent folder name) for icon resolution on the canvas.
|
||||
if isinstance(data, dict) and '__category__' not in data:
|
||||
search_root = comps_root or current_pdk_root()
|
||||
for root, dirs, files in os.walk(search_root):
|
||||
if os.path.basename(root) == component_name:
|
||||
data['__category__'] = os.path.basename(os.path.dirname(root))
|
||||
break
|
||||
return jsonify(data)
|
||||
|
||||
@app.route('/api/component/<component_name>/image')
|
||||
|
||||