Skip to content

Commit

Permalink
cool delete working and regular updates
Browse files Browse the repository at this point in the history
  • Loading branch information
trinidz committed Dec 8, 2024
1 parent e1eb3d2 commit ab32f22
Show file tree
Hide file tree
Showing 3 changed files with 200 additions and 220 deletions.
46 changes: 1 addition & 45 deletions handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ func handleMetricsDisplay(w http.ResponseWriter, _ *http.Request) {
}

func handleCreateFeed(w http.ResponseWriter, r *http.Request, secret *string) {
tmpl := template.Must(template.ParseFiles(fmt.Sprintf("%s/created.html", s.TemplatePath)))
metrics.CreateRequests.Inc()
entry := createFeed(r, secret)

Expand Down Expand Up @@ -125,6 +124,7 @@ func handleCreateFeed(w http.ResponseWriter, r *http.Request, secret *string) {
ErrorMessage: entry.ErrorMessage,
}

tmpl := template.Must(template.ParseFiles(fmt.Sprintf("%s/created.html", s.TemplatePath)))
err := tmpl.Execute(w, data)
if err != nil {
log.Print("[ERROR] ", err)
Expand Down Expand Up @@ -243,52 +243,8 @@ func handleDeleteFeed(w http.ResponseWriter, r *http.Request) {
log.Printf("[ERROR] could not delete feed '%q'...Error: %s ", feedPubkey, err)
}

/*items, err := getSavedEntries()
if err != nil {
log.Printf("[ERROR] %s", err)
http.Error(w, err.Error(), http.StatusInternalServerError)
}
npub, _ := nip19.EncodePublicKey(s.RelayPubkey)
tmpl := template.Must(template.ParseFiles(fmt.Sprintf("%s/index.html", s.TemplatePath)))
data := struct {
RelayName string
RelayPubkey string
RelayNPubkey string
RelayDescription string
RelayURL string
Count int
Entries []GUIEntry
KindTextNoteCreated string
KindTextNoteDeleted string
QueryEventsRequests string
NotesBlasted string
}{
RelayName: s.RelayName,
RelayPubkey: s.RelayPubkey,
RelayNPubkey: npub,
RelayDescription: s.RelayDescription,
RelayURL: s.RelayURL,
Count: len(items),
Entries: items,
KindTextNoteCreated: getPrometheusMetric(metrics.KindTextNoteCreated.Desc()),
KindTextNoteDeleted: getPrometheusMetric(metrics.KindTextNoteDeleted.Desc()),
QueryEventsRequests: getPrometheusMetric(metrics.QueryEventsRequests.Desc()),
NotesBlasted: getPrometheusMetric(metrics.NotesBlasted.Desc()),
} */

//http.Redirect(w, r, "/", http.StatusTemporaryRedirect)

tmpl := template.New("t")
tmpl.Execute(w, nil)

/*
if err := tmpl.Execute(w, data); err != nil {
log.Printf("[ERROR] %s", err)
http.Error(w, err.Error(), http.StatusInternalServerError)
}
*/
}

func handleImportOpml(w http.ResponseWriter, r *http.Request) {
Expand Down
4 changes: 4 additions & 0 deletions web/assets/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,8 @@
padding: .125em;
}

tr.htmx-swapping td {
opacity: 0;
transition: opacity 1s ease-out;
}

Loading

0 comments on commit ab32f22

Please sign in to comment.