使用新UI系统

This commit is contained in:
李宇翔
2020-04-15 17:39:03 +08:00
parent 4e92ebd409
commit 56a98c3218
20 changed files with 2343 additions and 2551 deletions

11
main.go
View File

@@ -1,4 +1,4 @@
package tsplugin
package ts
import (
"bytes"
@@ -25,11 +25,9 @@ var config = struct {
func init() {
InstallPlugin(&PluginConfig{
Name: "TS",
Type: PLUGIN_PUBLISHER,
Version: "1.0.1",
UI: util.CurrentDir("dashboard", "ui", "plugin-ts.min.js"),
Config: &config,
Name: "TS",
Type: PLUGIN_PUBLISHER,
Config: &config,
Run: func() {
if config.AutoPublish {
OnSubscribeHooks.AddHook(func(s *OutputStream) {
@@ -256,6 +254,7 @@ func readTsDir(currentDir string) []*TSDir {
return list
}
func listTsDir(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Access-Control-Allow-Origin", "*")
var list []*TSDir = readTsDir(".")
bytes, err := json.Marshal(list)
if err == nil {