corrige bug com registro txt e tradução
This commit is contained in:
@@ -159,14 +159,14 @@ func (s *Server) healthz(w http.ResponseWriter, _ *http.Request) {
|
||||
|
||||
func (s *Server) dashboard(w http.ResponseWriter, r *http.Request) {
|
||||
if r.URL.Path != "/" {
|
||||
http.NotFound(w, r)
|
||||
http.Error(w, "pagina nao encontrada", http.StatusNotFound)
|
||||
return
|
||||
}
|
||||
|
||||
server, serverErr := s.client.GetServer(r.Context())
|
||||
zones, zonesErr := s.client.ListZones(r.Context())
|
||||
data := pageData{
|
||||
Title: "Dashboard",
|
||||
Title: "Painel",
|
||||
Server: server,
|
||||
Zones: zones,
|
||||
Error: firstNonEmpty(errorText(serverErr), errorText(zonesErr)),
|
||||
@@ -185,7 +185,7 @@ func (s *Server) login(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
data := pageData{
|
||||
Title: "Login",
|
||||
Title: "Entrar",
|
||||
Error: r.URL.Query().Get("error"),
|
||||
Next: safeRedirectPath(r.URL.Query().Get("next")),
|
||||
}
|
||||
@@ -198,7 +198,7 @@ func (s *Server) loginPost(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
if err := r.ParseForm(); err != nil {
|
||||
http.Redirect(w, r, "/login?error="+url.QueryEscape("invalid form data"), http.StatusSeeOther)
|
||||
http.Redirect(w, r, "/login?error="+url.QueryEscape("dados do formulario invalidos"), http.StatusSeeOther)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -207,18 +207,18 @@ func (s *Server) loginPost(w http.ResponseWriter, r *http.Request) {
|
||||
allowed, err := s.auth.Authenticate(r.Context(), username, password)
|
||||
if err != nil {
|
||||
s.logger.Printf("authentication failed for %q: %v", username, err)
|
||||
http.Redirect(w, r, "/login?error="+url.QueryEscape("authentication backend failed"), http.StatusSeeOther)
|
||||
http.Redirect(w, r, "/login?error="+url.QueryEscape("falha no servico de autenticacao"), http.StatusSeeOther)
|
||||
return
|
||||
}
|
||||
if !allowed {
|
||||
http.Redirect(w, r, "/login?error="+url.QueryEscape("invalid username or password"), http.StatusSeeOther)
|
||||
http.Redirect(w, r, "/login?error="+url.QueryEscape("usuario ou senha invalidos"), http.StatusSeeOther)
|
||||
return
|
||||
}
|
||||
|
||||
token, err := s.createSession(username)
|
||||
if err != nil {
|
||||
s.logger.Printf("create session: %v", err)
|
||||
http.Error(w, "session creation failed", http.StatusInternalServerError)
|
||||
http.Error(w, "falha ao criar sessao", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
http.SetCookie(w, &http.Cookie{
|
||||
@@ -255,7 +255,7 @@ func (s *Server) logout(w http.ResponseWriter, r *http.Request) {
|
||||
func (s *Server) listZones(w http.ResponseWriter, r *http.Request) {
|
||||
zones, err := s.client.ListZones(r.Context())
|
||||
data := pageData{
|
||||
Title: "Zones",
|
||||
Title: "Zonas",
|
||||
Zones: zones,
|
||||
Error: firstNonEmpty(r.URL.Query().Get("error"), errorText(err)),
|
||||
}
|
||||
@@ -264,30 +264,30 @@ func (s *Server) listZones(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
func (s *Server) createZone(w http.ResponseWriter, r *http.Request) {
|
||||
if err := r.ParseForm(); err != nil {
|
||||
s.redirectZonesError(w, r, "invalid form data")
|
||||
s.redirectZonesError(w, r, "dados do formulario invalidos")
|
||||
return
|
||||
}
|
||||
|
||||
zoneName := dnsrecord.EnsureTrailingDot(r.FormValue("name"))
|
||||
if !dnsrecord.IsFQDN(zoneName) {
|
||||
s.redirectZonesError(w, r, "zone name must be a fully qualified domain name")
|
||||
s.redirectZonesError(w, r, "o nome da zona deve ser um nome de dominio totalmente qualificado")
|
||||
return
|
||||
}
|
||||
|
||||
kind := strings.TrimSpace(r.FormValue("kind"))
|
||||
if !validZoneKind(kind) {
|
||||
s.redirectZonesError(w, r, "zone kind must be Native, Master, or Slave")
|
||||
s.redirectZonesError(w, r, "o tipo da zona deve ser Native, Master ou Slave")
|
||||
return
|
||||
}
|
||||
|
||||
nameservers, err := parseFQDNLines(r.FormValue("nameservers"), "nameserver")
|
||||
nameservers, err := parseFQDNLines(r.FormValue("nameservers"), "servidor de nomes")
|
||||
if err != nil {
|
||||
s.redirectZonesError(w, r, err.Error())
|
||||
return
|
||||
}
|
||||
masters := parseLines(r.FormValue("masters"))
|
||||
if kind == "Slave" && len(masters) == 0 {
|
||||
s.redirectZonesError(w, r, "slave zones require at least one master address")
|
||||
s.redirectZonesError(w, r, "zonas Slave exigem ao menos um endereco de servidor mestre")
|
||||
return
|
||||
}
|
||||
|
||||
@@ -317,7 +317,7 @@ func (s *Server) showZone(w http.ResponseWriter, r *http.Request) {
|
||||
zoneID := r.PathValue("zoneID")
|
||||
zone, err := s.client.GetZone(r.Context(), zoneID)
|
||||
data := pageData{
|
||||
Title: "Zone " + zoneID,
|
||||
Title: "Zona " + zoneID,
|
||||
ZoneID: zoneID,
|
||||
Zone: zone,
|
||||
Error: firstNonEmpty(r.URL.Query().Get("error"), errorText(err)),
|
||||
@@ -329,7 +329,7 @@ func (s *Server) newRRSet(w http.ResponseWriter, r *http.Request) {
|
||||
zoneID := r.PathValue("zoneID")
|
||||
zone, err := s.client.GetZone(r.Context(), zoneID)
|
||||
data := pageData{
|
||||
Title: "Add record",
|
||||
Title: "Adicionar registro",
|
||||
ZoneID: zoneID,
|
||||
Zone: zone,
|
||||
Error: firstNonEmpty(r.URL.Query().Get("error"), errorText(err)),
|
||||
@@ -337,8 +337,8 @@ func (s *Server) newRRSet(w http.ResponseWriter, r *http.Request) {
|
||||
RecordForm: recordForm{
|
||||
Type: "A",
|
||||
TTL: 300,
|
||||
Title: "Add record",
|
||||
SubmitLabel: "Create record",
|
||||
Title: "Adicionar registro",
|
||||
SubmitLabel: "Criar registro",
|
||||
},
|
||||
}
|
||||
s.render(w, r, "record_form.html", data)
|
||||
@@ -356,7 +356,7 @@ func (s *Server) editRRSet(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
rrset, ok := findRRSet(zone, name, recordType)
|
||||
if !ok {
|
||||
s.redirectZoneError(w, r, zoneID, "record not found")
|
||||
s.redirectZoneError(w, r, zoneID, "registro nao encontrado")
|
||||
return
|
||||
}
|
||||
|
||||
@@ -366,11 +366,11 @@ func (s *Server) editRRSet(w http.ResponseWriter, r *http.Request) {
|
||||
TTL: rrset.TTL,
|
||||
Records: recordValues(rrset),
|
||||
IsEdit: true,
|
||||
Title: "Edit record",
|
||||
SubmitLabel: "Save record",
|
||||
Title: "Editar registro",
|
||||
SubmitLabel: "Salvar registro",
|
||||
}
|
||||
data := pageData{
|
||||
Title: "Edit record",
|
||||
Title: "Editar registro",
|
||||
ZoneID: zoneID,
|
||||
Zone: zone,
|
||||
Error: r.URL.Query().Get("error"),
|
||||
@@ -383,13 +383,13 @@ func (s *Server) editRRSet(w http.ResponseWriter, r *http.Request) {
|
||||
func (s *Server) saveRRSet(w http.ResponseWriter, r *http.Request) {
|
||||
zoneID := r.PathValue("zoneID")
|
||||
if err := r.ParseForm(); err != nil {
|
||||
s.redirectZoneError(w, r, zoneID, "invalid form data")
|
||||
s.redirectZoneError(w, r, zoneID, "dados do formulario invalidos")
|
||||
return
|
||||
}
|
||||
|
||||
ttl, err := strconv.ParseUint(strings.TrimSpace(r.FormValue("ttl")), 10, 32)
|
||||
if err != nil {
|
||||
s.redirectZoneError(w, r, zoneID, "ttl must be a positive integer")
|
||||
s.redirectZoneError(w, r, zoneID, "ttl deve ser um numero inteiro positivo")
|
||||
return
|
||||
}
|
||||
|
||||
@@ -412,18 +412,18 @@ func (s *Server) saveEditedRRSet(w http.ResponseWriter, r *http.Request) {
|
||||
name := r.URL.Query().Get("name")
|
||||
recordType := strings.ToUpper(strings.TrimSpace(r.URL.Query().Get("type")))
|
||||
if name == "" || recordType == "" {
|
||||
s.redirectZoneError(w, r, zoneID, "record identity is required")
|
||||
s.redirectZoneError(w, r, zoneID, "a identidade do registro e obrigatoria")
|
||||
return
|
||||
}
|
||||
|
||||
if err := r.ParseForm(); err != nil {
|
||||
s.redirectZoneError(w, r, zoneID, "invalid form data")
|
||||
s.redirectZoneError(w, r, zoneID, "dados do formulario invalidos")
|
||||
return
|
||||
}
|
||||
|
||||
ttl, err := strconv.ParseUint(strings.TrimSpace(r.FormValue("ttl")), 10, 32)
|
||||
if err != nil {
|
||||
s.redirectZoneError(w, r, zoneID, "ttl must be a positive integer")
|
||||
s.redirectZoneError(w, r, zoneID, "ttl deve ser um numero inteiro positivo")
|
||||
return
|
||||
}
|
||||
|
||||
@@ -443,18 +443,18 @@ func (s *Server) saveEditedRRSet(w http.ResponseWriter, r *http.Request) {
|
||||
func (s *Server) deleteRRSet(w http.ResponseWriter, r *http.Request) {
|
||||
zoneID := r.PathValue("zoneID")
|
||||
if err := r.ParseForm(); err != nil {
|
||||
s.redirectZoneError(w, r, zoneID, "invalid form data")
|
||||
s.redirectZoneError(w, r, zoneID, "dados do formulario invalidos")
|
||||
return
|
||||
}
|
||||
|
||||
name := dnsrecord.EnsureTrailingDot(r.FormValue("name"))
|
||||
recordType := strings.ToUpper(strings.TrimSpace(r.FormValue("type")))
|
||||
if name == "." || recordType == "" {
|
||||
s.redirectZoneError(w, r, zoneID, "record name and type are required")
|
||||
s.redirectZoneError(w, r, zoneID, "nome e tipo do registro sao obrigatorios")
|
||||
return
|
||||
}
|
||||
if isSOA(recordType) {
|
||||
s.redirectZoneError(w, r, zoneID, "SOA records are required for zones and cannot be deleted")
|
||||
s.redirectZoneError(w, r, zoneID, "registros SOA sao obrigatorios para zonas e nao podem ser excluidos")
|
||||
return
|
||||
}
|
||||
|
||||
@@ -475,7 +475,7 @@ func (s *Server) render(w http.ResponseWriter, r *http.Request, name string, dat
|
||||
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
||||
tmpl, ok := s.templates[name]
|
||||
if !ok {
|
||||
http.Error(w, "template not found", http.StatusInternalServerError)
|
||||
http.Error(w, "template nao encontrado", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
if err := tmpl.ExecuteTemplate(w, name, data); err != nil {
|
||||
@@ -507,7 +507,7 @@ func (s *Server) withSessionAuth(next http.Handler) http.Handler {
|
||||
return
|
||||
}
|
||||
if isUnsafeMethod(r.Method) && !validCSRFToken(r, sess.CSRFToken) {
|
||||
http.Error(w, "invalid CSRF token", http.StatusForbidden)
|
||||
http.Error(w, "token CSRF invalido", http.StatusForbidden)
|
||||
return
|
||||
}
|
||||
next.ServeHTTP(w, r)
|
||||
@@ -664,7 +664,7 @@ func parseFQDNLines(raw, label string) ([]string, error) {
|
||||
for i, value := range values {
|
||||
values[i] = dnsrecord.EnsureTrailingDot(value)
|
||||
if !dnsrecord.IsFQDN(values[i]) {
|
||||
return nil, fmt.Errorf("%s %q must be a fully qualified domain name", label, value)
|
||||
return nil, fmt.Errorf("%s %q deve ser um nome de dominio totalmente qualificado", label, value)
|
||||
}
|
||||
}
|
||||
return values, nil
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{{ define "layout" }}
|
||||
<!doctype html>
|
||||
<html lang="en" data-bs-theme="light">
|
||||
<html lang="pt-BR" data-bs-theme="light">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
@@ -15,16 +15,16 @@
|
||||
<h1 class="navbar-brand navbar-brand-autodark d-none-navbar-horizontal pe-0 pe-md-3">
|
||||
<a href="/">AehooDNS</a>
|
||||
</h1>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar-menu" aria-controls="navbar-menu" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar-menu" aria-controls="navbar-menu" aria-expanded="false" aria-label="Alternar navegacao">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbar-menu">
|
||||
<div class="navbar-nav">
|
||||
<a class="nav-link" href="/">
|
||||
<span class="nav-link-title">Dashboard</span>
|
||||
<span class="nav-link-title">Painel</span>
|
||||
</a>
|
||||
<a class="nav-link" href="/zones">
|
||||
<span class="nav-link-title">Zones</span>
|
||||
<span class="nav-link-title">Zonas</span>
|
||||
</a>
|
||||
</div>
|
||||
{{ if .AuthEnabled }}
|
||||
@@ -34,7 +34,7 @@
|
||||
<form method="post" action="/logout" class="nav-item">
|
||||
<input type="hidden" name="csrf_token" value="{{ .CSRFToken }}">
|
||||
<button class="nav-link btn btn-link px-0" type="submit">
|
||||
<span class="nav-link-title">Logout</span>
|
||||
<span class="nav-link-title">Sair</span>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -1,69 +1,76 @@
|
||||
{{ define "content" }}
|
||||
<div class="page-header d-print-none">
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<div class="page-pretitle">PowerDNS</div>
|
||||
<h2 class="page-title">Dashboard</h2>
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<div class="page-pretitle">PowerDNS</div>
|
||||
<h2 class="page-title">Painel</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row row-deck row-cards mb-3">
|
||||
<div class="col-sm-6 col-lg-3">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="subheader">Server ID</div>
|
||||
<div class="h2 mb-0 text-truncate">{{ .Server.ID }}</div>
|
||||
</div>
|
||||
<div class="col-sm-6 col-lg-3">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="subheader">ID do servidor</div>
|
||||
<div class="h2 mb-0 text-truncate">{{ .Server.ID }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6 col-lg-3">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="subheader">Daemon</div>
|
||||
<div class="h2 mb-0 text-truncate">{{ .Server.DaemonType }}</div>
|
||||
</div>
|
||||
<div class="col-sm-6 col-lg-3">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="subheader">Serviço</div>
|
||||
<div class="h2 mb-0 text-truncate">
|
||||
{{ .Server.DaemonType }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6 col-lg-3">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="subheader">Version</div>
|
||||
<div class="h2 mb-0 text-truncate">{{ .Server.Version }}</div>
|
||||
</div>
|
||||
<div class="col-sm-6 col-lg-3">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="subheader">Versão</div>
|
||||
<div class="h2 mb-0 text-truncate">{{ .Server.Version }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6 col-lg-3">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="subheader">Zones</div>
|
||||
<div class="h2 mb-0">{{ len .Zones }}</div>
|
||||
</div>
|
||||
<div class="col-sm-6 col-lg-3">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="subheader">Zonas</div>
|
||||
<div class="h2 mb-0">{{ len .Zones }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Recent zones</h3>
|
||||
</div>
|
||||
{{ if .Zones }}
|
||||
<div class="list-group list-group-flush">
|
||||
{{ range .Zones }}
|
||||
<a class="list-group-item list-group-item-action" href="/zones/{{ .ID }}">
|
||||
<div class="row align-items-center">
|
||||
<div class="col text-truncate">
|
||||
<strong>{{ .Name }}</strong>
|
||||
<div class="text-secondary text-truncate">{{ .DisplayKind }} · serial {{ .Serial }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
{{ end }}
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Zonas recentes</h3>
|
||||
</div>
|
||||
{{ else }}
|
||||
<div class="card-body text-secondary">No zones returned by PowerDNS.</div>
|
||||
{{ end }}
|
||||
{{ if .Zones }}
|
||||
<div class="list-group list-group-flush">
|
||||
{{ range .Zones }}
|
||||
<a
|
||||
class="list-group-item list-group-item-action"
|
||||
href="/zones/{{ .ID }}"
|
||||
>
|
||||
<div class="row align-items-center">
|
||||
<div class="col text-truncate">
|
||||
<strong>{{ .Name }}</strong>
|
||||
<div class="text-secondary text-truncate">
|
||||
{{ .DisplayKind }} · serial {{ .Serial }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ else }}
|
||||
<div class="card-body text-secondary">
|
||||
Nenhuma zona retornada pelo PowerDNS.
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ template "layout" . }}
|
||||
{{ end }} {{ template "layout" . }}
|
||||
|
||||
@@ -1,25 +1,37 @@
|
||||
{{ define "content" }}
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6 col-lg-4">
|
||||
<div class="card card-md">
|
||||
<div class="card-body">
|
||||
<h2 class="h2 text-center mb-2">Login</h2>
|
||||
<form method="post" action="/login">
|
||||
<input type="hidden" name="next" value="{{ .Next }}">
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Username</label>
|
||||
<input class="form-control" name="username" autocomplete="username" required autofocus>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Password</label>
|
||||
<input class="form-control" name="password" type="password" autocomplete="current-password" required>
|
||||
</div>
|
||||
<button class="btn btn-primary w-100" type="submit">Sign in</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-md-6 col-lg-4">
|
||||
<div class="card card-md">
|
||||
<div class="card-body">
|
||||
<h2 class="h2 text-center mb-2">Entrar</h2>
|
||||
<form method="post" action="/login">
|
||||
<input type="hidden" name="next" value="{{ .Next }}" />
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Usuário</label>
|
||||
<input
|
||||
class="form-control"
|
||||
name="username"
|
||||
autocomplete="username"
|
||||
required
|
||||
autofocus
|
||||
/>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Senha</label>
|
||||
<input
|
||||
class="form-control"
|
||||
name="password"
|
||||
type="password"
|
||||
autocomplete="current-password"
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
<button class="btn btn-primary w-100" type="submit">
|
||||
Entrar
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ template "layout" . }}
|
||||
{{ end }} {{ template "layout" . }}
|
||||
|
||||
@@ -1,64 +1,112 @@
|
||||
{{ define "content" }}
|
||||
<div class="page-header d-print-none">
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<div class="page-pretitle">{{ .Zone.Name }}</div>
|
||||
<h2 class="page-title">{{ .RecordForm.Title }}</h2>
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<div class="page-pretitle">{{ .Zone.Name }}</div>
|
||||
<h2 class="page-title">{{ .RecordForm.Title }}</h2>
|
||||
</div>
|
||||
<div class="col-auto ms-auto">
|
||||
<a class="btn btn-outline-secondary" href="/zones/{{ .ZoneID }}"
|
||||
>Voltar para registros</a
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto ms-auto">
|
||||
<a class="btn btn-outline-secondary" href="/zones/{{ .ZoneID }}">Back to records</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-lg-8">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
{{ if .RecordForm.IsEdit }}
|
||||
<div class="row mb-4">
|
||||
<div class="col-sm-8">
|
||||
<div class="subheader">Name</div>
|
||||
<div class="h3 mb-0">{{ .RecordForm.Name }}</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="subheader">Type</div>
|
||||
<div class="h3 mb-0">{{ .RecordForm.Type }}</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
<form method="post" action="{{ if .RecordForm.IsEdit }}/zones/{{ .ZoneID }}/rrsets/edit?name={{ urlQuery .RecordForm.Name }}&type={{ urlQuery .RecordForm.Type }}{{ else }}/zones/{{ .ZoneID }}/rrsets{{ end }}">
|
||||
<input type="hidden" name="csrf_token" value="{{ .CSRFToken }}">
|
||||
{{ if not .RecordForm.IsEdit }}
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Name</label>
|
||||
<input class="form-control" name="name" value="{{ .RecordForm.Name }}" placeholder="www.{{ .Zone.Name }}" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Type</label>
|
||||
<select class="form-select" name="type" required>
|
||||
{{ range .RecordTypes }}
|
||||
<option {{ if eq . $.RecordForm.Type }}selected{{ end }}>{{ . }}</option>
|
||||
<div class="col-lg-8">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
{{ if .RecordForm.IsEdit }}
|
||||
<div class="row mb-4">
|
||||
<div class="col-sm-8">
|
||||
<div class="subheader">Nome</div>
|
||||
<div class="h3 mb-0">{{ .RecordForm.Name }}</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="subheader">Tipo</div>
|
||||
<div class="h3 mb-0">{{ .RecordForm.Type }}</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
</select>
|
||||
</div>
|
||||
{{ end }}
|
||||
<div class="mb-3">
|
||||
<label class="form-label">TTL</label>
|
||||
<input class="form-control" name="ttl" type="number" min="1" value="{{ .RecordForm.TTL }}" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Records</label>
|
||||
<textarea class="form-control" name="records" rows="8" placeholder="One record value per line" required>{{ .RecordForm.Records }}</textarea>
|
||||
<div class="form-hint">Strict formats are enforced. TXT and CAA string values must be quoted. Adding A, AAAA, CAA, MX, NS, SRV, or TXT records appends to an existing RRset with the same name and type. SOA records can be edited here but cannot be deleted.</div>
|
||||
</div>
|
||||
<button class="btn btn-primary" type="submit">{{ .RecordForm.SubmitLabel }}</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ template "layout" . }}
|
||||
<form
|
||||
method="post"
|
||||
action="{{ if .RecordForm.IsEdit }}/zones/{{ .ZoneID }}/rrsets/edit?name={{ urlQuery .RecordForm.Name }}&type={{ urlQuery .RecordForm.Type }}{{ else }}/zones/{{ .ZoneID }}/rrsets{{ end }}"
|
||||
>
|
||||
<input
|
||||
type="hidden"
|
||||
name="csrf_token"
|
||||
value="{{ .CSRFToken }}"
|
||||
/>
|
||||
{{ if not .RecordForm.IsEdit }}
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Nome</label>
|
||||
<input
|
||||
class="form-control"
|
||||
name="name"
|
||||
value="{{ .RecordForm.Name }}"
|
||||
placeholder="www.{{ .Zone.Name }}"
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Tipo</label>
|
||||
<select class="form-select" name="type" required>
|
||||
{{ range .RecordTypes }}
|
||||
<option
|
||||
{{
|
||||
if
|
||||
eq
|
||||
.
|
||||
$.RecordForm.Type
|
||||
}}selected{{
|
||||
end
|
||||
}}
|
||||
>
|
||||
{{ . }}
|
||||
</option>
|
||||
{{ end }}
|
||||
</select>
|
||||
</div>
|
||||
{{ end }}
|
||||
<div class="mb-3">
|
||||
<label class="form-label">TTL</label>
|
||||
<input
|
||||
class="form-control"
|
||||
name="ttl"
|
||||
type="number"
|
||||
min="1"
|
||||
value="{{ .RecordForm.TTL }}"
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Registros</label>
|
||||
<textarea
|
||||
class="form-control"
|
||||
name="records"
|
||||
rows="8"
|
||||
placeholder="Um valor de registro por linha"
|
||||
required
|
||||
>
|
||||
{{ .RecordForm.Records }}</textarea
|
||||
>
|
||||
<div class="form-hint">
|
||||
Formato estrito exigido: Valores de texto TXT e CAA
|
||||
devem estar entre aspas. Adicionar registros A,
|
||||
AAAA, CAA, MX, NS, SRV ou TXT acrescenta ao conjunto
|
||||
de registros existente com o mesmo nome e tipo.
|
||||
Registros SOA podem ser editados aqui, mas não podem
|
||||
ser excluidos.
|
||||
</div>
|
||||
</div>
|
||||
<button class="btn btn-primary" type="submit">
|
||||
{{ .RecordForm.SubmitLabel }}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }} {{ template "layout" . }}
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
<div class="page-header d-print-none">
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<div class="page-pretitle">Zone</div>
|
||||
<div class="page-pretitle">Zona</div>
|
||||
<h2 class="page-title">{{ .Zone.Name }}</h2>
|
||||
<div class="text-secondary">{{ len .Zone.RRSets }} RRsets</div>
|
||||
<div class="text-secondary">{{ len .Zone.RRSets }} conjuntos de registros</div>
|
||||
</div>
|
||||
<div class="col-auto ms-auto">
|
||||
<div class="btn-list">
|
||||
<a class="btn btn-outline-secondary" href="/zones">Back to zones</a>
|
||||
<a class="btn btn-primary" href="/zones/{{ .ZoneID }}/rrsets/new">Add record</a>
|
||||
<a class="btn btn-outline-secondary" href="/zones">Voltar para zonas</a>
|
||||
<a class="btn btn-primary" href="/zones/{{ .ZoneID }}/rrsets/new">Adicionar registro</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -17,17 +17,17 @@
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Records</h3>
|
||||
<h3 class="card-title">Registros</h3>
|
||||
</div>
|
||||
{{ if .Zone.RRSets }}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-vcenter card-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Type</th>
|
||||
<th>Nome</th>
|
||||
<th>Tipo</th>
|
||||
<th>TTL</th>
|
||||
<th>Records</th>
|
||||
<th>Registros</th>
|
||||
<th class="w-1"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -46,13 +46,13 @@
|
||||
</td>
|
||||
<td>
|
||||
<div class="btn-list flex-nowrap">
|
||||
<a class="btn btn-outline-primary btn-sm" href="/zones/{{ $.ZoneID }}/rrsets/edit?name={{ urlQuery .Name }}&type={{ urlQuery .Type }}">Edit</a>
|
||||
<a class="btn btn-outline-primary btn-sm" href="/zones/{{ $.ZoneID }}/rrsets/edit?name={{ urlQuery .Name }}&type={{ urlQuery .Type }}">Editar</a>
|
||||
{{ if not (isSOA .Type) }}
|
||||
<form method="post" action="/zones/{{ $.ZoneID }}/rrsets/delete">
|
||||
<input type="hidden" name="csrf_token" value="{{ $.CSRFToken }}">
|
||||
<input type="hidden" name="name" value="{{ .Name }}">
|
||||
<input type="hidden" name="type" value="{{ .Type }}">
|
||||
<button class="btn btn-outline-danger btn-sm" type="submit">Delete</button>
|
||||
<button class="btn btn-outline-danger btn-sm" type="submit">Excluir</button>
|
||||
</form>
|
||||
{{ end }}
|
||||
</div>
|
||||
@@ -63,7 +63,7 @@
|
||||
</table>
|
||||
</div>
|
||||
{{ else }}
|
||||
<div class="card-body text-secondary">No records returned for this zone.</div>
|
||||
<div class="card-body text-secondary">Nenhum registro retornado para esta zona.</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<div class="page-header d-print-none">
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<div class="page-pretitle">Authoritative DNS</div>
|
||||
<h2 class="page-title">Zones</h2>
|
||||
<div class="text-secondary">{{ len .Zones }} zones loaded from PowerDNS.</div>
|
||||
<div class="page-pretitle">DNS autoritativo</div>
|
||||
<h2 class="page-title">Zonas</h2>
|
||||
<div class="text-secondary">{{ len .Zones }} zonas carregadas do PowerDNS.</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -13,15 +13,15 @@
|
||||
<div class="col-lg-8">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Existing zones</h3>
|
||||
<h3 class="card-title">Zonas existentes</h3>
|
||||
</div>
|
||||
{{ if .Zones }}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-vcenter card-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Kind</th>
|
||||
<th>Nome</th>
|
||||
<th>Tipo</th>
|
||||
<th>Serial</th>
|
||||
<th class="w-1"></th>
|
||||
</tr>
|
||||
@@ -35,7 +35,7 @@
|
||||
<td>
|
||||
<form method="post" action="/zones/{{ .ID }}/delete">
|
||||
<input type="hidden" name="csrf_token" value="{{ $.CSRFToken }}">
|
||||
<button class="btn btn-outline-danger btn-sm" type="submit">Delete</button>
|
||||
<button class="btn btn-outline-danger btn-sm" type="submit">Excluir</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -44,7 +44,7 @@
|
||||
</table>
|
||||
</div>
|
||||
{{ else }}
|
||||
<div class="card-body text-secondary">No zones returned by PowerDNS.</div>
|
||||
<div class="card-body text-secondary">Nenhuma zona retornada pelo PowerDNS.</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
@@ -52,17 +52,17 @@
|
||||
<div class="col-lg-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Add zone</h3>
|
||||
<h3 class="card-title">Adicionar zona</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form method="post" action="/zones">
|
||||
<input type="hidden" name="csrf_token" value="{{ .CSRFToken }}">
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Zone name</label>
|
||||
<label class="form-label">Nome da zona</label>
|
||||
<input class="form-control" name="name" placeholder="example.org." required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Kind</label>
|
||||
<label class="form-label">Tipo</label>
|
||||
<select class="form-select" name="kind" required>
|
||||
<option>Native</option>
|
||||
<option>Master</option>
|
||||
@@ -70,14 +70,14 @@
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Nameservers</label>
|
||||
<label class="form-label">Servidores de nomes</label>
|
||||
<textarea class="form-control" name="nameservers" rows="4" placeholder="ns1.example.org. ns2.example.org."></textarea>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Masters</label>
|
||||
<textarea class="form-control" name="masters" rows="3" placeholder="Required for Slave zones"></textarea>
|
||||
<label class="form-label">Servidores mestres</label>
|
||||
<textarea class="form-control" name="masters" rows="3" placeholder="Obrigatorio para zonas Slave"></textarea>
|
||||
</div>
|
||||
<button class="btn btn-primary" type="submit">Create zone</button>
|
||||
<button class="btn btn-primary" type="submit">Criar zona</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user