Skip to content

Commit

Permalink
Merge branch 'linuxkerneltravel:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
albertxu216 committed Jul 2, 2024
2 parents ebb464f + 04a4669 commit 79f5c90
Show file tree
Hide file tree
Showing 126 changed files with 7,994 additions and 2,237 deletions.
46 changes: 46 additions & 0 deletions MagicEyes/src/visualization/vscode_ext/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# lmp vscode 插件使用指南

### 1. 运行效果

![](./images/lmp_vscode_ext.gif)

### 2. 相关提示

设置可视化面板存放路径

> 注意:别忘记面板路径后面加 "/"
![](./images/set_panel_addr.png)

面板命名必须遵循如下规则:

![](./images/panel_name.png)

若面板不存在,或路径,或名称不对,将出现如下错误提示:

![](./images/error_info.png)

### 3. 开发注意事项

1. yo code生成的框架,vscode最小版本是1.90,需要修改为1.74,不然我当前的版本。1.89无法运行插件
2. tsconfig

```json
{
"compilerOptions": {
"module": "commonjs", // 不要用Node16,不然命令会触发失败
"target": "ES2021",
"lib": ["ES2021"],
"sourceMap": true,
"rootDir": "src",
"strict": true /* enable all strict type-checking options */
/* Additional Checks */
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
// "noUnusedParameters": true, /* Report errors on unused parameters. */
}
}
```



Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"rules": {
"@typescript-eslint/naming-convention": "warn",
"@typescript-eslint/semi": "warn",
"curly": "warn",
"eqeqeq": "warn",
"no-throw-literal": "warn",
"semi": "off"
},
"ignorePatterns": ["out", "dist", "**/*.d.ts"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Update dashboards

on:
push:
branches:
- main
paths:
- dashboards/**.json

jobs:
update-dashboards:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Get changed dashboards
id: changed-files
uses: tj-actions/changed-files@v41
with:
files: dashboards/**.json

- name: Update changed dashboards in Grafana
if: steps.changed-files.outputs.any_changed == 'true'
run: |
tmp=$(mktemp)
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
uid=$(jq -r '.uid' $file)
dashboardInfo=$(curl -H "Authorization: Bearer $GRAFANA_API_TOKEN" $GRAFANA_INSTANCE_URL/api/dashboards/uid/$uid)
currentVersion=$(echo $dashboardInfo | jq -r '.meta.version')
jq --argjson v $currentVersion '.version = $v' $file > $tmp && mv $tmp $file
dashboardJson='{"dashboard":'"$(jq -c . $file)"',"message":"'"$COMMIT_MESSAGE"'"}'
curl -X POST $GRAFANA_INSTANCE_URL/api/dashboards/db -H "Content-Type: application/json" -H "Authorization: Bearer $GRAFANA_API_TOKEN" -d "$dashboardJson"
done
env:
GRAFANA_INSTANCE_URL: ${{ secrets.GRAFANA_INSTANCE_URL }}
GRAFANA_API_TOKEN: ${{ secrets.GRAFANA_API_TOKEN }}
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}

Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
on:
push:
tags:
- "*"

# These permissions are needed to assume roles from Github's OIDC.
permissions:
contents: write
id-token: write

name: Publish Extension
jobs:
eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm install
- run: npm run compile
- run: npm run lint
publish:
needs: eslint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm install
- id: get-secrets
uses: grafana/shared-workflows/actions/get-vault-secrets@main
with:
# Secrets placed in the ci/repo/grafana/<repo>/<path> path in Vault
repo_secrets: |
OPEN_VSX_TOKEN=openvsx:token
VS_MARKETPLACE_TOKEN=vscode-marketplace:token
- name: Publish to Open VSX
uses: HaaLeo/publish-vscode-extension@v0
with:
pat: ${{ env.OPEN_VSX_TOKEN }}
registryUrl: https://open-vsx.org
- name: Publish to Visual Studio Marketplace
id: publishToMarketplace
uses: HaaLeo/publish-vscode-extension@v0
with:
pat: ${{ env.VS_MARKETPLACE_TOKEN }}
registryUrl: https://marketplace.visualstudio.com
- uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: "${{ steps.publishToMarketplace.outputs.vsixPath }}"
token: ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
!.vscode
.yarn
node_modules
.idea
dist
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": ["dbaeumer.vscode-eslint", "amodio.tsl-problem-matcher"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// A launch configuration that compiles the extension and then opens it inside a new window
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--disable-extensions"
],
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
"preLaunchTask": "${defaultBuildTask}"
},
{
"name": "Extension Tests",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index",
"--disable-extensions"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js",
"${workspaceFolder}/dist/**/*.js"
],
"preLaunchTask": "tasks: watch-tests"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Place your settings in this file to overwrite default and user settings.
{
"files.exclude": {
"out": false, // set this to true to hide the "out" folder with the compiled JS files
"dist": false // set this to true to hide the "dist" folder with the compiled JS files
},
"search.exclude": {
"out": true, // set this to false to include "out" folder in search results
"dist": true // set this to false to include "dist" folder in search results
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "watch",
"problemMatcher": "$ts-webpack-watch",
"isBackground": true,
"presentation": {
"reveal": "never",
"group": "watchers"
},
"group": {
"kind": "build",
"isDefault": true
}
},
{
"type": "npm",
"script": "watch-tests",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never",
"group": "watchers"
},
"group": "build"
},
{
"label": "tasks: watch-tests",
"dependsOn": ["npm: watch", "npm: watch-tests"],
"problemMatcher": []
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.vscode/**
.vscode-test/**
out/**
node_modules/**
src/**
.gitignore
.yarnrc
webpack.config.js
vsc-extension-quickstart.md
**/tsconfig.json
**/.eslintrc.json
**/*.map
**/*.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--ignore-engines true
34 changes: 34 additions & 0 deletions MagicEyes/src/visualization/vscode_ext/lmp_ext_vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Change Log

All notable changes to the "grafana-vscode" extension will be documented in this file.

## v0.0.16
- Add additional proxy endpoints (to support more dashboards/etc) (#80)

## v0.0.15
- Follow redirects and don't fail on trailing slashes (#77)
- Theming (light/dark) support for Grafana (#74)

## v0.0.14
- Improved readme (#62)

## v0.0.13
- Add telemetry that will allow us to evaluate usefulness of this extension (#48)

## v0.0.12
- Removed Kiosk mode - this was preventing the 'add panel' option from showing (#59)

## v0.0.11
- Fixed usage on Windows (#57)

## v0.0.10
- Readme tweaks (#54)

## v0.0.9
- Added support for vscodium (#53)

## v0.0.8
- Improved readme (#52)

## v0.0.7
- First release to VSCode Marketplace
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Docs on CODEOWNERS:
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
#
# Later codeowner matches take precedence over earlier ones.

# Default owner
* @grafana/platform-cat
Loading

0 comments on commit 79f5c90

Please sign in to comment.