dbgate-api 6.5.4 → 6.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,12 @@
1
- const getChartExport = (title, config, imageFile) => {
1
+ const getChartExport = (title, config, imageFile, plugins) => {
2
+ const PLUGIN_TAGS = {
3
+ zoom: '<script src="https://cdnjs.cloudflare.com/ajax/libs/chartjs-plugin-zoom/1.2.0/chartjs-plugin-zoom.min.js" integrity="sha512-TT0wAMqqtjXVzpc48sI0G84rBP+oTkBZPgeRYIOVRGUdwJsyS3WPipsNh///ay2LJ+onCM23tipnz6EvEy2/UA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>',
4
+ dataLabels:
5
+ '<script src="https://cdnjs.cloudflare.com/ajax/libs/chartjs-plugin-datalabels/2.2.0/chartjs-plugin-datalabels.min.js" integrity="sha512-JPcRR8yFa8mmCsfrw4TNte1ZvF1e3+1SdGMslZvmrzDYxS69J7J49vkFL8u6u8PlPJK+H3voElBtUCzaXj+6ig==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>',
6
+ outlabels:
7
+ '<script src="https://cdn.jsdelivr.net/npm/@energiency/chartjs-plugin-piechart-outlabels@1.3.4/dist/chartjs-plugin-piechart-outlabels.min.js"></script>',
8
+ };
9
+
2
10
  return `<html>
3
11
  <meta charset='utf-8'>
4
12
 
@@ -8,7 +16,7 @@ const getChartExport = (title, config, imageFile) => {
8
16
  <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js" integrity="sha512-qTXRIMyZIFb8iQcfjXWCO8+M5Tbc38Qi5WzdPOYZHIlZpzBHG3L3by84BBBOiRGiEb7KKtAOAs5qYdUiZiQNNQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
9
17
  <script src="https://cdnjs.cloudflare.com/ajax/libs/chartjs-adapter-moment/1.0.0/chartjs-adapter-moment.min.js" integrity="sha512-oh5t+CdSBsaVVAvxcZKy3XJdP7ZbYUBSRCXDTVn0ODewMDDNnELsrG9eDm8rVZAQg7RsDD/8K3MjPAFB13o6eA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
10
18
  <script src="https://cdnjs.cloudflare.com/ajax/libs/hammer.js/2.0.8/hammer.min.js" integrity="sha512-UXumZrZNiOwnTcZSHLOfcTs0aos2MzBWHXOHOuB0J/R44QB0dwY5JgfbvljXcklVf65Gc4El6RjZ+lnwd2az2g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
11
- <script src="https://cdnjs.cloudflare.com/ajax/libs/chartjs-plugin-zoom/1.2.0/chartjs-plugin-zoom.min.js" integrity="sha512-TT0wAMqqtjXVzpc48sI0G84rBP+oTkBZPgeRYIOVRGUdwJsyS3WPipsNh///ay2LJ+onCM23tipnz6EvEy2/UA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
19
+ ${plugins.map(plugin => PLUGIN_TAGS[plugin] ?? '')}
12
20
 
13
21
  <style>
14
22
  a { text-decoration: none }
@@ -45,7 +53,7 @@ const getChartExport = (title, config, imageFile) => {
45
53
  </div>
46
54
 
47
55
  <div class="footer">
48
- Exported from <a href='https://dbgate.org/' target='_blank'>DbGate</a>, powered by <a href='https://www.chartjs.org/' target='_blank'>Chart.js</a>
56
+ Exported from <a href='https://dbgate.io/' target='_blank'>DbGate</a>, powered by <a href='https://www.chartjs.org/' target='_blank'>Chart.js</a>
49
57
  </div>
50
58
  </body>
51
59
 
@@ -18,7 +18,7 @@ const getMapExport = (geoJson) => {
18
18
  leaflet
19
19
  .tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
20
20
  maxZoom: 19,
21
- attribution: '<a href="https://dbgate.org" title="Exported from DbGate">DbGate</a> | © OpenStreetMap',
21
+ attribution: '<a href="https://dbgate.io" title="Exported from DbGate">DbGate</a> | © OpenStreetMap',
22
22
  })
23
23
  .addTo(map);
24
24
 
@@ -0,0 +1,18 @@
1
+ // only in DbGate Premium
2
+
3
+ function markUserAsActive(licenseUid, token) {}
4
+
5
+ async function isLoginLicensed(req, licenseUid) {
6
+ return true;
7
+ }
8
+
9
+ function markLoginAsLoggedOut(licenseUid) {}
10
+
11
+ const LOGIN_LIMIT_ERROR = '';
12
+
13
+ module.exports = {
14
+ markUserAsActive,
15
+ isLoginLicensed,
16
+ markLoginAsLoggedOut,
17
+ LOGIN_LIMIT_ERROR,
18
+ };