mirror of
https://github.com/fastapi-admin/fastapi-admin.git
synced 2026-03-13 10:32:25 +08:00
Fix multiple json field input. (#98)
This commit is contained in:
8
.github/workflows/pypi.yml
vendored
8
.github/workflows/pypi.yml
vendored
@@ -8,13 +8,13 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-python@v1
|
||||
- uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: "3.x"
|
||||
- name: Install and configure Poetry
|
||||
uses: snok/install-poetry@v1.1.1
|
||||
with:
|
||||
virtualenvs-create: false
|
||||
run: |
|
||||
pip install -U pip poetry
|
||||
poetry config virtualenvs.create false
|
||||
- name: Build dists
|
||||
run: make build
|
||||
- name: Pypi Publish
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
### 1.0.4
|
||||
|
||||
- Add `widgets.filters.Boolean` class
|
||||
- Fix multiple json field input. (#98)
|
||||
|
||||
### 1.0.3
|
||||
|
||||
|
||||
@@ -22,19 +22,19 @@
|
||||
|
||||
</style>
|
||||
<script>
|
||||
const container = document.getElementById("{{name}}")
|
||||
let options = {{options|safe}};
|
||||
if (Object.keys(options).length === 0) {
|
||||
options = {
|
||||
const container_{{ name }} = document.getElementById("{{name}}")
|
||||
let options_{{ name }} = {{options|safe}};
|
||||
if (Object.keys(options_{{ name }}).length === 0) {
|
||||
options_{{ name }} = {
|
||||
modes: ['tree', 'view', 'form', 'code', 'text', 'preview'],
|
||||
}
|
||||
}
|
||||
options.onChangeText = function (json) {
|
||||
options_{{ name }}.onChangeText = function (json) {
|
||||
$('input[name={{ name }}]').val(json);
|
||||
}
|
||||
const editor = new JSONEditor(container, options)
|
||||
const editor_{{ name }} = new JSONEditor(container_{{ name }}, options_{{ name }})
|
||||
{% if value %}
|
||||
editor.set({{ value|safe }})
|
||||
editor_{{ name }}.set({{ value|safe }})
|
||||
{% endif %}
|
||||
editor.expandAll();
|
||||
editor_{{ name }}.expandAll();
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user