edit.html 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <navbar
  2. title="Data Sources"
  3. title-url="datasources"
  4. icon="icon-gf icon-gf-datasources">
  5. </navbar>
  6. <div class="page-container">
  7. <div class="page-header">
  8. <h1 ng-show="isNew">Add data source</h1>
  9. <h1 ng-show="!isNew">Edit data source</h1>
  10. </div>
  11. <form name="editForm">
  12. <div class="gf-form-group">
  13. <div class="gf-form">
  14. <span class="gf-form-label width-7">Name</span>
  15. <input class="gf-form-input max-width-21" type="text" ng-model="current.name" placeholder="My data source name" required>
  16. <info-popover offset="0px -95px">
  17. The name is used when you select the data source in panels.
  18. The <code>Default</code> data source is preselected in new
  19. panels.
  20. </info-popover>
  21. <editor-checkbox text="Default" model="current.isDefault"></editor-checkbox>
  22. </div>
  23. <div class="gf-form">
  24. <span class="gf-form-label width-7">Type</span>
  25. <div class="gf-form-select-wrapper">
  26. <select class="gf-form-input gf-size-auto" ng-model="current.type" ng-options="v.id as v.name for v in types" ng-change="typeChanged()"></select>
  27. </div>
  28. </div>
  29. </div>
  30. <rebuild-on-change property="datasourceMeta.id">
  31. <plugin-component type="datasource-config-ctrl">
  32. </plugin-component>
  33. <dashboard-import-list plugin="datasourceMeta"></dashboard-import-list>
  34. </rebuild-on-change>
  35. <div ng-if="testing" style="margin-top: 25px">
  36. <h5 ng-show="!testing.done">Testing.... <i class="fa fa-spiner fa-spin"></i></h5>
  37. <h5 ng-show="testing.done">Test results</h5>
  38. <div class="alert-{{testing.status}} alert">
  39. <div class="alert-title">{{testing.title}}</div>
  40. <div ng-bind='testing.message'></div>
  41. </div>
  42. </div>
  43. <div class="gf-form-button-row">
  44. <button type="submit" class="btn btn-success" ng-show="isNew" ng-click="saveChanges()">Add</button>
  45. <button type="submit" class="btn btn-success" ng-show="!isNew" ng-click="saveChanges()">Save</button>
  46. <button type="submit" class="btn btn-secondary" ng-show="!isNew" ng-click="saveChanges(true)">
  47. Test Connection
  48. </button>
  49. <a class="btn btn-link" href="datasources">Cancel</a>
  50. </div>
  51. </form>
  52. </div>