|
|
|
@ -4,10 +4,11 @@
|
|
|
|
|
* Description:
|
|
|
|
|
* This is a demo file used only for the main dashboard (index.html)
|
|
|
|
|
**/
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
$(function () {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
//Make the dashboard widgets sortable Using jquery UI
|
|
|
|
|
$(".connectedSortable").sortable({
|
|
|
|
|
placeholder: "sort-highlight",
|
|
|
|
@ -29,21 +30,19 @@ $(function () {
|
|
|
|
|
//bootstrap WYSIHTML5 - text editor
|
|
|
|
|
$(".textarea").wysihtml5();
|
|
|
|
|
|
|
|
|
|
$('.daterange').daterangepicker(
|
|
|
|
|
{
|
|
|
|
|
ranges: {
|
|
|
|
|
'Today': [moment(), moment()],
|
|
|
|
|
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
|
|
|
|
|
'Last 7 Days': [moment().subtract(6, 'days'), moment()],
|
|
|
|
|
'Last 30 Days': [moment().subtract(29, 'days'), moment()],
|
|
|
|
|
'This Month': [moment().startOf('month'), moment().endOf('month')],
|
|
|
|
|
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
|
|
|
|
|
},
|
|
|
|
|
startDate: moment().subtract(29, 'days'),
|
|
|
|
|
endDate: moment()
|
|
|
|
|
},
|
|
|
|
|
function (start, end) {
|
|
|
|
|
alert("You chose: " + start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
|
|
|
|
|
$('.daterange').daterangepicker({
|
|
|
|
|
ranges: {
|
|
|
|
|
'Today': [moment(), moment()],
|
|
|
|
|
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
|
|
|
|
|
'Last 7 Days': [moment().subtract(6, 'days'), moment()],
|
|
|
|
|
'Last 30 Days': [moment().subtract(29, 'days'), moment()],
|
|
|
|
|
'This Month': [moment().startOf('month'), moment().endOf('month')],
|
|
|
|
|
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
|
|
|
|
|
},
|
|
|
|
|
startDate: moment().subtract(29, 'days'),
|
|
|
|
|
endDate: moment()
|
|
|
|
|
}, function (start, end) {
|
|
|
|
|
window.alert("You chose: " + start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/* jQueryKnob */
|
|
|
|
@ -190,44 +189,21 @@ $(function () {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//Fix for charts under tabs
|
|
|
|
|
$('.box ul.nav a').on('shown.bs.tab', function (e) {
|
|
|
|
|
$('.box ul.nav a').on('shown.bs.tab', function () {
|
|
|
|
|
area.redraw();
|
|
|
|
|
donut.redraw();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* BOX REFRESH PLUGIN EXAMPLE (usage with morris charts) */
|
|
|
|
|
$("#loading-example").boxRefresh({
|
|
|
|
|
source: "ajax/dashboard-boxrefresh-demo.php",
|
|
|
|
|
onLoadDone: function (box) {
|
|
|
|
|
bar = new Morris.Bar({
|
|
|
|
|
element: 'bar-chart',
|
|
|
|
|
resize: true,
|
|
|
|
|
data: [
|
|
|
|
|
{y: '2006', a: 100, b: 90},
|
|
|
|
|
{y: '2007', a: 75, b: 65},
|
|
|
|
|
{y: '2008', a: 50, b: 40},
|
|
|
|
|
{y: '2009', a: 75, b: 65},
|
|
|
|
|
{y: '2010', a: 50, b: 40},
|
|
|
|
|
{y: '2011', a: 75, b: 65},
|
|
|
|
|
{y: '2012', a: 100, b: 90}
|
|
|
|
|
],
|
|
|
|
|
barColors: ['#00a65a', '#f56954'],
|
|
|
|
|
xkey: 'y',
|
|
|
|
|
ykeys: ['a', 'b'],
|
|
|
|
|
labels: ['CPU', 'DISK'],
|
|
|
|
|
hideHover: 'auto'
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
line.redraw();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/* The todo list plugin */
|
|
|
|
|
$(".todo-list").todolist({
|
|
|
|
|
onCheck: function (ele) {
|
|
|
|
|
console.log("The element has been checked")
|
|
|
|
|
window.console.log("The element has been checked");
|
|
|
|
|
return ele;
|
|
|
|
|
},
|
|
|
|
|
onUncheck: function (ele) {
|
|
|
|
|
console.log("The element has been unchecked")
|
|
|
|
|
window.console.log("The element has been unchecked");
|
|
|
|
|
return ele;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|