diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..ca35934 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,39 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.pnpm-debug.log* + +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/ +**/cypress/videos +**/cypress/report.json + +# Editor +.idea + +.eslintcache +.codecc +.vscode + +pre-*-bkcodeai diff --git a/.prettierrc.js b/.prettierrc.js index c0878e6..1eca1a8 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -1,11 +1,9 @@ module.exports = { arrowParens: 'always', - arrowParens: 'avoid', bracketSameLine: false, jsxSingleQuote: true, printWidth: 120, quoteProps: 'as-needed', - quoteProps: 'as-needed', semi: true, singleAttributePerLine: true, singleQuote: true, diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..481b3c9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +ARG NODE_IMAGE=node:20.11.1-slim +ARG PNPM_VERSION=8 +ARG NODE_PLATFORM=linux/amd64 + +FROM --platform=${NODE_PLATFORM} ${NODE_IMAGE} as nodejs + +WORKDIR /code + +RUN npm i -g pnpm@${PNPM_VERSION} + +COPY . . + +RUN pnpm i +RUN pnpm run build +RUN tar -czvf frontend.tar.gz src/alert/dist src/event/dist src/timeseries/dist + +CMD [ "echo", "前端构建完毕" ] diff --git a/docker_build.sh b/docker_build.sh new file mode 100644 index 0000000..9c9644c --- /dev/null +++ b/docker_build.sh @@ -0,0 +1,17 @@ +#!/bin/bash -e + +# 默认为./build +target=${1:-./build} + +rm -rf ./build + +docker build -t bkmonitor_plugin_build . + +docker run -d --name plugin-temp-container bkmonitor_plugin_build + +mkdir -p "$target" + +docker cp plugin-temp-container:/code/frontend.tar.gz "$target" + +docker rm plugin-temp-container + diff --git a/src/timeseries/src/plugin.json b/src/timeseries/src/plugin.json index aeeb46a..96f3b82 100644 --- a/src/timeseries/src/plugin.json +++ b/src/timeseries/src/plugin.json @@ -4,6 +4,8 @@ "id": "bkmonitor-timeseries-datasource", "metrics": true, "annotations": false, + "alerting": true, + "mixed": true, "queryOptions": { "maxDataPoints": true },