Skip to content

Commit 4d57fe5

Browse files
committed
🎉 Initial
0 parents  commit 4d57fe5

File tree

10 files changed

+946
-0
lines changed

10 files changed

+946
-0
lines changed

.pre-commit-config.yaml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
repos:
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v5.0.0
5+
hooks:
6+
- id: check-added-large-files
7+
- id: fix-byte-order-marker
8+
- id: check-case-conflict
9+
- id: check-shebang-scripts-are-executable
10+
- id: check-merge-conflict
11+
- id: trailing-whitespace
12+
- id: mixed-line-ending
13+
- id: end-of-file-fixer
14+
- id: detect-private-key
15+
- id: check-symlinks
16+
- id: check-ast
17+
- id: debug-statements
18+
- id: requirements-txt-fixer
19+
- id: check-xml
20+
- id: check-yaml
21+
- id: check-toml
22+
- id: check-json
23+
- repo: https://github.com/Lucas-C/pre-commit-hooks
24+
rev: v1.5.5
25+
hooks:
26+
- id: remove-crlf
27+
- repo: https://github.com/codespell-project/codespell
28+
rev: v2.4.1
29+
hooks:
30+
- id: codespell
31+
additional_dependencies:
32+
- tomli
33+
- repo: https://github.com/jorisroovers/gitlint
34+
rev: v0.19.1
35+
hooks:
36+
- id: gitlint
37+
args:
38+
- --msg-filename
39+
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
40+
rev: 3.2.0
41+
hooks:
42+
- id: editorconfig-checker
43+
- repo: https://github.com/jumanjihouse/pre-commit-hooks
44+
rev: 3.0.0
45+
hooks:
46+
- id: check-mailmap
47+
- repo: https://github.com/rhysd/actionlint
48+
rev: v1.7.7
49+
hooks:
50+
- id: actionlint
51+
- repo: https://github.com/adrienverge/yamllint
52+
rev: v1.35.1
53+
hooks:
54+
- id: yamllint
55+
- repo: https://github.com/executablebooks/mdformat
56+
rev: 0.7.22
57+
hooks:
58+
- id: mdformat
59+
additional_dependencies:
60+
- mdformat-pyproject
61+
- mdformat-gfm
62+
- mdformat-myst
63+
- mdformat-toc
64+
- mdformat-deflist
65+
- mdformat-beautysh
66+
- mdformat-ruff
67+
- mdformat-config
68+
- mdformat-web
69+
- repo: https://github.com/DavidAnson/markdownlint-cli2
70+
rev: v0.17.2
71+
hooks:
72+
- id: markdownlint-cli2
73+
additional_dependencies:
74+
- markdown-it-texmath
75+
- repo: https://github.com/biomejs/pre-commit
76+
rev: v1.9.4
77+
hooks:
78+
- id: biome-check
79+
- repo: https://github.com/NixOS/nixfmt
80+
rev: 3261d1016ecc753c59ff92767a257f91b587e705
81+
hooks:
82+
- id: nixfmt

