Skip to content

Commit ac8a7cf

Browse files
committed
fix web shell show output data bug
1 parent 71a87cd commit ac8a7cf

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

engine/store.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import (
55
"fmt"
66
"strings"
77

8-
//_ "github.com/mattn/go-sqlite3"
9-
108
_ "modernc.org/sqlite"
119
)
1210

@@ -20,7 +18,7 @@ var db *DB
2018

2119
func NewDB(dbName string) *DB {
2220

23-
newdb, err := sql.Open("sqlite", dbName) // sqlite3 whith mattn lib
21+
newdb, err := sql.Open("sqlite", dbName)
2422
if err != nil {
2523
panic(err)
2624
}
@@ -46,7 +44,7 @@ func NewDB(dbName string) *DB {
4644

4745
db.lastid[tableName] = lid
4846

49-
fmt.Println("Table Name:", tableName)
47+
//fmt.Println("Table Name:", tableName)
5048
}
5149
return db
5250
}

main.go

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,32 +24,30 @@ func main() {
2424

2525
http.Handle("/static/", http.FileServer(http.FS(content)))
2626

27-
http.HandleFunc("/shell", shell)
28-
29-
// not importent
30-
http.HandleFunc("/dev", dev)
27+
http.HandleFunc("/", index)
28+
http.HandleFunc("/index", shell)
3129

30+
http.HandleFunc("/shell", shell)
3231
// standard endpoint
3332
http.HandleFunc("/ws", engine.Ws)
3433

3534
// endpoints for speed network
3635
http.HandleFunc("/query", engine.Request)
3736
http.HandleFunc("/result", engine.Response)
3837

38+
// for pages under development
39+
http.HandleFunc("/dev", dev)
40+
3941
log.Println(http.ListenAndServe(":1111", nil))
4042
}
4143

4244
// redirect to shell page temporary
4345
func dev(w http.ResponseWriter, r *http.Request) {
44-
// TODO create index page
45-
//http.Redirect(w, r, "http://localhost:1111/shell", http.StatusSeeOther)
4646
f, err := content.ReadFile("static/dev.html")
47-
4847
if err != nil {
4948
http.Error(w, err.Error(), http.StatusInternalServerError)
5049
return
5150
}
52-
5351
fmt.Fprint(w, string(f))
5452
}
5553

static/shell.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,11 @@ function calcHeight(value) {
112112

113113
let textarea = document.querySelector("textarea");
114114
textarea.addEventListener("keyup", (e) => {
115-
textarea.style.height = calcHeight(textarea.value) + "px";
115+
let hi = calcHeight(textarea.value) + "px"
116+
textarea.style.height = hi;
117+
118+
$("#output").css("height", "calc(100vh - "+hi+")" )
119+
//css height: calc(100vh - 100px);
116120
//console.log("event : ", e)
117121
});
118122

0 commit comments

Comments
 (0)