diff --git a/grafana/plugins/scylla-plugin/.circleci/config.yml b/grafana/plugins/scylla-plugin/.circleci/config.yml deleted file mode 100644 index a44546562..000000000 --- a/grafana/plugins/scylla-plugin/.circleci/config.yml +++ /dev/null @@ -1,75 +0,0 @@ -version: 2.1 - -parameters: - ssh-fingerprint: - type: string - default: ${GITHUB_SSH_FINGERPRINT} - -aliases: - # Workflow filters - - &filter-only-master - branches: - only: master - - &filter-only-release - branches: - only: /^v[1-9]*[0-9]+\.[1-9]*[0-9]+\.x$/ - -workflows: - plugin_workflow: - jobs: - - build - -executors: - default_exec: # declares a reusable executor - docker: - - image: srclosson/grafana-plugin-ci-alpine:latest - e2e_exec: - docker: - - image: srclosson/grafana-plugin-ci-e2e:latest - -jobs: - build: - executor: default_exec - steps: - - checkout - - restore_cache: - name: restore node_modules - keys: - - build-cache-{{ .Environment.CACHE_VERSION }}-{{ checksum "yarn.lock" }} - - run: - name: Install dependencies - command: | - mkdir ci - [ -f ~/project/node_modules/.bin/grafana-toolkit ] || yarn install --frozen-lockfile - - save_cache: - name: save node_modules - paths: - - ~/project/node_modules - key: build-cache-{{ .Environment.CACHE_VERSION }}-{{ checksum "yarn.lock" }} - - run: - name: Build and test frontend - command: ./node_modules/.bin/grafana-toolkit plugin:ci-build - - run: - name: Build backend - command: mage -v buildAll - - run: - name: Test backend - command: | - mage -v lint - mage -v coverage - - run: - name: Move results to ci folder - command: ./node_modules/.bin/grafana-toolkit plugin:ci-build --finish - - run: - name: Package distribution - command: | - ./node_modules/.bin/grafana-toolkit plugin:ci-package - - persist_to_workspace: - root: . - paths: - - ci/jobs/package - - ci/packages - - ci/dist - - ci/grafana-test-env - - store_artifacts: - path: ci \ No newline at end of file diff --git a/grafana/plugins/scylla-plugin/.editorconfig b/grafana/plugins/scylla-plugin/.editorconfig deleted file mode 100644 index ba4e65a47..000000000 --- a/grafana/plugins/scylla-plugin/.editorconfig +++ /dev/null @@ -1,16 +0,0 @@ -# http://editorconfig.org -root = true - -[*] -indent_style = space -indent_size = 2 -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true -max_line_length = 120 - -[*.{js,ts,tsx,scss}] -quote_type = single - -[*.md] -trim_trailing_whitespace = false diff --git a/grafana/plugins/scylla-plugin/.gitignore b/grafana/plugins/scylla-plugin/.gitignore deleted file mode 100644 index f2e764571..000000000 --- a/grafana/plugins/scylla-plugin/.gitignore +++ /dev/null @@ -1,32 +0,0 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -jest.config.js - -node_modules/ - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# Compiled binary addons (https://nodejs.org/api/addons.html) -dist/ -artifacts/ -work/ -ci/ -e2e-results/ - -# Editor -.idea -.project diff --git a/grafana/plugins/scylla-plugin/.prettierrc.js b/grafana/plugins/scylla-plugin/.prettierrc.js deleted file mode 100644 index 21cece86f..000000000 --- a/grafana/plugins/scylla-plugin/.prettierrc.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - ...require("./node_modules/@grafana/toolkit/src/config/prettier.plugin.config.json"), -}; \ No newline at end of file diff --git a/grafana/plugins/scylla-plugin/dist/README.md b/grafana/plugins/scylla-plugin/dist/README.md index b48d7e1ed..e2be99c92 100644 --- a/grafana/plugins/scylla-plugin/dist/README.md +++ b/grafana/plugins/scylla-plugin/dist/README.md @@ -1,127 +1,51 @@ -# Scylla/Apache Cassandra Backend Plugin - -The plugin is currently in Alpha and not ready for commercial usage. - -[![CircleCI](https://circleci.com/gh/grafana/simple-datasource-backend/tree/master.svg?style=svg)](https://circleci.com/gh/grafana/simple-datasource-backend/tree/master) - -This plugin allows connecting Scylla or Appahe Cassandra to Grafana. - -## What is Scylla Grafana Data Source Backend Plugin? - -A [Backend plugins](https://grafana.com/docs/grafana/latest/developers/plugins/backend/) is a type of data-source plugin that runs on the server. -That means that that from IP connectivity, your Database (Scylla or Apache Cassanra) should be accessible from the grafana server. - - -## Getting started -Use Grafana 7.0 or higher -* Download and place the datasouce in grafana/plugins directory. - -This plugin is not signed yet, Granfa will not allow loading it by default. you should enable it by adding: - -for example, if you are using Grafana with containers, add: -``` --e "GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=scylladb-scylla-datasource" -``` - -You can now add the scylla data source, the only current configuration is a host in the cluster. - -When adding a panel use CQL to get the data. -you can only do select statements, but any valid select would work. - - -## For Scylla-Monitoring Users -* Take the master branch that would run Grafana 7 -* Either edit and add the the `ALLOW_PLUGINS` to `start-grafana.sh` or use the command line flag to `start-all.sh` -``` -./start-all.sh -s scylla_servers.yml -c "GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=scylladb-scylla-datasource" - -``` -### Configure the datasoure from file -* If you do not want to configure the data source on every restart, edit `grafana/datasource.yml` -And add: -``` -- name: scylla-datasource - type: scylladb-scylla-datasource - orgId: 1 - isDefault: - jsonData: - host: 'node-ip' -``` -Replacing `node-ip` with an ip of a node in the cluster. - -To support user and password add `secureJsonData` to `grafana/datasource.yml` -``` -- name: scylla-datasource - type: scylladb-scylla-datasource - orgId: 1 - isDefault: - jsonData: - host: 'node-ip' - secureJsonData: - user: 'cassandra' - password: 'cassandra' -``` - -### Configure the Datasource using Grafana API: -Grafana API allows adding datasource. -The following will add a data source without a username and password, replace the `ADMIN_PASSWORD` -with Grafana's Admin password - -``` -curl -XPOST -i http://admin:$ADMIN_PASSWORD@localhost:3000/api/datasources \ - --data-binary '{"name": "scylla-datasource","type": "scylladb-scylla-datasource", \ - "orgId": 1,"access":"proxy", "jsonData":{"host": ""}}' -H "Content-Type: application/json" -``` - -The following example shows how to configure the plugin with username and password -``` -curl -XPOST -i http://admin:$ADMIN_PASSWORD@localhost:3000/api/datasources \ - --data-binary '{"name": "scylla-datasource","type": "scylladb-scylla-datasource", "orgId": 1,"access":"proxy", \ - "jsonData":{"host": ""}, "secureJsonData":{"user": "scylla", "password": "scylla"}}' \ - -H "Content-Type: application/json" -``` - -## Compiling the data source by yourself -A data source backend plugin consists of both frontend and backend components. - -### Frontend - -1. Install dependencies -```BASH -yarn install -``` - -2. Build plugin in development mode or run in watch mode -```BASH -yarn dev -``` -or -```BASH -yarn watch -``` -3. Build plugin in production mode -```BASH -yarn build -``` - -### Backend - -1. Update [Grafana plugin SDK for Go](https://grafana.com/docs/grafana/latest/developers/plugins/backend/grafana-plugin-sdk-for-go/) dependency to the latest minor version: - -```bash -go get -u github.com/grafana/grafana-plugin-sdk-go -``` - -2. Build backend plugin binaries for Linux, Windows and Darwin: -```BASH -mage -v -``` - -3. List all available Mage targets for additional commands: -```BASH -mage -l -``` - -## Learn more - -- [Grafana plugin SDK for Go](https://grafana.com/docs/grafana/latest/developers/plugins/backend/grafana-plugin-sdk-for-go/) + + +# Scylla Jan24 + +Datasource for scylla + + diff --git a/grafana/plugins/scylla-plugin/dist/go_plugin_build_manifest b/grafana/plugins/scylla-plugin/dist/go_plugin_build_manifest index 9eb9396a9..623ed2c8d 100755 --- a/grafana/plugins/scylla-plugin/dist/go_plugin_build_manifest +++ b/grafana/plugins/scylla-plugin/dist/go_plugin_build_manifest @@ -1,3 +1,3 @@ ba5ee903d3b81740a1bd1c9aacf631a04ab8a209838d03a649365cf66590fdc7:Magefile.go 58fd59554a711989af68245d2dfd00de5a693297c4a511a35faf32439e9ec8ba:pkg/main.go -0205ee1f0b45b3bc115ceca620717d4fc288d85518d7bfcbf4ecbee65beef83f:pkg/plugin/datasource.go +a444f62d4ad6672b2d2bea9c2e1db75345c4469eddc365dea542574061be8ab6:pkg/plugin/datasource.go diff --git a/grafana/plugins/scylla-plugin/dist/gpx_scylladb_darwin_amd64 b/grafana/plugins/scylla-plugin/dist/gpx_scylladb_darwin_amd64 index 909654351..76dc9f617 100755 Binary files a/grafana/plugins/scylla-plugin/dist/gpx_scylladb_darwin_amd64 and b/grafana/plugins/scylla-plugin/dist/gpx_scylladb_darwin_amd64 differ diff --git a/grafana/plugins/scylla-plugin/dist/gpx_scylladb_darwin_arm64 b/grafana/plugins/scylla-plugin/dist/gpx_scylladb_darwin_arm64 index 81cbdbbb3..df79d6f3b 100755 Binary files a/grafana/plugins/scylla-plugin/dist/gpx_scylladb_darwin_arm64 and b/grafana/plugins/scylla-plugin/dist/gpx_scylladb_darwin_arm64 differ diff --git a/grafana/plugins/scylla-plugin/dist/gpx_scylladb_linux_amd64 b/grafana/plugins/scylla-plugin/dist/gpx_scylladb_linux_amd64 index db6f7a8ce..af9dc4b80 100755 Binary files a/grafana/plugins/scylla-plugin/dist/gpx_scylladb_linux_amd64 and b/grafana/plugins/scylla-plugin/dist/gpx_scylladb_linux_amd64 differ diff --git a/grafana/plugins/scylla-plugin/dist/gpx_scylladb_linux_arm b/grafana/plugins/scylla-plugin/dist/gpx_scylladb_linux_arm index 9023fd2e5..3a155952e 100755 Binary files a/grafana/plugins/scylla-plugin/dist/gpx_scylladb_linux_arm and b/grafana/plugins/scylla-plugin/dist/gpx_scylladb_linux_arm differ diff --git a/grafana/plugins/scylla-plugin/dist/gpx_scylladb_linux_arm64 b/grafana/plugins/scylla-plugin/dist/gpx_scylladb_linux_arm64 index 451d19409..753670ff3 100755 Binary files a/grafana/plugins/scylla-plugin/dist/gpx_scylladb_linux_arm64 and b/grafana/plugins/scylla-plugin/dist/gpx_scylladb_linux_arm64 differ diff --git a/grafana/plugins/scylla-plugin/dist/gpx_scylladb_windows_amd64.exe b/grafana/plugins/scylla-plugin/dist/gpx_scylladb_windows_amd64.exe index eef47f964..6e9bdb8f0 100755 Binary files a/grafana/plugins/scylla-plugin/dist/gpx_scylladb_windows_amd64.exe and b/grafana/plugins/scylla-plugin/dist/gpx_scylladb_windows_amd64.exe differ diff --git a/grafana/plugins/scylla-plugin/dist/module.js.map b/grafana/plugins/scylla-plugin/dist/module.js.map index eb519b73e..41ba66293 100644 --- a/grafana/plugins/scylla-plugin/dist/module.js.map +++ b/grafana/plugins/scylla-plugin/dist/module.js.map @@ -1 +1 @@ -{"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AY,GAClCN,YAAY,mCACZC,MAAO,GACPI,QA5DgB,KACtBpB,EAAgB,OACXC,GAAAA,CACHE,iBAAkB,OACbF,EAAQE,kBAAgB,CAC3BkB,UAAU,IAEZjB,eAAgB,OACXH,EAAQG,gBAAc,CACzBiB,SAAU,O,EAoDRV,SAtEkBC,IACxBZ,EAAgB,OACXC,GAAAA,CACHG,eAAgB,CACdiB,SAAUT,EAAME,OAAOnC,S,KAuE/B,ID7FG2C,gBEAI,UAAqB,MAAEnC,EAAK,SAAEwB,EAAQ,WAAEY,IAC7C,MAeM,UAAE1C,EAAS,UAAEC,EAAS,SAAEC,GAAYI,EAE1C,OACE,kBAACkB,MAAAA,CAAIC,UAAU,WACb,kBAACC,EAAAA,YAAWA,CAACC,MAAM,aAAaC,WAAY,GAAIe,QAAQ,eACtD,kBAACd,EAAAA,MAAKA,CAACC,SApBcC,IACzBD,EAAS,OAAKxB,GAAAA,CAAON,UAAW+B,EAAME,OAAOnC,Q,EAmBLA,MAAOE,GAAa,GAAKmC,MAAO,MAEzE,kBAACS,EAAAA,SAAQA,CAACd,SAZcC,IACvBD,EAAS,OAAKxB,GAAAA,CAAOJ,SAAU6B,EAAME,OAAOY,WAE5CH,GAAY,EASwB5C,MAAOI,EAAUyB,MAAM,WAAWmB,YAAY,wBAChF,kBAACpB,EAAAA,YAAWA,CAACC,MAAM,SACjB,kBAACE,EAAAA,MAAKA,CAACC,SApBSC,IACpBD,EAAS,OAAKxB,GAAAA,CAAOL,UAAW8B,EAAME,OAAOnC,SAE7C4C,GAAY,EAiBuB5C,MAAOG,EAAWkC,MAAO,KAKhE,G","sources":["webpack:///external amd \"@grafana/data\"","webpack:///external amd \"@grafana/runtime\"","webpack:///external amd \"@grafana/ui\"","webpack:///external amd \"react\"","webpack:///webpack/bootstrap","webpack:///webpack/runtime/compat get default export","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///webpack/runtime/make namespace object","webpack:///./types.ts","webpack:///./datasource.ts","webpack:///./module.ts","webpack:///./components/ConfigEditor.tsx","webpack:///./components/QueryEditor.tsx"],"sourcesContent":["module.exports = __WEBPACK_EXTERNAL_MODULE__305__;","module.exports = __WEBPACK_EXTERNAL_MODULE__545__;","module.exports = __WEBPACK_EXTERNAL_MODULE__388__;","module.exports = __WEBPACK_EXTERNAL_MODULE__650__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { DataQuery, DataSourceJsonData } from '@grafana/data';\n\nexport interface MyQuery extends DataQuery {\n queryText?: string;\n queryHost?: string;\n allHosts?: boolean;\n}\n\nexport const DEFAULT_QUERY: Partial = {\n queryText: '',\n queryHost: '',\n allHosts: false,\n};\n\n/**\n * These are options configured for each DataSource instance\n */\nexport interface MyDataSourceOptions extends DataSourceJsonData {\n host?: string;\n}\n\n/**\n * Value that is used in the backend, but never sent over HTTP to the frontend\n */\nexport interface MySecureJsonData {\n user?: string;\n password?: string;\n}\n","import { DataSourceInstanceSettings, CoreApp } from '@grafana/data';\nimport { DataSourceWithBackend, getTemplateSrv } from '@grafana/runtime';\nimport { MyQuery, MyDataSourceOptions, DEFAULT_QUERY } from './types';\n\nexport class DataSource extends DataSourceWithBackend {\n constructor(instanceSettings: DataSourceInstanceSettings) {\n super(instanceSettings);\n }\n applyTemplateVariables(query: MyQuery) {\n const templateSrv = getTemplateSrv();\n return {\n ...query,\n queryText: query.queryText ? templateSrv.replace(query.queryText) : '',\n queryHost: query.queryHost ? templateSrv.replace(query.queryHost) : '',\n allHosts: query.allHosts ? templateSrv.replace(query.allHosts? \"true\" : \"false\") === \"true\" : false,\n };\n }\n getDefaultQuery(_: CoreApp): Partial {\n return DEFAULT_QUERY\n }\n}\n","import { DataSourcePlugin } from '@grafana/data';\nimport { DataSource } from './datasource';\nimport { ConfigEditor } from './components/ConfigEditor';\nimport { QueryEditor } from './components/QueryEditor';\nimport { MyQuery, MyDataSourceOptions } from './types';\n\nexport const plugin = new DataSourcePlugin(DataSource)\n .setConfigEditor(ConfigEditor)\n .setQueryEditor(QueryEditor);\n","import React, { ChangeEvent } from 'react';\nimport { InlineField, Input, SecretInput } from '@grafana/ui';\nimport { DataSourcePluginOptionsEditorProps } from '@grafana/data';\nimport { MyDataSourceOptions, MySecureJsonData } from '../types';\n\ninterface Props extends DataSourcePluginOptionsEditorProps {}\n\nexport function ConfigEditor(props: Props) {\n const { onOptionsChange, options } = props;\n const onHostChange = (event: ChangeEvent) => {\n const jsonData = {\n ...options.jsonData,\n host: event.target.value,\n };\n onOptionsChange({ ...options, jsonData });\n };\n const onUserChange = (event: ChangeEvent) => {\n onOptionsChange({\n ...options,\n secureJsonData: {\n user: event.target.value,\n },\n });\n };\n\n // Secure field (only sent to the backend)\n const onPasswordChange = (event: ChangeEvent) => {\n onOptionsChange({\n ...options,\n secureJsonData: {\n password: event.target.value,\n },\n });\n };\n\n const onResetPassword = () => {\n onOptionsChange({\n ...options,\n secureJsonFields: {\n ...options.secureJsonFields,\n password: false,\n },\n secureJsonData: {\n ...options.secureJsonData,\n password: '',\n },\n });\n };\n\n const onResetUser = () => {\n onOptionsChange({\n ...options,\n secureJsonFields: {\n ...options.secureJsonFields,\n user: false,\n },\n secureJsonData: {\n ...options.secureJsonData,\n user: '',\n },\n });\n };\n\n const { jsonData, secureJsonFields } = options;\n const secureJsonData = (options.secureJsonData || {}) as MySecureJsonData;\n\n return (\n
\n \n \n \n \n \n \n \n \n \n
\n );\n}\n","import React, { ChangeEvent } from 'react';\nimport { InlineField, Input, Checkbox} from '@grafana/ui';\nimport { QueryEditorProps } from '@grafana/data';\nimport { DataSource } from '../datasource';\nimport { MyDataSourceOptions, MyQuery } from '../types';\n\ntype Props = QueryEditorProps;\n\nexport function QueryEditor({ query, onChange, onRunQuery }: Props) {\n const onQueryTextChange = (event: ChangeEvent) => {\n onChange({ ...query, queryText: event.target.value });\n };\n\n const onHostChange = (event: ChangeEvent) => {\n onChange({ ...query, queryHost: event.target.value });\n // executes the query\n onRunQuery();\n };\n\n const onallHostChange = (event: ChangeEvent) => {\n onChange({ ...query, allHosts: event.target.checked });\n // executes the query\n onRunQuery();\n };\n const { queryText, queryHost, allHosts} = query;\n\n return (\n
\n \n \n \n\t \n \n \n \n \n
\n );\n}\n"],"names":["module","exports","__WEBPACK_EXTERNAL_MODULE__305__","__WEBPACK_EXTERNAL_MODULE__545__","__WEBPACK_EXTERNAL_MODULE__388__","__WEBPACK_EXTERNAL_MODULE__650__","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","DEFAULT_QUERY","queryText","queryHost","allHosts","DataSource","DataSourceWithBackend","applyTemplateVariables","query","templateSrv","getTemplateSrv","replace","getDefaultQuery","_","constructor","instanceSettings","super","plugin","DataSourcePlugin","setConfigEditor","props","onOptionsChange","options","jsonData","secureJsonFields","secureJsonData","div","className","InlineField","label","labelWidth","Input","onChange","event","host","target","placeholder","width","SecretInput","isConfigured","user","onReset","password","setQueryEditor","onRunQuery","tooltip","Checkbox","checked","description"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"module.js","mappings":"gHAAAA,EAAOC,QAAUC,C,UCAjBF,EAAOC,QAAUE,C,UCAjBH,EAAOC,QAAUG,C,UCAjBJ,EAAOC,QAAUI,C,GCCbC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaR,QAGrB,IAAID,EAASM,EAAyBE,GAAY,CAGjDP,QAAS,CAAC,GAOX,OAHAU,EAAoBH,GAAUR,EAAQA,EAAOC,QAASM,GAG/CP,EAAOC,OACf,CCrBAM,EAAoBK,EAAKZ,IACxB,IAAIa,EAASb,GAAUA,EAAOc,WAC7B,IAAOd,EAAiB,QACxB,IAAM,EAEP,OADAO,EAAoBQ,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdN,EAAoBQ,EAAI,CAACd,EAASgB,KACjC,IAAI,IAAIC,KAAOD,EACXV,EAAoBY,EAAEF,EAAYC,KAASX,EAAoBY,EAAElB,EAASiB,IAC5EE,OAAOC,eAAepB,EAASiB,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDX,EAAoBY,EAAI,CAACK,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFlB,EAAoBsB,EAAK5B,IACH,oBAAX6B,QAA0BA,OAAOC,aAC1CX,OAAOC,eAAepB,EAAS6B,OAAOC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AAS,OAAKxB,GAAAA,CAAOL,UAAW8B,EAAME,OAAOnC,SAE7C4C,GAAY,EAiBuB5C,MAAOG,EAAWkC,MAAO,KAIhE,G","sources":["webpack://scylladb-scylla-datasource/external amd \"@grafana/data\"","webpack://scylladb-scylla-datasource/external amd \"@grafana/runtime\"","webpack://scylladb-scylla-datasource/external amd \"@grafana/ui\"","webpack://scylladb-scylla-datasource/external amd \"react\"","webpack://scylladb-scylla-datasource/webpack/bootstrap","webpack://scylladb-scylla-datasource/webpack/runtime/compat get default export","webpack://scylladb-scylla-datasource/webpack/runtime/define property getters","webpack://scylladb-scylla-datasource/webpack/runtime/hasOwnProperty shorthand","webpack://scylladb-scylla-datasource/webpack/runtime/make namespace object","webpack://scylladb-scylla-datasource/./types.ts","webpack://scylladb-scylla-datasource/./datasource.ts","webpack://scylladb-scylla-datasource/./module.ts","webpack://scylladb-scylla-datasource/./components/ConfigEditor.tsx","webpack://scylladb-scylla-datasource/./components/QueryEditor.tsx"],"sourcesContent":["module.exports = __WEBPACK_EXTERNAL_MODULE__305__;","module.exports = __WEBPACK_EXTERNAL_MODULE__545__;","module.exports = __WEBPACK_EXTERNAL_MODULE__388__;","module.exports = __WEBPACK_EXTERNAL_MODULE__650__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { DataQuery, DataSourceJsonData } from '@grafana/data';\n\nexport interface MyQuery extends DataQuery {\n queryText?: string;\n queryHost?: string;\n allHosts?: boolean;\n}\n\nexport const DEFAULT_QUERY: Partial = {\n queryText: '',\n queryHost: '',\n allHosts: false,\n};\n\n/**\n * These are options configured for each DataSource instance\n */\nexport interface MyDataSourceOptions extends DataSourceJsonData {\n host?: string;\n}\n\n/**\n * Value that is used in the backend, but never sent over HTTP to the frontend\n */\nexport interface MySecureJsonData {\n user?: string;\n password?: string;\n}\n","import { DataSourceInstanceSettings, CoreApp } from '@grafana/data';\nimport { DataSourceWithBackend, getTemplateSrv } from '@grafana/runtime';\nimport { MyQuery, MyDataSourceOptions, DEFAULT_QUERY } from './types';\n\nexport class DataSource extends DataSourceWithBackend {\n constructor(instanceSettings: DataSourceInstanceSettings) {\n super(instanceSettings);\n }\n applyTemplateVariables(query: MyQuery) {\n const templateSrv = getTemplateSrv();\n return {\n ...query,\n queryText: query.queryText ? templateSrv.replace(query.queryText) : '',\n queryHost: query.queryHost ? templateSrv.replace(query.queryHost) : '',\n allHosts: query.allHosts ? templateSrv.replace(query.allHosts? \"true\" : \"false\") === \"true\" : false,\n };\n }\n getDefaultQuery(_: CoreApp): Partial {\n return DEFAULT_QUERY\n }\n}\n","import { DataSourcePlugin } from '@grafana/data';\nimport { DataSource } from './datasource';\nimport { ConfigEditor } from './components/ConfigEditor';\nimport { QueryEditor } from './components/QueryEditor';\nimport { MyQuery, MyDataSourceOptions } from './types';\n\nexport const plugin = new DataSourcePlugin(DataSource)\n .setConfigEditor(ConfigEditor)\n .setQueryEditor(QueryEditor);\n","import React, { ChangeEvent } from 'react';\nimport { InlineField, Input, SecretInput } from '@grafana/ui';\nimport { DataSourcePluginOptionsEditorProps } from '@grafana/data';\nimport { MyDataSourceOptions, MySecureJsonData } from '../types';\n\ninterface Props extends DataSourcePluginOptionsEditorProps {}\n\nexport function ConfigEditor(props: Props) {\n const { onOptionsChange, options } = props;\n const onHostChange = (event: ChangeEvent) => {\n const jsonData = {\n ...options.jsonData,\n host: event.target.value,\n };\n onOptionsChange({ ...options, jsonData });\n };\n const onUserChange = (event: ChangeEvent) => {\n onOptionsChange({\n ...options,\n secureJsonData: {\n user: event.target.value,\n },\n });\n };\n\n // Secure field (only sent to the backend)\n const onPasswordChange = (event: ChangeEvent) => {\n onOptionsChange({\n ...options,\n secureJsonData: {\n password: event.target.value,\n },\n });\n };\n\n const onResetPassword = () => {\n onOptionsChange({\n ...options,\n secureJsonFields: {\n ...options.secureJsonFields,\n password: false,\n },\n secureJsonData: {\n ...options.secureJsonData,\n password: '',\n },\n });\n };\n\n const onResetUser = () => {\n onOptionsChange({\n ...options,\n secureJsonFields: {\n ...options.secureJsonFields,\n user: false,\n },\n secureJsonData: {\n ...options.secureJsonData,\n user: '',\n },\n });\n };\n\n const { jsonData, secureJsonFields } = options;\n const secureJsonData = (options.secureJsonData || {}) as MySecureJsonData;\n\n return (\n
\n \n \n \n \n \n \n \n \n \n
\n );\n}\n","import React, { ChangeEvent } from 'react';\nimport { InlineField, Input, Checkbox} from '@grafana/ui';\nimport { QueryEditorProps } from '@grafana/data';\nimport { DataSource } from '../datasource';\nimport { MyDataSourceOptions, MyQuery } from '../types';\n\ntype Props = QueryEditorProps;\n\nexport function QueryEditor({ query, onChange, onRunQuery }: Props) {\n const onQueryTextChange = (event: ChangeEvent) => {\n onChange({ ...query, queryText: event.target.value });\n };\n\n const onHostChange = (event: ChangeEvent) => {\n onChange({ ...query, queryHost: event.target.value });\n // executes the query\n onRunQuery();\n };\n\n const onallHostChange = (event: ChangeEvent) => {\n onChange({ ...query, allHosts: event.target.checked });\n // executes the query\n onRunQuery();\n };\n const { queryText, queryHost, allHosts} = query;\n\n return (\n
\n \n \n \n\t \n \n \n \n
\n );\n}\n"],"names":["module","exports","__WEBPACK_EXTERNAL_MODULE__305__","__WEBPACK_EXTERNAL_MODULE__545__","__WEBPACK_EXTERNAL_MODULE__388__","__WEBPACK_EXTERNAL_MODULE__650__","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","DEFAULT_QUERY","queryText","queryHost","allHosts","DataSource","DataSourceWithBackend","applyTemplateVariables","query","templateSrv","getTemplateSrv","replace","getDefaultQuery","_","constructor","instanceSettings","super","plugin","DataSourcePlugin","setConfigEditor","props","onOptionsChange","options","jsonData","secureJsonFields","secureJsonData","div","className","InlineField","label","labelWidth","Input","onChange","event","host","target","placeholder","width","SecretInput","isConfigured","user","onReset","password","setQueryEditor","onRunQuery","tooltip","Checkbox","checked","description"],"sourceRoot":""} \ No newline at end of file diff --git a/grafana/plugins/scylla-plugin/dist/plugin.json b/grafana/plugins/scylla-plugin/dist/plugin.json index 969d0444b..494e5f47a 100644 --- a/grafana/plugins/scylla-plugin/dist/plugin.json +++ b/grafana/plugins/scylla-plugin/dist/plugin.json @@ -34,11 +34,11 @@ } ], "screenshots": [], - "version": "0.2.0", - "updated": "2023-10-04" + "version": "0.3.0", + "updated": "2024-01-08" }, "dependencies": { - "grafanaDependency": ">=9.5.3", + "grafanaDependency": ">=10.0.3", "plugins": [] } }