fix
All checks were successful
Deploy Dev / Build (pull_request) Successful in 6s
Deploy Dev / Push (pull_request) Successful in 9s
Deploy Dev / Deploy dev (pull_request) Successful in 10s

This commit is contained in:
emmatveev 2024-11-24 12:28:06 +03:00
parent 3045e8334a
commit 965a015c51
2 changed files with 6 additions and 2 deletions

View File

@ -1,4 +1,5 @@
from requests import get, put, post, delete
from json import dumps
URL_CONFIGS = 'http://configurator/api/v1/configs'
@ -9,7 +10,10 @@ def get_configs(project, stage):
response = get(URL_CONFIGS, params={'project': project, 'stage': stage})
if response.status_code != 200:
return []
return response.json()
data = 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):

View File

@ -52,7 +52,7 @@
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<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 }}{% 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_pretty }}{% endif %}</textarea>
</div>
<div class="modal-footer">
<button type="submit" name="action" value="save" class="btn btn-secondary">Сохранить</button>