LICENSE

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# browser-bitahub
2+
3+
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/Freed-Wu/browser-bitahub/main.svg)](https://results.pre-commit.ci/latest/github/Freed-Wu/browser-bitahub/main)
4+
5+
[![github/downloads](https://shields.io/github/downloads/Freed-Wu/browser-bitahub/total)](https://github.com/Freed-Wu/browser-bitahub/releases)
6+
[![github/downloads/latest](https://shields.io/github/downloads/Freed-Wu/browser-bitahub/latest/total)](https://github.com/Freed-Wu/browser-bitahub/releases/latest)
7+
[![github/issues](https://shields.io/github/issues/Freed-Wu/browser-bitahub)](https://github.com/Freed-Wu/browser-bitahub/issues)
8+
[![github/issues-closed](https://shields.io/github/issues-closed/Freed-Wu/browser-bitahub)](https://github.com/Freed-Wu/browser-bitahub/issues?q=is%3Aissue+is%3Aclosed)
9+
[![github/issues-pr](https://shields.io/github/issues-pr/Freed-Wu/browser-bitahub)](https://github.com/Freed-Wu/browser-bitahub/pulls)
10+
[![github/issues-pr-closed](https://shields.io/github/issues-pr-closed/Freed-Wu/browser-bitahub)](https://github.com/Freed-Wu/browser-bitahub/pulls?q=is%3Apr+is%3Aclosed)
11+
[![github/discussions](https://shields.io/github/discussions/Freed-Wu/browser-bitahub)](https://github.com/Freed-Wu/browser-bitahub/discussions)
12+
[![github/milestones](https://shields.io/github/milestones/all/Freed-Wu/browser-bitahub)](https://github.com/Freed-Wu/browser-bitahub/milestones)
13+
[![github/forks](https://shields.io/github/forks/Freed-Wu/browser-bitahub)](https://github.com/Freed-Wu/browser-bitahub/network/members)
14+
[![github/stars](https://shields.io/github/stars/Freed-Wu/browser-bitahub)](https://github.com/Freed-Wu/browser-bitahub/stargazers)
15+
[![github/watchers](https://shields.io/github/watchers/Freed-Wu/browser-bitahub)](https://github.com/Freed-Wu/browser-bitahub/watchers)
16+
[![github/contributors](https://shields.io/github/contributors/Freed-Wu/browser-bitahub)](https://github.com/Freed-Wu/browser-bitahub/graphs/contributors)
17+
[![github/commit-activity](https://shields.io/github/commit-activity/w/Freed-Wu/browser-bitahub)](https://github.com/Freed-Wu/browser-bitahub/graphs/commit-activity)
18+
[![github/last-commit](https://shields.io/github/last-commit/Freed-Wu/browser-bitahub)](https://github.com/Freed-Wu/browser-bitahub/commits)
19+
[![github/release-date](https://shields.io/github/release-date/Freed-Wu/browser-bitahub)](https://github.com/Freed-Wu/browser-bitahub/releases/latest)
20+
21+
[![github/license](https://shields.io/github/license/Freed-Wu/browser-bitahub)](https://github.com/Freed-Wu/browser-bitahub/blob/main/LICENSE)
22+
[![github/languages](https://shields.io/github/languages/count/Freed-Wu/browser-bitahub)](https://github.com/Freed-Wu/browser-bitahub)
23+
[![github/languages/top](https://shields.io/github/languages/top/Freed-Wu/browser-bitahub)](https://github.com/Freed-Wu/browser-bitahub)
24+
[![github/directory-file-count](https://shields.io/github/directory-file-count/Freed-Wu/browser-bitahub)](https://github.com/Freed-Wu/browser-bitahub)
25+
[![github/code-size](https://shields.io/github/languages/code-size/Freed-Wu/browser-bitahub)](https://github.com/Freed-Wu/browser-bitahub)
26+
[![github/repo-size](https://shields.io/github/repo-size/Freed-Wu/browser-bitahub)](https://github.com/Freed-Wu/browser-bitahub)
27+
[![github/v](https://shields.io/github/v/release/Freed-Wu/browser-bitahub)](https://github.com/Freed-Wu/browser-bitahub)
28+
29+
Display [bitahub](https://bitahub.ustc.edu.cn/resources) GPU status in browser.

assets/css/index.css

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
.hidden {
2+
display: none;
3+
}
4+
5+
table {
6+
border-collapse: collapse;
7+
}
8+
9+
th,
10+
td {
11+
border: 1px solid #666;
12+
padding: 5px;
13+
}
14+
15+
/* th单元格 */
16+
.slash-wrap {
17+
position: relative;
18+
box-sizing: border-box;
19+
width: 60px;
20+
height: 45px;
21+
}
22+
23+
/* 斜线 */
24+
.slash {
25+
position: absolute;
26+
display: block;
27+
top: 0;
28+
left: 0;
29+
/* Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2)) */
30+
width: 75px;
31+
height: 1px;
32+
background-color: #000;
33+
/* Math.atan(height / width) * 180 / Math.PI */
34+
transform: rotate(36.86989764584402deg);
35+
transform-origin: top left;
36+
}
37+
38+
/* 左下角文字 */
39+
.left {
40+
position: absolute;
41+
left: 0px;
42+
bottom: 0px;
43+
}
44+
45+
/* 右上角文字 */
46+
.right {
47+
position: absolute;
48+
right: 0px;
49+
top: 0px;
50+
}
51+
52+
.item {
53+
text-align: center;
54+
cursor: pointer;
55+
background-color: #e5f2f2;
56+
}
57+
58+
.item:hover {
59+
background-color: #cff2f2;
60+
}

assets/icons/48.png

1.89 KB
Loading

assets/js/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
document.body.style.border = "5px solid red";

index.html

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="stylesheet" href="assets/css/index.css" />
6+
</head>
7+
8+
<body>
9+
<table id="popup-content">
10+
<tr>
11+
<th class="slash-wrap">
12+
<span class="left">GPU</span>
13+
<span class="slash"></span>
14+
<span class="right">free</span>
15+
</th>
16+
<th>0</th>
17+
<th>1</th>
18+
<th>2</th>
19+
<th>3</th>
20+
<th>4</th>
21+
<th>5</th>
22+
<th>6</th>
23+
<th>7</th>
24+
<th>8</th>
25+
</tr>
26+
<tr id="1080ti">
27+
<td class="item">1080ti</td>
28+
<td class="number">0</td>
29+
<td class="number">0</td>
30+
<td class="number">0</td>
31+
<td class="number">0</td>
32+
<td class="number">0</td>
33+
<td class="number">0</td>
34+
<td class="number">0</td>
35+
<td class="number">0</td>
36+
<td class="number">0</td>
37+
</tr>
38+
<tr id="3090">
39+
<td class="item">3090</td>
40+
<td class="number">0</td>
41+
<td class="number">0</td>
42+
<td class="number">0</td>
43+
<td class="number">0</td>
44+
<td class="number">0</td>
45+
<td class="number">0</td>
46+
<td class="number">0</td>
47+
<td class="number">0</td>
48+
<td class="number">0</td>
49+
</tr>
50+
<tr id="v100">
51+
<td class="item">v100</td>
52+
<td class="number">0</td>
53+
<td class="number">0</td>
54+
<td class="number">0</td>
55+
<td class="number">0</td>
56+
<td class="number">0</td>
57+
<td class="number">0</td>
58+
<td class="number">0</td>
59+
<td class="number">0</td>
60+
<td class="number">0</td>
61+
</tr>
62+
</table>
63+
<div id="error-content" class="hidden">
64+
<p>Can't render this web page.</p>
65+
</div>
66+
<script src="assets/js/index.js"></script>
67+
</body>
68+
</html>

manifest.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"manifest_version": 2,
3+
"name": "bitahub",
4+
"version": "1.0",
5+
"description": "Display GPU information of bitahub",
6+
"icons": {
7+
"48": "assets/icons/48.png"
8+
},
9+
"browser_action": {
10+
"default_title": "bitahub",
11+
"default_popup": "index.html"
12+
}
13+
}

package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"devDependencies": {
3+
"web-ext": "*"
4+
},
5+
"scripts": {
6+
"run": "web-ext run"
7+
}
8+
}

shell.nix

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
pkgs ? import <nixpkgs> { },
3+
}:
4+
5+
with pkgs;
6+
mkShell {
7+
name = "browser-bitahub";
8+
buildInputs = [
9+
web-ext
10+
];
11+
}

0 commit comments

Comments
 (0)