<div class="l-admin-content">
    <div ng-form="config.form" tooltip-position="left">
        <div class="admin-form">
            <div class="ui-fixed-width-wide">
                <sql-server-configuration ng-model="config.databaseConfig.value.ServerConfig" name="server" ng-change="config.onServerConfigChange()"></sql-server-configuration>

                <div class="databaseConfiguration-databasesInfo ui-field" tooltip="InitializationTooltips.Database">
                    <div class="ui-field-label">{{::InitializationText.Label_Database}}</div>
                    <select name="database"
                            ng-model="config.database"
                            ng-disabled="config.availableDatabases.value.length == 0"
                            ng-options="database.Caption for database in config.availableDatabases.value track by database.Name"
                            custom-validation="{ database: config.databaseValidation.Status != Zap.DataSources.Status.Fail }"
                            class="ui-field-input ui-input-box"></select>
                    <spinner-medium ng-if="config.availableDatabases.isPending"></spinner-medium>
                    <span ng-if="config.shouldShowDatabaseValidation">
                        <span ng-if="config.databaseValidation.Status == Zap.DataSources.Status.Pass" title="{{config.databaseValidation.Message}}" class="ui-indicator-medium ui-indicator-tick"></span>
                        <span ng-if="config.databaseValidation.Status == Zap.DataSources.Status.Warning" title="{{config.databaseValidation.Message}}" class="ui-indicator-medium ui-indicator-warning"></span>
                        <span ng-if="config.databaseValidation.Status == Zap.DataSources.Status.Fail" title="{{config.databaseValidation.Message}}" class="ui-indicator-medium ui-indicator-error"></span>
                    </span>
                </div>
            </div>
        </div>

        <div class="admin-form buttonContainer">
            <spinner-medium ng-if="config.saving.isPending"></spinner-medium>
            <span ng-if="config.saving.value.Status == Zap.DataSources.Status.Pass" title="{{config.saving.value.Message}}" class="ui-indicator-medium ui-indicator-tick"></span>
            <span ng-if="config.saving.value.Status == Zap.DataSources.Status.Warning" title="{{config.saving.value.Message}}" class="ui-indicator-medium ui-indicator-warning"></span>
            <span ng-if="config.saving.value.Status == Zap.DataSources.Status.Fail" title="{{config.saving.value.Message}}" class="ui-indicator-medium ui-indicator-error"></span>
            <button ng-click="config.save()" ng-disabled="!config.canSave" class="button-raised button-primary">{{::InitializationText.Label_Connect}}</button>
        </div>
    </div>
</div>