feat(ui): streamline workspace settings and remove sharing
Unify compact workspace controls and panel transitions, move directory actions into the context menu, and remove backlink UI. Reorganize settings with searchable sections, per-setting resets, shortcut search, and accurate save feedback. Remove sharing UI, APIs, authentication helpers, and storage code; provide a transactional cleanup script with retirement tests. Reject directories during orphan image cleanup and cover mixed-batch preservation.
This commit is contained in:
1 parent
a716794e41
commit
19aab631ec
63 files changed
+1077
-3343
No files matched your search
+2
-28
@@ -1,11 +1,6 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"net/http"
|
||||
"rawmark/internal/vault"
|
||||
"time"
|
||||
)
|
||||
import "net/http"
|
||||
|
||||
func (s *Server) cleanupImages(w http.ResponseWriter, r *http.Request) {
|
||||
var body struct {
|
||||
@@ -18,28 +13,7 @@ func (s *Server) cleanupImages(w http.ResponseWriter, r *http.Request) {
|
||||
writeError(w, 400, "请选择 1~1000 张待清理图片")
|
||||
return
|
||||
}
|
||||
result, err := s.vault.CleanupImages(body.Paths, func() ([]string, error) {
|
||||
shares, err := s.store.Shares()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
scopes := []string{}
|
||||
now := time.Now().UnixMilli()
|
||||
for _, share := range shares {
|
||||
if share.ExpiresAt != 0 && share.ExpiresAt <= now {
|
||||
continue
|
||||
}
|
||||
for _, item := range share.Items {
|
||||
if _, err := s.vault.Stat(item.Path); errors.Is(err, vault.ErrNotFound) {
|
||||
continue
|
||||
} else if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
scopes = append(scopes, item.Path)
|
||||
}
|
||||
}
|
||||
return scopes, nil
|
||||
})
|
||||
result, err := s.vault.CleanupImages(body.Paths)
|
||||
if err != nil {
|
||||
vaultError(w, r, err)
|
||||
return
|
||||
|
||||
Reference in new issue
Block a user