Skip to content

Commit 8c8d3e3

Browse files
authored
Dashboard Redesign (#48)
* feat: add user_template setting * style: header * style: page padding * style: header * feat: header now time * style: login page * feat: nav indicator * style: button inset shadow * style: footer text size * feat: header show login_ip * fix: error toast * fix: frontend_templates setting * fix: lint * feat: pr auto format * chore: auto-fix linting and formatting issues --------- Co-authored-by: hamster1963 <[email protected]>
1 parent b04ef1b commit 8c8d3e3

File tree

132 files changed

+13278
-12914
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+13278
-12914
lines changed
Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,53 @@
11
name: Auto Format
22

33
on:
4-
pull_request_target:
5-
types: [opened, synchronize]
4+
pull_request_target:
5+
types: [opened, synchronize]
66

77
jobs:
8-
auto-fix:
9-
runs-on: ubuntu-latest
10-
steps:
11-
- name: Checkout code
12-
uses: actions/checkout@v4
13-
with:
14-
fetch-depth: 0
15-
ref: ${{ github.head_ref }}
16-
repository: ${{ github.event.pull_request.head.repo.full_name }}
17-
18-
- name: Set up Bun
19-
uses: oven-sh/setup-bun@v1
20-
with:
21-
bun-version: "latest"
22-
23-
- name: Install dependencies
24-
run: bun install
25-
26-
- name: Run formatter
27-
run: bun run format
28-
29-
- name: Check for changes
30-
id: check_changes
31-
run: |
32-
git diff --exit-code || echo "has_changes=true" >> $GITHUB_ENV
33-
34-
- name: Commit and push changes
35-
if: steps.check_changes.outputs.has_changes == 'true' || env.has_changes == 'true'
36-
uses: stefanzweifel/git-auto-commit-action@v5
37-
with:
38-
commit_message: "chore: auto-fix linting and formatting issues"
39-
commit_options: "--no-verify"
40-
file_pattern: "."
41-
42-
- name: Add PR comment
43-
if: steps.check_changes.outputs.has_changes == 'true' || env.has_changes == 'true'
44-
uses: actions/github-script@v7
45-
with:
46-
github-token: ${{secrets.GITHUB_TOKEN}}
47-
script: |
48-
github.rest.issues.createComment({
49-
issue_number: context.issue.number,
50-
owner: context.repo.owner,
51-
repo: context.repo.repo,
52-
body: 'Linting and formatting issues were automatically fixed. Please review the changes.'
53-
});
8+
auto-fix:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
15+
ref: ${{ github.head_ref }}
16+
repository: ${{ github.event.pull_request.head.repo.full_name }}
17+
18+
- name: Set up Bun
19+
uses: oven-sh/setup-bun@v1
20+
with:
21+
bun-version: "latest"
22+
23+
- name: Install dependencies
24+
run: bun install
25+
26+
- name: Run formatter
27+
run: bun run format
28+
29+
- name: Check for changes
30+
id: check_changes
31+
run: |
32+
git diff --exit-code || echo "has_changes=true" >> $GITHUB_ENV
33+
34+
- name: Commit and push changes
35+
if: steps.check_changes.outputs.has_changes == 'true' || env.has_changes == 'true'
36+
uses: stefanzweifel/git-auto-commit-action@v5
37+
with:
38+
commit_message: "chore: auto-fix linting and formatting issues"
39+
commit_options: "--no-verify"
40+
file_pattern: "."
41+
42+
- name: Add PR comment
43+
if: steps.check_changes.outputs.has_changes == 'true' || env.has_changes == 'true'
44+
uses: actions/github-script@v7
45+
with:
46+
github-token: ${{secrets.GITHUB_TOKEN}}
47+
script: |
48+
github.rest.issues.createComment({
49+
issue_number: context.issue.number,
50+
owner: context.repo.owner,
51+
repo: context.repo.repo,
52+
body: 'Linting and formatting issues were automatically fixed. Please review the changes.'
53+
});

.github/workflows/release.yaml

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
11
name: Build and release static export
22

33
on:
4-
push:
5-
tags:
6-
- "v*"
4+
push:
5+
tags:
6+
- "v*"
77

88
jobs:
9-
release:
10-
runs-on: ubuntu-latest
11-
permissions:
12-
contents: write
13-
steps:
14-
- name: Check out code
15-
uses: actions/checkout@v4
16-
with:
17-
fetch-depth: 0
18-
19-
- name: Set up Bun
20-
uses: oven-sh/setup-bun@v1
21-
with:
22-
bun-version: "latest"
23-
24-
- name: Install dependencies
25-
run: bun install
26-
27-
- name: Build static export
28-
run: |
29-
bun run build-ignore-error
30-
31-
- name: Compress dist folder
32-
run: zip -r dist.zip dist
33-
34-
- name: Release
35-
uses: softprops/action-gh-release@v2
36-
with:
37-
files: dist.zip
38-
39-
- name: Changelog
40-
run: bun x changelogithub
41-
env:
42-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
9+
release:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
steps:
14+
- name: Check out code
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Set up Bun
20+
uses: oven-sh/setup-bun@v1
21+
with:
22+
bun-version: "latest"
23+
24+
- name: Install dependencies
25+
run: bun install
26+
27+
- name: Build static export
28+
run: |
29+
bun run build-ignore-error
30+
31+
- name: Compress dist folder
32+
run: zip -r dist.zip dist
33+
34+
- name: Release
35+
uses: softprops/action-gh-release@v2
36+
with:
37+
files: dist.zip
38+
39+
- name: Changelog
40+
run: bun x changelogithub
41+
env:
42+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.prettierrc.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"semi": false,
3-
"singleQuote": false,
4-
"printWidth": 100,
5-
"tabWidth": 4,
6-
"trailingComma": "all",
7-
"importOrder": ["^@core/(.*)$", "^@server/(.*)$", "^@ui/(.*)$", "^[./]"],
8-
"importOrderSeparation": true,
9-
"importOrderSortSpecifiers": true,
10-
"endOfLine": "auto",
11-
"plugins": ["prettier-plugin-tailwindcss", "@trivago/prettier-plugin-sort-imports"]
2+
"semi": false,
3+
"singleQuote": false,
4+
"printWidth": 100,
5+
"tabWidth": 4,
6+
"trailingComma": "all",
7+
"importOrder": ["^@core/(.*)$", "^@server/(.*)$", "^@ui/(.*)$", "^[./]"],
8+
"importOrderSeparation": true,
9+
"importOrderSortSpecifiers": true,
10+
"endOfLine": "auto",
11+
"plugins": ["prettier-plugin-tailwindcss", "@trivago/prettier-plugin-sort-imports"]
1212
}

