Commit 21605bf9 authored by Antonin Dvorak's avatar Antonin Dvorak
Browse files

update js for grafana 8.2.1

parent 9349d957
......@@ -383107,7 +383107,8 @@ module.exports = path;
/***/ ((module) => {
 
// Module
var code = "\n<div class=\"graph-annotation\">\n\t<div class=\"graph-annotation__header\">\n\t\t<div class=\"graph-annotation__user\" bs-tooltip=\"'Created by {{ctrl.login}}'\">\n\t\t</div>\n\n\t\t<div class=\"graph-annotation__title\">\n\t\t\t<span ng-if=\"!ctrl.event.id\">Add annotation</span>\n\t\t\t<span ng-if=\"ctrl.event.id\">Edit annotation</span>\n\t\t</div>\n\n <div class=\"graph-annotation__time\">{{ctrl.timeFormated}}</div>\n\t</div>\n\n\t<form name=\"ctrl.form\" class=\"graph-annotation__body text-center\">\n\t\t<div style=\"display: inline-block\">\n\t\t\t<div class=\"gf-form gf-form--v-stretch\">\n\t\t\t\t<span class=\"gf-form-label width-7\">Description</span>\n\t\t\t\t<textarea class=\"gf-form-input width-20\" rows=\"2\" ng-model=\"ctrl.event.text\" placeholder=\"Description\"></textarea>\n\t\t\t</div>\n\n\t\t\t<div class=\"gf-form\">\n\t\t\t\t<span class=\"gf-form-label width-7\">Tags</span>\n\t\t\t\t<bootstrap-tagsinput ng-model=\"ctrl.event.tags\" tagclass=\"label label-tag\" placeholder=\"add tags\">\n\t\t\t\t</bootstrap-tagsinput>\n\t\t\t</div>\n\n\t\t\t<div class=\"gf-form-button-row\">\n\t\t\t\t<button type=\"submit\" class=\"btn btn-primary\" ng-click=\"ctrl.save_anomaly_with_vars()\">Anomaly</button><button type=\"submit\" class=\"btn btn-primary\" ng-click=\"ctrl.save_normal_with_vars()\">Normal</button><button type=\"submit\" class=\"btn btn-primary\" ng-click=\"ctrl.save()\">Save</button>\n\t\t\t\t<button ng-if=\"ctrl.event.id\" type=\"submit\" class=\"btn btn-danger\" ng-click=\"ctrl.delete()\">Delete</button>\n\t\t\t\t<a class=\"btn-text\" ng-click=\"ctrl.close();\">Cancel</a>\n\t\t\t</div>\n\t\t</div>\n\t</form>\n</div>\n";// Exports
var code = "\n<div class=\"graph-annotation\">\n\t<div class=\"graph-annotation__header\">\n\t\t<div class=\"graph-annotation__user\" bs-tooltip=\"'Created by {{ctrl.login}}'\">\n\t\t</div>\n\n\t\t<div class=\"graph-annotation__title\">\n\t\t\t<span ng-if=\"!ctrl.event.id\">Add annotation</span>\n\t\t\t<span ng-if=\"ctrl.event.id\">Edit annotation</span>\n\t\t</div>\n\n <div class=\"graph-annotation__time\">{{ctrl.timeFormated}}</div>\n\t</div>\n\n\t<form name=\"ctrl.form\" class=\"graph-annotation__body text-center\">\n\t\t<div style=\"display: inline-block\">\n\t\t\t<div class=\"gf-form gf-form--v-stretch\">\n\t\t\t\t<span class=\"gf-form-label width-7\">Description</span>\n\t\t\t\t<textarea class=\"gf-form-input width-20\" rows=\"2\" ng-model=\"ctrl.event.text\" placeholder=\"Description\"></textarea>\n\t\t\t</div>\n\n\t\t\t<div class=\"gf-form\">\n\t\t\t\t<span class=\"gf-form-label width-7\">Tags</span>\n\t\t\t\t<bootstrap-tagsinput ng-model=\"ctrl.event.tags\" tagclass=\"label label-tag\" placeholder=\"add tags\">\n\t\t\t\t</bootstrap-tagsinput>\n\t\t\t</div>\n\n\t\t\t<div class=\"gf-form-button-row\">\n\t\t\t\t<button type=\"submit\" class=\"btn btn-primary\" ng-click=\"ctrl.save_anomaly_with_vars()\">Anomaly</button><button type=\"submit\" class=\"btn btn-primary\" ng-click=\"ctrl.save_normal_with_vars()\">Normal</button><button type=\"submit\" class=\"btn btn-primary\" ng-click=\"ctrl.save()\">Save</button>\n\t\t\t\t<button ng-if=\"ctrl.event.id\" type=\"submit\" class=\"btn btn-danger\" ng-click=\"ctrl.delete()\">Delete</button>\n\t\t\t\t<a class=\"btn-text\" ng-click=\"ctrl.close();\">Cancel</a>\n\t\t\t</div>\n\t\t</div>\n\t</form>\n</div>\n";
// Exports
var _module_exports =code;;
var path = 'public/app/features/annotations/partials/event_editor.html';
window.angular.module('ng').run(['$templateCache', function(c) { c.put(path, _module_exports) }]);
......@@ -543505,75 +543506,47 @@ var SetLike = /*#__PURE__*/function () {
value: function clear() {
this.items = [];
}
}, {
key: "save_normal_with_vars",
value: function() {
var e = this;
if (this.form.$valid) {
var t = u.a.cloneDeep(this.event);
//Extension: Include automatically templated values as tags
t.tags.push("normal");
// Get list of templated variables from the DOM
var mylist = document.querySelectorAll('[aria-label="Dashboard template variables submenu item"]');
//console.log(mylist);
for (var i = 0; i < mylist.length; i ) {
var mylabel = mylist[i].childNodes[0].childNodes[0].innerText;
var myvalue = mylist[i].childNodes[0].childNodes[1].innerText;
console.log("templated var label: " mylabel);
console.log("templated var value: " myvalue);
var mytag = mylabel ":" myvalue;
console.log(mytag);
//t.tags.push(myvalue);
t.tags.push(mytag);
}
//End Extension
t.time = t.time.valueOf(), t.timeEnd = 0, t.isRegion && (t.timeEnd = this.event.timeEnd.valueOf(), t.timeEnd < t.time) ? console.log("invalid time") : t.id ? this.anno
e.panelCtrl.refresh(), e.close()
})).catch((function() {
e.panelCtrl.refresh(), e.close()
})) : this.annotationsSrv.saveAnnotationEvent(t).then((function() {
e.panelCtrl.refresh(), e.close()
})).catch((function() {
e.panelCtrl.refresh(), e.close()
}))
}
}
},{
key: "save_anomaly_with_vars",
value: function() {
var e = this;
if (this.form.$valid) {
var t = u.a.cloneDeep(this.event);
//Extension: Include automatically templated values as tags
t.tags.push("anomaly");
// Get list of templated variables from the DOM
var mylist = document.querySelectorAll('[aria-label="Dashboard template variables submenu item"]');
//console.log(mylist);
for (var i = 0; i < mylist.length; i ) {
var mylabel = mylist[i].childNodes[0].childNodes[0].innerText;
var myvalue = mylist[i].childNodes[0].childNodes[1].innerText;
console.log("templated var label: " mylabel);
console.log("templated var value: " myvalue);
var mytag = mylabel ":" myvalue;
console.log(mytag);
//t.tags.push(myvalue);
t.tags.push(mytag);
}
//End Extension
t.time = t.time.valueOf(), t.timeEnd = 0, t.isRegion && (t.timeEnd = this.event.timeEnd.valueOf(), t.timeEnd < t.time) ? console.log("invalid time") : t.id ? this.anno
e.panelCtrl.refresh(), e.close()
})).catch((function() {
e.panelCtrl.refresh(), e.close()
})) : this.annotationsSrv.saveAnnotationEvent(t).then((function() {
e.panelCtrl.refresh(), e.close()
})).catch((function() {
e.panelCtrl.refresh(), e.close()
}))
}
}
key:"save_normal_with_vars",value:function(){var e=this;if(this.form.$valid){var t=u.a.cloneDeep(this.event);
//Extension: Include automatically templated values as tags
t.tags.push("normal");
// Get list of templated variables from the DOM
var mylist = document.querySelectorAll('[aria-label="Dashboard template variables submenu item"]');
//console.log(mylist);
for (var i = 0; i < mylist.length; i++) {
var mylabel = mylist[i].childNodes[0].childNodes[0].innerText;
var myvalue = mylist[i].childNodes[0].childNodes[1].innerText;
console.log("templated var label: " + mylabel);
console.log("templated var value: " + myvalue);
var mytag = mylabel + ":" + myvalue;
console.log(mytag);
//t.tags.push(myvalue);
t.tags.push(mytag);
}
//End Extension
t.time=t.time.valueOf(),t.timeEnd=0,t.isRegion&&(t.timeEnd=this.event.timeEnd.valueOf(),t.timeEnd<t.time)?console.log("invalid time"):t.id?this.annotationsSrv.updateAnnotationEvent(t).then((function(){e.panelCtrl.refresh(),e.close()})).catch((function(){e.panelCtrl.refresh(),e.close()})):this.annotationsSrv.saveAnnotationEvent(t).then((function(){e.panelCtrl.refresh(),e.close()})).catch((function(){e.panelCtrl.refresh(),e.close()}))}}
},{
key:"save_anomaly_with_vars",value:function(){var e=this;if(this.form.$valid){var t=u.a.cloneDeep(this.event);
//Extension: Include automatically templated values as tags
t.tags.push("anomaly");
// Get list of templated variables from the DOM
var mylist = document.querySelectorAll('[aria-label="Dashboard template variables submenu item"]');
//console.log(mylist);
for (var i = 0; i < mylist.length; i++) {
var mylabel = mylist[i].childNodes[0].childNodes[0].innerText;
var myvalue = mylist[i].childNodes[0].childNodes[1].innerText;
console.log("templated var label: " + mylabel);
console.log("templated var value: " + myvalue);
var mytag = mylabel + ":" + myvalue;
console.log(mytag);
//t.tags.push(myvalue);
t.tags.push(mytag);
}
//End Extension
t.time=t.time.valueOf(),t.timeEnd=0,t.isRegion&&(t.timeEnd=this.event.timeEnd.valueOf(),t.timeEnd<t.time)?console.log("invalid time"):t.id?this.annotationsSrv.updateAnnotationEvent(t).then((function(){e.panelCtrl.refresh(),e.close()})).catch((function(){e.panelCtrl.refresh(),e.close()})):this.annotationsSrv.saveAnnotationEvent(t).then((function(){e.panelCtrl.refresh(),e.close()})).catch((function(){e.panelCtrl.refresh(),e.close()}))}}
},{
key: "delete",
value: function _delete(value) {
var previousLength = this.items.length;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment