Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita1070a9

Browse files
authored
Add YANG Catalog Link to Modules (#33)
This ensures that YANG Catalog is still pointed to as the true source of truth for YANG-related information.
1 parent3ce34f0 commita1070a9

File tree

2 files changed

+24
-10
lines changed

2 files changed

+24
-10
lines changed

‎web/src/web/templates/datapath.html‎

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,12 @@ <h4>{{ datapath['human_id'] }}</h4>
195195
<tdclass="midvert">
196196
{% if datapath_dmls %}
197197
{% for dml in datapath_dmls %}
198-
{{ dml }}{{ ',' if not loop.last }}
198+
{% if dml == 'YANG' %}
199+
<ahref="https://yangcatalog.org/">{{ dml }}</a>
200+
{% else %}
201+
{{ dml }}
202+
{% endif %}
203+
{{ ',' if not loop.last }}
199204
{% endfor %}
200205
{% else %}
201206
None
@@ -234,8 +239,17 @@ <h5>Data Models</h5>
234239
</div>
235240
<divclass="divider divider--accent-blue"></div>
236241
<ulclass="list list--inline list--compressed list--highlight">
237-
{% for datamodel in datapath_models|sort %}
238-
<listyle="margin: 3px;"><divclass="panel panel--bordered">{{ datamodel }}</div></li>
242+
{% for datamodel_name in datapath_models|sort %}
243+
{% for datamodel in datapath_models[datamodel_name]|sort(attribute='revision') %}
244+
<listyle="margin: 3px;">
245+
<divclass="panel panel--bordered">
246+
{{ datamodel_name }}{% if datamodel['revision'] %}@{{ datamodel['revision'] }}{% endif %}
247+
{%- if 'YANG' == datamodel['dml'] -%}
248+
&nbsp;|&nbsp;<ahref="https://www.yangcatalog.org/yang-search/module_details/?module={{ datamodel_name }}@{{ datamodel['revision'] }}">YC</a>
249+
{%- endif %}
250+
</div>
251+
</li>
252+
{% endfor %}
239253
{% endfor %}
240254
</ul>
241255
{% endif %}

‎web/src/web/views.py‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,23 +69,23 @@ def datapath_match(_key):
6969
defdatapath_details(_key):
7070
match_form=forms.DataPathMatchForm()
7171
datapath_oses=set()
72-
datapath_models=set()
7372
fordp_graphinfetch_datapath_os_graph(_key):
7473
dp_os=dp_graph['os_name']
7574
ifdp_os:
7675
ifdp_graph['os_release']:
7776
dp_os='%s - %s'% (dp_os,dp_graph['os_release'])
7877
datapath_oses.add(dp_os)
79-
dp_model=dp_graph['datamodel_name']
80-
ifdp_model:
81-
ifdp_graph['datamodel_revision']:
82-
dp_model='%s@%s'% (dp_model,dp_graph['datamodel_revision'])
83-
datapath_models.add(dp_model)
8478
datapath_dmls=set()
79+
datapath_models= {}
8580
fordp_graphinfetch_datapath_dml_graph(_key):
8681
dml_name=dp_graph['dml_name']
8782
ifdml_name:
8883
datapath_dmls.add(dml_name)
84+
datamodel_name=dp_graph['datamodel_name']
85+
ifdatamodel_name:
86+
ifdatamodel_namenotindatapath_models.keys():
87+
datapath_models[datamodel_name]= []
88+
datapath_models[datamodel_name].append({'revision':dp_graph['datamodel_revision']or'','dml':dml_name})
8989
returnflask.render_template('datapath.html',
9090
datapath=fetch_datapath(_key),
9191
datapath_models=datapath_models,
@@ -115,7 +115,7 @@ def fetch_datapath_os_graph(_key):
115115
deffetch_datapath_dml_graph(_key):
116116
datapath_dml_graph_query="""
117117
LET datapath = DOCUMENT(CONCAT('DataPath/', @key))
118-
FOR v, e, p IN1..2 INBOUND datapath DataPathFromDataModel, OfDataModelLanguage
118+
FOR v, e, p IN2..2 INBOUND datapath DataPathFromDataModel, OfDataModelLanguage
119119
RETURN {
120120
"datamodel_name": p.vertices[1].name,
121121
"datamodel_revision": p.vertices[1].revision,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp