зеркало из https://github.com/github/vitess-gh.git
Move schema_editor to go/cmd/vtctld
This commit is contained in:
Родитель
13d830b859
Коммит
a21ec42d70
|
@ -73,7 +73,6 @@ func HandleExplorer(name, url, templateName string, exp Explorer) {
|
|||
|
||||
explorer = exp
|
||||
explorerName = name
|
||||
indexContent.ToplevelLinks[name+" explorer"] = url
|
||||
|
||||
http.HandleFunc(url, func(w http.ResponseWriter, r *http.Request) {
|
||||
if err := r.ParseForm(); err != nil {
|
||||
|
|
|
@ -26,6 +26,7 @@ license that can be found in the LICENSE file.
|
|||
<li><a href="/etcd">etcd browser</a></li>
|
||||
<li><a href="/zk">zk browser</a></li>
|
||||
<li><a href="/schema_editor">Schema editor</a></li>
|
||||
<li><a href="/vschema">Schema View</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
|
@ -1,23 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>vtctld</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: sans-serif;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
{{with .ToplevelLinks}}
|
||||
<h1>vtctld</h1>
|
||||
<ul>
|
||||
{{range $name, $href := .}}
|
||||
<li><a href="{{$href}}">{{$name}}</a></li>
|
||||
{{end}}
|
||||
</ul>
|
||||
{{end}}
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -48,14 +48,7 @@ type IndexContent struct {
|
|||
// used at runtime by plug-ins
|
||||
var templateLoader *TemplateLoader
|
||||
var actionRepo *ActionRepository
|
||||
var indexContent = IndexContent{
|
||||
ToplevelLinks: map[string]string{
|
||||
"DbTopology Tool": "/dbtopo",
|
||||
"Serving Graph": "/serving_graph",
|
||||
"Schema editor": "/schema_editor",
|
||||
"Schema view": "/vschema",
|
||||
},
|
||||
}
|
||||
|
||||
var ts topo.Server
|
||||
|
||||
func main() {
|
||||
|
@ -152,11 +145,6 @@ func main() {
|
|||
return "", wr.DeleteTablet(tabletAlias)
|
||||
})
|
||||
|
||||
// toplevel index
|
||||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
templateLoader.ServeTemplate("index.html", indexContent, w, r)
|
||||
})
|
||||
|
||||
// keyspace actions
|
||||
http.HandleFunc("/keyspace_actions", func(w http.ResponseWriter, r *http.Request) {
|
||||
if err := r.ParseForm(); err != nil {
|
||||
|
@ -268,6 +256,11 @@ func main() {
|
|||
templateLoader.ServeTemplate("serving_graph.html", servingGraph, w, r)
|
||||
})
|
||||
|
||||
// vschema editor
|
||||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
http.ServeFile(w, r, *schemaEditorDir+"/schema_editor/index.html")
|
||||
})
|
||||
|
||||
// vschema editor
|
||||
http.HandleFunc("/schema_editor/", func(w http.ResponseWriter, r *http.Request) {
|
||||
http.ServeFile(w, r, *schemaEditorDir+r.URL.Path)
|
||||
|
|
|
@ -694,7 +694,7 @@ class Vtctld(object):
|
|||
args = environment.binary_args('vtctld') + [
|
||||
'-debug',
|
||||
'-templates', environment.vttop + '/go/cmd/vtctld/templates',
|
||||
'-schema-editor-dir', environment.vttop + '/go/vt/vtgate',
|
||||
'-schema-editor-dir', environment.vttop + '/go/cmd/vtctld',
|
||||
'-log_dir', environment.vtlogroot,
|
||||
'-port', str(self.port),
|
||||
] + \
|
||||
|
|
Загрузка…
Ссылка в новой задаче