Skip to content

Commit

Permalink
fix: go embed error
Browse files Browse the repository at this point in the history
  • Loading branch information
devhaozi committed Oct 22, 2024
1 parent 8184347 commit 6e3db10
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 5 deletions.
2 changes: 1 addition & 1 deletion internal/bootstrap/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func initConf() {

func initGlobal() {
app.Root = app.Conf.MustString("app.root")
app.Version = "2.3.11"
app.Version = "2.3.12"
app.Locale = app.Conf.MustString("app.locale")

// 初始化时区
Expand Down
4 changes: 2 additions & 2 deletions internal/embed/embed.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package embed

import "embed"

//go:embed frontend/*
//go:embed all:frontend/*
var PublicFS embed.FS

//go:embed website/*
//go:embed all:website/*
var WebsiteFS embed.FS
1 change: 1 addition & 0 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@xterm/addon-attach": "^0.11.0",
"@xterm/addon-clipboard": "^0.1.0",
"@xterm/addon-fit": "^0.10.0",
"@xterm/addon-unicode11": "^0.8.0",
"@xterm/addon-web-links": "^0.11.0",
"@xterm/addon-webgl": "^0.18.0",
"@xterm/xterm": "^5.5.0",
Expand Down
26 changes: 26 additions & 0 deletions web/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions web/src/views/ssh/IndexView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import '@fontsource/jetbrains-mono/400.css'
import { AttachAddon } from '@xterm/addon-attach'
import { ClipboardAddon } from '@xterm/addon-clipboard'
import { FitAddon } from '@xterm/addon-fit'
import { Unicode11Addon } from '@xterm/addon-unicode11'
import { WebLinksAddon } from '@xterm/addon-web-links'
import { WebglAddon } from '@xterm/addon-webgl'
import { Terminal } from '@xterm/xterm'
import '@xterm/xterm/css/xterm.css'
import type { MenuOption } from 'naive-ui'
import { NButton, NFlex, NPopconfirm } from 'naive-ui'
const terminal = ref<HTMLElement | null>(null)
Expand All @@ -32,7 +32,7 @@ const create = ref(false)
const update = ref(false)
const updateId = ref(0)
const list = ref<MenuOption[]>([])
const list = ref<any[]>([])
const fetchData = async () => {
list.value = []
Expand Down Expand Up @@ -129,6 +129,7 @@ const openSession = async (id: number) => {
await ws.ssh(id).then((ws) => {
sshWs = ws
term.value = new Terminal({
allowProposedApi: true,
lineHeight: 1.2,
fontSize: 14,
fontFamily: 'JetBrains Mono',
Expand All @@ -142,6 +143,8 @@ const openSession = async (id: number) => {
term.value.loadAddon(fitAddon)
term.value.loadAddon(new ClipboardAddon())
term.value.loadAddon(new WebLinksAddon())
term.value.loadAddon(new Unicode11Addon())
term.value.unicode.activeVersion = '11'
term.value.loadAddon(webglAddon)
webglAddon.onContextLoss(() => {
webglAddon.dispose()
Expand Down

0 comments on commit 6e3db10

Please sign in to comment.