List of all uploaded files

Hello friends,

what are you thinking about some extra tab at the admin interface to keep control over the current disk usage, files sizes, click rates, filtering them after extension and searching for specific terms?

I wish, I could get more control over all attachments.

Best

7 إعجابات

That’s something I definitely want done. Not sure when though.

11 إعجابًا

Sounds useful!

There is a bunch of product questions around how this could/should work in my mind. It looks like a problem that has been already figured out or solved in other forum software, but I wonder how will this be framed / built around Discourse’s philosophy.

I am also wondering more about the manifestations of providing uploads settings, e.g.: if you chose to introduce extension configuration, the composer needs to cater for this when users are selecting/uploading attachments, and so on. Also, whether this should be in core, or as a plugin.

On the bright side, if we ignore all questions / assumptions / product / design considerations, it doesn’t look like it is technically tricky, I made a one hour spike here (this is very immature implementation though :blush:).

You can definitely extend this with a bunch of useful features: settings, search / filtering, sorting, etc (and some other considerations like supporting pagination, …)

6 إعجابات

If youbtalking about admin tools. You can considure usong plugin data explorer whic allows admins to query database. When I hunting free space I am querying db there is table uploads whic gives you size location and other useful things. Also one good thing is that deleating rows from uploads also dealeting files. Becouse ther is sidekiq job pruge oprhan uploads.

I am totally open to adding something here, but I feel a top level tab is a bit too much .

Conceptually this feels like a “report” to me with a drilldown vs a section for uploading things.

I would like to see this link to the new report

When I think about this problem I think the main use case is around admins trying to get a handle on the … upload problem…

  • Why do I have so many uploads?

  • Which users have the most/largest uploads ?

  • What are the 100 biggest uploads on my forum?

  • How many things were uploaded in the last month? That way I can keep track of trends.

@codinghorror / @j.jaffeux what are your thoughts here?

12 إعجابًا

Yes I agree it could be a report, we might have to start working on the filtering logic I talked with you months ago. But other than that it should be good.

3 إعجابات

Great line of questioning @sam !

I think perhaps I lack some context on what is the admin’s job / use case for the upload problem, but it appears to be (if there is any research or perhaps admin opinions to confirm that, it would be great!) that it can be framed as: I am an Admin, I want to gain understanding of my instance’s uploads usage.

I wonder if there are any after actions when the job / use case is satisfied. For example, if the admin notices a problem or a trend, will the admin/site_settings/category/files is the place they can optimise their file uploading strategy?

Also, I agree that the Uploads section is heavy as a top level tab for this use case.

هل هناك أي أخبار حول هذا الموضوع؟

أبحث عن خيار لاستعراض الملفات المُحمَّلة.

3 إعجابات

أظن أن ترتيب الملفات وعرضها ليس بنفس الأهمية لمنصة Discourse كما هو بالنسبة لنا. :see_no_evil:

مشكلة مشابهة:

إليك بعض استعلامات مستكشف البيانات للحصول على تفاصيل حول تحميلات المنشورات. من الممكن إضافة شيء مشابه إلى قسم تقارير المشرفين للمواقع التي لا تحتوي على إضافة مستكشف البيانات. أخبرني إذا كانت هذه البيانات ليست ما تبحث عنه.

أي مستخدمين لديهم أكبر عدد من التحميلات أو أكبر حجم؟

يعيد الاستعلام المستخدم، وعدد التحميلات الخاصة به، وإجمالي حجم التحميلات بالكيلوبايت مقربًا إلى منزلتين عشريتين. يتم الانضمام إلى جدول users لمنع إرجاع بيانات المستخدمين المحذوفين. يتم ترتيب النتائج حسب الحجم الإجمالي للتحميل تنازليًا.

شاملة الصور المحسنة

WITH uploads_with_optimized AS (
SELECT
ul.user_id,
ROUND((SUM(COALESCE(oi.filesize, 0)) + SUM(ul.filesize)) / 1000.0, 2) AS total_kb
FROM post_uploads pul
JOIN uploads ul
ON ul.id = pul.upload_id
LEFT JOIN optimized_images oi
ON ul.id = oi.upload_id
GROUP BY ul.user_id
)

SELECT
uwo.user_id,
COUNT(uploads.user_id) AS upload_count,
total_kb
FROM uploads_with_optimized uwo
JOIN uploads
ON uploads.user_id = uwo.user_id
GROUP BY uploads.user_id, uwo.user_id, total_kb
ORDER BY total_kb DESC
LIMIT 50

مستثنية الصور المحسنة

SELECT
ul.user_id,
COUNT(ul.user_id) AS upload_count,
ROUND(SUM(ul.filesize) / 1000.0, 2) AS total_kb
FROM post_uploads pul
JOIN uploads ul
ON ul.id = pul.upload_id
GROUP BY ul.user_id
ORDER BY total_kb DESC
LIMIT 50

ما هي أكبر 100 تحميل في منتداك؟

يعيد الاستعلام المستخدم، والمنشور الذي يحتوي على التحميل، وحجم ملف التحميل بالكيلوبايت. يتم ترتيب النتائج حسب حجم التحميل تنازليًا.

شاملة الصور المحسنة

SELECT
ul.user_id,
pul.post_id,
ROUND((SUM(oi.filesize) + ul.filesize) / 1000.0, 2) AS total_kb
FROM post_uploads pul
JOIN uploads ul
ON ul.id = pul.upload_id
JOIN optimized_images oi
ON ul.id = oi.upload_id
GROUP BY oi.upload_id, ul.user_id, pul.post_id, ul.filesize
ORDER BY total_kb DESC
LIMIT 100

