diff --git a/copy_static_files.js b/copy_static_files.js new file mode 100644 index 0000000..6763909 --- /dev/null +++ b/copy_static_files.js @@ -0,0 +1,18 @@ +let fs = require('fs'); +let mkdirp = require('mkdirp'); +let getDirName = require('path').dirname; + +let copy = [ + { from: './src/css/worldmap.dark.css', to: './dist/css/worldmap.dark.css' }, + { from: './src/css/worldmap.light.css', to: './dist/css/worldmap.light.css' }, +]; + +copy.forEach(path => { + let dir = getDirName(path.to); + if (!fs.existsSync(dir)) { + mkdirp(dir, function (err) { + if (err) return cb(err); + }); + } + fs.createReadStream(path.from).pipe(fs.createWriteStream(path.to)); +}); diff --git a/package.json b/package.json index 8e038f5..6379991 100644 --- a/package.json +++ b/package.json @@ -2,12 +2,12 @@ "name": "worldmap-panel", "version": "1.0.1", "description": "Worldmap Panel Plugin for Grafana", - "main": "src/module.js", + "main": "src/module.ts", "scripts": { - "build": "grafana-toolkit plugin:build", - "test": "grafana-toolkit plugin:test", - "dev": "grafana-toolkit plugin:dev", - "watch": "grafana-toolkit plugin:dev --watch" + "build": "node ./copy_static_files.js && grafana-toolkit plugin:build", + "test": "node ./copy_static_files.js && grafana-toolkit plugin:test", + "dev": "node ./copy_static_files.js && grafana-toolkit plugin:dev", + "watch": "node ./copy_static_files.js && grafana-toolkit plugin:dev --watch" }, "keywords": [ "worldmap", diff --git a/src/css/worldmap.dark.css b/src/css/worldmap.dark.css index ce009f1..9528a56 100644 --- a/src/css/worldmap.dark.css +++ b/src/css/worldmap.dark.css @@ -1,8 +1,3 @@ -.map-darken img.leaflet-tile { - /* -webkit-filter: brightness(1.6) grayscale(1) contrast(1); - filter: brightness(1.6) grayscale(1) contrast(1); */ -} - .worldmap-popup .leaflet-popup-content-wrapper, .worldmap-popup .leaflet-popup-tip { background-color: #333; }