Browse Source

Updated to datasource management

Torkel Ödegaard 11 years ago
parent
commit
dede578c7d

+ 1 - 1
src/app/partials/pro/account.html

@@ -53,7 +53,7 @@
 
 			<table class="grafana-options-table">
 				<tr ng-repeat="other in otherAccounts">
-					<td>name: {{other.name}}</td>
+					<td>email: {{other.email}}</td>
 					<td>role: {{other.role}}</td>
 					<td ng-show="other.isUsing">
 						currently using this account

+ 20 - 2
src/app/partials/pro/datasources.html

@@ -54,7 +54,7 @@
 						<div class="editor-row">
 							<div class="editor-option">
 								<label class="small">Data source name</label>
-								<input type="text" class="input-large" required ng-model='current.name' placeholder="production" required></input>
+								<input type="text" class="input-large" ng-model='current.name' placeholder="production" required></input>
 							</div>
 							<div class="editor-option">
 								<label class="small">Type</label>
@@ -65,13 +65,31 @@
 						<div class="editor-row">
 							<div class="editor-option">
 								<label class="small">Url</label>
-								<input type="text" class="input-xxlarge" required ng-model='current.url' placeholder="http://my.graphite.com:8080" required></input>
+								<input type="text" class="input-xxlarge" ng-model='current.url' placeholder="http://my.graphite.com:8080" required></input>
 							</div>
 							<div class="editor-option">
 								<label class="small">Access method <tip>Direct = url is used directly from browser, Proxy = Grafana backend will proxy the request</label>
 								<select class="input-medium" ng-model="current.access" ng-options="f for f in ['direct', 'proxy']"></select>
 							</div>
 						</div>
+
+						<div class="editor-row" ng-if="current.type === 'influxdb'">
+							<div class="section">
+								<h5>InfluxDB Details</h5>
+								<div class="editor-option">
+									<label class="small">Database name</label>
+									<input type="text" class="input-large" required ng-model='current.database' placeholder=""></input>
+								</div>
+								<div class="editor-option">
+									<label class="small">User</label>
+									<input type="text" class="input-large" ng-model='current.user' placeholder=""></input>
+								</div>
+								<div class="editor-option">
+									<label class="small">Password</label>
+									<input type="password" class="input-large" ng-model='current.password' placeholder=""></input>
+								</div>
+							</div>
+						</div>
 					</div>
 
 					<div class="dashboard-editor-footer" style="margin-top: 20px">

+ 4 - 0
src/app/services/pro/backendSrv.js

@@ -21,6 +21,10 @@ function (angular, _) {
       return this.request({ method: 'POST', url: url, data: data });
     };
 
+    this.put = function(url, data) {
+      return this.request({ method: 'PUT', url: url, data: data });
+    };
+
     this.request = function(options) {
       var httpOptions = {
         url: options.url,