bun.lockb

0 Bytes
Binary file not shown.

components.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
{
2-
"$schema": "https://ui.shadcn.com/schema.json",
3-
"style": "default",
4-
"rsc": false,
5-
"tsx": true,
6-
"tailwind": {
7-
"config": "tailwind.config.js",
8-
"css": "src/index.css",
9-
"baseColor": "neutral",
10-
"cssVariables": true,
11-
"prefix": ""
12-
},
13-
"aliases": {
14-
"components": "@/components",
15-
"utils": "@/lib/utils",
16-
"ui": "@/components/ui",
17-
"lib": "@/lib",
18-
"hooks": "@/hooks"
19-
}
20-
}
2+
"$schema": "https://ui.shadcn.com/schema.json",
3+
"style": "default",
4+
"rsc": false,
5+
"tsx": true,
6+
"tailwind": {
7+
"config": "tailwind.config.js",
8+
"css": "src/index.css",
9+
"baseColor": "neutral",
10+
"cssVariables": true,
11+
"prefix": ""
12+
},
13+
"aliases": {
14+
"components": "@/components",
15+
"utils": "@/lib/utils",
16+
"ui": "@/components/ui",
17+
"lib": "@/lib",
18+
"hooks": "@/hooks"
19+
}
20+
}

eslint.config.js

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,27 @@
1-
import js from '@eslint/js'
2-
import globals from 'globals'
3-
import reactHooks from 'eslint-plugin-react-hooks'
4-
import reactRefresh from 'eslint-plugin-react-refresh'
5-
import tseslint from 'typescript-eslint'
1+
import js from "@eslint/js"
2+
import reactHooks from "eslint-plugin-react-hooks"
3+
import reactRefresh from "eslint-plugin-react-refresh"
4+
import globals from "globals"
5+
import tseslint from "typescript-eslint"
66

77
export default tseslint.config(
8-
{ ignores: ['dist'] },
9-
{
10-
extends: [js.configs.recommended, ...tseslint.configs.recommended],
11-
files: ['**/*.{ts,tsx}'],
12-
languageOptions: {
13-
ecmaVersion: 2020,
14-
globals: globals.browser,
8+
{ ignores: ["dist"] },
9+
{
10+
extends: [js.configs.recommended, ...tseslint.configs.recommended],
11+
files: ["**/*.{ts,tsx}"],
12+
languageOptions: {
13+
ecmaVersion: 2020,
14+
globals: globals.browser,
15+
},
16+
plugins: {
17+
"react-hooks": reactHooks,
18+
"react-refresh": reactRefresh,
19+
},
20+
rules: {
21+
...reactHooks.configs.recommended.rules,
22+
"@typescript-eslint/no-explicit-any": "off",
23+
"react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
24+
indent: ["error", 4],
25+
},
1526
},
16-
plugins: {
17-
'react-hooks': reactHooks,
18-
'react-refresh': reactRefresh,
19-
},
20-
rules: {
21-
...reactHooks.configs.recommended.rules,
22-
'react-refresh/only-export-components': [
23-
'warn',
24-
{ allowConstantExport: true },
25-
],
26-
"indent": ['error', 4],
27-
},
28-
},
2927
)

index.html

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
<!doctype html>
22
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="shortcut icon" type="image/svg+xml" href="/logo.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>哪吒监控 Nezha Monitoring</title>
8+
</head>
39

4-
<head>
5-
<meta charset="UTF-8" />
6-
<link rel="shortcut icon" type="image/svg+xml" href="/logo.svg" />
7-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8-
<title>哪吒监控 Nezha Monitoring</title>
9-
</head>
10-
11-
<body>
12-
<div id="root"></div>
13-
<script type="module" src="/src/main.tsx"></script>
14-
</body>
15-
16-
</html>
10+
<body>
11+
<div id="root"></div>
12+
<script type="module" src="/src/main.tsx"></script>
13+
</body>
14+
</html>

0 commit comments

Comments
 (0)