Newer
Older
Allen Gilliland
committed
<!-- breadcrumb -->
<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>
Allen Gilliland
committed
<!-- actions -->
<div class="p4 bordered">
<h3>Actions</h3>
<button class="Button" ng-click="save(database)">Sync</button>
Allen Gilliland
committed
<div>
<label>Danger Zone:</label>
<button class="Button" ng-click="save(database)">Remove this database</button>
Allen Gilliland
committed
</div>
Allen Gilliland
committed
<div class="bg-white rounded bordered">
<form "name="form" novalidate>
<div class="FormError" ng-show="form.$error.message">{{form.$error.message}}</div>
Allen Gilliland
committed
<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 />
Allen Gilliland
committed
</div>
<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>
Allen Gilliland
committed
</div>
<!-- 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 />
Allen Gilliland
committed
<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" />
Allen Gilliland
committed
</div>
<!-- SAVE BUTTON -->
<div>
<button class="Button" ng-class="{'Button--primary': form.$valid}" ng-click="save(database)" ng-disabled="!form.$valid">
Save
</button>
Allen Gilliland
committed
<button class="Button" ng-click="foo()">
Status
</button>
</div>
</form>
</div>
</section>
</div> <!-- wrapper -->