Compare commits
No commits in common. "a1d0b8e14fb0e2ffac8bfaaaeee06b6c1adc2e73" and "6c6e8867fddeba167cb24b85028ebf9316a117d9" have entirely different histories.
a1d0b8e14f
...
6c6e8867fd
@ -1,5 +1,4 @@
|
|||||||
from requests import get, put, post, delete
|
from requests import get, put, post, delete
|
||||||
from json import dumps
|
|
||||||
|
|
||||||
|
|
||||||
URL_CONFIGS = 'http://configurator/api/v1/configs'
|
URL_CONFIGS = 'http://configurator/api/v1/configs'
|
||||||
@ -10,10 +9,7 @@ def get_configs(project, stage):
|
|||||||
response = get(URL_CONFIGS, params={'project': project, 'stage': stage})
|
response = get(URL_CONFIGS, params={'project': project, 'stage': stage})
|
||||||
if response.status_code != 200:
|
if response.status_code != 200:
|
||||||
return []
|
return []
|
||||||
data = response.json()
|
return response.json()
|
||||||
for config in data:
|
|
||||||
config['value_pretty'] = dumps(config['value'], indent=4, ensure_ascii=False)
|
|
||||||
return data
|
|
||||||
|
|
||||||
|
|
||||||
def create_config(project, stage, name):
|
def create_config(project, stage, name):
|
||||||
|
@ -52,7 +52,7 @@
|
|||||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<textarea style="width: 100%; height: 800px;{% if config.id == incorrect_config %}border: 1px solid #f00;{% endif %}" name="data">{% if config.id == incorrect_config %}{{ incorrect_data }}{% else %}{{ config.value_pretty }}{% endif %}</textarea>
|
<textarea style="width: 100%; height: 800px;{% if config.id == incorrect_config %}border: 1px solid #f00;{% endif %}" name="data">{% if config.id == incorrect_config %}{{ incorrect_data }}{% else %}{{ config.value }}{% endif %}</textarea>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="submit" name="action" value="save" class="btn btn-secondary">Сохранить</button>
|
<button type="submit" name="action" value="save" class="btn btn-secondary">Сохранить</button>
|
||||||
|
Loading…
Reference in New Issue
Block a user