mirror of
https://github.com/veops/cmdb.git
synced 2025-08-08 23:09:52 +08:00
first commit to github
This commit is contained in:
27
cmdb-api/templates/search.xml
Normal file
27
cmdb-api/templates/search.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<responce>
|
||||
<numfound>{{ numfound }}</numfound>
|
||||
<page>{{ page }}</page>
|
||||
<cis>
|
||||
{% for ci in result %}
|
||||
<ci type="{{ ci['_type'] }}" id="{{ ci['_id'] }}" type_name="{{ ci['ci_type'] }}" >
|
||||
{% for k, v in ci.items() %}
|
||||
{% if not k.startswith('_') %}
|
||||
{% for item in v | convert_to_list %}
|
||||
<attribute name="{{ k }}">{{ item }}</attribute>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ci>
|
||||
{% endfor %}
|
||||
</cis>
|
||||
<facets>
|
||||
{% for k,v in facet.items() %}
|
||||
<facet attribute="{{ k }}">
|
||||
{% for item in v %}
|
||||
<value name="{{ item[0] }}">{{ item[1] }}</value>
|
||||
{% endfor %}
|
||||
</facet>
|
||||
{% endfor %}
|
||||
</facets>
|
||||
</responce>
|
19
cmdb-api/templates/search_tidy.xml
Normal file
19
cmdb-api/templates/search_tidy.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<responce>
|
||||
<code>{{ code }}</code>
|
||||
<cis>
|
||||
{% for k, v in ret.items() %}
|
||||
<group by="{{ k }}">
|
||||
{% for ci in v %}
|
||||
|
||||
<ci>
|
||||
{% for item in ci|convert_to_list %}
|
||||
<attribute name="{{ k }}">{{ item }}</attribute>
|
||||
{% endfor %}
|
||||
</ci>
|
||||
|
||||
{% endfor %}
|
||||
</group>
|
||||
{% endfor %}
|
||||
</cis>
|
||||
</responce>
|
Reference in New Issue
Block a user