master
11617 2 years ago
parent 142f4b2147
commit fb6539a6c8
  1. 4
      App/views.py
  2. 3
      djangoProject/settings.py
  3. 3
      docker-compose.yml
  4. 3
      docker-entrypoint.sh
  5. 2
      templates/nav/dashboard.html
  6. 10
      templates/nav/videolist.html

@ -112,7 +112,7 @@ def dashboard(request, type):
t = 6
if type == 'login':
data = getData(username, t)
table = Login.objects.filter(username=username).order_by('-login_time').all()[:30]
table = Login.objects.order_by('-login_time').all()[:30]
elif type == 'docs':
data = getData(username, t, 'docs')
table = Upload.objects.filter(username=username).order_by('-upload_time').all()[:100]
@ -225,7 +225,6 @@ def getData(username, time, type='login'):
data.update({str(date): videoUpload.objects.filter(video_time__startswith=date).count()})
elif type == 'package':
data.update({str(date): packageUpload.objects.filter(package_time__startswith=date).count()})
print(data)
return data
@ -275,7 +274,6 @@ def checkTask(request, id):
if request.method == 'POST':
url = request.get_raw_uri().split('?')[0]
if eval(request.COOKIES.get(f'sign{id}', '{}')).get('url') != url:
print(request.COOKIES,url)
task = Task.objects.get(id=id)
jsondata = json.loads(task.task_content)
jsondata['userlist'][request.GET.get('name')] = {'status': '已完成', 'update_time': str(datetime.datetime.now())}

@ -79,7 +79,7 @@ DATABASES = {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'object',
'USER': 'root',
'PASSWORD': 'Qianfeng@123',
'PASSWORD': 'QianFeng@123',
'HOST': 'mysql.server'
}
@ -137,7 +137,6 @@ STATIC_URL = '/staticfiles/'
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static'),
os.path.join(BASE_DIR, 'upload'),
os.path.join(BASE_DIR, 'staticfiles'),
)
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
# Default primary key field type

@ -9,6 +9,9 @@ services:
links:
- db:mysql.server
- redis:redis.server
volumes:
- ../upload:/webapp/upload
- /data/nextcloud/app/data/admin/files/随堂视频:/data/nextcloud/app/data/admin/files/随堂视频
depends_on:
- db
- redis

@ -7,4 +7,5 @@ gunicorn --workers 8 \
--bind 0.0.0.0:8000 \
djangoProject.wsgi:application \
--log-level info \
--access-logfile /var/log/myblog.log
--access-logfile /var/log/myblog.log \
--timeout 3600

@ -91,6 +91,7 @@
<thead>
<tr>
<th scope="col">登录时间</th>
<th scope="col">用户</th>
<th scope="col">登录IP</th>
<th scope="col">国家</th>
<th scope="col"></th>
@ -101,6 +102,7 @@
{% for i in table %}
<tr>
<td>{{ i.login_time }}</td>
<td>{{ i.username }}</td>
<td>{{ i.client_addr }}</td>
<td>{{ i.country }}</td>
<td>{{ i.region }}</td>

@ -37,11 +37,11 @@
<div class="dy-video-meta">
<div class="dy-video-meta-bg"></div>
<div class="dy-video-meta-dy">
<h5 class="dy-video-title">{{ i.video_title }}</h5>
<span>文件大小:{{ i.video_size|filesizeformat }}</span> <br>
<span>上传用户:{{ i.username }} </span> <br>
<span>上传时间:{{ i.video_time }}</span> <br>
<span><a href="{% url 'App:videoDownload' i.id %}">点击下载</a></span>
<h5 class="dy-video-title" style="font-size: 10px">{{ i.video_title }}</h5>
<span style="font-size: 10px">文件大小:{{ i.video_size|filesizeformat }}</span> <br>
<span style="font-size: 10px">上传用户:{{ i.username }} </span> <br>
<span style="font-size: 10px">上传时间:{{ i.video_time }}</span> <br>
<span style="font-size: 10px"><a href="{% url 'App:videoDownload' i.id %}">点击下载</a></span>
<p class="dy-video-intro">本视频由千锋云计算持续维护,加速通道正在开发当中。</p>
</div>
<div class="dy-video-meta-bg"></div>

Loading…
Cancel
Save