fix: small fixes
This commit is contained in:
1 parent
86cb0226ab
commit
171e14176a
28 files changed
+95
-91
No files matched your search
@@ -137,7 +137,7 @@ func seenText(online bool, lastSeen time.Time) string {
|
||||
return humanSince(lastSeen)
|
||||
}
|
||||
|
||||
// GET /api/panel/agents/presence — who is online, for the dashboard to keep
|
||||
// GET /api/panel/agents/presence - who is online, for the dashboard to keep
|
||||
// its status column live without reloading.
|
||||
func (s *Server) handlePresence(w http.ResponseWriter, r *http.Request) {
|
||||
agents, err := s.db.ListAgents()
|
||||
@@ -227,7 +227,7 @@ func (s *Server) agentUsers(agentID string) (*proto.SysUsersResult, error) {
|
||||
case res := <-ch:
|
||||
if !res.OK {
|
||||
// Agents older than 0.0.2 don't know this task.
|
||||
return nil, errors.New("клиент не поддерживает выбор пользователя — обновите его")
|
||||
return nil, errors.New("клиент не поддерживает выбор пользователя - обновите его")
|
||||
}
|
||||
var out proto.SysUsersResult
|
||||
if err := json.Unmarshal(res.Data, &out); err != nil {
|
||||
@@ -258,7 +258,7 @@ func (s *Server) handleAgentSetUser(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
name := strings.TrimSpace(r.FormValue("user"))
|
||||
if !s.online(a) {
|
||||
editUserRedirect(w, r, id, "uerr", "Машина офлайн — сменить пользователя нельзя.")
|
||||
editUserRedirect(w, r, id, "uerr", "Машина офлайн - сменить пользователя нельзя.")
|
||||
return
|
||||
}
|
||||
// Only accept a user the machine itself reports, so a typo (or an agent too
|
||||
@@ -299,7 +299,7 @@ func (s *Server) handleAgentAddUser(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
if !s.online(a) {
|
||||
editUserRedirect(w, r, id, "uerr", "Машина офлайн — создать пользователя нельзя.")
|
||||
editUserRedirect(w, r, id, "uerr", "Машина офлайн - создать пользователя нельзя.")
|
||||
return
|
||||
}
|
||||
name := strings.TrimSpace(r.FormValue("name"))
|
||||
@@ -402,7 +402,7 @@ func (s *Server) handleSettings(w http.ResponseWriter, r *http.Request) {
|
||||
})
|
||||
}
|
||||
|
||||
// POST /settings/tunnel — host and port agents use for the direct tunnel.
|
||||
// POST /settings/tunnel - host and port agents use for the direct tunnel.
|
||||
func (s *Server) handleSetTunnel(w http.ResponseWriter, r *http.Request) {
|
||||
if !checkCSRF(r) {
|
||||
http.Error(w, "bad csrf", http.StatusForbidden)
|
||||
|
||||
Reference in new issue
Block a user