22 |
23 | Welcome to GitHub Pages.
24 |
25 | This automatic page generator is the easiest way to create beautiful pages for all of your projects. Author your page content here using GitHub Flavored Markdown, select a template crafted by a designer, and publish. After your page is generated, you can check out the new gh-pages branch locally. If you’re using GitHub Desktop, simply sync your repository and you’ll see the new branch.
26 |
27 |
28 | Designer Templates
29 |
30 | We’ve crafted some handsome templates for you to use. Go ahead and click 'Continue to layouts' to browse through them. You can easily go back to edit your page before publishing. After publishing your page, you can revisit the page generator and switch to another theme. Your Page content will be preserved.
31 |
32 |
33 | Creating pages manually
34 |
35 | If you prefer to not use the automatic generator, push a branch named gh-pages to your repository to create a page manually. In addition to supporting regular HTML content, GitHub Pages support Jekyll, a simple, blog aware static site generator. Jekyll makes it easy to create site-wide headers and footers without having to copy them across every page. It also offers intelligent blog support and other advanced templating features.
36 |
37 |
38 | Authors and Contributors
39 |
40 | You can @mention a GitHub username to generate a link to their profile. The resulting <a> element will link to the contributor’s GitHub Profile. For example: In 2007, Chris Wanstrath (@defunkt), PJ Hyett (@pjhyett), and Tom Preston-Werner (@mojombo) founded GitHub.
41 |
42 |
43 | Support or Contact
44 |
45 | Having trouble with Pages? Check out our documentation or contact support and we’ll help you sort it out.
46 |
47 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/dist/test/query_ctrl.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports.AtlasDatasourceQueryCtrl = undefined;
7 |
8 | var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
9 |
10 | var _angular = require("angular");
11 |
12 | var _angular2 = _interopRequireDefault(_angular);
13 |
14 | var _lodash = require("lodash");
15 |
16 | var _lodash2 = _interopRequireDefault(_lodash);
17 |
18 | var _sdk = require("app/plugins/sdk");
19 |
20 | require("./css/query-editor.css!");
21 |
22 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23 |
24 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
25 |
26 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
27 |
28 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
29 |
30 | var AtlasDatasourceQueryCtrl = exports.AtlasDatasourceQueryCtrl = function (_QueryCtrl) {
31 | _inherits(AtlasDatasourceQueryCtrl, _QueryCtrl);
32 |
33 | function AtlasDatasourceQueryCtrl($scope, $injector, templateSrv, uiSegmentSrv) {
34 | _classCallCheck(this, AtlasDatasourceQueryCtrl);
35 |
36 | var _this = _possibleConstructorReturn(this, (AtlasDatasourceQueryCtrl.__proto__ || Object.getPrototypeOf(AtlasDatasourceQueryCtrl)).call(this, $scope, $injector));
37 |
38 | _this.scope = $scope;
39 | _this.uiSegmentSrv = uiSegmentSrv;
40 | _this.templateSrv = templateSrv;
41 | _this.target.target = _this.target.target || 'select metric';
42 | _this.scope.atlas = {};
43 | _this.scope.atlas.aggregations = ["sum", "avg", "count", "max", "min", "cf-avg", "cf-max", "cf-min", "cf-sum"];
44 | _this.scope.atlas.steps = ["s", "m", "h", "d"];
45 | _this.scope.atlas.logical = ["and", "or"];
46 | _this.scope.atlas.notCondition = [" ", "not"];
47 | _this.scope.atlas.matchers = ["eq", "ge", "gt", "le", "lt", "has", "in", "re", "reic"];
48 | return _this;
49 | }
50 |
51 | _createClass(AtlasDatasourceQueryCtrl, [{
52 | key: "getOptions",
53 | value: function getOptions() {
54 | return this.datasource.metricFindQuery(this.target).then(this.uiSegmentSrv.transformToSegments(true));
55 | // Options have to be transformed by uiSegmentSrv to be usable by metric-segment-model directive
56 | }
57 | }, {
58 | key: "getDimensionsForMetric",
59 | value: function getDimensionsForMetric() {
60 | if (this.target.target) {
61 | console.log("have a target, getting applicable dimensions");
62 |
63 | return this.datasource.metricFindDimensions(this.target).then(this.uiSegmentSrv.transformToSegments(true));
64 | }
65 | }
66 | }, {
67 | key: "getDimensionValues",
68 | value: function getDimensionValues(tag) {
69 | if (tag) {
70 | console.log("have a dimension, getting available values");
71 | return this.datasource.dimensionFindValues(this.target, tag).then(this.uiSegmentSrv.transformToSegments(true));
72 | }
73 | }
74 | }, {
75 | key: "onChangeInternal",
76 | value: function onChangeInternal() {
77 | this.panelCtrl.refresh(); // Asks the panel to refresh data.
78 | }
79 | }, {
80 | key: "toggleRawQuery",
81 | value: function toggleRawQuery(aTarget) {
82 | aTarget.rawQueryInput = !aTarget.rawQueryInput;
83 | this.panelCtrl.refresh();
84 | }
85 | }, {
86 | key: "removeTag",
87 | value: function removeTag(tag) {
88 | if (this.target.tags) {
89 | this.target.tags.splice(this.target.tags.indexOf(tag), 1);
90 | this.panelCtrl.refresh();
91 | }
92 | }
93 | }, {
94 | key: "addTag",
95 | value: function addTag() {
96 | if (!this.target.tags) {
97 | this.target.tags = [];
98 | }
99 | this.target.tags.push({
100 | name: null,
101 | value: null,
102 | notCondition: this.scope.atlas.notCondition[0],
103 | logical: this.scope.atlas.logical[0],
104 | matcher: this.scope.atlas.matchers[0]
105 | });
106 | }
107 | }, {
108 | key: "removeGroupBy",
109 | value: function removeGroupBy(groupBy) {
110 | if (this.target.groupBys) {
111 | this.target.groupBys.splice(this.target.groupBys.indexOf(groupBy), 1);
112 | }
113 | }
114 | }, {
115 | key: "addGroupBy",
116 | value: function addGroupBy() {
117 | if (!this.target.groupBys) {
118 | this.target.groupBys = [];
119 | }
120 | this.target.groupBys.push({});
121 | }
122 | }]);
123 |
124 | return AtlasDatasourceQueryCtrl;
125 | }(_sdk.QueryCtrl);
126 |
127 | AtlasDatasourceQueryCtrl.templateUrl = 'partials/query.editor.html';
128 | //# sourceMappingURL=query_ctrl.js.map
129 |
--------------------------------------------------------------------------------
/dist/test/query_ctrl.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"sources":["../../src/query_ctrl.js"],"names":["AtlasDatasourceQueryCtrl","$scope","$injector","templateSrv","uiSegmentSrv","scope","target","atlas","aggregations","steps","logical","notCondition","matchers","datasource","metricFindQuery","then","transformToSegments","console","log","metricFindDimensions","tag","dimensionFindValues","panelCtrl","refresh","aTarget","rawQueryInput","tags","splice","indexOf","push","name","value","matcher","groupBy","groupBys","templateUrl"],"mappings":";;;;;;;;;AAAA;;;;AACA;;;;AACA;;AACA;;;;;;;;;;IAEaA,wB,WAAAA,wB;;;AAET,sCAAYC,MAAZ,EAAoBC,SAApB,EAA+BC,WAA/B,EAA4CC,YAA5C,EAA0D;AAAA;;AAAA,wJAChDH,MADgD,EACxCC,SADwC;;AAGtD,cAAKG,KAAL,GAAaJ,MAAb;AACA,cAAKG,YAAL,GAAoBA,YAApB;AACA,cAAKD,WAAL,GAAmBA,WAAnB;AACA,cAAKG,MAAL,CAAYA,MAAZ,GAAqB,MAAKA,MAAL,CAAYA,MAAZ,IAAsB,eAA3C;AACA,cAAKD,KAAL,CAAWE,KAAX,GAAmB,EAAnB;AACA,cAAKF,KAAL,CAAWE,KAAX,CAAiBC,YAAjB,GAAgC,CAC5B,KAD4B,EAE5B,KAF4B,EAG5B,OAH4B,EAI5B,KAJ4B,EAK5B,KAL4B,EAM5B,QAN4B,EAO5B,QAP4B,EAQ5B,QAR4B,EAS5B,QAT4B,CAAhC;AAWA,cAAKH,KAAL,CAAWE,KA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"query_ctrl.js","sourcesContent":["import angular from \"angular\";\nimport _ from \"lodash\";\nimport {QueryCtrl} from 'app/plugins/sdk';\nimport './css/query-editor.css!';\n\nexport class AtlasDatasourceQueryCtrl extends QueryCtrl {\n\n constructor($scope, $injector, templateSrv, uiSegmentSrv) {\n super($scope, $injector);\n\n this.scope = $scope;\n this.uiSegmentSrv = uiSegmentSrv;\n this.templateSrv = templateSrv;\n this.target.target = this.target.target || 'select metric';\n this.scope.atlas = {};\n this.scope.atlas.aggregations = [\n \"sum\",\n \"avg\",\n \"count\",\n \"max\",\n \"min\",\n \"cf-avg\",\n \"cf-max\",\n \"cf-min\",\n \"cf-sum\"\n ];\n this.scope.atlas.steps = [\n \"s\",\n \"m\",\n \"h\",\n \"d\"\n ];\n this.scope.atlas.logical = [\n \"and\",\n \"or\"\n ];\n this.scope.atlas.notCondition = [\n \" \",\n \"not\"\n ];\n this.scope.atlas.matchers = [\n \"eq\",\n \"ge\",\n \"gt\",\n \"le\",\n \"lt\",\n \"has\",\n \"in\",\n \"re\",\n \"reic\"\n ];\n }\n\n getOptions() {\n return this.datasource.metricFindQuery(this.target)\n .then(this.uiSegmentSrv.transformToSegments(true));\n // Options have to be transformed by uiSegmentSrv to be usable by metric-segment-model directive\n }\n\n getDimensionsForMetric() {\n if (this.target.target) {\n console.log(\"have a target, getting applicable dimensions\");\n\n return this.datasource.metricFindDimensions(this.target)\n .then(this.uiSegmentSrv.transformToSegments(true));\n }\n }\n\n getDimensionValues(tag) {\n if (tag) {\n console.log(\"have a dimension, getting available values\");\n return this.datasource.dimensionFindValues(this.target,tag)\n .then(this.uiSegmentSrv.transformToSegments(true));\n }\n }\n\n onChangeInternal() {\n this.panelCtrl.refresh(); // Asks the panel to refresh data.\n }\n\n toggleRawQuery(aTarget) {\n aTarget.rawQueryInput = !aTarget.rawQueryInput;\n this.panelCtrl.refresh();\n }\n\n removeTag(tag) {\n if (this.target.tags) {\n this.target.tags.splice(this.target.tags.indexOf(tag), 1);\n this.panelCtrl.refresh();\n }\n }\n\n addTag() {\n if (!this.target.tags) {\n this.target.tags = [];\n }\n this.target.tags.push({\n name: null,\n value: null,\n notCondition: this.scope.atlas.notCondition[0],\n logical: this.scope.atlas.logical[0],\n matcher: this.scope.atlas.matchers[0]\n });\n }\n\n removeGroupBy(groupBy) {\n if (this.target.groupBys) {\n this.target.groupBys.splice(this.target.groupBys.indexOf(groupBy), 1);\n }\n }\n\n addGroupBy() {\n if (!this.target.groupBys) {\n this.target.groupBys = [];\n }\n this.target.groupBys.push({});\n }\n}\n\nAtlasDatasourceQueryCtrl.templateUrl = 'partials/query.editor.html';\n"]}
--------------------------------------------------------------------------------
/dist/query_ctrl.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"sources":["../src/query_ctrl.js"],"names":["angular","_","QueryCtrl","AtlasDatasourceQueryCtrl","$scope","$injector","templateSrv","uiSegmentSrv","scope","target","atlas","aggregations","steps","logical","notCondition","matchers","datasource","metricFindQuery","then","transformToSegments","console","log","metricFindDimensions","tag","dimensionFindValues","panelCtrl","refresh","aTarget","rawQueryInput","tags","splice","indexOf","push","name","value","matcher","groupBy","groupBys","templateUrl"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAOA,mB;;AACAC,a;;AACCC,qB,kBAAAA,S;;;;;;;;;;;;;;;;;;;;;gDAGKC,wB;;;AAET,kDAAYC,MAAZ,EAAoBC,SAApB,EAA+BC,WAA/B,EAA4CC,YAA5C,EAA0D;AAAA;;AAAA,oKAChDH,MADgD,EACxCC,SADwC;;AAGtD,0BAAKG,KAAL,GAAaJ,MAAb;AACA,0BAAKG,YAAL,GAAoBA,YAApB;AACA,0BAAKD,WAAL,GAAmBA,WAAnB;AACA,0BAAKG,MAAL,CAAYA,MAAZ,GAAqB,MAAKA,MAAL,CAAYA,MAAZ,IAAsB,eAA3C;AACA,0BAAKD,KAAL,CAAWE,KAAX,GAAmB,EAAnB;AACA,0BAAKF,KAAL,CAAWE,KAAX,CA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4B,QAAjB,EAA2B;AACvB,iCAAK5B,MAAL,CAAY4B,QAAZ,GAAuB,EAAvB;AACH;AACD,6BAAK5B,MAAL,CAAY4B,QAAZ,CAAqBL,IAArB,CAA0B,EAA1B;AACH;;;;cA/GyC9B,S;;;;AAkH9CC,qCAAyBmC,WAAzB,GAAuC,4BAAvC","file":"query_ctrl.js","sourcesContent":["import angular from \"angular\";\nimport _ from \"lodash\";\nimport {QueryCtrl} from 'app/plugins/sdk';\nimport './css/query-editor.css!';\n\nexport class AtlasDatasourceQueryCtrl extends QueryCtrl {\n\n constructor($scope, $injector, templateSrv, uiSegmentSrv) {\n super($scope, $injector);\n\n this.scope = $scope;\n this.uiSegmentSrv = uiSegmentSrv;\n this.templateSrv = templateSrv;\n this.target.target = this.target.target || 'select metric';\n this.scope.atlas = {};\n this.scope.atlas.aggregations = [\n \"sum\",\n \"avg\",\n \"count\",\n \"max\",\n \"min\",\n \"cf-avg\",\n \"cf-max\",\n \"cf-min\",\n \"cf-sum\"\n ];\n this.scope.atlas.steps = [\n \"s\",\n \"m\",\n \"h\",\n \"d\"\n ];\n this.scope.atlas.logical = [\n \"and\",\n \"or\"\n ];\n this.scope.atlas.notCondition = [\n \" \",\n \"not\"\n ];\n this.scope.atlas.matchers = [\n \"eq\",\n \"ge\",\n \"gt\",\n \"le\",\n \"lt\",\n \"has\",\n \"in\",\n \"re\",\n \"reic\"\n ];\n }\n\n getOptions() {\n return this.datasource.metricFindQuery(this.target)\n .then(this.uiSegmentSrv.transformToSegments(true));\n // Options have to be transformed by uiSegmentSrv to be usable by metric-segment-model directive\n }\n\n getDimensionsForMetric() {\n if (this.target.target) {\n console.log(\"have a target, getting applicable dimensions\");\n\n return this.datasource.metricFindDimensions(this.target)\n .then(this.uiSegmentSrv.transformToSegments(true));\n }\n }\n\n getDimensionValues(tag) {\n if (tag) {\n console.log(\"have a dimension, getting available values\");\n return this.datasource.dimensionFindValues(this.target,tag)\n .then(this.uiSegmentSrv.transformToSegments(true));\n }\n }\n\n onChangeInternal() {\n this.panelCtrl.refresh(); // Asks the panel to refresh data.\n }\n\n toggleRawQuery(aTarget) {\n aTarget.rawQueryInput = !aTarget.rawQueryInput;\n this.panelCtrl.refresh();\n }\n\n removeTag(tag) {\n if (this.target.tags) {\n this.target.tags.splice(this.target.tags.indexOf(tag), 1);\n this.panelCtrl.refresh();\n }\n }\n\n addTag() {\n if (!this.target.tags) {\n this.target.tags = [];\n }\n this.target.tags.push({\n name: null,\n value: null,\n notCondition: this.scope.atlas.notCondition[0],\n logical: this.scope.atlas.logical[0],\n matcher: this.scope.atlas.matchers[0]\n });\n }\n\n removeGroupBy(groupBy) {\n if (this.target.groupBys) {\n this.target.groupBys.splice(this.target.groupBys.indexOf(groupBy), 1);\n }\n }\n\n addGroupBy() {\n if (!this.target.groupBys) {\n this.target.groupBys = [];\n }\n this.target.groupBys.push({});\n }\n}\n\nAtlasDatasourceQueryCtrl.templateUrl = 'partials/query.editor.html';\n"]}
--------------------------------------------------------------------------------
/dist/partials/query.editor.html:
--------------------------------------------------------------------------------
1 |