مستثنية الصور المحسنة

SELECT
ul.user_id,
pul.post_id,
ROUND(ul.filesize / 1000.0, 2) AS total_kb
FROM post_uploads pul
JOIN uploads ul
ON ul.id = pul.upload_id
ORDER BY total_kb DESC
LIMIT 100

التحميلات خلال الـ 30 يومًا الماضية

يتطلب الاستعلام تزويده بمعامل :end_date. يجب أن يكون التاريخ بصيغة ‘yyyy-mm-dd’. على سبيل المثال ‘2020-01-08’. يعيد النتائج لفترة الـ 30 يومًا التي تنتهي بتاريخ end_date. يعيد اليوم، وعدد التحميلات، والإجمالي اليومي للتحميلات بالكيلوبايت لأي أيام في الفترة تحتوي على تحميلات منشورات. يتم ترتيب النتائج حسب اليوم.

شاملة الصور المحسنة

--[params]
-- date :end_date

SELECT
ul.created_at::date AS day,
COUNT(1) AS upload_count,
ROUND((SUM(COALESCE(oi.filesize, 0)) + SUM(ul.filesize)) / 1000.0, 2) AS total_kb
FROM post_uploads pul
JOIN uploads ul
ON ul.id = pul.upload_id
LEFT JOIN optimized_images oi
ON ul.id = oi.upload_id
WHERE ul.created_at::date BETWEEN :end_date::date - INTERVAL '30 days' AND :end_date
GROUP BY ul.created_at::date
ORDER BY ul.created_at::date DESC

مستثنية الصور المحسنة

--[params]
-- date :end_date

SELECT
ul.created_at::date AS day,
COUNT(1) AS upload_count,
ROUND(SUM(ul.filesize) / 1000.0, 2) AS daily_upload_kb
FROM post_uploads pul
JOIN uploads ul
ON ul.id = pul.upload_id
WHERE ul.created_at::date BETWEEN :end_date::date - INTERVAL '30 days' AND :end_date
GROUP BY ul.created_at::date
ORDER BY ul.created_at::date DESC

11 إعجابًا

أنا عضو جديد في المجتمع (meta)، وقد توليت مؤخرًا مسؤوليات الإدارة لمجتمع آخر يستخدم Discourse (والمُستضاف بواسطة Discourse). في لوحة التحكم، رأيت للتو “قفزة” في المساحة التي تشغلها الملفات المرفوعة (من حوالي 0.7 جيجابايت إلى 1.2 جيجابايت). يبدو أن مستكشف البيانات متاح فقط للخطط التجارية وما فوق… هل توجد أي طريقة أخرى لمعرفة الملفات الأخيرة التي تستهلك الـ 0.5 جيجابايت الإضافية؟

إعجابَين (2)

هذا خطأ كليًا مني.

كان لدينا خطأ كبير في الماضي حيث لم نكن نحسب حجم جميع التحميلات بشكل صحيح.

عندما يقوم المستخدم بتحميل صورة، نقوم غالبًا بتغيير حجمها من 3 إلى 4 مرات للحصول على دقات和优化 مختلفة. تُخزن هذه الصور المُحسّنة في السحابة ولا تزال تستهلك مساحة تخزين.

لرؤية الصور الفعلية، يمكنك:

SELECT * FROM optimized_images

@simon ربما تحتاج إلى تحديث ما سبق ليأخذ في الاعتبار optimized_images؟

5 إعجابات

آه، هذا منطقي جدًا. لقد تساءلتُ لفترة وجيزة عما إذا كان ذلك ممكنًا—بعد أن كتبتُ المنشور هنا :wink:

هه، ربما يستحق الأمر إضافة جملة موجزة بهذا المعنى على مؤشر التخزين في لوحة التحكم، حتى لا يظن الناس أن شخصًا ما يستنزف مساحة التخزين الخاصة بهم ببيانات مجهولة :wink:

وإذا أنشأتَ يومًا ما “مُفتش الملفات المرفوعة” لا يتطلب إضافات خطة الأعمال، فسنكون ممتنين جدًا لذلك!!

تحياتي!

4 إعجابات

أخيراً، لم أفهم كيف يمكنني رؤية قائمة برفع الأعضاء في مواضيع ومنشورات مختلفة!!؟

إعجاب واحد (1)

أود تصفح دليل الملفات المرفوعة. حالة الاستخدام الخاصة بي هي التحقيق في تفاصيل هذا الرابط التالف:

أي دعم إداري مُفسَّر للقيام بذلك سيكون عونًا كبيرًا. أم أنني أغفلت شيئًا؟

مع أطيب التحيات،
R

إعجاب واحد (1)

هناك حل بديل آخر يتمثل في:

  • إنشاء وتنزيل نسخة احتياطية للموقع مع “تضمين التحميلات”
  • الانتقال إلى هذا الأرشيف وفك ضغطه، على سبيل المثال من سطر الأوامر: $ tar -xvzf xxxx.tar.gz
  • التبديل إلى دليل التحميلات: $ cd uploads
  • الاختيار بين الأقسام الأصلية والمحسّنة واستكشاف شجرة الملفات الناتجة
  • لا توجد أسماء تحميلات، جميع الأسماء تستخدم سلاسل عشوائية (أو مشفرة)

توفر واجهة رسومية في بوابة المسؤول تجربة مستخدم أفضل. لذا صوتي لصالح هذه الوظيفة.

إعجاب واحد (1)