Skip to content

Commit b556689

Browse files
committed
init v0.0.1
0 parents  commit b556689

Some content is hidden

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

75 files changed

+7326
-0
lines changed

.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.idea
2+
.vscode
3+
4+
build
5+
logs
6+
7+
frontend/node_modules
8+
frontend/dist
9+

README.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# rscript
2+
3+
rscript 是通过 ssh 远程执行命令的工具。具有三种运行模式,目的是简化边缘场景下的运维过程。
4+
5+
<img alt="gui" height="450" width="550" src=".\example\gui_2.png"/>
6+
7+
## 快速开始
8+
9+
### gui/tui
10+
11+
step 1: 编写 yaml 脚本
12+
13+
step 2: 运行 rscript_gui.exe ,选择 yaml 脚本执行
14+
15+
### rscript package
16+
17+
rscript package 的作用是通过 go embed 将资源文件和脚本文件嵌入到 tui ,制作成单一执行文件的包。
18+
19+
step 1: git clone https://github.com/leijux/rscript.git
20+
21+
step 2: internal/app/package 编写 yaml 脚本
22+
23+
step 3: 编译包 go build -ldflags "-s -w" -o upgrade.exe

Taskfile.yaml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
version: "3"
2+
3+
env:
4+
VERSION: v0.0.1
5+
6+
tasks:
7+
build:
8+
deps: [ build_wails ,build_cmd ]
9+
10+
test:
11+
cmds:
12+
- go test -timeout 30s
13+
14+
build_wails:
15+
cmds:
16+
- pwsh ./script/wailsBuild.ps1
17+
18+
build_cmd:
19+
cmds:
20+
- pwsh ./script/build.ps1
21+
22+
wails_dev:
23+
cmds:
24+
- wails dev -tags gui
25+
26+
build_update_package:
27+
cmds:
28+
- Set-Location ./internal/app/package
29+
- go build -ldflags "-s -w" -o upgrade.exe

example/example.yaml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
schema_version: 1
2+
3+
variables:
4+
update_path: /example
5+
update_package_name: example.zip
6+
7+
# rscript internal command
8+
# rscript.uploadFile {local_path} {remote_path}
9+
# rscript.downloadFile {remote_path} {loacl_path}
10+
# rscript.exec {local command}
11+
commands:
12+
- rscript.uploadFile ./package/{{update_package_name}} {{update_package_name}}
13+
# linux shell command
14+
- systemctl stop example
15+
- rm -rf {{update_path}}/*
16+
- unzip -q -o ~/{{update_package_name}} -d {{update_path}}
17+
- systemctl start example
18+
- rm -rf ./{{update_package_name}}
19+
20+
# default ssh username and password
21+
default:
22+
username: root
23+
password: 123456
24+
25+
remotes:
26+
- { ip: 192.168.7.201 }
27+
- { ip: 192.168.7.200:9099, username: leijux, password: bbb }
28+
- { ip: localhost }

example/gui_1.png

18.8 KB
Loading

example/gui_2.png

27.9 KB
Loading

example/tui_1.png

29.3 KB
Loading

example/tui_2.png

26.8 KB
Loading

frontend/.prettierrc

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"plugins": [
3+
"prettier-plugin-tailwindcss"
4+
],
5+
"singleQuote": true,
6+
"trailingComma": "es5",
7+
"printWidth": 170,
8+
"arrowParens": "always"
9+
}

frontend/components.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"$schema": "https://ui.shadcn.com/schema.json",
3+
"style": "default",
4+
"rsc": false,
5+
"tsx": true,
6+
"tailwind": {
7+
"config": "tailwind.config.ts",
8+
"css": "src/style.css",
9+
"baseColor": "slate",
10+
"cssVariables": true,
11+
"prefix": ""
12+
},
13+
"aliases": {
14+
"components": "@/components",
15+
"utils": "@/lib/utils"
16+
}
17+
}

frontend/index.html

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
6+
<title>testools</title>
7+
</head>
8+
<body>
9+
<div id="root"></div>
10+
<script src="./src/main.tsx" type="module"></script>
11+
</body>
12+
</html>

0 commit comments

Comments
 (0)