Enhance editor logging for file sessions in routes and update video URL handling in file explorer
This commit is contained in:
@@ -1411,11 +1411,11 @@ class _FileExplorerState extends State<FileExplorer> {
|
||||
return GestureDetector(
|
||||
onTap: () async {
|
||||
final videoUrl = await getIt<FileService>()
|
||||
.getFileUrl(
|
||||
orgId: widget.orgId,
|
||||
fileId: file.id ?? '',
|
||||
);
|
||||
_showVideoViewer(file.name, videoUrl);
|
||||
.getDownloadUrl(widget.orgId, file.path);
|
||||
_showVideoViewer(
|
||||
file.name,
|
||||
'${getIt<FileService>().baseUrl}$videoUrl',
|
||||
);
|
||||
},
|
||||
child: _buildFileItem(
|
||||
file,
|
||||
|
||||
@@ -685,6 +685,8 @@ func editorHandler(w http.ResponseWriter, r *http.Request, db *database.DB, audi
|
||||
orgID := r.Context().Value(middleware.OrgKey).(uuid.UUID)
|
||||
fileId := chi.URLParam(r, "fileId")
|
||||
|
||||
fmt.Printf("[EDITOR] Starting editor session for file=%s user=%s org=%s\n", fileId, userIDStr, orgID.String())
|
||||
|
||||
// Log activity
|
||||
db.LogActivity(r.Context(), userID, orgID, &fileId, "edit_file", map[string]interface{}{})
|
||||
|
||||
@@ -722,6 +724,8 @@ func userEditorHandler(w http.ResponseWriter, r *http.Request, db *database.DB,
|
||||
userID, _ := uuid.Parse(userIDStr)
|
||||
fileId := chi.URLParam(r, "fileId")
|
||||
|
||||
fmt.Printf("[EDITOR] Starting user editor session for file=%s user=%s\n", fileId, userIDStr)
|
||||
|
||||
// Get file metadata to determine path and type
|
||||
fileUUID, err := uuid.Parse(fileId)
|
||||
if err != nil {
|
||||
@@ -754,6 +758,8 @@ func userEditorHandler(w http.ResponseWriter, r *http.Request, db *database.DB,
|
||||
// Build Collabora editor URL
|
||||
collaboraUrl := fmt.Sprintf("https://of.b0esche.cloud/lool/dist/mobile/cool.html?WOPISrc=%s", url.QueryEscape(wopiSrc))
|
||||
|
||||
fmt.Printf("[EDITOR] Built user URLs: wopiSrc=%s collaboraUrl=%s\n", wopiSrc, collaboraUrl)
|
||||
|
||||
// Check if user can edit (for now, all users can edit their own files)
|
||||
readOnly := false
|
||||
|
||||
|
||||
Reference in New Issue
Block a user