Adding initial admin console html pages
Этот коммит содержится в:
@@ -21,8 +21,15 @@ func main() {
|
|||||||
fmt.Println("Current working directory is set to " + pwd)
|
fmt.Println("Current working directory is set to " + pwd)
|
||||||
|
|
||||||
var config = flag.String("config", "config.json", "path to config file")
|
var config = flag.String("config", "config.json", "path to config file")
|
||||||
|
var action = flag.String("action", "none", "path to config file")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
|
fmt.Println(action)
|
||||||
|
|
||||||
|
if len(action) > 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
utils.LoadConfig(*config)
|
utils.LoadConfig(*config)
|
||||||
api.NewServer()
|
api.NewServer()
|
||||||
api.InitApi()
|
api.InitApi()
|
||||||
|
|||||||
@@ -4,30 +4,20 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
border: $border-gray;
|
border: $border-gray;
|
||||||
bottom: 38px;
|
bottom: 38px;
|
||||||
overflow: auto;
|
|
||||||
@extend %popover-box-shadow;
|
@extend %popover-box-shadow;
|
||||||
.sidebar--right & {
|
|
||||||
bottom: 100px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.command-name {
|
.command-name {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
line-height: 24px;
|
height: 37px;
|
||||||
padding: 5px 10px 8px;
|
line-height: 37px;
|
||||||
|
padding: 2px 10px 2px 5px;
|
||||||
z-index: 101;
|
z-index: 101;
|
||||||
font-size: 0.95em;
|
|
||||||
border-bottom: 1px solid #ddd;
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: #e8eaed;
|
background-color: #e8eaed;
|
||||||
}
|
}
|
||||||
.command__desc {
|
|
||||||
margin-left: 5px;
|
|
||||||
color: #999;
|
|
||||||
line-height: normal;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.command-desc {
|
.command-desc {
|
||||||
|
|||||||
@@ -139,7 +139,6 @@ body.ios {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 1em 0 0;
|
padding: 1em 0 0;
|
||||||
position: relative;
|
position: relative;
|
||||||
-webkit-overflow-scrolling: touch;
|
|
||||||
&.hide-scroll::-webkit-scrollbar {
|
&.hide-scroll::-webkit-scrollbar {
|
||||||
width: 0px !important;
|
width: 0px !important;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -635,10 +635,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.app__content {
|
.app__content {
|
||||||
padding-top: 50px;
|
padding-top: 45px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
.channel__wrap & {
|
.channel__wrap & {
|
||||||
padding-top: 50px;
|
padding-top: 45px;
|
||||||
}
|
}
|
||||||
.channel-header {
|
.channel-header {
|
||||||
display: none;
|
display: none;
|
||||||
|
|||||||
@@ -94,11 +94,6 @@
|
|||||||
list-style-type:none;
|
list-style-type:none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.setting-list__hint {
|
|
||||||
color: #555;
|
|
||||||
margin-top: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mentions-input {
|
.mentions-input {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
top: 66px;
|
top: 66px;
|
||||||
}
|
}
|
||||||
.nav-pills__unread-indicator-bottom {
|
.nav-pills__unread-indicator-bottom {
|
||||||
bottom: 10px;
|
bottom: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav {
|
.nav {
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
@import "partials/sidebar--left";
|
@import "partials/sidebar--left";
|
||||||
@import "partials/sidebar--right";
|
@import "partials/sidebar--right";
|
||||||
@import "partials/sidebar--menu";
|
@import "partials/sidebar--menu";
|
||||||
|
@import "partials/admin-console";
|
||||||
@import "partials/signup";
|
@import "partials/signup";
|
||||||
@import "partials/files";
|
@import "partials/files";
|
||||||
@import "partials/videos";
|
@import "partials/videos";
|
||||||
|
|||||||
43
web/web.go
43
web/web.go
@@ -52,31 +52,33 @@ func InitWeb() {
|
|||||||
mainrouter.PathPrefix("/static/").Handler(http.StripPrefix("/static/", http.FileServer(http.Dir(staticDir))))
|
mainrouter.PathPrefix("/static/").Handler(http.StripPrefix("/static/", http.FileServer(http.Dir(staticDir))))
|
||||||
|
|
||||||
mainrouter.Handle("/", api.AppHandlerIndependent(root)).Methods("GET")
|
mainrouter.Handle("/", api.AppHandlerIndependent(root)).Methods("GET")
|
||||||
mainrouter.Handle("/{team:[A-Za-z0-9-]+(__)?[A-Za-z0-9-]+}", api.AppHandler(login)).Methods("GET")
|
|
||||||
mainrouter.Handle("/{team:[A-Za-z0-9-]+(__)?[A-Za-z0-9-]+}/", api.AppHandler(login)).Methods("GET")
|
|
||||||
mainrouter.Handle("/{team:[A-Za-z0-9-]+(__)?[A-Za-z0-9-]+}/login", api.AppHandler(login)).Methods("GET")
|
|
||||||
|
|
||||||
// Bug in gorilla.mux prevents us from using regex here.
|
|
||||||
mainrouter.Handle("/{team}/login/{service}", api.AppHandler(loginWithOAuth)).Methods("GET")
|
|
||||||
mainrouter.Handle("/login/{service:[A-Za-z]+}/complete", api.AppHandlerIndependent(loginCompleteOAuth)).Methods("GET")
|
|
||||||
|
|
||||||
mainrouter.Handle("/{team:[A-Za-z0-9-]+(__)?[A-Za-z0-9-]+}/logout", api.AppHandler(logout)).Methods("GET")
|
|
||||||
mainrouter.Handle("/{team:[A-Za-z0-9-]+(__)?[A-Za-z0-9-]+}/reset_password", api.AppHandler(resetPassword)).Methods("GET")
|
|
||||||
// Bug in gorilla.mux prevents us from using regex here.
|
|
||||||
mainrouter.Handle("/{team}/channels/{channelname}", api.UserRequired(getChannel)).Methods("GET")
|
|
||||||
|
|
||||||
// Anything added here must have an _ in it so it does not conflict with team names
|
|
||||||
mainrouter.Handle("/signup_team_complete/", api.AppHandlerIndependent(signupTeamComplete)).Methods("GET")
|
mainrouter.Handle("/signup_team_complete/", api.AppHandlerIndependent(signupTeamComplete)).Methods("GET")
|
||||||
mainrouter.Handle("/signup_user_complete/", api.AppHandlerIndependent(signupUserComplete)).Methods("GET")
|
mainrouter.Handle("/signup_user_complete/", api.AppHandlerIndependent(signupUserComplete)).Methods("GET")
|
||||||
mainrouter.Handle("/signup_team_confirm/", api.AppHandlerIndependent(signupTeamConfirm)).Methods("GET")
|
mainrouter.Handle("/signup_team_confirm/", api.AppHandlerIndependent(signupTeamConfirm)).Methods("GET")
|
||||||
|
|
||||||
// Bug in gorilla.mux prevents us from using regex here.
|
|
||||||
mainrouter.Handle("/{team}/signup/{service}", api.AppHandler(signupWithOAuth)).Methods("GET")
|
|
||||||
mainrouter.Handle("/signup/{service:[A-Za-z]+}/complete", api.AppHandlerIndependent(signupCompleteOAuth)).Methods("GET")
|
|
||||||
|
|
||||||
mainrouter.Handle("/verify_email", api.AppHandlerIndependent(verifyEmail)).Methods("GET")
|
mainrouter.Handle("/verify_email", api.AppHandlerIndependent(verifyEmail)).Methods("GET")
|
||||||
mainrouter.Handle("/find_team", api.AppHandlerIndependent(findTeam)).Methods("GET")
|
mainrouter.Handle("/find_team", api.AppHandlerIndependent(findTeam)).Methods("GET")
|
||||||
mainrouter.Handle("/signup_team", api.AppHandlerIndependent(signup)).Methods("GET")
|
mainrouter.Handle("/signup_team", api.AppHandlerIndependent(signup)).Methods("GET")
|
||||||
|
mainrouter.Handle("/login/{service:[A-Za-z]+}/complete", api.AppHandlerIndependent(loginCompleteOAuth)).Methods("GET")
|
||||||
|
mainrouter.Handle("/signup/{service:[A-Za-z]+}/complete", api.AppHandlerIndependent(signupCompleteOAuth)).Methods("GET")
|
||||||
|
|
||||||
|
mainrouter.Handle("/admin", api.AppHandlerIndependent(adminConsole)).Methods("GET")
|
||||||
|
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------------------------
|
||||||
|
// *ANYTHING* team spefic should go below this line
|
||||||
|
// ----------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
mainrouter.Handle("/{team:[A-Za-z0-9-]+(__)?[A-Za-z0-9-]+}", api.AppHandler(login)).Methods("GET")
|
||||||
|
mainrouter.Handle("/{team:[A-Za-z0-9-]+(__)?[A-Za-z0-9-]+}/", api.AppHandler(login)).Methods("GET")
|
||||||
|
mainrouter.Handle("/{team:[A-Za-z0-9-]+(__)?[A-Za-z0-9-]+}/login", api.AppHandler(login)).Methods("GET")
|
||||||
|
mainrouter.Handle("/{team:[A-Za-z0-9-]+(__)?[A-Za-z0-9-]+}/logout", api.AppHandler(logout)).Methods("GET")
|
||||||
|
mainrouter.Handle("/{team:[A-Za-z0-9-]+(__)?[A-Za-z0-9-]+}/reset_password", api.AppHandler(resetPassword)).Methods("GET")
|
||||||
|
mainrouter.Handle("/{team}/login/{service}", api.AppHandler(loginWithOAuth)).Methods("GET") // Bug in gorilla.mux prevents us from using regex here.
|
||||||
|
mainrouter.Handle("/{team}/channels/{channelname}", api.UserRequired(getChannel)).Methods("GET") // Bug in gorilla.mux prevents us from using regex here.
|
||||||
|
mainrouter.Handle("/{team}/signup/{service}", api.AppHandler(signupWithOAuth)).Methods("GET") // Bug in gorilla.mux prevents us from using regex here.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
watchAndParseTemplates()
|
watchAndParseTemplates()
|
||||||
}
|
}
|
||||||
@@ -640,3 +642,8 @@ func loginCompleteOAuth(c *api.Context, w http.ResponseWriter, r *http.Request)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func adminConsole(c *api.Context, w http.ResponseWriter, r *http.Request) {
|
||||||
|
page := NewHtmlTemplatePage("admin_console", "Admin Console")
|
||||||
|
page.Render(c, w)
|
||||||
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user