This commit is contained in:
cdle
2023-06-07 17:33:29 +08:00
parent 90f302a682
commit c74c9b130e
7 changed files with 124 additions and 6 deletions
+4 -1
View File
@@ -109,7 +109,7 @@ func CancelPluginCrons(uuid string) {
}
}
func SetPluginMethod(vm *goja.Runtime, uuid string, on_start bool) {
func SetPluginMethod(vm *goja.Runtime, uuid string, on_start bool, running func() bool) {
vm.Set("Bucket", func(name string) interface{} {
return vm.NewProxy(MakeBucketObject(vm, uuid, on_start, MakeBucket(name)), &goja.ProxyTrapConfig{
Get: func(target *goja.Object, property string, receiver goja.Value) (value goja.Value) {
@@ -433,6 +433,9 @@ func SetPluginMethod(vm *goja.Runtime, uuid string, on_start bool) {
},
}
})
osjs := getJsOs(vm, running)
vm.Set("os", osjs)
}
func EncryptPlugin(script string) string {