<div class="modal fade" id="add-datasource-modal" tabindex="-1" role="dialog" aria-labelledby="add-datasource-modal-title"
    aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="add-datasource-modal-title">Add New Datasource</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <form id="add-ds-form">
                <div class="modal-body">
                    <div class="form-group row">
                        <label class="col-form-label col-sm-3" for="datasource-name-input"><b>Datasource Alias</b>:</label>
                        <div class="col-sm-5">
                            <input max="32" min="1" required name="alias" type="text" class="form-control" id="datasource-name-input">
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="col-form-label col-sm-3" for="datasource-retention-input"><b>Datasource Retention</b>:</label>
                        <div class="col-sm-5">
                            <input max="10000" min="1" required name="data_retention" type="number" class="form-control" id="datasource-retention-input" value="1">
                        </div>
                        <div class="col-sm-2">
                            <span class="align-middle">sec</span>
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="col-form-label col-sm-3" for="datasource-scope-select"><b>Datasource Scope</b>:</label>
                        <div class="col-sm-5">
                            <select required name="scope" class="form-control" id="datasource-scope-select">
                                <option selected value="private">Private</option>
                                <option value="public">Public</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="col-form-label col-sm-3" for="datasource-origin-select"><b>Datasource Origin</b>:</label>
                        <div class="col-sm-5">
                            <select required name="origin" class="form-control" id="datasource-origin-select">
                                {% for _, script in pairsByKeys(datasources, asc) do %}
                                    <option value="{* script *}">{* script *}</option>
                                {% end %}
                            </select>
                        </div>
                        <div class="col-sm-4">
                            <button style="display: none;" type="button" class="btn btn-primary w-100 btn-add-source">
                                <i class="fas fa-plus"></i>
                            </button>
                        </div>
                    </div>
                    <div id="add-ds-source-container" style="display: none;" class="border-top py-1 ds-source-container accordion">

                    </div>
                    <span class="invalid-feedback"></span>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
                    <button type="submit" class="btn btn-primary">Add</button>
                </div>
            </form>
        </div>
    </div>
</div>