Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,19 @@ import (
"log"
"os"

"github.com/jackc/pgx/v5"
"github.com/jackc/pgx/v5/pgconn"
"github.com/jackc/pgx/v5/pgxpool"
)

type Pool interface {
Begin(context.Context) (pgx.Tx, error)
Exec(context.Context, string, ...any) (pgconn.CommandTag, error)
Query(context.Context, string, ...any) (pgx.Rows, error)
}

type MetadataDatabase struct {
Pool *pgxpool.Pool
Pool Pool
}

func New(ctx context.Context, envVar string) (*MetadataDatabase, error) {
Expand Down
24 changes: 12 additions & 12 deletions backend/src/usecase/files/data/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ import (

// Metadata Model - need ContentCID string for IPFS
type MetaData struct {
ID uuid.UUID
FileName string
Path string
Size uint64
FileType string
ModifiedAt time.Time
UploadedAt time.Time
Owner uuid.UUID
AccessTo []uuid.UUID
Group []uuid.UUID
CheckSum []byte
Version time.Time
ID uuid.UUID `json:"uuid"`
FileName string `json:"file_name"`
Path string `json:"path"`
Size uint64 `json:"size"`
FileType string `json:"file_type"`
ModifiedAt time.Time `json:"modified_at"`
UploadedAt time.Time `json:"created_at"`
Owner uuid.UUID `json:"owner_id"`
AccessTo []uuid.UUID `json:"access_to"`
Group []uuid.UUID `json:"group_id"`
CheckSum []byte `json:"checksum"`
Version time.Time `json:"version"`
}

func (m *MetaData) ToResponse() MetaDataResponse {
Expand Down
1 change: 1 addition & 0 deletions backend/tempfiles/react-1618799214.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
77 changes: 64 additions & 13 deletions frontend/index.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,70 @@
<!doctype html>
<html lang="en">
<head>
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<link rel="icon" type="image/png" href="/public/favicon-96x96.png" sizes="96x96" />
<link rel="icon" type="image/svg+xml" href="/public/favicon.svg" />
<link rel="shortcut icon" href="/public/favicon.ico" />
<link rel="apple-touch-icon" sizes="180x180" href="/public/apple-touch-icon.png" />
<link rel="manifest" href="/public/site.webmanifest" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Gestalto</title>
</head>
<body>
<div id="root">
</div>
<title>Gestalt</title>
<script>
// Gets colour scheme before React is loaded, avoids white flash if dark.
const isDarkTheme = window.matchMedia('(prefers-color-scheme: dark)').matches;
if (isDarkTheme) document.documentElement.classList.add("dark");
(function() {
const storageKey = 'vite-ui-theme';
const savedTheme = localStorage.getItem(storageKey);
const systemPrefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
const isDark = savedTheme === 'dark' || (!savedTheme && systemPrefersDark);

if (isDark) {
document.documentElement.style.backgroundColor = '#262626';
document.documentElement.classList.add('dark');
} else {
document.documentElement.style.backgroundColor = '#FBF8F1';
document.documentElement.classList.remove('dark');
}
})();
</script>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
<style>
#initial-loader {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
width: 100vw;
position: fixed;
top: 0;
left: 0;

/* 1. Hide it initially */
opacity: 0;

/* 2. Wait 400ms, then fade in over 200ms */
/* Adjust '0.4s' to your preferred "bad latency" threshold */
animation: delayedFadeIn 1s 0.2s forwards;
}

.spinner-img {
width: 100px;
height: 100px;
}

.dark .spinner-img {
filter: invert(1);
}

@keyframes delayedFadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
</style>
</head>
<body>
<div id="root">
<div id="initial-loader">
<img src="/media/spinner.svg" class="spinner-img" />
</div>
</div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading
Loading