Browse Source

Empty template for mysql action

Vova Tkach 6 years ago
parent
commit
5cf157c81e
2 changed files with 13 additions and 0 deletions
  1. 12 0
      engine/actions/action_mysql.go
  2. 1 0
      engine/actions/actions.go

+ 12 - 0
engine/actions/action_mysql.go

@@ -0,0 +1,12 @@
+package actions
+
+import (
+	"fmt"
+)
+
+func action_mysql(e *Action) {
+	action := e.R.FormValue("action")
+	(*e.W).Write([]byte(fmt.Sprintf(`
+		ModalShowMsg('MySQL Action', 'Hello from web server (%s)');
+	`, action)))
+}

+ 1 - 0
engine/actions/actions.go

@@ -23,6 +23,7 @@ func New(w *http.ResponseWriter, r *http.Request, vhost string, vhosthome string
 	act := Action{w, r, vhost, vhosthome, remoteip, make(map[string]hRun)}
 	act := Action{w, r, vhost, vhosthome, remoteip, make(map[string]hRun)}
 
 
 	// Register all action here
 	// Register all action here
+	act.register("mysql", action_mysql)
 	act.register("signin", action_signin)
 	act.register("signin", action_signin)
 
 
 	return &act
 	return &act