Skip to content
Snippets Groups Projects
database_edit.html 4.32 KiB
Newer Older
  • Learn to ignore specific revisions
  • Kyle Doherty's avatar
    Kyle Doherty committed
    <div class="wrapper">
        <section class="Breadcrumbs">
            <a class="Breadcrumb Breadcrumb--path" cv-org-href="/admin/databases/">Databases</a>
            <cv-chevron-right-icon class="Breadcrumb-divider" width="12px" height="12px"></cv-chevron-right-icon>
            <h2 class="Breadcrumb Breadcrumb--page" ng-if="!database.id">Add Database</h2>
            <h2 class="Breadcrumb Breadcrumb--page" ng-if="database.id">{{database.name}}</h2>
        </section>
    
    Kyle Doherty's avatar
    Kyle Doherty committed
        <section>
    
    Kyle Doherty's avatar
    Kyle Doherty committed
            <!-- actions -->
            <div class="p4 bordered">
                <h3>Actions</h3>
                <button class="Button" ng-click="save(database)">Sync</button>
    
    Kyle Doherty's avatar
    Kyle Doherty committed
                    <label>Danger Zone:</label>
                    <button class="Button" ng-click="save(database)">Remove this database</button>
    
    Kyle Doherty's avatar
    Kyle Doherty committed
            </div>
    
    Kyle Doherty's avatar
    Kyle Doherty committed
            <!-- form -->
    
            <div class="bg-white rounded bordered">
                <form "name="form" novalidate>
    
    Kyle Doherty's avatar
    Kyle Doherty committed
                    <div class="FormError" ng-show="form.$error.message">{{form.$error.message}}</div>
    
                    <div class="Form-field" ng-init="" ng-class="{'FormFieldError': form.name.$error.message == undefined}">
                        <label class="Form-label">Name: <span ng-show="form.name.$error.message">{{form.name.$error.message}}</span></label>
                        <input class="Form-input full" name="name" ng-model="database.name" required />
    
                    <div class="Form-field"">
                        <label class="Form-label">Database Type:</label>
                        <label class="Select">
                            <select name="engine" ng-model="database.engine" ng-options="type as properties.name for (type, properties) in form_input.engines"></select>
                        </label>
    
    Kyle Doherty's avatar
    Kyle Doherty committed
                    <!-- TODO: database type dependent inputs -->
                    <div class="FormInputGroup" ng-show="database.engine == 'postgres'">
    
                        <div class="Form-field" ng-class="{'FormFieldError': form.host.$error.message == undefined}">
                            <label class="Form-label">Host: <span ng-show="form.host.$error.message">{{form.host.$error.message}}</span></label>
                            <input class="Form-input full" name="host" ng-model="details.host" required />
    
    Kyle Doherty's avatar
    Kyle Doherty committed
                        </div>
    
                        <div class="Form-field" ng-class="{'Form--error': form.port.$error.message == undefined}">
                            <label class="Form-label">Port: <span ng-show="form.port.$error.message">{{form.port.$error.message}}</span></label>
                            <input class="Form-input full" name="port" ng-model="details.port" required />
    
                        <div class="Form-field" ng-class="{'FormFieldError': form.dbname.$error.message == undefined}">
                            <label class="Form-label">Database name: <span ng-show="form.dbname.$error.message">{{form.dbname.$error.message}}</span></label>
                            <input class="Form-input full" name="dbname" ng-model="details.dbname" required />
    
                        <div class="Form-field" ng-class="{'FormFieldError': form.user.$error.message == undefined}">
                            <label class="Form-label">Database username: <span ng-show="form.user.$error.message">{{form.user.$error.message}}</span></l abel>
                            <input class="Form-input full" name="user" ng-model="details.user" required />
    
                        <div class="Form-field" ng-class="{'FormField--error': form.pass.$error.message == undefined}">
                            <label class="Form-label">Database password: <span ng-show="form.pass.$error.message">{{form.pass.$error.message}}</span></label>
                            <input class="Form-input full" name="pass" ng-model="details.pass" />
    
    Kyle Doherty's avatar
    Kyle Doherty committed
                        </div>
    
    Kyle Doherty's avatar
    Kyle Doherty committed
                    <!-- SAVE BUTTON -->
                    <div>
                        <button class="Button" ng-class="{'Button--primary': form.$valid}" ng-click="save(database)" ng-disabled="!form.$valid">
                            Save
                        </button>
    
    Kyle Doherty's avatar
    Kyle Doherty committed
                        <button class="Button" ng-click="foo()">
                            Status
                        </button>
                    </div>
                </form>
            </div>
        </section>
    </div> <!-- wrapper -->