diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 5492d6c8b5224026b25900d780341bb0be9463d3..d12f29c1be05e2c2666c14907168aaf097099d13 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1961,15 +1961,38 @@ "integrity": "sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc=", "dev": true }, - "charm": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/charm/-/charm-0.1.2.tgz", - "integrity": "sha1-BsIe7RobBq62dVPNxT4jJ0usIpY=" - }, "chart.js": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-1.0.2.tgz", - "integrity": "sha1-rVfSIpz9jM9ZVRR+gSG0kR5p3+c=" + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-2.7.2.tgz", + "integrity": "sha512-90wl3V9xRZ8tnMvMlpcW+0Yg13BelsGS9P9t0ClaDxv/hdypHDr/YAGf+728m11P5ljwyB0ZHfPKCapZFqSqYA==", + "requires": { + "chartjs-color": "^2.1.0", + "moment": "^2.10.2" + } + }, + "chartjs-color": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/chartjs-color/-/chartjs-color-2.2.0.tgz", + "integrity": "sha1-hKL7dVeH7YXDndbdjHsdiEKbrq4=", + "requires": { + "chartjs-color-string": "^0.5.0", + "color-convert": "^0.5.3" + }, + "dependencies": { + "color-convert": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-0.5.3.tgz", + "integrity": "sha1-vbbGnOZg+t/+CwAHzER+G59ygr0=" + } + } + }, + "chartjs-color-string": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/chartjs-color-string/-/chartjs-color-string-0.5.0.tgz", + "integrity": "sha512-amWNvCOXlOUYxZVDSa0YOab5K/lmEhbFNKI55PWc4mlv28BDzA7zaoQTGxSBgJMHIW+hGX8YUrvw/FH4LyhwSQ==", + "requires": { + "color-name": "^1.0.0" + } }, "chokidar": { "version": "2.0.4", @@ -2201,8 +2224,7 @@ "color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" }, "color-string": { "version": "0.3.0", @@ -6715,38 +6737,11 @@ "minimist": "0.0.8" } }, - "module-deps": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-6.1.0.tgz", - "integrity": "sha512-NPs5N511VD1rrVJihSso/LiBShRbJALYBKzDW91uZYy7BpjnO4bGnZL3HjZ9yKcFdZUWwaYjDz9zxbuP7vKMuQ==", - "requires": { - "JSONStream": "^1.0.3", - "browser-resolve": "^1.7.0", - "cached-path-relative": "^1.0.0", - "concat-stream": "~1.6.0", - "defined": "^1.0.0", - "detective": "^5.0.2", - "duplexer2": "^0.1.2", - "inherits": "^2.0.1", - "parents": "^1.0.0", - "readable-stream": "^2.0.2", - "resolve": "^1.4.0", - "stream-combiner2": "^1.1.1", - "subarg": "^1.0.0", - "through2": "^2.0.0", - "xtend": "^4.0.0" - } - }, "moment": { "version": "2.22.2", "resolved": "https://registry.npmjs.org/moment/-/moment-2.22.2.tgz", "integrity": "sha1-PCV/mDn8DpP/UxSWMiOeuQeD/2Y=" }, - "morris.js": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/morris.js/-/morris.js-0.5.0.tgz", - "integrity": "sha1-cldnE1z64Fmq51mZuyzmocXRtEs=" - }, "move-concurrently": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", diff --git a/package.json b/package.json index 287ab6dbc86dcb0a0affed2564f339570d1c8406..f818ceb493c70fed00b2bda0184b538ce63779c4 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ "bootstrap-datepicker": "^1.6.4", "bootstrap-less": "^3.3.8", "bootstrap-table": "^1.12.1", + "chart.js": "^2.7.2", "ekko-lightbox": "^5.1.1", "font-awesome": "^4.7.0", "icheck": "^1.0.2", diff --git a/public/css/AdminLTE.css b/public/css/AdminLTE.css index 36ea687f54fc486fdf16e05b388c6b6b3e05a3c8..1acf4d9479e4d2a3a2aed246c1c9e6b8c2f4ead9 100755 Binary files a/public/css/AdminLTE.css and b/public/css/AdminLTE.css differ diff --git a/public/css/app.css b/public/css/app.css index 256006746ca692904e491e11ef7809f7abe3bbf5..9c49411b797b6331981604335fd0c879250e6dc4 100644 Binary files a/public/css/app.css and b/public/css/app.css differ diff --git a/public/css/build/all.css b/public/css/build/all.css index 451f4691f3f6afae973b66bc0ef006635930d557..f175d1103b8a7a30cbfc84a1ceb9f72db8bd35d8 100644 Binary files a/public/css/build/all.css and b/public/css/build/all.css differ diff --git a/public/css/dist/all.css b/public/css/dist/all.css index f08aef2a4aa81727bc8dcaa1e25c75c64e382061..f175d1103b8a7a30cbfc84a1ceb9f72db8bd35d8 100644 Binary files a/public/css/dist/all.css and b/public/css/dist/all.css differ diff --git a/public/css/dist/bootstrap-table.css b/public/css/dist/bootstrap-table.css index 31703a32646e2d7375260cca70f6e4ee2feb28dd..1daf4f1c8f991e18288e1721c241c1929515ed55 100644 Binary files a/public/css/dist/bootstrap-table.css and b/public/css/dist/bootstrap-table.css differ diff --git a/public/css/overrides.css b/public/css/overrides.css index b7a7f60b45ce23bfa5bc9e6d35558f7c2ae10a95..642f85d2b11008a8cf5e5f6018af79b0843483bf 100644 Binary files a/public/css/overrides.css and b/public/css/overrides.css differ diff --git a/public/js/app.js b/public/js/app.js index 26262e6af987b42f1b38bc1a08ff6944d884d9d2..3f88b28eb82e7fc9628c1e2feedd17b2fd065f79 100644 Binary files a/public/js/app.js and b/public/js/app.js differ diff --git a/public/js/dist/bootstrap-table-simple-view.js b/public/js/dist/bootstrap-table-simple-view.js index c224ff0c555bfd5556c5c46066d200812a365931..efa8072bc74936299e3ccf483ca3e1abf37ae277 100644 Binary files a/public/js/dist/bootstrap-table-simple-view.js and b/public/js/dist/bootstrap-table-simple-view.js differ diff --git a/public/js/dist/bootstrap-table.js b/public/js/dist/bootstrap-table.js index 3d732e38894b7e0e271d3c1871bca4bd6decc828..62ee160380bb9cb5b15b8be8a57d5914c614682c 100644 Binary files a/public/js/dist/bootstrap-table.js and b/public/js/dist/bootstrap-table.js differ diff --git a/public/js/vendor.js b/public/js/vendor.js index 3e959e3914df496ad06bfe327291e18fc13b4757..c89382a34760c4b8e0ccef69d7f9b35617992038 100644 Binary files a/public/js/vendor.js and b/public/js/vendor.js differ diff --git a/public/mix-manifest.json b/public/mix-manifest.json index ecad0c047cf97e1ce142c2aa4bb4da9a941b3e8c..be6f5a6a35703b92ab55ee43d677685b8115694f 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,11 +1,11 @@ { - "/js/app.js": "/js/app.js?id=cb3b214bf844383831d7", - "/css/AdminLTE.css": "/css/AdminLTE.css?id=a501321b732a1aca5cc9", - "/css/app.css": "/css/app.css?id=c3b4e5ea2063d7f76241", - "/css/overrides.css": "/css/overrides.css?id=3f6a7848656e6755847e", - "/css/dist/all.css": "/css/dist/all.css?id=c78a60594ab97ac02719", - "/css/build/all.css": "/css/build/all.css?id=c78a60594ab97ac02719", - "/js/vendor.js": "/js/vendor.js?id=534ce0a6cfd17eec12d1", + "/js/app.js": "/js/app.js?id=d5f4ce25af088f5c0b3b", + "/css/AdminLTE.css": "/css/AdminLTE.css?id=3f11a229453c98bd7d9d", + "/css/app.css": "/css/app.css?id=6c077c0864a66fa68f27", + "/css/overrides.css": "/css/overrides.css?id=6b828d7767ff152a582b", + "/css/dist/all.css": "/css/dist/all.css?id=52eeb0ac804d01ab930e", + "/css/build/all.css": "/css/build/all.css?id=52eeb0ac804d01ab930e", + "/js/vendor.js": "/js/vendor.js?id=b1deab531243218b0614", "/js/html5shiv.min.js": "/js/html5shiv.min.js?id=ba846cb704dbfbc5f1b3", "/js/respond.min.js": "/js/respond.min.js?id=afc1984a3d17110449dc", "/js/dist/bootstrap-table.js": "/js/dist/bootstrap-table.js?id=7223478ba9bf2c6dfb4f", diff --git a/resources/assets/js/snipeit.js b/resources/assets/js/snipeit.js index 9bae43b2a30e83f5eda617d6b23511a6e80ef3fa..8cd91d69ed51a8af723ac55af6139d29c5763880 100755 --- a/resources/assets/js/snipeit.js +++ b/resources/assets/js/snipeit.js @@ -6,7 +6,7 @@ * @return {IIFE} Immediately invoked. Returns self. */ -var lineOptions = { +lineOptions = { legend: { position: "bottom" @@ -39,7 +39,7 @@ var lineOptions = { }; -var pieOptions = { +pieOptions = { //Boolean - Whether we should show a stroke on each segment segmentShowStroke: true, //String - The colour of each segment stroke diff --git a/resources/views/dashboard.blade.php b/resources/views/dashboard.blade.php index 6b5a030dbd7d75df1167c19a6ed190c7dda82689..b8a32f223e77fbc5b2b34b857eff68951ffde2ed 100755 --- a/resources/views/dashboard.blade.php +++ b/resources/views/dashboard.blade.php @@ -279,95 +279,36 @@ @section('moar_scripts') @include ('partials.bootstrap-table', ['simple_view' => true, 'nopages' => true]) +@stop -@if ($snipeSettings->load_remote=='1') - <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.min.js"></script> -@else - <script src="{{ asset('js/plugins/chartjs/Chart.min.js') }}"></script> -@endif - - +@push('js') <script nonce="{{ csrf_token() }}"> - - - - - /* ChartJS - * ------- - */ - - // ----------------------- - // - LINE CHART - - // ----------------------- - - - - //var ctx = document.getElementById('salesChart').getContext("2d") - //var myChart = new Chart(ctx, { - // type: 'line' - //}); - - - //$.ajax({ - // type: 'GET', - // url: '{{ route('api.statuslabels.assets.bytype') }}', - // headers: { - // "X-Requested-With": 'XMLHttpRequest', - // "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content') - // }, - - // dataType: 'json', - // success: function (data) { - // var ctx = new Chart(ctx,{ - // type: 'line', - // data: data, - // options: lineOptions - // }); - // }, - // error: function (data) { - // window.location.reload(true); - // } - // }); - - - - - - // --------------------------- - // - END MONTHLY SALES CHART - - // --------------------------- - - - var pieChartCanvas = $("#statusPieChart").get(0).getContext("2d"); - var pieChart = new Chart(pieChartCanvas); - var ctx = document.getElementById("statusPieChart"); - - - - $.ajax({ - type: 'GET', - url: '{{ route('api.statuslabels.assets.bytype') }}', - headers: { - "X-Requested-With": 'XMLHttpRequest', - "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content') - }, - - dataType: 'json', - success: function (data) { - var myPieChart = new Chart(ctx,{ - - type: 'doughnut', - data: data, - options: pieOptions - }); - }, - error: function (data) { - // window.location.reload(true); - } - }); - - + // --------------------------- + // - ASSET STATUS CHART - + // --------------------------- + var pieChartCanvas = $("#statusPieChart").get(0).getContext("2d"); + var pieChart = new Chart(pieChartCanvas); + var ctx = document.getElementById("statusPieChart"); + + $.ajax({ + type: 'GET', + url: '{{ route('api.statuslabels.assets.bytype') }}', + headers: { + "X-Requested-With": 'XMLHttpRequest', + "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content') + }, + + dataType: 'json', + success: function (data) { + var myPieChart = new Chart(ctx,{ + type : 'doughnut', + data : data, + options: pieOptions + }); + }, + error: function (data) { + // window.location.reload(true); + } + }); </script> - - -@stop +@endpush \ No newline at end of file diff --git a/resources/views/layouts/default.blade.php b/resources/views/layouts/default.blade.php index 318ffe26d788616b69f924773024ccbbb8e5cde3..08915869014ece789f7044ff7f2433e8cbe60789 100644 --- a/resources/views/layouts/default.blade.php +++ b/resources/views/layouts/default.blade.php @@ -787,17 +787,16 @@ </div> </div> - + {{-- Javascript files --}} <script src="{{ url(mix('js/app.js')) }}" nonce="{{ csrf_token() }}"></script> <script src="{{ url(mix('js/vendor.js')) }}" nonce="{{ csrf_token() }}"></script> + {{-- Page level javascript --}} @stack('js') @section('moar_scripts') @show <script nonce="{{ csrf_token() }}"> - - $(function () { $('[data-toggle="tooltip"]').tooltip(); $('[data-toggle="popover"]').popover(); diff --git a/webpack.mix.js b/webpack.mix.js index 871804c32e397a0d8bf0f18d8d267dff1add7831..3afe9a598da669c530ccfde0bf67f4720761807d 100644 --- a/webpack.mix.js +++ b/webpack.mix.js @@ -41,41 +41,6 @@ mix .minify("./public/css/signature-pad.css") .version(); -/** - * Copy image for iCheck - */ -mix.copyDirectory( - "./node_modules/admin-lte/plugins/iCheck/minimal/blue*.png", - "./public/css" -); -// 'resources/assets/js/vue.js', // Snipe-IT's initializer for Vue.js -// './public/js/build' -// ).sourceMaps() -// .scripts([ -// './node_modules/jquery-ui/jquery-ui.js', -// './public/js/build/vue.js', //this is the modularized nifty Vue.js thing we just built, above! -// './node_modules/tether/dist/js/tether.min.js', -// './node_modules/jquery-slimscroll/jquery.slimscroll.js', -// './node_modules/jquery.iframe-transport/jquery.iframe-transport.js', -// './node_modules/blueimp-file-upload/js/jquery.fileupload.js', -// './node_modules/bootstrap-colorpicker/dist/js/bootstrap-colorpicker.js', -// './node_modules/bootstrap-datepicker/dist/js/bootstrap-datepicker.js', -// './node_modules/icheck/icheck.js', -// './node_modules/ekko-lightbox/dist/ekko-lightbox.js', -// './resources/assets/js/app.js', //this is part of AdminLTE -// './resources/assets/js/snipeit.js', //this is the actual Snipe-IT JS -// './resources/assets/js/snipeit_modals.js' -// ], -// './public/js/dist/all.js'); - -/** - * Copy Fontawesome fonts to public fonts directory - */ -mix.copyDirectory("./node_modules/font-awesome/fonts", "./public/fonts"); -// mix.copy('./public/css/dist/all.css', './public/css/build/all.css').copy('./public/js/dist/all.js', './public/js/build/all.js'); - -// mix.version(); - // Combine main SnipeIT JS files mix.js([ './resources/assets/js/vue.js', @@ -98,13 +63,14 @@ mix.combine([ './node_modules/bootstrap-datepicker/dist/js/bootstrap-datepicker.js', './node_modules/ekko-lightbox/dist/ekko-lightbox.js', './node_modules/icheck/icheck.js', - './resources/assets/js/extensions/pGenerator.jquery.js' + './resources/assets/js/extensions/pGenerator.jquery.js', + './node_modules/chart.js/dist/Chart.js', ], 'public/js/vendor.js') .version(); mix.copy([ './resources/assets/js/html5shiv.min.js', - './resources/assets/js/respond.min.js' + './resources/assets/js/respond.min.js', ], './public/js'); /**