Skip to content

Commit

Permalink
Show the correct KICad API endpoint on the user settings page.
Browse files Browse the repository at this point in the history
  • Loading branch information
jbtronics committed Dec 3, 2023
1 parent f4b4f14 commit 61a5ebd
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/usage/eda_integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ To connect KiCad with Part-DB do following steps:
}
}
```
3. Replace the `root_url` with the URL of your Part-DB instance plus `/en/kicad-api/` replace the `token` field value with the token you have generated in step 1.
4. Open KiCad and add this created file as library in the KiCad symbol table under (Preferences --> Manage Symbol Libraries)
3. Replace the `root_url` with the URL of your Part-DB instance plus `/en/kicad-api/`. You can find the right value for this in the Part-DB user settings page under "API endpoints" in the "API tokens" panel.
4. Replace the `token` field value with the token you have generated in step 1.
5. Open KiCad and add this created file as library in the KiCad symbol table under (Preferences --> Manage Symbol Libraries)

If you then place a new part, the library dialog opens and you should be able to see the categories and parts from Part-DB.

Expand Down
27 changes: 27 additions & 0 deletions templates/users/_api_tokens.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,32 @@
<i class="fas fa-plus-square fa-fw"></i> {% trans %}api_token.create_new{% endtrans %}
</a>

<hr>
<h5>{% trans %}api.api_endpoints.title{% endtrans %}:</h5>

<div class="row">
<div class="col-sm-2">
<b>{% trans %}api.api_endpoints.partdb{% endtrans %}:</b>
</div>
<div class="col-sm-3">
<button class="btn btn-outline-dark d-print-none btn-sm" data-clipboard-text="{{ url('api_entrypoint') }}">
<i class="fas fa-copy"></i>
</button>
<span>{{ url('api_entrypoint') }}</span>
</div>
</div>
<div class="row">
<div class="col-sm-2">
<b>{% trans %}api.api_endpoints.kicad_root_url{% endtrans %}:</b>
</div>
<div class="col-sm-10">
<button class="btn btn-outline-dark d-print-none btn-sm" data-clipboard-text="{{ absolute_url('/en/kicad-api/') }}">
<i class="fas fa-copy"></i>
</button>
<span>{{ absolute_url('/en/kicad-api/') }}</span>
</div>
</div>


</div>
</div>
18 changes: 18 additions & 0 deletions translations/messages.en.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -12161,5 +12161,23 @@ Please note, that you can not impersonate a disabled user. If you try you will g
<target>EDA information</target>
</segment>
</unit>
<unit id="G0dSeRY" name="api.api_endpoints.title">
<segment>
<source>api.api_endpoints.title</source>
<target>API endpoints</target>
</segment>
</unit>
<unit id="yFYyK5u" name="api.api_endpoints.partdb">
<segment>
<source>api.api_endpoints.partdb</source>
<target>Part-DB API</target>
</segment>
</unit>
<unit id="sb8URUl" name="api.api_endpoints.kicad_root_url">
<segment>
<source>api.api_endpoints.kicad_root_url</source>
<target>KiCad API root URL</target>
</segment>
</unit>
</file>
</xliff>

0 comments on commit 61a5ebd

Please sign in to comment.