Skip to content

Commit

Permalink
feat: add dicts settings and docs interface, implemented main functions
Browse files Browse the repository at this point in the history
  • Loading branch information
terasum committed Sep 20, 2023
1 parent eeae3fe commit 28b704b
Show file tree
Hide file tree
Showing 95 changed files with 6,971 additions and 5,578 deletions.
26 changes: 26 additions & 0 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,14 @@ package main

import (
"context"
"errors"
"github.com/op/go-logging"
"github.com/skratchdot/open-golang/open"
"github.com/terasum/medict/internal/entry"
"github.com/terasum/medict/internal/utils"
"github.com/terasum/medict/pkg/backserver"
"github.com/terasum/medict/pkg/model"
"go.etcd.io/etcd/client/pkg/v3/fileutil"
)

var log = logging.MustGetLogger("default")
Expand Down Expand Up @@ -100,3 +104,25 @@ func (b *App) Dispatch(apiName string, args map[string]interface{}) *model.Resp
func (b *App) ResourceServerAddr() string {
return b.bs.StaticServerBaseUrl()
}

func (b *App) OpenFinder(filepath string) error {
if !fileutil.Exist(filepath) {
return errors.New("file path not exist, cannot open")
}
err := open.Run(filepath)
if err != nil {
return err
}
return nil
}

func (b *App) BaseDictDir() string {
if b.bs == nil {
return "internal error"
}
f, e := utils.ReplaceHome(b.bs.Config.BaseDictDir)
if e != nil {
return "internal error"
}
return f
}
11 changes: 9 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"build": "vite build",
"preview": "vite preview"
},
"type": "module",
"dependencies": {
"axios": "^0.21.4",
"normalize.css": "^8.0.1",
Expand All @@ -23,11 +24,17 @@
"@vicons/fa": "^0.12.0",
"@vicons/fluent": "^0.12.0",
"@vicons/tabler": "^0.12.0",
"@vitejs/plugin-vue": "^3.2.0",
"@vitejs/plugin-vue": "^4.3.4",
"@vue/compiler-sfc": "^3.3.4",
"@yankeeinlondon/code-builder": "^1.2.1",
"highlight.js": "^11.8.0",
"markdown-it": "^13.0.1",
"markdown-it-prism": "^2.3.0",
"naive-ui": "^2.34.4",
"sass": "^1.66.1",
"vfonts": "^0.0.3",
"vite": "^3.2.7"
"vite": "^4.4.9",
"vite-plugin-inspect": "^0.7.38",
"vite-plugin-md": "^0.21.5"
}
}
2 changes: 1 addition & 1 deletion frontend/package.json.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a4a4cf1bcccbecd9e93f8fc6306287d5
6ac352e94d40d91fd4abca1a60b8b4f0

0 comments on commit 28b704b

Please sign in to comment.