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(
|
return GestureDetector(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
final videoUrl = await getIt<FileService>()
|
final videoUrl = await getIt<FileService>()
|
||||||
.getFileUrl(
|
.getDownloadUrl(widget.orgId, file.path);
|
||||||
orgId: widget.orgId,
|
_showVideoViewer(
|
||||||
fileId: file.id ?? '',
|
file.name,
|
||||||
|
'${getIt<FileService>().baseUrl}$videoUrl',
|
||||||
);
|
);
|
||||||
_showVideoViewer(file.name, videoUrl);
|
|
||||||
},
|
},
|
||||||
child: _buildFileItem(
|
child: _buildFileItem(
|
||||||
file,
|
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)
|
orgID := r.Context().Value(middleware.OrgKey).(uuid.UUID)
|
||||||
fileId := chi.URLParam(r, "fileId")
|
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
|
// Log activity
|
||||||
db.LogActivity(r.Context(), userID, orgID, &fileId, "edit_file", map[string]interface{}{})
|
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)
|
userID, _ := uuid.Parse(userIDStr)
|
||||||
fileId := chi.URLParam(r, "fileId")
|
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
|
// Get file metadata to determine path and type
|
||||||
fileUUID, err := uuid.Parse(fileId)
|
fileUUID, err := uuid.Parse(fileId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -754,6 +758,8 @@ func userEditorHandler(w http.ResponseWriter, r *http.Request, db *database.DB,
|
|||||||
// Build Collabora editor URL
|
// Build Collabora editor URL
|
||||||
collaboraUrl := fmt.Sprintf("https://of.b0esche.cloud/lool/dist/mobile/cool.html?WOPISrc=%s", url.QueryEscape(wopiSrc))
|
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)
|
// Check if user can edit (for now, all users can edit their own files)
|
||||||
readOnly := false
|
readOnly := false
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user