初始化

This commit is contained in:
lblblong
2021-07-26 15:29:22 +08:00
commit b643682ebd
58 changed files with 14164 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
GENERATE_SOURCEMAP = false
+1
View File
@@ -0,0 +1 @@
[{"/root/code/my/utools/nat-utools/src/index.tsx":"1","/root/code/my/utools/nat-utools/src/react/reportWebVitals.ts":"2","/root/code/my/utools/nat-utools/src/pages/manager/index.tsx":"3","/root/code/my/utools/nat-utools/src/model/nat.ts":"4","/root/code/my/utools/nat-utools/src/store/server.ts":"5","/root/code/my/utools/nat-utools/src/components/icon/index.tsx":"6","/root/code/my/utools/nat-utools/src/components/nat-edit/index.tsx":"7","/root/code/my/utools/nat-utools/src/components/alert/index.tsx":"8","/root/code/my/utools/nat-utools/src/components/nat-log/index.tsx":"9","/root/code/my/utools/nat-utools/src/components/help/index.tsx":"10"},{"size":697,"mtime":1627279865447,"results":"11","hashOfConfig":"12"},{"size":425,"mtime":1627263151942,"results":"13","hashOfConfig":"12"},{"size":3269,"mtime":1627279795438,"results":"14","hashOfConfig":"12"},{"size":510,"mtime":1627267804565,"results":"15","hashOfConfig":"12"},{"size":4235,"mtime":1627279817838,"results":"16","hashOfConfig":"12"},{"size":406,"mtime":1627263151934,"results":"17","hashOfConfig":"12"},{"size":1626,"mtime":1627269048414,"results":"18","hashOfConfig":"12"},{"size":842,"mtime":1627268262179,"results":"19","hashOfConfig":"12"},{"size":1109,"mtime":1627270225081,"results":"20","hashOfConfig":"12"},{"size":783,"mtime":1627278401400,"results":"21","hashOfConfig":"12"},{"filePath":"22","messages":"23","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"35h0pq",{"filePath":"24","messages":"25","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"26"},{"filePath":"27","messages":"28","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"29","messages":"30","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"26"},{"filePath":"31","messages":"32","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"33","messages":"34","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"26"},{"filePath":"35","messages":"36","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"26"},{"filePath":"37","messages":"38","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"26"},{"filePath":"39","messages":"40","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"26"},{"filePath":"41","messages":"42","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/root/code/my/utools/nat-utools/src/index.tsx",[],"/root/code/my/utools/nat-utools/src/react/reportWebVitals.ts",[],["43","44"],"/root/code/my/utools/nat-utools/src/pages/manager/index.tsx",[],"/root/code/my/utools/nat-utools/src/model/nat.ts",[],"/root/code/my/utools/nat-utools/src/store/server.ts",["45"],"/root/code/my/utools/nat-utools/src/components/icon/index.tsx",[],"/root/code/my/utools/nat-utools/src/components/nat-edit/index.tsx",[],"/root/code/my/utools/nat-utools/src/components/alert/index.tsx",[],"/root/code/my/utools/nat-utools/src/components/nat-log/index.tsx",[],"/root/code/my/utools/nat-utools/src/components/help/index.tsx",[],{"ruleId":"46","replacedBy":"47"},{"ruleId":"48","replacedBy":"49"},{"ruleId":"50","severity":1,"message":"51","line":2,"column":30,"nodeType":"52","messageId":"53","endLine":2,"endColumn":34},"no-native-reassign",["54"],"no-negated-in-lhs",["55"],"@typescript-eslint/no-unused-vars","'toJS' is defined but never used.","Identifier","unusedVar","no-global-assign","no-unsafe-negation"]
+37
View File
@@ -0,0 +1,37 @@
# compiled output
/dist
/node_modules
/build
/build-preload
/.cache
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# OS
.DS_Store
# Tests
/coverage
/.nyc_output
# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
+6
View File
@@ -0,0 +1,6 @@
{
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"printWidth": 120
}
+3
View File
@@ -0,0 +1,3 @@
{
"cssvar.extensions": ["src/assets/css/vs.css"]
}
View File
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

+6
View File
@@ -0,0 +1,6 @@
module.exports = {
eslint: {
enable: false,
model: 'file',
},
}
+73
View File
@@ -0,0 +1,73 @@
{
"name": "nat-utools",
"version": "0.1.0",
"private": true,
"homepage": ".",
"scripts": {
"serve": "craco build && cra-build-watch",
"serve:preload": "cd ./preload && npm run serve",
"build": "npm run build:html && npm run build:preload",
"build:html": "craco build",
"build:preload": "cd ./preload && npm run build",
"build:demo": "env-cmd -f .env.staging craco build",
"test": "craco test",
"commit": "git-cz"
},
"dependencies": {
"classnames": "^2.2.6",
"global": "^4.4.0",
"history": "^5.0.0",
"lbl-popups": "^1.0.0",
"lbtools": "^2.0.2",
"mobx": "^6.1.0",
"mobx-react": "^7.1.0",
"preload": "link:E:/code/pro/utools/preload",
"react": "^17.0.1",
"react-dom": "^17.0.1"
},
"devDependencies": {
"@craco/craco": "^6.0.0",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"@types/classnames": "^2.2.11",
"@types/jest": "^26.0.15",
"@types/js-cookie": "^2.2.6",
"@types/localtunnel": "^2.0.1",
"@types/node": "^12.0.0",
"@types/react": "^16.9.53",
"@types/react-dom": "^16.9.8",
"@types/tcp-port-used": "^1.0.0",
"cra-build-watch": "^3.4.0",
"craco-alias": "^2.1.1",
"craco-sass-resources-loader": "^1.1.0",
"env-cmd": "^10.1.0",
"passport": "^0.4.1",
"react-scripts": "4.0.1",
"sass": "^1.30.0",
"sass-loader": "^10.1.0",
"tslib": "^2.1.0",
"typescript": "^4.0.3",
"utility-types": "^3.10.0",
"utools-helper": "^1.4.6",
"web-vitals": "^0.2.4"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
+18
View File
@@ -0,0 +1,18 @@
{
"pluginName": "Live Server",
"description": "启动静态资源实时服务,静态页面开发神器。",
"author": "lblblong",
"homepage": "https://github.com/lblblong/live-server-utools",
"main": "./build/index.html",
"preload": "./build-preload/index.js",
"version": "0.0.1",
"logo": "assets/logo.png",
"platform": ["win32"],
"features": [
{
"code": "startLiveServer",
"explain": "内网穿透管理面板",
"cmds": ["内网穿透"]
}
]
}
+34
View File
@@ -0,0 +1,34 @@
# compiled output
/dist
/node_modules
/.cache
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# OS
.DS_Store
# Tests
/coverage
/.nyc_output
# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
+41
View File
@@ -0,0 +1,41 @@
## Live Server
启动静态资源实时服务,静态页面开发神器。
**Github**[https://github.com/lblblong/live-server-utools](https://github.com/lblblong/live-server-utools)
欢迎 start ✨
![](https://files.catbox.moe/zr51mx.gif)
## 安装
utools 中 搜索 `Live Server`
## 使用方法
#### 1. 启动静态资源实时服务
进入一个有 index.html 文件的目录,呼出超级面板,选择 `启动实时文件服务`
![](https://files.catbox.moe/f8gayz.png)
#### 2. 管理服务
utools 输入框中输入 `live server` ,进入管理面板
![](https://files.catbox.moe/8c4nw9.png)
快捷操作
- 点击端口号可打开默认浏览器进入当前服务
- 点击文件夹路径可快速进入资源管理器该目录
+18
View File
@@ -0,0 +1,18 @@
{
"name": "preload",
"version": "0.1.0",
"private": true,
"homepage": ".",
"main": "./dist/index.js",
"scripts": {
"serve": "parcel src/index.ts --out-dir ../build-preload --target node --bundle-node-modules",
"build": "rm -rf ../build-preload && parcel build src/index.ts --out-dir ../build-preload --target node --bundle-node-modules --no-source-maps"
},
"dependencies": {
"localtunnel": "^2.0.1",
"tslib": "^2.1.0"
},
"devDependencies": {
"@types/localtunnel": "^2.0.1"
}
}
+9
View File
@@ -0,0 +1,9 @@
import localtunnel from 'localtunnel'
declare global {
interface Window {
localtunnel: typeof localtunnel
}
}
window.localtunnel = localtunnel
+33
View File
@@ -0,0 +1,33 @@
{
"compilerOptions": {
"target": "ES5",
"module": "commonjs",
"strict": false,
"noImplicitAny": false,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"charset": "utf8",
"allowJs": false,
"pretty": true,
"noEmitOnError": false,
"noUnusedLocals": false,
"noUnusedParameters": true,
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"strictPropertyInitialization": false,
"noFallthroughCasesInSwitch": true,
"skipLibCheck": true,
"skipDefaultLibCheck": true,
"inlineSourceMap": true,
"importHelpers": true,
"outDir": "dist",
"sourceMap": false,
"esModuleInterop": true,
"types": [
"utools-helper/@types/utools",
"utools-helper/@types/electron",
"@types/node"
]
},
"include": ["src"]
}
+165
View File
@@ -0,0 +1,165 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@types/localtunnel@^2.0.1":
version "2.0.1"
resolved "https://registry.nlark.com/@types/localtunnel/download/@types/localtunnel-2.0.1.tgz#c28a067de1da81b0b4730a9fc2f98e067f973996"
integrity sha1-wooGfeHagbC0cwqfwvmOBn+XOZY=
dependencies:
"@types/node" "*"
"@types/node@*":
version "16.4.3"
resolved "https://registry.nlark.com/@types/node/download/@types/node-16.4.3.tgz?cache=0&sync_timestamp=1627257813519&other_urls=https%3A%2F%2Fregistry.nlark.com%2F%40types%2Fnode%2Fdownload%2F%40types%2Fnode-16.4.3.tgz#c01c1a215721f6dec71b47d88b4687463601ba48"
integrity sha1-wBwaIVch9t7HG0fYi0aHRjYBukg=
ansi-regex@^5.0.0:
version "5.0.0"
resolved "https://registry.nlark.com/ansi-regex/download/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75"
integrity sha1-OIU59VF5vzkznIGvMKZU1p+Hy3U=
ansi-styles@^4.0.0:
version "4.3.0"
resolved "https://registry.nlark.com/ansi-styles/download/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937"
integrity sha1-7dgDYornHATIWuegkG7a00tkiTc=
dependencies:
color-convert "^2.0.1"
[email protected]:
version "0.21.1"
resolved "https://registry.nlark.com/axios/download/axios-0.21.1.tgz#22563481962f4d6bde9a76d516ef0e5d3c09b2b8"
integrity sha1-IlY0gZYvTWvemnbVFu8OXTwJsrg=
dependencies:
follow-redirects "^1.10.0"
cliui@^7.0.2:
version "7.0.4"
resolved "https://registry.nlark.com/cliui/download/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f"
integrity sha1-oCZe5lVHb8gHrqnfPfjfd4OAi08=
dependencies:
string-width "^4.2.0"
strip-ansi "^6.0.0"
wrap-ansi "^7.0.0"
color-convert@^2.0.1:
version "2.0.1"
resolved "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3"
integrity sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=
dependencies:
color-name "~1.1.4"
color-name@~1.1.4:
version "1.1.4"
resolved "https://registry.nlark.com/color-name/download/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
integrity sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=
[email protected]:
version "4.3.1"
resolved "https://registry.nlark.com/debug/download/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee"
integrity sha1-8NIpxQXgxtjEmsVT0bE9wYP2su4=
dependencies:
ms "2.1.2"
emoji-regex@^8.0.0:
version "8.0.0"
resolved "https://registry.nlark.com/emoji-regex/download/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37"
integrity sha1-6Bj9ac5cz8tARZT4QpY79TFkzDc=
escalade@^3.1.1:
version "3.1.1"
resolved "https://registry.nlark.com/escalade/download/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40"
integrity sha1-2M/ccACWXFoBdLSoLqpcBVJ0LkA=
follow-redirects@^1.10.0:
version "1.14.1"
resolved "https://registry.nlark.com/follow-redirects/download/follow-redirects-1.14.1.tgz?cache=0&sync_timestamp=1620555300559&other_urls=https%3A%2F%2Fregistry.nlark.com%2Ffollow-redirects%2Fdownload%2Ffollow-redirects-1.14.1.tgz#d9114ded0a1cfdd334e164e6662ad02bfd91ff43"
integrity sha1-2RFN7Qoc/dM04WTmZirQK/2R/0M=
get-caller-file@^2.0.5:
version "2.0.5"
resolved "https://registry.npm.taobao.org/get-caller-file/download/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"
integrity sha1-T5RBKoLbMvNuOwuXQfipf+sDH34=
is-fullwidth-code-point@^3.0.0:
version "3.0.0"
resolved "https://registry.npm.taobao.org/is-fullwidth-code-point/download/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d"
integrity sha1-8Rb4Bk/pCz94RKOJl8C3UFEmnx0=
localtunnel@^2.0.1:
version "2.0.1"
resolved "https://registry.npm.taobao.org/localtunnel/download/localtunnel-2.0.1.tgz#8f7c593f3005647f7675e6e69af9bf746571a631"
integrity sha1-j3xZPzAFZH92debmmvm/dGVxpjE=
dependencies:
axios "0.21.1"
debug "4.3.1"
openurl "1.1.1"
yargs "16.2.0"
[email protected]:
version "2.1.2"
resolved "https://registry.nlark.com/ms/download/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
integrity sha1-0J0fNXtEP0kzgqjrPM0YOHKuYAk=
[email protected]:
version "1.1.1"
resolved "https://registry.npm.taobao.org/openurl/download/openurl-1.1.1.tgz#3875b4b0ef7a52c156f0db41d4609dbb0f94b387"
integrity sha1-OHW0sO96UsFW8NtB1GCduw+Us4c=
require-directory@^2.1.1:
version "2.1.1"
resolved "https://registry.nlark.com/require-directory/download/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I=
string-width@^4.1.0, string-width@^4.2.0:
version "4.2.2"
resolved "https://registry.nlark.com/string-width/download/string-width-4.2.2.tgz#dafd4f9559a7585cfba529c6a0a4f73488ebd4c5"
integrity sha1-2v1PlVmnWFz7pSnGoKT3NIjr1MU=
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.0"
strip-ansi@^6.0.0:
version "6.0.0"
resolved "https://registry.nlark.com/strip-ansi/download/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532"
integrity sha1-CxVx3XZpzNTz4G4U7x7tJiJa5TI=
dependencies:
ansi-regex "^5.0.0"
tslib@^2.1.0:
version "2.3.0"
resolved "https://registry.nlark.com/tslib/download/tslib-2.3.0.tgz#803b8cdab3e12ba581a4ca41c8839bbb0dacb09e"
integrity sha1-gDuM2rPhK6WBpMpByIObuw2ssJ4=
wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.npm.taobao.org/wrap-ansi/download/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha1-Z+FFz/UQpqaYS98RUpEdadLrnkM=
dependencies:
ansi-styles "^4.0.0"
string-width "^4.1.0"
strip-ansi "^6.0.0"
y18n@^5.0.5:
version "5.0.8"
resolved "https://registry.npm.taobao.org/y18n/download/y18n-5.0.8.tgz?cache=0&sync_timestamp=1617822684820&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fy18n%2Fdownload%2Fy18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55"
integrity sha1-f0k00PfKjFb5UxSTndzS3ZHOHVU=
yargs-parser@^20.2.2:
version "20.2.9"
resolved "https://registry.nlark.com/yargs-parser/download/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee"
integrity sha1-LrfcOwKJcY/ClfNidThFxBoMlO4=
[email protected]:
version "16.2.0"
resolved "https://registry.nlark.com/yargs/download/yargs-16.2.0.tgz?cache=0&sync_timestamp=1626358476652&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fyargs%2Fdownload%2Fyargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66"
integrity sha1-HIK/D2tqZur85+8w43b0mhJHf2Y=
dependencies:
cliui "^7.0.2"
escalade "^3.1.1"
get-caller-file "^2.0.5"
require-directory "^2.1.1"
string-width "^4.2.0"
y18n "^5.0.5"
yargs-parser "^20.2.2"
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

+43
View File
@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>指南针管理后台</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
+15
View File
@@ -0,0 +1,15 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
+3
View File
@@ -0,0 +1,3 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:
+4
View File
@@ -0,0 +1,4 @@
:root {
--color-primary: #5d9cec;
--color-third: #f2237b;
}
+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="none" d="M0 0h24v24H0z"/><path d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"/></svg>

After

Width:  |  Height:  |  Size: 171 B

+22
View File
@@ -0,0 +1,22 @@
@font-face {
font-family: "icon";
src: url('icon.eot?t=1627271109350'); /* IE9*/
src: url('icon.eot?t=1627271109350#iefix') format('embedded-opentype'), /* IE6-IE8 */
url("icon.woff2?t=1627271109350") format("woff2"),
url("icon.woff?t=1627271109350") format("woff"),
url('icon.ttf?t=1627271109350') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
url('icon.svg?t=1627271109350#icon') format('svg'); /* iOS 4.1- */
}
[class^="icon-"], [class*=" icon-"] {
font-family: 'icon' !important;
font-size:16px;
font-style:normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-add-line:before { content: "\ea01"; }
.icon-github-line:before { content: "\ea02"; }
.icon-question-mark:before { content: "\ea03"; }
Binary file not shown.
+20
View File
@@ -0,0 +1,20 @@
@font-face {font-family: "icon";
src: url('icon.eot?t=1627271109350'); /* IE9*/
src: url('icon.eot?t=1627271109350#iefix') format('embedded-opentype'), /* IE6-IE8 */
url("icon.woff2?t=1627271109350") format("woff2"),
url("icon.woff?t=1627271109350") format("woff"),
url('icon.ttf?t=1627271109350') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
url('icon.svg?t=1627271109350#icon') format('svg'); /* iOS 4.1- */
}
[class^="icon-"], [class*=" icon-"] {
font-family: 'icon' !important;
font-size:16px;
font-style:normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-add-line:before { content: "\ea01"; }
.icon-github-line:before { content: "\ea02"; }
.icon-question-mark:before { content: "\ea03"; }
+23
View File
@@ -0,0 +1,23 @@
@font-face {font-family: "icon";
src: url('icon.eot?t=1627271109350'); /* IE9*/
src: url('icon.eot?t=1627271109350#iefix') format('embedded-opentype'), /* IE6-IE8 */
url("icon.woff2?t=1627271109350") format("woff2"),
url("icon.woff?t=1627271109350") format("woff"),
url('icon.ttf?t=1627271109350') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
url('icon.svg?t=1627271109350#icon') format('svg'); /* iOS 4.1- */
}
[class^="icon-"], [class*=" icon-"] {
font-family: 'icon' !important;
font-size:16px;
font-style:normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
:global {
.icon-add-line:before { content: "\ea01"; }
.icon-github-line:before { content: "\ea02"; }
.icon-question-mark:before { content: "\ea03"; }
}
+21
View File
@@ -0,0 +1,21 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<defs>
<font id="icon" horiz-adv-x="24">
<font-face font-family="icon"
units-per-em="24" ascent="24"
descent="0" />
<missing-glyph horiz-adv-x="0" />
<glyph glyph-name="add-line"
unicode="&#xEA01;"
horiz-adv-x="24" d="M11 13V19H13V13H19V11H13V5H11V11H5V13z" />
<glyph glyph-name="github-line"
unicode="&#xEA02;"
horiz-adv-x="24" d="M6.3141665347662 5.347C6.0141665347662 5.547 5.7561665347662 5.802 5.4541665347662 6.163A50.32 50.32 0 0 0 4.9881665347662 6.742C4.5251665347662 7.317 4.2331665347662 7.582 3.9311665347662 7.691A1 1 0 0 0 4.6071665347662 9.574C5.3591665347662 9.304 5.8681665347662 8.839 6.5541665347662 7.986C6.4601665347662 8.103 6.8941665347662 7.559 6.9871665347662 7.447C7.1771665347662 7.22 7.3171665347662 7.082 7.4271665347662 7.009C7.6311665347662 6.872 8.0141665347662 6.813 8.5771665347662 6.869C8.6001665347662 7.251 8.6711665347662 7.622 8.7791665347662 7.964C5.8111665347662 8.69 4.1311665347662 10.604 4.1311665347662 14.36C4.1311665347662 15.6 4.5011665347662 16.716 5.1891665347662 17.652C4.9711665347662 18.546 5.0041665347662 19.627 5.4911665347662 20.844A1 1 0 0 0 6.1211665347662 21.426C6.2021665347662 21.45 6.2481665347662 21.461 6.3291665347662 21.473C7.1321665347662 21.596 8.2661665347662 21.303 9.7441665347662 20.377A11.731 11.731 0 0 0 12.4311665347662 20.685C13.3431665347662 20.685 14.2491665347662 20.581 15.1151665347662 20.377C16.5921665347662 21.31 17.7281665347662 21.603 18.5371665347662 21.473C18.6221665347662 21.46 18.6941665347662 21.443 18.7551665347662 21.423A1 1 0 0 0 19.3711665347662 20.843C19.8581665347662 19.627 19.8911665347662 18.546 19.6731665347662 17.653C20.3641665347662 16.717 20.7311665347662 15.608 20.7311665347662 14.36C20.7311665347662 10.603 19.0571665347662 8.695 16.0891665347662 7.968C16.2141665347662 7.553 16.2791665347662 7.089 16.2791665347662 6.588A300.492 300.492 0 0 0 16.2671665347662 3.872A1 1 0 0 0 16.2481665347662 1.914C15.1091665347662 1.686 14.2651665347662 2.446 14.2651665347662 3.439L14.2671665347662 3.885L14.2721665347662 4.59C14.2771665347662 5.298 14.2791665347662 5.928 14.2791665347662 6.588C14.2791665347662 7.285 14.0961665347662 7.74 13.8541665347662 7.948C13.1931665347662 8.518 13.5281665347662 9.603 14.3941665347662 9.7C17.3611665347662 10.033 18.7311665347662 11.182 18.7311665347662 14.36C18.7311665347662 15.315 18.4191665347662 16.104 17.8181665347662 16.764A1 1 0 0 0 17.6281665347662 17.809C17.7941665347662 18.223 17.8651665347662 18.766 17.7241665347662 19.423L17.7141665347662 19.42C17.2231665347662 19.281 16.6041665347662 18.98 15.8561665347662 18.471A1 1 0 0 0 15.0231665347662 18.336A9.626 9.626 0 0 1 12.4311665347662 18.685C11.5411665347662 18.685 10.6591665347662 18.566 9.8391665347662 18.335A1 1 0 0 0 9.0091665347662 18.469C8.2571665347662 18.976 7.6351665347662 19.276 7.1411665347662 19.416C6.9971665347662 18.763 7.0681665347662 18.222 7.2331665347662 17.809A1 1 0 0 0 7.0441665347662 16.764C6.4471665347662 16.11 6.1311665347662 15.306 6.1311665347662 14.36C6.1311665347662 11.188 7.5021665347662 10.032 10.4531665347662 9.7C11.3181665347662 9.603 11.6541665347662 8.523 10.9971665347662 7.952C10.8051665347662 7.784 10.5681665347662 7.22 10.5681665347662 6.588V3.438C10.5681665347662 2.452 9.7331665347662 1.713 8.6081665347662 1.91A1 1 0 0 0 8.5681665347662 3.872V4.862C7.6581665347662 4.801 6.9061665347662 4.95 6.3141665347662 5.347z" />
<glyph glyph-name="question-mark"
unicode="&#xEA03;"
horiz-adv-x="24" d="M12 5C12.828 5 13.5 4.328 13.5 3.5S12.828 2 12 2S10.5 2.672 10.5 3.5S11.172 5 12 5zM12 22C15.314 22 18 19.314 18 16C18 13.835 17.247 12.71 15.326 11.077C13.399 9.44 13 8.703 13 7H11C11 9.474 11.787 10.695 14.031 12.601C15.548 13.89 16 14.566 16 16C16 18.21 14.21 20 12 20S8 18.21 8 16V15H6V16C6 19.314 8.686 22 12 22z" />
</font>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 3.9 KiB

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="0" height="0" style="display:none;"><symbol viewBox="0 0 24 24" id="icon-add-line"><path fill="none" d="M0 0h24v24H0z"></path><path d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"></path></symbol><symbol viewBox="0 0 24 24" id="icon-github-line"><path fill="none" d="M0 0h24v24H0z"></path><path d="M5.883 18.653c-.3-.2-.558-.455-.86-.816a50.32 50.32 0 0 1-.466-.579c-.463-.575-.755-.84-1.057-.949a1 1 0 0 1 .676-1.883c.752.27 1.261.735 1.947 1.588-.094-.117.34.427.433.539.19.227.33.365.44.438.204.137.587.196 1.15.14.023-.382.094-.753.202-1.095C5.38 15.31 3.7 13.396 3.7 9.64c0-1.24.37-2.356 1.058-3.292-.218-.894-.185-1.975.302-3.192a1 1 0 0 1 .63-.582c.081-.024.127-.035.208-.047.803-.123 1.937.17 3.415 1.096A11.731 11.731 0 0 1 12 3.315c.912 0 1.818.104 2.684.308 1.477-.933 2.613-1.226 3.422-1.096.085.013.157.03.218.05a1 1 0 0 1 .616.58c.487 1.216.52 2.297.302 3.19.691.936 1.058 2.045 1.058 3.293 0 3.757-1.674 5.665-4.642 6.392.125.415.19.879.19 1.38a300.492 300.492 0 0 1-.012 2.716 1 1 0 0 1-.019 1.958c-1.139.228-1.983-.532-1.983-1.525l.002-.446.005-.705c.005-.708.007-1.338.007-1.998 0-.697-.183-1.152-.425-1.36-.661-.57-.326-1.655.54-1.752 2.967-.333 4.337-1.482 4.337-4.66 0-.955-.312-1.744-.913-2.404a1 1 0 0 1-.19-1.045c.166-.414.237-.957.096-1.614l-.01.003c-.491.139-1.11.44-1.858.949a1 1 0 0 1-.833.135A9.626 9.626 0 0 0 12 5.315c-.89 0-1.772.119-2.592.35a1 1 0 0 1-.83-.134c-.752-.507-1.374-.807-1.868-.947-.144.653-.073 1.194.092 1.607a1 1 0 0 1-.189 1.045C6.016 7.89 5.7 8.694 5.7 9.64c0 3.172 1.371 4.328 4.322 4.66.865.097 1.201 1.177.544 1.748-.192.168-.429.732-.429 1.364v3.15c0 .986-.835 1.725-1.96 1.528a1 1 0 0 1-.04-1.962v-.99c-.91.061-1.662-.088-2.254-.485z"></path></symbol><symbol viewBox="0 0 24 24" id="icon-question-mark"><path fill="none" d="M0 0H24V24H0z"></path><path d="M12 19c.828 0 1.5.672 1.5 1.5S12.828 22 12 22s-1.5-.672-1.5-1.5.672-1.5 1.5-1.5zm0-17c3.314 0 6 2.686 6 6 0 2.165-.753 3.29-2.674 4.923C13.399 14.56 13 15.297 13 17h-2c0-2.474.787-3.695 3.031-5.601C15.548 10.11 16 9.434 16 8c0-2.21-1.79-4-4-4S8 5.79 8 8v1H6V8c0-3.314 2.686-6 6-6z"></path></symbol></svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.
Binary file not shown.
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>查看图标</title><meta name="viewport" content="width=device-width,minimum-scale=1,maximum-scale=1,user-scalable=no"><meta name="description" content="File icons in the file tree."><meta name="keywords" content="file,icon,file-icons,TTF,EOT,WOFF,WOFF2,SVG"><link rel="stylesheet" href="icon.css"><style>*{margin:0;padding:0;list-style:none}body{color:#696969;font:12px/1.5 tahoma,arial,\5b8b\4f53,sans-serif}a{color:#333;text-decoration:underline}a:hover{color:#0949d1}.header{color:#333;text-align:center;padding:80px 0 60px 0;min-height:153px;font-size:14px}.header .logo svg{height:120px;width:120px}.header h1{font-size:42px;padding:26px 0 10px 0}.header sup{font-size:14px;margin:8px 0 0 8px;position:absolute;color:#7b7b7b}.info{color:#999;font-weight:400;max-width:346px;margin:0 auto;padding:20px 0;font-size:14px}.icons{max-width:1190px;margin:0 auto}.icons ul{text-align:center}.icons ul li{vertical-align:top;width:120px;display:inline-block;text-align:center;background-color:rgba(0,0,0,.02);border-radius:3px;padding:29px 0 10px 0;margin-right:10px;margin-top:10px;transition:all .6s ease}.icons ul li:hover{background-color:rgba(0,0,0,.06)}.icons ul li:hover span{color:#3c75e4;opacity:1}.icons ul li .unicode{color:#8c8c8c;opacity:.3}.icons ul li h4{font-weight:400;padding:10px 0 5px 0;display:block;color:#8c8c8c;font-size:14px;line-height:12px;opacity:.8}.icons ul li:hover h4{opacity:1}.icons ul li svg{width:24px;height:24px}.icons ul li:hover{color:#3c75e4}.footer{text-align:center;padding:10px 0 90px 0}.footer a{text-align:center;padding:10px 0 90px 0;color:#696969}.footer a:hover{color:#0949d1}.links{text-align:center;padding:50px 0 0 0;font-size:14px}.icons ul li.class-icon{font-size:21px;line-height:21px;padding-bottom:20px}.icons ul li.class-icon p{font-size:12px}.icons ul li.class-icon [class^=icon-]{font-size:26px}</style></head><body><div class="header"><h1>查看图标<sup>1</sup></h1><div class="info">File icons in the file tree.</div><p><a href="index.html">Font Class Demo</a> · <a href="symbol.html">Symbol Demo</a> · <a href="unicode.html">Unicode Demo</a></p></div><div class="icons"><ul><li class="class-icon"><i class="icon-add-line"></i><p class="name">add-line</p></li><li class="class-icon"><i class="icon-github-line"></i><p class="name">github-line</p></li><li class="class-icon"><i class="icon-question-mark"></i><p class="name">question-mark</p></li></ul></div><p class="links"><a href="index.html">Font Class Demo</a> · <a href="symbol.html">Symbol Demo</a> · <a href="unicode.html">Unicode Demo</a></p><div class="footer"><div><a target="_blank" href="https://github.com/jaywcjlove/svgtofont">Created By svgtofont</a></div></div></body></html>
+1
View File
@@ -0,0 +1 @@
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>查看图标</title><meta name="viewport" content="width=device-width,minimum-scale=1,maximum-scale=1,user-scalable=no"><meta name="description" content="File icons in the file tree."><meta name="keywords" content="file,icon,file-icons,TTF,EOT,WOFF,WOFF2,SVG"><style>*{margin:0;padding:0;list-style:none}body{color:#696969;font:12px/1.5 tahoma,arial,\5b8b\4f53,sans-serif}a{color:#333;text-decoration:underline}a:hover{color:#0949d1}.header{color:#333;text-align:center;padding:80px 0 60px 0;min-height:153px;font-size:14px}.header .logo svg{height:120px;width:120px}.header h1{font-size:42px;padding:26px 0 10px 0}.header sup{font-size:14px;margin:8px 0 0 8px;position:absolute;color:#7b7b7b}.info{color:#999;font-weight:400;max-width:346px;margin:0 auto;padding:20px 0;font-size:14px}.icons{max-width:1190px;margin:0 auto}.icons ul{text-align:center}.icons ul li{vertical-align:top;width:120px;display:inline-block;text-align:center;background-color:rgba(0,0,0,.02);border-radius:3px;padding:29px 0 10px 0;margin-right:10px;margin-top:10px;transition:all .6s ease}.icons ul li:hover{background-color:rgba(0,0,0,.06)}.icons ul li:hover span{color:#3c75e4;opacity:1}.icons ul li .unicode{color:#8c8c8c;opacity:.3}.icons ul li h4{font-weight:400;padding:10px 0 5px 0;display:block;color:#8c8c8c;font-size:14px;line-height:12px;opacity:.8}.icons ul li:hover h4{opacity:1}.icons ul li svg{width:24px;height:24px}.icons ul li:hover{color:#3c75e4}.footer{text-align:center;padding:10px 0 90px 0}.footer a{text-align:center;padding:10px 0 90px 0;color:#696969}.footer a:hover{color:#0949d1}.links{text-align:center;padding:50px 0 0 0;font-size:14px}.icons ul li.symbol{padding:28px 10px 16px 10px;width:100px}.icons ul li.symbol svg{width:34px;height:34px}.icons ul li.symbol h4{font-size:12px}</style></head><body><div class="header"><h1>查看图标<sup>1</sup></h1><div class="info">File icons in the file tree.</div><p><a href="index.html">Font Class Demo</a> · <a href="symbol.html">Symbol Demo</a> · <a href="unicode.html">Unicode Demo</a></p></div><div class="icons"><ul><li class="symbol"><svg class="icon" aria-hidden="true"><use xlink:href="icon.symbol.svg#icon-add-line"></use></svg><h4>icon-add-line</h4></li><li class="symbol"><svg class="icon" aria-hidden="true"><use xlink:href="icon.symbol.svg#icon-github-line"></use></svg><h4>icon-github-line</h4></li><li class="symbol"><svg class="icon" aria-hidden="true"><use xlink:href="icon.symbol.svg#icon-question-mark"></use></svg><h4>icon-question-mark</h4></li></ul></div><p class="links"><a href="index.html">Font Class Demo</a> · <a href="symbol.html">Symbol Demo</a> · <a href="unicode.html">Unicode Demo</a></p><div class="footer"><div><a target="_blank" href="https://github.com/jaywcjlove/svgtofont">Created By svgtofont</a></div></div></body></html>
+1
View File
@@ -0,0 +1 @@
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>查看图标</title><meta name="viewport" content="width=device-width,minimum-scale=1,maximum-scale=1,user-scalable=no"><meta name="description" content="File icons in the file tree."><meta name="keywords" content="file,icon,file-icons,TTF,EOT,WOFF,WOFF2,SVG"><style>*{margin:0;padding:0;list-style:none}body{color:#696969;font:12px/1.5 tahoma,arial,\5b8b\4f53,sans-serif}a{color:#333;text-decoration:underline}a:hover{color:#0949d1}.header{color:#333;text-align:center;padding:80px 0 60px 0;min-height:153px;font-size:14px}.header .logo svg{height:120px;width:120px}.header h1{font-size:42px;padding:26px 0 10px 0}.header sup{font-size:14px;margin:8px 0 0 8px;position:absolute;color:#7b7b7b}.info{color:#999;font-weight:400;max-width:346px;margin:0 auto;padding:20px 0;font-size:14px}.icons{max-width:1190px;margin:0 auto}.icons ul{text-align:center}.icons ul li{vertical-align:top;width:120px;display:inline-block;text-align:center;background-color:rgba(0,0,0,.02);border-radius:3px;padding:29px 0 10px 0;margin-right:10px;margin-top:10px;transition:all .6s ease}.icons ul li:hover{background-color:rgba(0,0,0,.06)}.icons ul li:hover span{color:#3c75e4;opacity:1}.icons ul li .unicode{color:#8c8c8c;opacity:.3}.icons ul li h4{font-weight:400;padding:10px 0 5px 0;display:block;color:#8c8c8c;font-size:14px;line-height:12px;opacity:.8}.icons ul li:hover h4{opacity:1}.icons ul li svg{width:24px;height:24px}.icons ul li:hover{color:#3c75e4}.footer{text-align:center;padding:10px 0 90px 0}.footer a{text-align:center;padding:10px 0 90px 0;color:#696969}.footer a:hover{color:#0949d1}.links{text-align:center;padding:50px 0 0 0;font-size:14px}.icons ul .unicode-icon span{display:block}.icons ul .unicode-icon h4{font-size:12px}@font-face{font-family:icon;src:url(icon.eot);src:url(icon.eot#iefix) format("embedded-opentype"),url(icon.woff2?1627271109432) format("woff2"),url(icon.woff?1627271109432) format("woff"),url(icon.ttf?1627271109432) format("truetype"),url(icon.svg#icon?1627271109432) format("svg")}.iconfont{font-family:icon!important;font-size:26px;font-style:normal;-webkit-font-smoothing:antialiased;-webkit-text-stroke-width:.2px;-moz-osx-font-smoothing:grayscale}</style></head><body><div class="header"><h1>查看图标<sup>1</sup></h1><div class="info">File icons in the file tree.</div><p><a href="index.html">Font Class Demo</a> · <a href="symbol.html">Symbol Demo</a> · <a href="unicode.html">Unicode Demo</a></p></div><div class="icons"><ul><li class="unicode-icon"><span class="iconfont"></span><h4>add-line</h4><span class="unicode">&amp;#59905;</span></li><li class="unicode-icon"><span class="iconfont"></span><h4>github-line</h4><span class="unicode">&amp;#59906;</span></li><li class="unicode-icon"><span class="iconfont"></span><h4>question-mark</h4><span class="unicode">&amp;#59907;</span></li></ul></div><p class="links"><a href="index.html">Font Class Demo</a> · <a href="symbol.html">Symbol Demo</a> · <a href="unicode.html">Unicode Demo</a></p><div class="footer"><div><a target="_blank" href="https://github.com/jaywcjlove/svgtofont">Created By svgtofont</a></div></div></body></html>
+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="none" d="M0 0h24v24H0z"/><path d="M5.883 18.653c-.3-.2-.558-.455-.86-.816a50.32 50.32 0 0 1-.466-.579c-.463-.575-.755-.84-1.057-.949a1 1 0 0 1 .676-1.883c.752.27 1.261.735 1.947 1.588-.094-.117.34.427.433.539.19.227.33.365.44.438.204.137.587.196 1.15.14.023-.382.094-.753.202-1.095C5.38 15.31 3.7 13.396 3.7 9.64c0-1.24.37-2.356 1.058-3.292-.218-.894-.185-1.975.302-3.192a1 1 0 0 1 .63-.582c.081-.024.127-.035.208-.047.803-.123 1.937.17 3.415 1.096A11.731 11.731 0 0 1 12 3.315c.912 0 1.818.104 2.684.308 1.477-.933 2.613-1.226 3.422-1.096.085.013.157.03.218.05a1 1 0 0 1 .616.58c.487 1.216.52 2.297.302 3.19.691.936 1.058 2.045 1.058 3.293 0 3.757-1.674 5.665-4.642 6.392.125.415.19.879.19 1.38a300.492 300.492 0 0 1-.012 2.716 1 1 0 0 1-.019 1.958c-1.139.228-1.983-.532-1.983-1.525l.002-.446.005-.705c.005-.708.007-1.338.007-1.998 0-.697-.183-1.152-.425-1.36-.661-.57-.326-1.655.54-1.752 2.967-.333 4.337-1.482 4.337-4.66 0-.955-.312-1.744-.913-2.404a1 1 0 0 1-.19-1.045c.166-.414.237-.957.096-1.614l-.01.003c-.491.139-1.11.44-1.858.949a1 1 0 0 1-.833.135A9.626 9.626 0 0 0 12 5.315c-.89 0-1.772.119-2.592.35a1 1 0 0 1-.83-.134c-.752-.507-1.374-.807-1.868-.947-.144.653-.073 1.194.092 1.607a1 1 0 0 1-.189 1.045C6.016 7.89 5.7 8.694 5.7 9.64c0 3.172 1.371 4.328 4.322 4.66.865.097 1.201 1.177.544 1.748-.192.168-.429.732-.429 1.364v3.15c0 .986-.835 1.725-1.96 1.528a1 1 0 0 1-.04-1.962v-.99c-.91.061-1.662-.088-2.254-.485z"/></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="none" d="M0 0H24V24H0z"/><path d="M12 19c.828 0 1.5.672 1.5 1.5S12.828 22 12 22s-1.5-.672-1.5-1.5.672-1.5 1.5-1.5zm0-17c3.314 0 6 2.686 6 6 0 2.165-.753 3.29-2.674 4.923C13.399 14.56 13 15.297 13 17h-2c0-2.474.787-3.695 3.031-5.601C15.548 10.11 16 9.434 16 8c0-2.21-1.79-4-4-4S8 5.79 8 8v1H6V8c0-3.314 2.686-6 6-6z"/></svg>

After

Width:  |  Height:  |  Size: 418 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

+7
View File
@@ -0,0 +1,7 @@
export function isNil(val: any) {
return val === null || val === undefined
}
export function isNotNil(val: any) {
return !isNil(val)
}
+37
View File
@@ -0,0 +1,37 @@
.index {
padding: 18px;
border-radius: 12px;
background-color: #fff;
width: 50vw;
max-width: 400px;
display: flex;
flex-direction: column;
line-height: 1;
> * + * {
margin-top: 18px;
font-size: 18px;
}
.title {
font-size: 28px;
color: #333;
}
.content {
color: #666;
padding: 16px 0;
line-height: 1.7;
}
.btn {
padding: 16px;
background-color: var(--color-primary);
display: flex;
justify-content: center;
align-items: center;
color: #fff;
border-radius: 12px;
cursor: pointer;
}
}
+41
View File
@@ -0,0 +1,41 @@
import { Popups, useController } from 'lbl-popups'
import { Observer } from 'mobx-react'
import { FC } from 'react'
import styles from './index.module.scss'
interface Props {
title: React.ReactNode
content: React.ReactNode
}
const Alert: FC<Props> = (props) => {
const ctl = useController()
return (
<Observer>
{() => (
<div className={styles.index}>
<div className={styles.title}>{props.title}</div>
<div className={styles.content}>{props.content}</div>
<div
className={styles.btn}
onClick={() => {
ctl.close()
}}
>
</div>
</div>
)}
</Observer>
)
}
export function openAlert(props: Props) {
return Popups.open({
el: Alert,
position: 'center',
props,
})
}
+42
View File
@@ -0,0 +1,42 @@
.index {
padding: 18px;
border-radius: 12px;
background-color: #fff;
width: 50vw;
max-width: 400px;
display: flex;
flex-direction: column;
line-height: 1;
.link {
color: var(--color-primary);
cursor: pointer;
}
> * + * {
margin-top: 18px;
font-size: 18px;
}
.title {
font-size: 28px;
color: #333;
}
.content {
color: #666;
padding: 16px 0;
line-height: 1.7;
}
.btn {
padding: 16px;
background-color: var(--color-primary);
display: flex;
justify-content: center;
align-items: center;
color: #fff;
border-radius: 12px;
cursor: pointer;
}
}
+28
View File
@@ -0,0 +1,28 @@
import { Popups } from 'lbl-popups'
import { Observer } from 'mobx-react'
import { FC } from 'react'
import styles from './index.module.scss'
const Help: FC = () => {
return (
<Observer>
{() => (
<div className={styles.index}>
<div className={styles.title}>穿NAT</div>
<div className={styles.content}>
utools localtunnel GitHub
<span className={styles.link} onClick={()=>utools.shellOpenExternal('https://github.com/lblblong/nat-utools')}>https://github.com/lblblong/nat-utools</span>
</div>
</div>
)}
</Observer>
)
}
export function openHelp() {
return Popups.open({
el: Help,
position: 'center',
})
}
+4
View File
@@ -0,0 +1,4 @@
.index {
font-size: inherit;
line-height: inherit;
}
+17
View File
@@ -0,0 +1,17 @@
import { CSSProperties, FC } from 'react'
import styles from './index.module.scss'
import classNames from 'classnames'
interface Props {
className?: string
value?: string
style?: CSSProperties
}
export const Icon: FC<Props> = (props) => {
return <span style={props.style} className={classNames(styles.index, 'icon-' + props.value, props.className)} />
}
Icon.defaultProps = {
value: 'star',
}
+38
View File
@@ -0,0 +1,38 @@
.index {
padding: 18px;
border-radius: 12px;
background-color: #fff;
width: 50vw;
max-width: 400px;
display: flex;
flex-direction: column;
line-height: 1;
> * + * {
margin-top: 18px;
font-size: 18px;
}
.title {
font-size: 28px;
}
input {
padding: 16px;
border: none;
border-bottom: 1px solid #efefef;
outline: none;
font-weight: bold;
}
.btn {
padding: 16px;
background-color: var(--color-primary);
display: flex;
justify-content: center;
align-items: center;
color: #fff;
border-radius: 12px;
cursor: pointer;
}
}
+69
View File
@@ -0,0 +1,69 @@
import { Popups, useController } from 'lbl-popups'
import { Observer, useLocalStore } from 'mobx-react'
import { FC } from 'react'
import styles from './index.module.scss'
interface Props {
defaultValue?: {
port: number
subdomain?: string
}
}
const NatEdit: FC<Props> = (props) => {
const ctl = useController()
const localStore = useLocalStore(() => {
return {
port: props.defaultValue?.port || '',
subdomian: props.defaultValue?.subdomain || '',
bindOnChange: (key: string) => {
return (e: any) => {
localStore[key] = e.target.value
}
},
}
})
return (
<Observer>
{() => (
<div className={styles.index}>
<div className={styles.title}>穿</div>
<input
placeholder="端口号"
value={localStore.port}
onChange={localStore.bindOnChange('port')}
type="number"
/>
<input
placeholder="子域名(可选)"
value={localStore.subdomian}
onChange={localStore.bindOnChange('subdomian')}
/>
<div
className={styles.btn}
onClick={() => {
ctl.close({
port: localStore.port,
subdomain: localStore.subdomian,
})
}}
>
</div>
</div>
)}
</Observer>
)
}
export function openNatEdit(props?: Props): Promise<{
port: number
subdomain?: string
}> {
return Popups.open({
el: NatEdit,
position: 'center',
props
})
}
+11
View File
@@ -0,0 +1,11 @@
.index {
width: 70vw;
max-width: 800px;
height: 100vh;
background-color: #fff;
overflow-y: auto;
color: #333;
.content {
padding: 20px;
}
}
+46
View File
@@ -0,0 +1,46 @@
import { Popups } from 'lbl-popups'
import { Observer } from 'mobx-react'
import { FC, useRef } from 'react'
import { StoreServer } from 'src/store/server'
import styles from './index.module.scss'
interface Props {
id: number
}
const NatLog: FC<Props> = (props) => {
const nat = StoreServer.getNatById(props.id)
const indexRef = useRef<HTMLDivElement>(null)
const contentRef = useRef<HTMLDivElement>(null)
const resetScroll = () => {
setTimeout(() => {
if (indexRef.current && contentRef.current) indexRef.current.scrollTop = contentRef.current.offsetHeight
})
}
return (
<Observer>
{() => {
resetScroll()
return (
<div className={styles.index} ref={indexRef}>
<div className={styles.content} ref={contentRef}>
{nat.logs.map((l) => {
return <div className={styles.item}>{l}</div>
})}
</div>
</div>
)
}}
</Observer>
)
}
export function openNatLog(props: Props) {
return Popups.open({
el: NatLog,
props,
position: 'right',
})
}
+24
View File
@@ -0,0 +1,24 @@
import { Popups } from 'lbl-popups'
import { configure } from 'mobx'
import React from 'react'
import ReactDOM from 'react-dom'
import './assets/css/vs.css'
import './assets/icon/fonts/icon.css'
import { IndexPage } from './pages/manager'
import reportWebVitals from './react/reportWebVitals'
configure({
enforceActions: 'never',
})
ReactDOM.render(
<React.StrictMode>
<Popups />
<IndexPage />
</React.StrictMode>,
document.getElementById('root')
)
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals()
+27
View File
@@ -0,0 +1,27 @@
import { EventEmitter } from 'events'
import { makeAutoObservable } from 'mobx'
export enum NatState {
on,
off,
loading,
}
export class Nat {
constructor(it: Partial<Nat> = {}) {
makeAutoObservable(this)
if (it.subdomain === '') {
delete it.subdomain
}
this.id = Date.now()
Object.assign(this, it)
}
id: number
state = NatState.off
subdomain?: string
port = 6600
tunnel?: EventEmitter & { url: string; close: () => void }
url?: string
logs: string[] = []
}
+107
View File
@@ -0,0 +1,107 @@
.index {
position: relative;
.actions {
position: fixed;
bottom: 24px;
right: 24px;
display: flex;
align-items: center;
.action + .action {
margin-left: 16px;
}
.action {
width: 40px;
height: 40px;
border-radius: 50%;
background-color: var(--color-primary);
color: #fff;
display: flex;
justify-content: center;
align-items: center;
font-size: 18px;
cursor: pointer;
box-shadow: 0px 1px 2px -2px rgba($color: #000000, $alpha: 0.16);
transition: all 0.3s;
&:hover {
// background-color: rgba($color: var(--color-primary), $alpha: 0.9);
box-shadow: 0px 5px 12px 4px rgba($color: #000000, $alpha: 0.09);
}
}
}
.list {
padding-bottom: 100px;
.item,
.item > .lbox,
.item > .rbox {
display: flex;
align-items: center;
}
.item + .item {
border-top: 1px solid #efefef;
}
.item {
line-height: 1;
padding: 24px 16px;
color: #999;
&:hover {
background: rgba($color: var(--color-primary), $alpha: 0.09);
}
.lbox {
flex: 1;
> * + * {
margin-left: 16px;
}
.state {
width: 14px;
height: 14px;
background-color: #dfdfdf;
border-radius: 50%;
}
.name {
font-weight: bold;
}
.url {
cursor: pointer;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
&:hover {
color: var(--color-primary);
}
}
}
.rbox {
margin: -8px;
button {
border: none;
background: none;
padding: 0;
color: var(--color-primary);
margin: 8px;
cursor: pointer;
&:hover {
text-decoration: underline;
}
}
.del {
color: var(--color-third);
}
button:disabled {
color: #999;
}
}
}
.active {
color: #333;
.lbox {
.state {
background-color: var(--color-primary);
}
}
}
}
}
+85
View File
@@ -0,0 +1,85 @@
import classNames from 'classnames'
import { Observer } from 'mobx-react'
import React from 'react'
import { Icon } from '../../components/icon'
import { NatState } from '../../model/nat'
import { StoreServer } from '../../store/server'
import styles from './index.module.scss'
export const IndexPage = () => {
return (
<Observer>
{() => (
<div className={styles.index}>
<div className={styles.actions}>
<div
className={styles.action}
onClick={() => utools.shellOpenExternal('https://github.com/lblblong/nat-utools')}
>
<Icon value="github-line" />
</div>
<div className={styles.action} onClick={() => StoreServer.openHelp()}>
<Icon value="question-mark" />
</div>
<div className={styles.action} onClick={() => StoreServer.add()}>
<Icon value="add-line" />
</div>
</div>
<div className={styles.list}>
{StoreServer.natList.map((it) => {
return (
<div className={classNames(styles.item, { [styles.active]: it.state === NatState.on })} key={it.id}>
<div className={styles.lbox}>
<span className={styles.state}></span>
<span className={styles.name}>
{it.port}
{it.subdomain ? ` - ${it.subdomain}` : ''}
</span>
<span className={styles.url}>{it.url}</span>
</div>
<div className={styles.rbox}>
<button
disabled={it.state === NatState.loading}
className={classNames(styles.btn, styles.del)}
onClick={() => StoreServer.del(it.id)}
>
</button>
<button
disabled={it.state === NatState.loading}
className={classNames(styles.btn)}
onClick={() => StoreServer.edit(it.id)}
>
</button>
<button className={classNames(styles.btn)} onClick={() => StoreServer.showLog(it.id)}>
</button>
<button
disabled={!it.url}
className={classNames(styles.btn)}
onClick={() => {
utools.copyText(it.url!)
utools.showNotification('地址已成功复制到剪切板')
}}
>
</button>
<button
disabled={it.state === NatState.loading}
className={styles.btn}
onClick={() => StoreServer.toggle(it.id)}
>
{it.state === NatState.on ? '关闭服务' : '启动服务'}
</button>
</div>
</div>
)
})}
</div>
</div>
)}
</Observer>
)
}
+1
View File
@@ -0,0 +1 @@
/// <reference types="react-scripts" />
+15
View File
@@ -0,0 +1,15 @@
import { ReportHandler } from 'web-vitals';
const reportWebVitals = (onPerfEntry?: ReportHandler) => {
if (onPerfEntry && onPerfEntry instanceof Function) {
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
getCLS(onPerfEntry);
getFID(onPerfEntry);
getFCP(onPerfEntry);
getLCP(onPerfEntry);
getTTFB(onPerfEntry);
});
}
};
export default reportWebVitals;
+5
View File
@@ -0,0 +1,5 @@
// jest-dom adds custom jest matchers for asserting on DOM nodes.
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom';
+193
View File
@@ -0,0 +1,193 @@
import localtunnel from 'localtunnel'
import { makeAutoObservable, toJS } from 'mobx'
import { openAlert } from 'src/components/alert'
import { openHelp } from 'src/components/help'
import { openNatEdit } from 'src/components/nat-edit'
import { openNatLog } from 'src/components/nat-log'
import { onPluginEnterCBParams } from 'utools-helper/@types/utools'
import { Nat, NatState } from '../model/nat'
declare global {
interface Window {
localtunnel: typeof localtunnel
}
}
function getStorageID() {
return utools.getLocalId() + '_servers'
}
class Store {
constructor() {
makeAutoObservable(this)
utools.onPluginEnter(this.onPluginEnter)
utools.onPluginReady(() => {
this.loadDb()
})
}
onPluginEnter = (params: onPluginEnterCBParams) => {}
natList: Nat[] = []
async add() {
const data = await openNatEdit()
const nat = new Nat(data)
this.natList.push(nat)
this.flushDb()
this.start(nat.id)
}
getNatById(id: number) {
return this.natList.find((it) => it.id === id)!
}
async start(id: number) {
const nat = this.getNatById(id)
if (nat.state === NatState.loading) return
nat.state = NatState.loading
nat.tunnel = await window.localtunnel({
port: nat.port,
subdomain: nat.subdomain,
})
nat.url = nat.tunnel.url
nat.state = NatState.on
const onRequest = (req: any) => {
nat.logs.push(`${req.method} ${req.path}`)
}
const onError = (err: Error) => {
console.log(nat.id, err)
nat.logs.push(err.message)
}
nat.tunnel?.once('close', () => {
nat.tunnel?.off('error', onError)
nat.tunnel?.off('request', onRequest)
nat.state = NatState.off
nat.tunnel = undefined
nat.url = ''
})
nat.tunnel?.on('error', onError)
nat.tunnel?.on('request', onRequest)
if (nat.subdomain && nat.url.indexOf('//' + nat.subdomain) === -1) {
openAlert({
title: '提示',
content: '子域名被占用,已为您分配其他子域名',
})
}
}
async stop(id: number) {
const nat = this.getNatById(id)
if (nat.state !== NatState.on || nat.tunnel === undefined) return
return new Promise<void>((ok) => {
nat.tunnel?.once('close', () => {
ok()
})
nat.tunnel?.close()
})
}
async del(id: number) {
await this.stop(id)
this.natList = this.natList.filter((it) => it.id !== id)
this.flushDb()
}
async edit(id: number) {
const nat = this.getNatById(id)
const originState = nat.state
if (originState === NatState.loading) return
if (originState === NatState.on) {
await this.stop(id)
}
const data = await openNatEdit({
defaultValue: {
port: nat.port,
subdomain: nat.subdomain,
},
})
nat.port = data.port
nat.subdomain = data.subdomain
this.flushDb()
if (originState === NatState.on) {
this.start(id)
}
}
async showLog(id: number) {
openNatLog({ id })
}
async openHelp() {
openHelp()
}
toggle = async (id: number) => {
const nat = this.getNatById(id)
if (nat.state === NatState.on) {
await this.stop(nat.id)
} else {
await this.start(nat.id)
}
}
loadDb = () => {
try {
const it = utools.db.get<
{
id: number
subdomain?: string
port: number
}[]
>(getStorageID())
if (!it || !it.data) return
this.natList = it.data.map((d) => {
return new Nat({
id: d.id,
subdomain: d.subdomain,
port: d.port,
})
})
} catch (err) {
alert(err)
}
}
flushDb() {
let it = utools.db.get<
{
id: number
subdomain?: string
port: number
}[]
>(getStorageID())
const data = this.natList.map((d) => {
return {
id: d.id,
subdomain: d.subdomain,
port: d.port,
}
})
if (!it) {
it = {
_id: getStorageID(),
data: data,
}
} else {
it.data = data
}
const { ok, error } = utools.db.put(it)
if (!ok) {
throw Error(error)
}
}
}
export const StoreServer = new Store()
+36
View File
@@ -0,0 +1,36 @@
{
"compilerOptions": {
"baseUrl": ".",
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"noImplicitAny": false,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"downlevelIteration": true,
"experimentalDecorators": true,
"noEmit": true,
"jsx": "react-jsx",
"types": [
"utools-helper/@types/utools",
"utools-helper/@types/electron",
"@types/node"
]
},
"include": [
"src",
"global.d.ts"
]
}
+12728
View File
File diff suppressed because it is too large Load Diff