diff --git a/pixelapi/file.go b/pixelapi/file.go
index e14f71f..4a19a50 100644
--- a/pixelapi/file.go
+++ b/pixelapi/file.go
@@ -13,15 +13,14 @@ func (p *PixelAPI) GetFile(id string) (io.ReadCloser, error) {
// FileInfo File information object from the pixeldrain API
type FileInfo struct {
+ Success bool `json:"success"`
ID string `json:"id"`
FileName string `json:"file_name"`
DateUpload time.Time `json:"date_upload"`
DateLastview time.Time `json:"date_last_view"`
- DaysValid uint16 `json:"days_valid"`
FileSize uint64 `json:"file_size"`
Views uint `json:"views"`
MimeType string `json:"mime_type"`
- Description string `json:"description"`
MimeImage string `json:"mime_image"`
ThumbnailHREF string `json:"thumbnail_href"`
}
diff --git a/pixelapi/user.go b/pixelapi/user.go
index 1d1b920..f36f4ac 100644
--- a/pixelapi/user.go
+++ b/pixelapi/user.go
@@ -1,6 +1,7 @@
package pixelapi
import (
+ "fmt"
"net/url"
)
@@ -40,7 +41,7 @@ type UserInfo struct {
Username string `json:"username"`
}
-// UserInfo returns information about the logged in user. Required an API key
+// UserInfo returns information about the logged in user. Requires an API key
func (p *PixelAPI) UserInfo() (resp *UserInfo, err *Error) {
resp = &UserInfo{}
err = p.jsonRequest("GET", p.apiEndpoint+"/user", resp)
@@ -60,3 +61,21 @@ func (p *PixelAPI) UserSessionDestroy(key string) (resp *SuccessResponse, err *E
}
return resp, nil
}
+
+type UserFiles struct {
+ Success bool `json:"success"`
+ Files []FileInfo `json:"files"`
+}
+
+func (p *PixelAPI) UserFiles(page, limit int) (resp *UserFiles, err *Error) {
+ resp = &UserFiles{Files: make([]FileInfo, 0)}
+ err = p.jsonRequest(
+ "GET",
+ fmt.Sprintf("%s/user/files?page=%d&limit=%d", p.apiEndpoint, page, limit),
+ resp,
+ )
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
diff --git a/res/static/res/style/layout.css b/res/static/res/style/layout.css
index b04552e..da20ba0 100644
--- a/res/static/res/style/layout.css
+++ b/res/static/res/style/layout.css
@@ -219,20 +219,19 @@ a:hover{
.file_button, .file_button:hover{
position: relative;
box-sizing: border-box;
- width: 316px;
+ width: 310px;
max-width: 90%;
height: 60px;
- float: left;
margin: 6px;
padding: 0;
overflow: hidden;
- box-shadow: 0px 0px 5px 2px #111;
+ box-shadow: 0px 0px 10px 4px #111;
background-color: #111;
color: var(--text_color);
word-break: break-all;
text-align: left;
line-height: 120%;
- display: block;
+ display: inline-block;
}
.file_button > img{
max-height: 60px;
diff --git a/res/template/account/filemanager.html b/res/template/account/filemanager.html
index 5fbecc8..40cae17 100644
--- a/res/template/account/filemanager.html
+++ b/res/template/account/filemanager.html
@@ -13,6 +13,15 @@
in this browser.
+
+ {{range .Other.Files}}
+
+
+ {{.FileName}}
+
+ {{.DateUpload}}
+
+ {{end}}
{{template "analytics"}}