fix url error after dealing with request
This commit is contained in:
parent
60ce611033
commit
0316fe2973
|
@ -1,4 +1,4 @@
|
|||
from flask import session
|
||||
from flask import session, redirect
|
||||
from webViews.view import normalView
|
||||
from webViews.dockletrequest import dockletRequest
|
||||
from webViews.dashboard import *
|
||||
|
@ -34,7 +34,7 @@ class createClusterView(normalView):
|
|||
}
|
||||
result = dockletRequest.post("/cluster/create/", data)
|
||||
if(result.get('success', None) == "true"):
|
||||
return dashboardView.as_view()
|
||||
return redirect("/dashboard/")
|
||||
#return self.render(self.template_path, user = session['username'])
|
||||
else:
|
||||
return self.render(self.error_path, message = result.get('message'))
|
||||
|
@ -73,7 +73,7 @@ class scaleoutView(normalView):
|
|||
}
|
||||
result = dockletRequest.post("/cluster/scaleout/", data)
|
||||
if(result.get('success', None) == "true"):
|
||||
return configView.as_view()
|
||||
return redirect("/config/")
|
||||
else:
|
||||
return self.render(self.error_path, message = result.get('message'))
|
||||
|
||||
|
@ -86,7 +86,7 @@ class scaleinView(normalView):
|
|||
}
|
||||
result = dockletRequest.post("/cluster/scalein/", data)
|
||||
if(result):
|
||||
return configView.as_view()
|
||||
return redirect("/config/")
|
||||
else:
|
||||
self.error()
|
||||
|
||||
|
@ -112,7 +112,7 @@ class startClusterView(normalView):
|
|||
}
|
||||
result = dockletRequest.post("/cluster/start/", data)
|
||||
if(result):
|
||||
return dashboardView.as_view()
|
||||
return redirect("/dashboard/")
|
||||
else:
|
||||
return self.error()
|
||||
|
||||
|
@ -126,7 +126,7 @@ class stopClusterView(normalView):
|
|||
}
|
||||
result = dockletRequest.post("/cluster/stop/", data)
|
||||
if(result):
|
||||
return dashboardView.as_view()
|
||||
return redirect("/dashboard/")
|
||||
else:
|
||||
return self.error()
|
||||
|
||||
|
@ -160,7 +160,7 @@ class deleteClusterView(normalView):
|
|||
}
|
||||
result = dockletRequest.post("/cluster/delete/", data)
|
||||
if(result):
|
||||
return dashboardView.as_view()
|
||||
return redirect("/dashboard/")
|
||||
else:
|
||||
return self.error()
|
||||
|
||||
|
@ -199,7 +199,7 @@ class saveImageView(normalView):
|
|||
if(result):
|
||||
if result.get('success') == 'true':
|
||||
#return self.render(self.success_path, user = session['username'])
|
||||
return configView.as_view()
|
||||
return redirect("/config/")
|
||||
#res = detailClusterView()
|
||||
#res.clustername = self.clustername
|
||||
#return res.as_view()
|
||||
|
@ -221,7 +221,7 @@ class shareImageView(normalView):
|
|||
}
|
||||
result = dockletRequest.post("/image/share/", data)
|
||||
if(result):
|
||||
return configView.as_view()
|
||||
return redirect("/dashboard/")
|
||||
else:
|
||||
self.error()
|
||||
|
||||
|
@ -235,7 +235,7 @@ class unshareImageView(normalView):
|
|||
}
|
||||
result = dockletRequest.post("/image/unshare/", data)
|
||||
if(result):
|
||||
return configView.as_view()
|
||||
return redirect("/dashboard/")
|
||||
else:
|
||||
self.error()
|
||||
|
||||
|
@ -249,7 +249,7 @@ class deleteImageView(normalView):
|
|||
}
|
||||
result = dockletRequest.post("/image/delete/", data)
|
||||
if(result):
|
||||
return configView.as_view()
|
||||
return redirect("/dashboard/")
|
||||
else:
|
||||
self.error()
|
||||
|
||||
|
@ -264,7 +264,7 @@ class addproxyView(normalView):
|
|||
}
|
||||
result = dockletRequest.post("/addproxy/", data)
|
||||
if(result):
|
||||
return configView.as_view()
|
||||
return redirect("/dashboard/")
|
||||
else:
|
||||
self.error()
|
||||
|
||||
|
@ -277,7 +277,7 @@ class deleteproxyView(normalView):
|
|||
}
|
||||
result = dockletRequest.post("/deleteproxy/", data)
|
||||
if(result):
|
||||
return configView.as_view()
|
||||
return redirect("/dashboard/")
|
||||
else:
|
||||
self.error()
|
||||
|
||||
|
|
Loading…
Reference in New Issue