mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-29 16:54:04 +02:00
parent
4587f26476
commit
06296f29d8
@ -50,10 +50,14 @@ class InlinePie extends AbstractWidget
|
|||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
private $template =<<<'EOD'
|
private $template =<<<'EOD'
|
||||||
|
<span class="sparkline" sparkTitle="{title}" sparkWidth="{width}" sparkHeight="{height}" style="{style}"
|
||||||
|
sparkSliceColors="[{colors}]" values="{data}" sparkType="pie"></span>
|
||||||
|
<noscript>
|
||||||
<img class="inlinepie"
|
<img class="inlinepie"
|
||||||
title="{title}" src="{url}" style="width: {width}px; height: {height}px; {style}"
|
title="{title}" src="{url}" style="width: {width}px; height: {height}px; {style}"
|
||||||
data-icinga-colors="{colors}" data-icinga-values="{data}"
|
data-icinga-colors="{colors}" data-icinga-values="{data}"
|
||||||
/>
|
/>
|
||||||
|
</noscript>
|
||||||
EOD;
|
EOD;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -69,10 +69,6 @@
|
|||||||
|
|
||||||
$('input.autofocus', el).focus();
|
$('input.autofocus', el).focus();
|
||||||
|
|
||||||
$('img.inlinepie', el).each(function() {
|
|
||||||
icinga.ui.initializeSparklines($(this));
|
|
||||||
});
|
|
||||||
|
|
||||||
// replace all sparklines
|
// replace all sparklines
|
||||||
$('span.sparkline', el).sparkline('html', { enableTagOptions: true });
|
$('span.sparkline', el).sparkline('html', { enableTagOptions: true });
|
||||||
|
|
||||||
|
@ -409,11 +409,6 @@
|
|||||||
|
|
||||||
this.icinga.ui.initializeTriStates($resp);
|
this.icinga.ui.initializeTriStates($resp);
|
||||||
|
|
||||||
// Replace images with sparklines.
|
|
||||||
$resp.find('img.inlinepie').each(function(){
|
|
||||||
self.icinga.ui.initializeSparklines($(this));
|
|
||||||
});
|
|
||||||
|
|
||||||
/* Should we try to fiddle with responses containing full HTML? */
|
/* Should we try to fiddle with responses containing full HTML? */
|
||||||
/*
|
/*
|
||||||
if ($('body', $resp).length) {
|
if ($('body', $resp).length) {
|
||||||
|
@ -631,32 +631,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* Search and replace all inlinepies with html for sparklines.
|
|
||||||
*
|
|
||||||
* @param parent
|
|
||||||
*/
|
|
||||||
initializeSparklines: function($container) {
|
|
||||||
|
|
||||||
// replace all remaining images with sparklines
|
|
||||||
var title = $container.attr('title'),
|
|
||||||
values = $container.data('icinga-values'),
|
|
||||||
colors = $container.data('icinga-colors'),
|
|
||||||
width = $container.css('width'),
|
|
||||||
height = $container.css('height');
|
|
||||||
if (!values) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$container.replaceWith(
|
|
||||||
'<span sparkTitle="' + title +
|
|
||||||
'" sparkWidth="' + width +
|
|
||||||
'" sparkHeight="' + height +
|
|
||||||
'" sparkType="pie" sparkSliceColors="[' +
|
|
||||||
colors + ']" values="' +
|
|
||||||
values + '" class="sparkline"></span>'
|
|
||||||
);
|
|
||||||
},
|
|
||||||
|
|
||||||
initializeControls: function (parent) {
|
initializeControls: function (parent) {
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user