Spaces:
Runtime error
Runtime error
thejagstudio
commited on
Commit
•
0a08d4d
1
Parent(s):
d9de285
Upload 30 files
Browse files- Dockerfile +7 -0
- client_secrets.json +1 -0
- cloudStorage/__init__.py +0 -0
- cloudStorage/asgi.py +16 -0
- cloudStorage/settings.py +145 -0
- cloudStorage/urls.py +24 -0
- cloudStorage/wsgi.py +16 -0
- home/__init__.py +0 -0
- home/admin.py +8 -0
- home/apps.py +6 -0
- home/migrations/0001_initial.py +26 -0
- home/migrations/0002_rename_data_userdata.py +19 -0
- home/migrations/0003_userdata_ip.py +18 -0
- home/migrations/0004_ip_address_remove_userdata_ip.py +24 -0
- home/migrations/0005_remove_userdata_files.py +16 -0
- home/migrations/__init__.py +0 -0
- home/models.py +11 -0
- home/tests.py +3 -0
- home/urls.py +17 -0
- home/views.py +228 -0
- manage.py +22 -0
- requirements.txt +0 -0
- templates/folder_list.html +130 -0
- templates/godMode.html +69 -0
- templates/index.html +310 -0
- templates/list.html +123 -0
- templates/login.html +98 -0
- templates/new.svg +1 -0
- templates/signup.html +97 -0
- templates/upload.html +145 -0
Dockerfile
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM python:3
|
2 |
+
WORKDIR /usr/src/app
|
3 |
+
COPY requirements.txt ./
|
4 |
+
RUN pip install -r requirements.txt
|
5 |
+
COPY . .
|
6 |
+
EXPOSE 7860
|
7 |
+
CMD ["python","./manage.py","runserver","0.0.0.0:7860"]
|
client_secrets.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"web":{"client_id":"895306463817-h14aujg3ohgptue5safg2d81530qs4c3.apps.googleusercontent.com","project_id":"cloudstore-424406","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://oauth2.googleapis.com/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_secret":"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","redirect_uris":["http://localhost:8080/","http://127.0.0.1:8000/"]}}
|
cloudStorage/__init__.py
ADDED
File without changes
|
cloudStorage/asgi.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""
|
2 |
+
ASGI config for cloudStorage project.
|
3 |
+
|
4 |
+
It exposes the ASGI callable as a module-level variable named ``application``.
|
5 |
+
|
6 |
+
For more information on this file, see
|
7 |
+
https://docs.djangoproject.com/en/4.0/howto/deployment/asgi/
|
8 |
+
"""
|
9 |
+
|
10 |
+
import os
|
11 |
+
|
12 |
+
from django.core.asgi import get_asgi_application
|
13 |
+
|
14 |
+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'cloudStorage.settings')
|
15 |
+
|
16 |
+
application = get_asgi_application()
|
cloudStorage/settings.py
ADDED
@@ -0,0 +1,145 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""
|
2 |
+
Django settings for cloudStorage project.
|
3 |
+
|
4 |
+
Generated by 'django-admin startproject' using Django 4.0.4.
|
5 |
+
|
6 |
+
For more information on this file, see
|
7 |
+
https://docs.djangoproject.com/en/4.0/topics/settings/
|
8 |
+
|
9 |
+
For the full list of settings and their values, see
|
10 |
+
https://docs.djangoproject.com/en/4.0/ref/settings/
|
11 |
+
"""
|
12 |
+
|
13 |
+
from pathlib import Path
|
14 |
+
import os
|
15 |
+
|
16 |
+
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
17 |
+
BASE_DIR = Path(__file__).resolve().parent.parent
|
18 |
+
|
19 |
+
|
20 |
+
# Quick-start development settings - unsuitable for production
|
21 |
+
# See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/
|
22 |
+
|
23 |
+
# SECURITY WARNING: keep the secret key used in production secret!
|
24 |
+
SECRET_KEY = 'django-insecure-f221fh+#lk4ul5x@gk7bm2x5f&+u3uhu+t-(bri%t(uh!z6gf#'
|
25 |
+
|
26 |
+
# SECURITY WARNING: don't run with debug turned on in production!
|
27 |
+
DEBUG = True
|
28 |
+
|
29 |
+
ALLOWED_HOSTS = ['127.0.0.1', 'cloudstorageunlimited.herokuapp.com', 'thejagstudio123.pythonanywhere.com']
|
30 |
+
|
31 |
+
|
32 |
+
# Application definition
|
33 |
+
|
34 |
+
INSTALLED_APPS = [
|
35 |
+
'django.contrib.admin',
|
36 |
+
'django.contrib.auth',
|
37 |
+
'django.contrib.contenttypes',
|
38 |
+
'django.contrib.sessions',
|
39 |
+
'django.contrib.messages',
|
40 |
+
'django.contrib.staticfiles',
|
41 |
+
'home',
|
42 |
+
]
|
43 |
+
|
44 |
+
MIDDLEWARE = [
|
45 |
+
'django.middleware.security.SecurityMiddleware',
|
46 |
+
'django.contrib.sessions.middleware.SessionMiddleware',
|
47 |
+
'django.middleware.common.CommonMiddleware',
|
48 |
+
'django.middleware.csrf.CsrfViewMiddleware',
|
49 |
+
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
50 |
+
'django.contrib.messages.middleware.MessageMiddleware',
|
51 |
+
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
52 |
+
]
|
53 |
+
|
54 |
+
ROOT_URLCONF = 'cloudStorage.urls'
|
55 |
+
|
56 |
+
TEMPLATES = [
|
57 |
+
{
|
58 |
+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
59 |
+
'DIRS': ['templates'],
|
60 |
+
'APP_DIRS': True,
|
61 |
+
'OPTIONS': {
|
62 |
+
'context_processors': [
|
63 |
+
'django.template.context_processors.debug',
|
64 |
+
'django.template.context_processors.request',
|
65 |
+
'django.contrib.auth.context_processors.auth',
|
66 |
+
'django.contrib.messages.context_processors.messages',
|
67 |
+
],
|
68 |
+
},
|
69 |
+
},
|
70 |
+
]
|
71 |
+
|
72 |
+
WSGI_APPLICATION = 'cloudStorage.wsgi.application'
|
73 |
+
|
74 |
+
|
75 |
+
# Database
|
76 |
+
# https://docs.djangoproject.com/en/4.0/ref/settings/#databases
|
77 |
+
|
78 |
+
DATABASES = {
|
79 |
+
'default': {
|
80 |
+
'ENGINE': 'django.db.backends.postgresql',
|
81 |
+
'NAME': 'postgres',
|
82 |
+
'USER': 'postgres.dfnawdyzwhxsjsyvlgbi',
|
83 |
+
'PORT': 5432,
|
84 |
+
'PASSWORD': 'luwNgwCcDNLbZ5qt',
|
85 |
+
'HOST': 'aws-0-ap-south-1.pooler.supabase.com',
|
86 |
+
}
|
87 |
+
}
|
88 |
+
# DATABASES = {
|
89 |
+
# 'default': {
|
90 |
+
# 'ENGINE': 'django.db.backends.sqlite3',
|
91 |
+
# 'NAME': BASE_DIR / 'db.sqlite3',
|
92 |
+
# }
|
93 |
+
# }
|
94 |
+
|
95 |
+
|
96 |
+
# Password validation
|
97 |
+
# https://docs.djangoproject.com/en/4.0/ref/settings/#auth-password-validators
|
98 |
+
|
99 |
+
AUTH_PASSWORD_VALIDATORS = [
|
100 |
+
{
|
101 |
+
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
|
102 |
+
},
|
103 |
+
{
|
104 |
+
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
|
105 |
+
},
|
106 |
+
{
|
107 |
+
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
|
108 |
+
},
|
109 |
+
{
|
110 |
+
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
|
111 |
+
},
|
112 |
+
]
|
113 |
+
|
114 |
+
|
115 |
+
# Internationalization
|
116 |
+
# https://docs.djangoproject.com/en/4.0/topics/i18n/
|
117 |
+
|
118 |
+
LANGUAGE_CODE = 'en-us'
|
119 |
+
|
120 |
+
TIME_ZONE = 'UTC'
|
121 |
+
|
122 |
+
USE_I18N = True
|
123 |
+
|
124 |
+
USE_TZ = True
|
125 |
+
|
126 |
+
|
127 |
+
# Static files (CSS, JavaScript, Images)
|
128 |
+
# https://docs.djangoproject.com/en/4.0/howto/static-files/
|
129 |
+
|
130 |
+
STATIC_URL = '/static/'
|
131 |
+
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
|
132 |
+
|
133 |
+
|
134 |
+
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
|
135 |
+
EMAIL_HOST = 'smtp.gmail.com'
|
136 |
+
EMAIL_USE_TLS = True
|
137 |
+
EMAIL_PORT = 587
|
138 |
+
EMAIL_HOST_USER = '[email protected]'
|
139 |
+
EMAIL_HOST_PASSWORD = 'Patel@99'
|
140 |
+
|
141 |
+
|
142 |
+
# Default primary key field type
|
143 |
+
# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field
|
144 |
+
|
145 |
+
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
cloudStorage/urls.py
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""cloudStorage URL Configuration
|
2 |
+
|
3 |
+
The `urlpatterns` list routes URLs to views. For more information please see:
|
4 |
+
https://docs.djangoproject.com/en/4.0/topics/http/urls/
|
5 |
+
Examples:
|
6 |
+
Function views
|
7 |
+
1. Add an import: from my_app import views
|
8 |
+
2. Add a URL to urlpatterns: path('', views.home, name='home')
|
9 |
+
Class-based views
|
10 |
+
1. Add an import: from other_app.views import Home
|
11 |
+
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
|
12 |
+
Including another URLconf
|
13 |
+
1. Import the include() function: from django.urls import include, path
|
14 |
+
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
15 |
+
"""
|
16 |
+
from django.contrib import admin
|
17 |
+
from django.urls import path,include
|
18 |
+
from django.conf import settings
|
19 |
+
from django.conf.urls.static import static
|
20 |
+
|
21 |
+
urlpatterns = [
|
22 |
+
path('admin/', admin.site.urls),
|
23 |
+
path('', include('home.urls')),
|
24 |
+
]
|
cloudStorage/wsgi.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""
|
2 |
+
WSGI config for cloudStorage project.
|
3 |
+
|
4 |
+
It exposes the WSGI callable as a module-level variable named ``application``.
|
5 |
+
|
6 |
+
For more information on this file, see
|
7 |
+
https://docs.djangoproject.com/en/4.0/howto/deployment/wsgi/
|
8 |
+
"""
|
9 |
+
|
10 |
+
import os
|
11 |
+
|
12 |
+
from django.core.wsgi import get_wsgi_application
|
13 |
+
|
14 |
+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'cloudStorage.settings')
|
15 |
+
|
16 |
+
application = get_wsgi_application()
|
home/__init__.py
ADDED
File without changes
|
home/admin.py
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from django.contrib import admin
|
2 |
+
from .models import Userdata
|
3 |
+
|
4 |
+
class UserdataAdmin(admin.ModelAdmin):
|
5 |
+
list_display = ['id','user_id']
|
6 |
+
search_fields = ['user_id']
|
7 |
+
|
8 |
+
admin.site.register(Userdata, UserdataAdmin)
|
home/apps.py
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from django.apps import AppConfig
|
2 |
+
|
3 |
+
|
4 |
+
class HomeConfig(AppConfig):
|
5 |
+
default_auto_field = 'django.db.models.BigAutoField'
|
6 |
+
name = 'home'
|
home/migrations/0001_initial.py
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Generated by Django 4.0.4 on 2022-04-13 11:06
|
2 |
+
|
3 |
+
from django.conf import settings
|
4 |
+
from django.db import migrations, models
|
5 |
+
import django.db.models.deletion
|
6 |
+
|
7 |
+
|
8 |
+
class Migration(migrations.Migration):
|
9 |
+
|
10 |
+
initial = True
|
11 |
+
|
12 |
+
dependencies = [
|
13 |
+
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
14 |
+
]
|
15 |
+
|
16 |
+
operations = [
|
17 |
+
migrations.CreateModel(
|
18 |
+
name='data',
|
19 |
+
fields=[
|
20 |
+
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
21 |
+
('folder', models.CharField(max_length=1000)),
|
22 |
+
('files', models.JSONField()),
|
23 |
+
('user_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
24 |
+
],
|
25 |
+
),
|
26 |
+
]
|
home/migrations/0002_rename_data_userdata.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Generated by Django 4.0.4 on 2022-04-13 11:31
|
2 |
+
|
3 |
+
from django.conf import settings
|
4 |
+
from django.db import migrations
|
5 |
+
|
6 |
+
|
7 |
+
class Migration(migrations.Migration):
|
8 |
+
|
9 |
+
dependencies = [
|
10 |
+
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
11 |
+
('home', '0001_initial'),
|
12 |
+
]
|
13 |
+
|
14 |
+
operations = [
|
15 |
+
migrations.RenameModel(
|
16 |
+
old_name='data',
|
17 |
+
new_name='Userdata',
|
18 |
+
),
|
19 |
+
]
|
home/migrations/0003_userdata_ip.py
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Generated by Django 4.0.4 on 2022-06-28 14:32
|
2 |
+
|
3 |
+
from django.db import migrations, models
|
4 |
+
|
5 |
+
|
6 |
+
class Migration(migrations.Migration):
|
7 |
+
|
8 |
+
dependencies = [
|
9 |
+
('home', '0002_rename_data_userdata'),
|
10 |
+
]
|
11 |
+
|
12 |
+
operations = [
|
13 |
+
migrations.AddField(
|
14 |
+
model_name='userdata',
|
15 |
+
name='ip',
|
16 |
+
field=models.CharField(default='', max_length=100),
|
17 |
+
),
|
18 |
+
]
|
home/migrations/0004_ip_address_remove_userdata_ip.py
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Generated by Django 4.0.4 on 2022-06-28 14:42
|
2 |
+
|
3 |
+
from django.db import migrations, models
|
4 |
+
|
5 |
+
|
6 |
+
class Migration(migrations.Migration):
|
7 |
+
|
8 |
+
dependencies = [
|
9 |
+
('home', '0003_userdata_ip'),
|
10 |
+
]
|
11 |
+
|
12 |
+
operations = [
|
13 |
+
migrations.CreateModel(
|
14 |
+
name='ip_address',
|
15 |
+
fields=[
|
16 |
+
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
17 |
+
('ip', models.CharField(default='', max_length=100)),
|
18 |
+
],
|
19 |
+
),
|
20 |
+
migrations.RemoveField(
|
21 |
+
model_name='userdata',
|
22 |
+
name='ip',
|
23 |
+
),
|
24 |
+
]
|
home/migrations/0005_remove_userdata_files.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Generated by Django 4.1.4 on 2024-05-25 08:01
|
2 |
+
|
3 |
+
from django.db import migrations
|
4 |
+
|
5 |
+
|
6 |
+
class Migration(migrations.Migration):
|
7 |
+
dependencies = [
|
8 |
+
("home", "0004_ip_address_remove_userdata_ip"),
|
9 |
+
]
|
10 |
+
|
11 |
+
operations = [
|
12 |
+
migrations.RemoveField(
|
13 |
+
model_name="userdata",
|
14 |
+
name="files",
|
15 |
+
),
|
16 |
+
]
|
home/migrations/__init__.py
ADDED
File without changes
|
home/models.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from django.db import models
|
2 |
+
from django.contrib.auth.models import User
|
3 |
+
|
4 |
+
|
5 |
+
class Userdata(models.Model):
|
6 |
+
user_id = models.ForeignKey(User, on_delete=models.CASCADE)
|
7 |
+
folder = models.CharField(max_length=1000)
|
8 |
+
|
9 |
+
|
10 |
+
class ip_address(models.Model):
|
11 |
+
ip = models.CharField(max_length=100, default="")
|
home/tests.py
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
from django.test import TestCase
|
2 |
+
|
3 |
+
# Create your tests here.
|
home/urls.py
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from django.urls import path, re_path
|
2 |
+
from . import views
|
3 |
+
|
4 |
+
urlpatterns = [
|
5 |
+
path('', views.index, name="index"),
|
6 |
+
path('login/', views.user_login, name="user_login"),
|
7 |
+
path('signup/', views.sign_up, name="sign_up"),
|
8 |
+
path('logout/', views.user_logout, name="user_logout"),
|
9 |
+
path('upload/', views.upload, name="upload"),
|
10 |
+
path('uploader/', views.uploader, name="uploader"),
|
11 |
+
path('list/', views.list, name="list"),
|
12 |
+
path('list/<str:id>/', views.folder_list, name="folder_list"),
|
13 |
+
path('deleteFile/', views.deleteFile, name="deleteFile"),
|
14 |
+
path('emailSender/', views.emailSender, name="emailSender"),
|
15 |
+
path('ip/', views.ipGetter, name="ipGetter"),
|
16 |
+
path('godmode/', views.godMode, name="godMode"),
|
17 |
+
]
|
home/views.py
ADDED
@@ -0,0 +1,228 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from django.shortcuts import render, redirect, HttpResponse
|
2 |
+
from django.contrib.auth import authenticate, login, logout
|
3 |
+
from django.contrib import messages
|
4 |
+
from django.contrib.auth.decorators import login_required
|
5 |
+
from django.contrib.auth.models import User
|
6 |
+
import json
|
7 |
+
from .models import Userdata, ip_address
|
8 |
+
import threading
|
9 |
+
from django.core.files.storage import FileSystemStorage
|
10 |
+
from django.conf import settings
|
11 |
+
from django.views.decorators.csrf import csrf_exempt, csrf_protect
|
12 |
+
from django.core.mail import send_mail
|
13 |
+
import os
|
14 |
+
from pydrive.auth import GoogleAuth
|
15 |
+
from pydrive.drive import GoogleDrive
|
16 |
+
import requests
|
17 |
+
import geocoder
|
18 |
+
import folium
|
19 |
+
|
20 |
+
gauth = GoogleAuth()
|
21 |
+
gauth.LoadCredentialsFile("mycreds.txt")
|
22 |
+
if gauth.credentials is None:
|
23 |
+
# Authenticate if they're not there
|
24 |
+
gauth.LocalWebserverAuth()
|
25 |
+
elif gauth.access_token_expired:
|
26 |
+
# Refresh them if expired
|
27 |
+
gauth.Refresh()
|
28 |
+
else:
|
29 |
+
# Initialize the saved creds
|
30 |
+
gauth.Authorize()
|
31 |
+
# Save the current credentials to a file
|
32 |
+
gauth.SaveCredentialsFile("mycreds.txt")
|
33 |
+
DRIVE = GoogleDrive(gauth)
|
34 |
+
|
35 |
+
|
36 |
+
def GoogleDriveUpload(filename, folder):
|
37 |
+
file1 = DRIVE.CreateFile({'title': filename, 'parents': [{'id': folder}]})
|
38 |
+
file1.SetContentFile("files/"+filename)
|
39 |
+
file1.Upload()
|
40 |
+
|
41 |
+
|
42 |
+
@csrf_exempt
|
43 |
+
def index(request):
|
44 |
+
context = {
|
45 |
+
'user': request.user
|
46 |
+
}
|
47 |
+
return render(request, 'index.html', context=context)
|
48 |
+
|
49 |
+
|
50 |
+
@csrf_exempt
|
51 |
+
def user_login(request):
|
52 |
+
if request.method == 'POST':
|
53 |
+
username = request.POST['username']
|
54 |
+
password = request.POST['password']
|
55 |
+
user = authenticate(request, username=username, password=password)
|
56 |
+
if user is not None:
|
57 |
+
login(request, user)
|
58 |
+
messages.success(request, ('You have been logged in!'))
|
59 |
+
# print('logged in')
|
60 |
+
return redirect('index')
|
61 |
+
else:
|
62 |
+
messages.success(request, ('Error logging in - please try again.'))
|
63 |
+
# print('error logging in')
|
64 |
+
return render(request, 'login.html')
|
65 |
+
return render(request, 'login.html')
|
66 |
+
|
67 |
+
|
68 |
+
@csrf_exempt
|
69 |
+
def sign_up(request):
|
70 |
+
if request.method == 'POST':
|
71 |
+
name = request.POST['name']
|
72 |
+
email = request.POST['email']
|
73 |
+
password = request.POST['password']
|
74 |
+
password2 = request.POST['password1']
|
75 |
+
user = authenticate(request, email=email, password=password)
|
76 |
+
if user is not None and password == password2:
|
77 |
+
login(request, user)
|
78 |
+
messages.success(request, ('You have been logged in!'))
|
79 |
+
# print('logged in')
|
80 |
+
return redirect('index')
|
81 |
+
elif user is None and password == password2:
|
82 |
+
user = User.objects.create_user(username=email, email=email, password=password, first_name=name)
|
83 |
+
user.save()
|
84 |
+
messages.success(request, ('Created new user!'))
|
85 |
+
login(request, user)
|
86 |
+
folder = '1N3uD81zuXY_23esOFWRvN2Fp4zEbCrzy'
|
87 |
+
new_folder = DRIVE.CreateFile({'title': name, 'mimeType': 'application/vnd.google-apps.folder', 'parents': [{'id': folder}]})
|
88 |
+
new_folder.Upload()
|
89 |
+
new_folder.InsertPermission({'type': 'user', 'value': email, 'role': 'writer'})
|
90 |
+
dataObj = Userdata(user_id=request.user, folder=new_folder['id'])
|
91 |
+
dataObj.save()
|
92 |
+
# print('new user created')
|
93 |
+
return redirect('index')
|
94 |
+
else:
|
95 |
+
pass
|
96 |
+
return render(request, 'signup.html')
|
97 |
+
|
98 |
+
|
99 |
+
@csrf_exempt
|
100 |
+
@login_required
|
101 |
+
def user_logout(request):
|
102 |
+
logout(request)
|
103 |
+
messages.success(request, ('You have been logged out!'))
|
104 |
+
# print('logged out')
|
105 |
+
return redirect('index')
|
106 |
+
|
107 |
+
|
108 |
+
@csrf_exempt
|
109 |
+
@login_required
|
110 |
+
def upload(request):
|
111 |
+
return render(request, 'upload.html')
|
112 |
+
|
113 |
+
|
114 |
+
@csrf_exempt
|
115 |
+
@login_required
|
116 |
+
def uploader(request):
|
117 |
+
if request.method == 'POST':
|
118 |
+
folder = 'files/'
|
119 |
+
file = request.FILES['file']
|
120 |
+
title = request.POST['title']
|
121 |
+
if title == '':
|
122 |
+
title = file.name
|
123 |
+
fs = FileSystemStorage(location=folder)
|
124 |
+
filename = fs.save(title, file)
|
125 |
+
# print(filename)
|
126 |
+
if file.name == '':
|
127 |
+
return redirect('../upload/')
|
128 |
+
folder_id = Userdata.objects.get(user_id=request.user).folder
|
129 |
+
thread = threading.Thread(target=GoogleDriveUpload, args=(title, folder_id))
|
130 |
+
thread.start()
|
131 |
+
thread.join()
|
132 |
+
os.remove(folder+"/"+filename)
|
133 |
+
return redirect('../upload/')
|
134 |
+
|
135 |
+
|
136 |
+
@csrf_exempt
|
137 |
+
@login_required
|
138 |
+
def list(request):
|
139 |
+
files = []
|
140 |
+
folders = []
|
141 |
+
folder_id = Userdata.objects.get(user_id=request.user).folder
|
142 |
+
list_files = DRIVE.ListFile({'q': "'%s' in parents and trashed=false" % folder_id}).GetList()
|
143 |
+
for file in list_files:
|
144 |
+
if file['title'] != 'Deleted' and file['title'] != 'DeletedFile' and file['mimeType'] != 'application/vnd.google-apps.folder':
|
145 |
+
files.append([file['title'], file['embedLink']])
|
146 |
+
elif file['mimeType'] == 'application/vnd.google-apps.folder':
|
147 |
+
folders.append([file['title'], "/list/"+file['id'][::-1]])
|
148 |
+
else:
|
149 |
+
pass
|
150 |
+
context = {'files': files, 'folders': folders}
|
151 |
+
return render(request, 'list.html', context=context)
|
152 |
+
|
153 |
+
|
154 |
+
@csrf_exempt
|
155 |
+
@login_required
|
156 |
+
def folder_list(request, id):
|
157 |
+
files = []
|
158 |
+
folders = []
|
159 |
+
folder_id = id[::-1] # Userdata.objects.get(user_id=request.user).folder
|
160 |
+
list_files = DRIVE.ListFile({'q': "'%s' in parents and trashed=false" % folder_id}).GetList()
|
161 |
+
for file in list_files:
|
162 |
+
if file['title'] != 'Deleted' and file['mimeType'] != 'application/vnd.google-apps.folder':
|
163 |
+
files.append([file['title'], file['embedLink']])
|
164 |
+
elif file['mimeType'] == 'application/vnd.google-apps.folder':
|
165 |
+
folders.append([file['title'], "/list/"+file['id'][::-1]])
|
166 |
+
else:
|
167 |
+
pass
|
168 |
+
context = {'files': files, 'folders': folders}
|
169 |
+
return render(request, 'folder_list.html', context=context)
|
170 |
+
|
171 |
+
|
172 |
+
@csrf_exempt
|
173 |
+
@login_required
|
174 |
+
def deleteFile(request):
|
175 |
+
if request.method == 'POST':
|
176 |
+
file_id = json.loads(request.body)['file_id']
|
177 |
+
print(file_id)
|
178 |
+
file = DRIVE.CreateFile({'id': file_id})
|
179 |
+
file.FetchMetadata(fields="title")
|
180 |
+
file['title'] = 'Deleted'
|
181 |
+
file.SetContentString('')
|
182 |
+
file.Upload()
|
183 |
+
return HttpResponse(json.dumps({'status': 'success'}), content_type='application/json')
|
184 |
+
|
185 |
+
|
186 |
+
def emailSender(request):
|
187 |
+
name = request.GET.get('name', '')
|
188 |
+
email = request.GET.get('email', '')
|
189 |
+
subject = request.GET.get('subject', '')
|
190 |
+
message = request.GET.get('message', '')
|
191 |
+
print(name, email, subject, message)
|
192 |
+
subject = subject + ' - ' + name + ' - ' + email
|
193 |
+
response = requests.get('https://script.google.com/macros/s/AKfycbwQxoJPZYttDmLEym7btUB2F-KIbvITr9EWSdfC5TaYJZybnA-s/[email protected]&subject='+subject+'&body='+message+'&html=false')
|
194 |
+
print(response.json())
|
195 |
+
'''message = message
|
196 |
+
from_email = settings.EMAIL_HOST_USER
|
197 |
+
to_email = settings.EMAIL_HOST_USER
|
198 |
+
send_mail(subject, message, from_email, [to_email], fail_silently=True)'''
|
199 |
+
return redirect('index')
|
200 |
+
|
201 |
+
# http://127.0.0.1:8000/emailSender/?name=jagrat%20patel&[email protected]&subject=sdsd&message=sdsfs
|
202 |
+
# https://script.google.com/macros/s/AKfycbwQxoJPZYttDmLEym7btUB2F-KIbvITr9EWSdfC5TaYJZybnA-s/[email protected]&subject=hello&body=world&html=false
|
203 |
+
|
204 |
+
|
205 |
+
def ipGetter(request):
|
206 |
+
ip = request.GET.get('ip', '')
|
207 |
+
ipIn = ip_address.objects.filter(ip=ip).first()
|
208 |
+
if ipIn is None:
|
209 |
+
new_entry = ip_address(ip=ip)
|
210 |
+
new_entry.save()
|
211 |
+
print(ip)
|
212 |
+
return HttpResponse(json.dumps({'status': 'success'}), content_type='application/json')
|
213 |
+
|
214 |
+
|
215 |
+
@login_required
|
216 |
+
def godMode(request):
|
217 |
+
if request.user.is_superuser:
|
218 |
+
ips = ip_address.objects.all()
|
219 |
+
ipF = ips[0].ip
|
220 |
+
g = geocoder.ip(ipF)
|
221 |
+
myAddress = g.latlng
|
222 |
+
my_map1 = folium.Map(location=myAddress, zoom_start=12)
|
223 |
+
for ip in ips:
|
224 |
+
g = geocoder.ip(ip.ip)
|
225 |
+
myAddress = g.latlng
|
226 |
+
folium.Marker(myAddress).add_to(my_map1)
|
227 |
+
my_map1.save('templates/godMode.html')
|
228 |
+
return render(request, 'godMode.html')
|
manage.py
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/usr/bin/env python
|
2 |
+
"""Django's command-line utility for administrative tasks."""
|
3 |
+
import os
|
4 |
+
import sys
|
5 |
+
|
6 |
+
|
7 |
+
def main():
|
8 |
+
"""Run administrative tasks."""
|
9 |
+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'cloudStorage.settings')
|
10 |
+
try:
|
11 |
+
from django.core.management import execute_from_command_line
|
12 |
+
except ImportError as exc:
|
13 |
+
raise ImportError(
|
14 |
+
"Couldn't import Django. Are you sure it's installed and "
|
15 |
+
"available on your PYTHONPATH environment variable? Did you "
|
16 |
+
"forget to activate a virtual environment?"
|
17 |
+
) from exc
|
18 |
+
execute_from_command_line(sys.argv)
|
19 |
+
|
20 |
+
|
21 |
+
if __name__ == '__main__':
|
22 |
+
main()
|
requirements.txt
ADDED
Binary file (1.63 kB). View file
|
|
templates/folder_list.html
ADDED
@@ -0,0 +1,130 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8" />
|
5 |
+
<title>List</title>
|
6 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
7 |
+
<style>
|
8 |
+
.issuu-embed-container {
|
9 |
+
position: relative;
|
10 |
+
padding-bottom: 56.25%; /* set the aspect ratio here as (height / width) * 100% */
|
11 |
+
height: 0;
|
12 |
+
overflow: hidden;
|
13 |
+
max-width: 100%;
|
14 |
+
}
|
15 |
+
.issuu-embed-container iframe {
|
16 |
+
position: absolute;
|
17 |
+
top: 0;
|
18 |
+
left: 0;
|
19 |
+
width: 100%;
|
20 |
+
height: 100%;
|
21 |
+
}
|
22 |
+
</style>
|
23 |
+
</head>
|
24 |
+
<body>
|
25 |
+
<div class="bg-white">
|
26 |
+
<header class="h-20 flex m-4 justify-between items-center mb-4">
|
27 |
+
<!-- logo - start -->
|
28 |
+
<a href="/" class="my-5 inline-flex items-center text-black-800 text-2xl md:text-3xl font-bold gap-2.5" aria-label="logo">
|
29 |
+
<svg class="w-[10%] text-indigo-500" id="outputsvg" xmlns="http://www.w3.org/2000/svg" style="transform: none; transform-origin: 50% 50%; cursor: move; transition: none 0s ease 0s" viewBox="0 0 3500 3500">
|
30 |
+
<g id="l5TLm6F9JGem8YOQ8A41YML" fill="rgb(100,103,241)" style="transform: none">
|
31 |
+
<g><path id="pulsHdoRs" d="M1455 3470 c-164 -30 -323 -83 -480 -160 -487 -242 -829 -689 -935 -1226 -28 -139 -37 -389 -21 -534 64 -550 390 -1040 879 -1319 170 -98 440 -186 642 -211 203 -24 460 -7 658 45 609 160 1093 651 1246 1263 120 479 34 978 -238 1387 -258 387 -641 646 -1101 745 -149 33 -495 38 -650 10z m488 -574 c37 -7 70 -15 72 -18 3 -3 -39 -24 -92 -48 -214 -94 -369 -196 -520 -343 -336 -327 -433 -761 -242 -1084 19 -31 67 -89 107 -130 40 -40 70 -73 67 -73 -15 0 -143 54 -225 95 -221 111 -505 336 -517 410 -9 55 17 270 43 362 121 418 441 719 869 818 117 28 326 33 438 11z m360 -132 c271 -152 315 -279 149 -436 -70 -67 -94 -78 -165 -78 -46 0 -61 6 -127 51 -90 62 -156 92 -258 121 -65 17 -95 20 -187 15 -153 -7 -269 -48 -381 -133 -27 -21 -44 -31 -38 -23 110 147 205 237 364 343 100 67 296 166 395 199 l70 24 55 -23 c30 -12 85 -39 123 -60z m-1463 -1370 c262 -187 520 -287 807 -314 125 -12 210 -3 313 31 81 26 86 29 188 96 128 86 196 84 296 -8 59 -54 106 -135 106 -183 -1 -41 -30 -104 -66 -139 -47 -47 -187 -136 -271 -172 -299 -129 -612 -133 -916 -10 -250 102 -488 336 -599 590 -42 96 -74 194 -83 254 l-7 44 73 -64 c41 -36 112 -92 159 -125z"></path></g>
|
32 |
+
</g>
|
33 |
+
</svg>
|
34 |
+
Cloud Storage
|
35 |
+
</a>
|
36 |
+
<!-- logo - end -->
|
37 |
+
|
38 |
+
<!-- nav - start -->
|
39 |
+
<nav class="hidden lg:flex gap-12">
|
40 |
+
<a href="../" class="text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">Home</a>
|
41 |
+
<a href="../list" class="text-indigo-500 text-lg font-semibold">List</a>
|
42 |
+
<a href="../upload" class="text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">Upload</a>
|
43 |
+
<a href="../logout" class="text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">Logout</a>
|
44 |
+
</nav>
|
45 |
+
<!-- nav - end -->
|
46 |
+
|
47 |
+
<!-- buttons - start -->
|
48 |
+
<div id="nav" onmouseout="outB()" onmouseover="inB()" class="overflow-visible z-10 mt-[150px] grid grid-cols-1 grid-rows-5">
|
49 |
+
<button type="button" class="shadow-xl inline-flex items-center lg:hidden bg-gray-200 hover:bg-gray-300 focus-visible:ring ring-indigo-300 text-gray-500 active:text-gray-700 text-sm md:text-base font-semibold rounded-lg gap-2 px-2.5 py-2">
|
50 |
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" viewBox="0 0 20 20" fill="currentColor">
|
51 |
+
<path fill-rule="evenodd" d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h6a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z" clip-rule="evenodd" />
|
52 |
+
</svg>
|
53 |
+
Menu
|
54 |
+
</button>
|
55 |
+
<a href="../" class="mt-2 hidden bg-white rounded-t-lg px-2 text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">Home</a>
|
56 |
+
<a href="../list" class="shadow-xl hidden bg-white px-2 text-indigo-500 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">List</a>
|
57 |
+
<a href="../upload" class="shadow-xl hidden bg-white px-2 text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">Upload</a>
|
58 |
+
<a href="../logout" class="shadow-xl hidden bg-white px-2 text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100 rounded-b-lg">Logout</a>
|
59 |
+
</div>
|
60 |
+
<!-- buttons - end -->
|
61 |
+
</header>
|
62 |
+
<button onclick="history.back()" class="bg-indigo-500 hover:bg-indigo-400 text-white mx-8 font-bold p-3 mb-3 rounded-lg inline-flex items-center">
|
63 |
+
<svg class="fill-current w-4 h-4 mr-2" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-left" viewBox="0 0 16 16">
|
64 |
+
<path fill-rule="evenodd" d="M15 8a.5.5 0 0 0-.5-.5H2.707l3.147-3.146a.5.5 0 1 0-.708-.708l-4 4a.5.5 0 0 0 0 .708l4 4a.5.5 0 0 0 .708-.708L2.707 8.5H14.5A.5.5 0 0 0 15 8z" />
|
65 |
+
</svg>
|
66 |
+
|
67 |
+
<span>Back</span>
|
68 |
+
</button>
|
69 |
+
<div class="max-w-screen-2xl px-4 md:px-8 mx-auto">
|
70 |
+
<div class="grid sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-x-4 md:gap-x-6 gap-y-8">
|
71 |
+
{% for file in folders%}
|
72 |
+
<!-- product - start -->
|
73 |
+
<div onclick="location.href = '{{ file.1 }}';">
|
74 |
+
<a class="shadow-lg h-60 group block bg-gray-100 rounded-lg overflow-hidden relative mb-2 lg:mb-3">
|
75 |
+
<img style="max-width: 100%; max-height: 80%; display: block; margin-left: auto; margin-right: auto" src="https://i.ibb.co/GxpmwzS/blue-folder-icon-774519.png" />
|
76 |
+
<div class="flex flex-nowrap">
|
77 |
+
<h1 class="w-[80%] m-3 text-gray-600 font-bold hover:gray-800 lg:text-lg transition duration-100 mb-1 truncate">{{ file.0 }}</h1>
|
78 |
+
<svg class="m-4 bi bi-trash" onclick="deleteB(this)" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
|
79 |
+
<path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z" />
|
80 |
+
<path fill-rule="evenodd" d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z" />
|
81 |
+
</svg>
|
82 |
+
</div>
|
83 |
+
</a>
|
84 |
+
</div>
|
85 |
+
<!-- product - end -->
|
86 |
+
{% endfor %} {% for file in files%}
|
87 |
+
<!-- product - start -->
|
88 |
+
<div>
|
89 |
+
<a class="shadow-lg h-60 group block bg-gray-100 rounded-lg overflow-hidden relative mb-2 lg:mb-3">
|
90 |
+
<iframe width="100%" height="80%" src="{{ file.1 }}" frameborder="0" seamless=""></iframe>
|
91 |
+
<div class="flex flex-nowrap">
|
92 |
+
<h1 class="w-[80%] m-3 text-gray-600 font-bold hover:gray-800 lg:text-lg transition duration-100 mb-1 truncate">{{ file.0 }}</h1>
|
93 |
+
<svg class="m-4 bi bi-trash" onclick="deleteB(this)" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
|
94 |
+
<path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z" />
|
95 |
+
<path fill-rule="evenodd" d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z" />
|
96 |
+
</svg>
|
97 |
+
</div>
|
98 |
+
</a>
|
99 |
+
</div>
|
100 |
+
<!-- product - end -->
|
101 |
+
{% endfor %}
|
102 |
+
</div>
|
103 |
+
</div>
|
104 |
+
</div>
|
105 |
+
<script>
|
106 |
+
function deleteB(element) {
|
107 |
+
element.parentNode.parentNode.parentNode.remove();
|
108 |
+
var id = element.parentNode.parentNode.children[0].src.split("/")[5];
|
109 |
+
fetch("../deleteFile/", {
|
110 |
+
method: "POST",
|
111 |
+
body: JSON.stringify({ file_id: id }),
|
112 |
+
});
|
113 |
+
}
|
114 |
+
</script>
|
115 |
+
<script>
|
116 |
+
function inB(event) {
|
117 |
+
ass = document.getElementById("nav").getElementsByTagName("a");
|
118 |
+
for (let i = 0; i < ass.length; i++) {
|
119 |
+
ass[i].classList.remove("hidden");
|
120 |
+
}
|
121 |
+
}
|
122 |
+
function outB(event) {
|
123 |
+
ass = document.getElementById("nav").getElementsByTagName("a");
|
124 |
+
for (let i = 0; i < ass.length; i++) {
|
125 |
+
ass[i].classList.add("hidden");
|
126 |
+
}
|
127 |
+
}
|
128 |
+
</script>
|
129 |
+
</body>
|
130 |
+
</html>
|
templates/godMode.html
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<head>
|
3 |
+
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
4 |
+
|
5 |
+
<script>
|
6 |
+
L_NO_TOUCH = false;
|
7 |
+
L_DISABLE_3D = false;
|
8 |
+
</script>
|
9 |
+
|
10 |
+
<style>html, body {width: 100%;height: 100%;margin: 0;padding: 0;}</style>
|
11 |
+
<style>#map {position:absolute;top:0;bottom:0;right:0;left:0;}</style>
|
12 |
+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/leaflet.js"></script>
|
13 |
+
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
|
14 |
+
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
|
15 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js"></script>
|
16 |
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/leaflet.css"/>
|
17 |
+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"/>
|
18 |
+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"/>
|
19 |
+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css"/>
|
20 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css"/>
|
21 |
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/python-visualization/folium/folium/templates/leaflet.awesome.rotate.min.css"/>
|
22 |
+
|
23 |
+
<meta name="viewport" content="width=device-width,
|
24 |
+
initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
25 |
+
<style>
|
26 |
+
#map_a56fa172756e09c586f80091ef3deb65 {
|
27 |
+
position: relative;
|
28 |
+
width: 100.0%;
|
29 |
+
height: 100.0%;
|
30 |
+
left: 0.0%;
|
31 |
+
top: 0.0%;
|
32 |
+
}
|
33 |
+
</style>
|
34 |
+
|
35 |
+
</head>
|
36 |
+
<body>
|
37 |
+
|
38 |
+
<div class="folium-map" id="map_a56fa172756e09c586f80091ef3deb65" ></div>
|
39 |
+
|
40 |
+
</body>
|
41 |
+
<script>
|
42 |
+
|
43 |
+
var map_a56fa172756e09c586f80091ef3deb65 = L.map(
|
44 |
+
"map_a56fa172756e09c586f80091ef3deb65",
|
45 |
+
{
|
46 |
+
center: [23.2167, 72.6833],
|
47 |
+
crs: L.CRS.EPSG3857,
|
48 |
+
zoom: 12,
|
49 |
+
zoomControl: true,
|
50 |
+
preferCanvas: false,
|
51 |
+
}
|
52 |
+
);
|
53 |
+
|
54 |
+
|
55 |
+
|
56 |
+
|
57 |
+
|
58 |
+
var tile_layer_d9dfbbec21cc9c231a48711de4a03ab3 = L.tileLayer(
|
59 |
+
"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
|
60 |
+
{"attribution": "Data by \u0026copy; \u003ca href=\"http://openstreetmap.org\"\u003eOpenStreetMap\u003c/a\u003e, under \u003ca href=\"http://www.openstreetmap.org/copyright\"\u003eODbL\u003c/a\u003e.", "detectRetina": false, "maxNativeZoom": 18, "maxZoom": 18, "minZoom": 0, "noWrap": false, "opacity": 1, "subdomains": "abc", "tms": false}
|
61 |
+
).addTo(map_a56fa172756e09c586f80091ef3deb65);
|
62 |
+
|
63 |
+
|
64 |
+
var marker_56241107a6a5ac22d4ad084ccfc25bf2 = L.marker(
|
65 |
+
[23.2167, 72.6833],
|
66 |
+
{}
|
67 |
+
).addTo(map_a56fa172756e09c586f80091ef3deb65);
|
68 |
+
|
69 |
+
</script>
|
templates/index.html
ADDED
@@ -0,0 +1,310 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8" />
|
5 |
+
<title>Cloud Storage</title>
|
6 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
7 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
|
8 |
+
</head>
|
9 |
+
<body>
|
10 |
+
<div class="bg-white pb-6 sm:pb-8 lg:pb-12">
|
11 |
+
<div class="max-w-screen-2xl px-4 md:px-8 mx-auto">
|
12 |
+
<header class="h-20 flex justify-between items-center py-4 md:py-8 mb-4">
|
13 |
+
<!-- logo - start -->
|
14 |
+
<a href="/" class="my-5 inline-flex items-center text-black-800 text-2xl md:text-3xl font-bold gap-2.5" aria-label="logo">
|
15 |
+
<svg class="w-[10%] text-indigo-500" id="outputsvg" xmlns="http://www.w3.org/2000/svg" style="transform: none; transform-origin: 50% 50%; cursor: move; transition: none 0s ease 0s" viewBox="0 0 3500 3500">
|
16 |
+
<g id="l5TLm6F9JGem8YOQ8A41YML" fill="rgb(100,103,241)" style="transform: none">
|
17 |
+
<g><path id="pulsHdoRs" d="M1455 3470 c-164 -30 -323 -83 -480 -160 -487 -242 -829 -689 -935 -1226 -28 -139 -37 -389 -21 -534 64 -550 390 -1040 879 -1319 170 -98 440 -186 642 -211 203 -24 460 -7 658 45 609 160 1093 651 1246 1263 120 479 34 978 -238 1387 -258 387 -641 646 -1101 745 -149 33 -495 38 -650 10z m488 -574 c37 -7 70 -15 72 -18 3 -3 -39 -24 -92 -48 -214 -94 -369 -196 -520 -343 -336 -327 -433 -761 -242 -1084 19 -31 67 -89 107 -130 40 -40 70 -73 67 -73 -15 0 -143 54 -225 95 -221 111 -505 336 -517 410 -9 55 17 270 43 362 121 418 441 719 869 818 117 28 326 33 438 11z m360 -132 c271 -152 315 -279 149 -436 -70 -67 -94 -78 -165 -78 -46 0 -61 6 -127 51 -90 62 -156 92 -258 121 -65 17 -95 20 -187 15 -153 -7 -269 -48 -381 -133 -27 -21 -44 -31 -38 -23 110 147 205 237 364 343 100 67 296 166 395 199 l70 24 55 -23 c30 -12 85 -39 123 -60z m-1463 -1370 c262 -187 520 -287 807 -314 125 -12 210 -3 313 31 81 26 86 29 188 96 128 86 196 84 296 -8 59 -54 106 -135 106 -183 -1 -41 -30 -104 -66 -139 -47 -47 -187 -136 -271 -172 -299 -129 -612 -133 -916 -10 -250 102 -488 336 -599 590 -42 96 -74 194 -83 254 l-7 44 73 -64 c41 -36 112 -92 159 -125z"></path></g>
|
18 |
+
</g>
|
19 |
+
</svg>
|
20 |
+
Cloud Storage
|
21 |
+
</a>
|
22 |
+
<!-- logo - end -->
|
23 |
+
|
24 |
+
<!-- nav - start -->
|
25 |
+
<nav class="hidden lg:flex gap-12">
|
26 |
+
<a href="./" class="text-indigo-500 text-lg font-semibold">Home</a>
|
27 |
+
{% if user.is_authenticated %}
|
28 |
+
<a href="./list" class="text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">List</a>
|
29 |
+
<a href="./upload" class="text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">Upload</a>
|
30 |
+
<a href="./logout" class="text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">Logout</a>
|
31 |
+
{% else %}
|
32 |
+
<a href="./login" class="text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">Login</a>
|
33 |
+
<a href="./signup" class="text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">Signup</a>
|
34 |
+
{% endif %}
|
35 |
+
</nav>
|
36 |
+
<!-- nav - end -->
|
37 |
+
|
38 |
+
<!-- buttons - start -->
|
39 |
+
<div id="nav" onmouseout="outB()" onmouseover="inB()" class="overflow-visible z-10 mt-[150px] grid grid-cols-1 grid-rows-5">
|
40 |
+
<button type="button" class="shadow-xl inline-flex items-center lg:hidden bg-gray-200 hover:bg-gray-300 focus-visible:ring ring-indigo-300 text-gray-500 active:text-gray-700 text-sm md:text-base font-semibold rounded-lg gap-2 px-2.5 py-2">
|
41 |
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" viewBox="0 0 20 20" fill="currentColor">
|
42 |
+
<path fill-rule="evenodd" d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h6a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z" clip-rule="evenodd" />
|
43 |
+
</svg>
|
44 |
+
Menu
|
45 |
+
</button>
|
46 |
+
<a href="./" class="shadow-xl hidden mt-2 rounded-t-lg bg-white px-2 text-indigo-500 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">Home</a>
|
47 |
+
{% if user.is_authenticated %}
|
48 |
+
<a href="./list" class="shadow-xl hidden bg-white px-2 text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">List</a>
|
49 |
+
<a href="./upload" class="shadow-xl hidden bg-white px-2 text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">Upload</a>
|
50 |
+
<a href="./logout" class="shadow-xl hidden bg-white px-2 text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100 rounded-b-lg">Logout</a>
|
51 |
+
{% else %}
|
52 |
+
<a href="./login" class="shadow-xl hidden bg-white px-2 text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">Login</a>
|
53 |
+
<a href="./signup" class="shadow-xl hidden bg-white px-2 text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100 rounded-b-lg">Signup</a>
|
54 |
+
{% endif %}
|
55 |
+
</div>
|
56 |
+
<!-- buttons - end -->
|
57 |
+
</header>
|
58 |
+
|
59 |
+
<section class="min-h-96 flex justify-center items-center flex-1 shrink-0 bg-gray-100 overflow-hidden shadow-lg rounded-lg relative py-16 md:py-20 xl:py-48">
|
60 |
+
<!-- image - start -->
|
61 |
+
<img src="https://images.unsplash.com/photo-1618004652321-13a63e576b80?auto=format&q=75&fit=crop&w=1500" loading="lazy" alt="Photo by Fakurian Design" class="w-full h-full object-cover object-center absolute inset-0" />
|
62 |
+
<!-- image - end -->
|
63 |
+
|
64 |
+
<!-- overlay - start -->
|
65 |
+
<div class="bg-indigo-500 mix-blend-multiply absolute inset-0"></div>
|
66 |
+
<!-- overlay - end -->
|
67 |
+
|
68 |
+
<!-- text start -->
|
69 |
+
<div class="sm:max-w-xl flex flex-col items-center relative p-4">
|
70 |
+
{% if user.is_authenticated %}
|
71 |
+
<p class="text-indigo-200 text-lg sm:text-xl text-center mb-4 md:mb-8">Welcome {{ user.username }}</p>
|
72 |
+
{% endif %}
|
73 |
+
<p class="text-indigo-200 text-lg sm:text-xl text-center mb-4 md:mb-8">Very proud to introduce</p>
|
74 |
+
<h1 class="text-white text-4xl sm:text-5xl md:text-6xl font-bold text-center mb-8 md:mb-12">Revolutionary way to store files online for free</h1>
|
75 |
+
</div>
|
76 |
+
<!-- text end -->
|
77 |
+
</section>
|
78 |
+
</div>
|
79 |
+
</div>
|
80 |
+
<!-- hero - end -->
|
81 |
+
|
82 |
+
<!-- gallery - start -->
|
83 |
+
<div class="bg-white py-6 sm:py-8 lg:py-12">
|
84 |
+
<div class="max-w-screen-2xl px-4 md:px-8 mx-auto">
|
85 |
+
<h2 class="text-gray-800 text-2xl lg:text-3xl font-bold text-center mb-4 md:mb-8 xl:mb-12">Gallery</h2>
|
86 |
+
|
87 |
+
<div class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4 md:gap-6 xl:gap-8 mb-4 md:mb-8">
|
88 |
+
<!-- image - start -->
|
89 |
+
<a class="group h-48 md:h-80 flex items-end bg-gray-100 overflow-hidden rounded-lg shadow-lg relative">
|
90 |
+
<img src="https://images.unsplash.com/photo-1593508512255-86ab42a8e620?auto=format&q=75&fit=crop&w=600" loading="lazy" alt="Photo by Minh Pham" class="w-full h-full object-cover object-center absolute inset-0 group-hover:scale-110 transition duration-200" />
|
91 |
+
|
92 |
+
<div class="bg-gradient-to-t from-gray-800 via-transparent to-transparent opacity-50 absolute inset-0 pointer-events-none"></div>
|
93 |
+
|
94 |
+
<span class="inline-block text-white text-sm md:text-lg relative ml-4 md:ml-5 mb-3">VR</span>
|
95 |
+
</a>
|
96 |
+
<!-- image - end -->
|
97 |
+
|
98 |
+
<!-- image - start -->
|
99 |
+
<a class="group h-48 md:h-80 flex items-end bg-gray-100 overflow-hidden rounded-lg shadow-lg relative">
|
100 |
+
<img src="https://images.unsplash.com/photo-1542759564-7ccbb6ac450a?auto=format&q=75&fit=crop&w=600" loading="lazy" alt="Photo by Magicle" class="w-full h-full object-cover object-center absolute inset-0 group-hover:scale-110 transition duration-200" />
|
101 |
+
|
102 |
+
<div class="bg-gradient-to-t from-gray-800 via-transparent to-transparent opacity-50 absolute inset-0 pointer-events-none"></div>
|
103 |
+
|
104 |
+
<span class="inline-block text-white text-sm md:text-lg relative ml-4 md:ml-5 mb-3">Tech</span>
|
105 |
+
</a>
|
106 |
+
<!-- image - end -->
|
107 |
+
|
108 |
+
<!-- image - start -->
|
109 |
+
<a class="group h-48 md:h-80 flex items-end bg-gray-100 overflow-hidden rounded-lg shadow-lg relative">
|
110 |
+
<img src="https://images.unsplash.com/photo-1610465299996-30f240ac2b1c?auto=format&q=75&fit=crop&w=600" loading="lazy" alt="Photo by Martin Sanchez" class="w-full h-full object-cover object-center absolute inset-0 group-hover:scale-110 transition duration-200" />
|
111 |
+
|
112 |
+
<div class="bg-gradient-to-t from-gray-800 via-transparent to-transparent opacity-50 absolute inset-0 pointer-events-none"></div>
|
113 |
+
|
114 |
+
<span class="inline-block text-white text-sm md:text-lg relative ml-4 md:ml-5 mb-3">Dev</span>
|
115 |
+
</a>
|
116 |
+
<!-- image - end -->
|
117 |
+
|
118 |
+
<!-- image - start -->
|
119 |
+
<a class="group h-48 md:h-80 flex items-end bg-gray-100 overflow-hidden rounded-lg shadow-lg relative">
|
120 |
+
<img src="https://images.unsplash.com/photo-1550745165-9bc0b252726f?auto=format&q=75&fit=crop&w=600" loading="lazy" alt="Photo by Lorenzo Herrera" class="w-full h-full object-cover object-center absolute inset-0 group-hover:scale-110 transition duration-200" />
|
121 |
+
|
122 |
+
<div class="bg-gradient-to-t from-gray-800 via-transparent to-transparent opacity-50 absolute inset-0 pointer-events-none"></div>
|
123 |
+
|
124 |
+
<span class="inline-block text-white text-sm md:text-lg relative ml-4 md:ml-5 mb-3">Retro</span>
|
125 |
+
</a>
|
126 |
+
<!-- image - end -->
|
127 |
+
</div>
|
128 |
+
|
129 |
+
<div class="flex justify-between items-start sm:items-center gap-8">
|
130 |
+
<p class="max-w-screen-sm text-gray-500 text-center text-sm lg:text-base">We are planning to extend our services in all domain, so that all users could get free and accessible services to all.</p>
|
131 |
+
</div>
|
132 |
+
</div>
|
133 |
+
</div>
|
134 |
+
<!-- gallery - end -->
|
135 |
+
<!-- team - start -->
|
136 |
+
<div class="bg-white py-6 sm:py-8 lg:py-12">
|
137 |
+
<div class="max-w-screen-xl px-4 md:px-8 mx-auto">
|
138 |
+
<!-- text - start -->
|
139 |
+
<div class="mb-10 md:mb-16">
|
140 |
+
<h2 class="text-gray-800 text-2xl lg:text-3xl font-bold text-center mb-4 md:mb-6">Meet our Team</h2>
|
141 |
+
<p class="max-w-screen-md text-gray-500 md:text-lg text-center mx-auto">We here at Cloud Storage use our team endeavour to create best quality products for everyone.</p>
|
142 |
+
</div>
|
143 |
+
<!-- text - end -->
|
144 |
+
|
145 |
+
<div class="grid grid-cols-2 md:grid-cols-2 gap-x-4 lg:gap-x-8 gap-y-8 lg:gap-y-12">
|
146 |
+
<!-- person - start -->
|
147 |
+
<div class="flex flex-col items-center">
|
148 |
+
<div class="w-24 md:w-32 h-24 md:h-32 bg-gray-100 rounded-full overflow-hidden shadow-lg mb-2 md:mb-4">
|
149 |
+
<img src="https://images.unsplash.com/photo-1567515004624-219c11d31f2e??auto=format&q=75&fit=crop&w=256" loading="lazy" alt="Photo by Radu Florin" class="w-full h-full object-cover object-center" />
|
150 |
+
</div>
|
151 |
+
|
152 |
+
<div>
|
153 |
+
<div class="text-indigo-500 md:text-lg font-bold text-center">Jagrat Patel</div>
|
154 |
+
<p class="text-gray-500 text-sm md:text-base text-center mb-3 md:mb-4">Founder / CEO</p>
|
155 |
+
</div>
|
156 |
+
</div>
|
157 |
+
<!-- person - end -->
|
158 |
+
|
159 |
+
<!-- person - start -->
|
160 |
+
<div class="flex flex-col items-center">
|
161 |
+
<div class="w-24 md:w-32 h-24 md:h-32 bg-gray-100 rounded-full overflow-hidden shadow-lg mb-2 md:mb-4">
|
162 |
+
<img src="https://i.ibb.co/8YfGzWg/Avtar-Icon-PNG-Image.jpg" loading="lazy" alt="Photo by christian ferrer" class="w-full h-full object-cover object-center" />
|
163 |
+
</div>
|
164 |
+
|
165 |
+
<div>
|
166 |
+
<div class="text-indigo-500 md:text-lg font-bold text-center">Jaivin Baroat</div>
|
167 |
+
<p class="text-gray-500 text-sm md:text-base text-center mb-3 md:mb-4">Founder / CFO</p>
|
168 |
+
</div>
|
169 |
+
</div>
|
170 |
+
<!-- person - end -->
|
171 |
+
</div>
|
172 |
+
</div>
|
173 |
+
</div>
|
174 |
+
<!-- team - end -->
|
175 |
+
|
176 |
+
<!-- call to action - start -->
|
177 |
+
<div class="bg-white py-6 sm:py-8 lg:py-12">
|
178 |
+
<div class="max-w-screen-2xl px-4 md:px-8 mx-auto">
|
179 |
+
<div class="rounded-2xl shadow-xl h-full flex flex-col sm:flex-row bg-whiterounded-lg overflow-hidden">
|
180 |
+
<!-- image - start -->
|
181 |
+
<div class="w-full sm:w-1/2 lg:w-2/5 h-48 sm:h-auto order-first sm:order-none bg-gray-300">
|
182 |
+
<img src="https://images.unsplash.com/photo-1525547719571-a2d4ac8945e2?auto=format&q=75&fit=crop&w=1000" loading="lazy" alt="Photo by Andras Vas" class="w-full h-full object-cover object-center" />
|
183 |
+
</div>
|
184 |
+
<!-- image - end -->
|
185 |
+
<div class="bg-white py-6 sm:py-8 lg:py-12 border-2 rounded-r-2xl">
|
186 |
+
<div class="w-full px-8 md:px-16 mx-auto">
|
187 |
+
<!-- text - start -->
|
188 |
+
<div class="mb-10 md:mb-16">
|
189 |
+
<h2 class="text-gray-800 text-2xl lg:text-3xl font-bold text-center mb-4 md:mb-6">Get in touch</h2>
|
190 |
+
|
191 |
+
<p class="max-w-screen-md text-gray-500 md:text-lg text-center mx-auto">Please fill free to contact us for any problems you have with our services. We will be happy to take input from you</p>
|
192 |
+
</div>
|
193 |
+
|
194 |
+
<div class="sm:col-span-2">
|
195 |
+
<label for="name" class="inline-block text-gray-800 text-sm sm:text-base mb-2">Name*</label>
|
196 |
+
<input name="name" id="name" class="w-full bg-gray-50 text-gray-800 border focus:ring ring-indigo-300 rounded outline-none transition duration-100 px-3 py-2" />
|
197 |
+
</div>
|
198 |
+
<div class="sm:col-span-2">
|
199 |
+
<label for="email" class="inline-block text-gray-800 text-sm sm:text-base mb-2">Email*</label>
|
200 |
+
<input name="email" id="email" class="w-full bg-gray-50 text-gray-800 border focus:ring ring-indigo-300 rounded outline-none transition duration-100 px-3 py-2" />
|
201 |
+
</div>
|
202 |
+
|
203 |
+
<div class="sm:col-span-2">
|
204 |
+
<label for="subject" class="inline-block text-gray-800 text-sm sm:text-base mb-2">Subject*</label>
|
205 |
+
<input name="subject" id="subject" class="w-full bg-gray-50 text-gray-800 border focus:ring ring-indigo-300 rounded outline-none transition duration-100 px-3 py-2" />
|
206 |
+
</div>
|
207 |
+
|
208 |
+
<div class="sm:col-span-2">
|
209 |
+
<label for="message" class="inline-block text-gray-800 text-sm sm:text-base mb-2">Message*</label>
|
210 |
+
<textarea name="message" id="message" class="w-full h-64 bg-gray-50 text-gray-800 border focus:ring ring-indigo-300 rounded outline-none transition duration-100 px-3 py-2"></textarea>
|
211 |
+
</div>
|
212 |
+
|
213 |
+
<div class="sm:col-span-2 flex justify-between items-center">
|
214 |
+
<button onclick="sendE()" class="inline-block bg-indigo-500 hover:bg-indigo-600 active:bg-indigo-700 focus-visible:ring ring-indigo-300 text-white text-sm md:text-base font-semibold text-center rounded-lg outline-none transition duration-100 px-8 py-3">Send</button>
|
215 |
+
|
216 |
+
<span class="text-gray-500 text-sm">*Required</span>
|
217 |
+
</div>
|
218 |
+
|
219 |
+
<p class="text-gray-400 text-xs">By signing up to our newsletter you agree to our <a class="hover:text-indigo-500 active:text-indigo-600 underline transition duration-100">Privacy Policy</a>.</p>
|
220 |
+
</div>
|
221 |
+
</div>
|
222 |
+
</div>
|
223 |
+
</div>
|
224 |
+
</div>
|
225 |
+
<!-- call to action - end -->
|
226 |
+
<!-- footer - start -->
|
227 |
+
<footer class="bg-white">
|
228 |
+
<div class="pt-12 lg:pt-16">
|
229 |
+
<div class="max-w-screen-2xl px-4 md:px-8 mx-auto">
|
230 |
+
<div class="grid grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-12 lg:gap-8 mb-16">
|
231 |
+
<div class="col-span-full lg:col-span-2">
|
232 |
+
<!-- logo - start -->
|
233 |
+
<div class="lg:-mt-2 mb-4">
|
234 |
+
<a href="/" class="my-5 inline-flex items-center text-black-800 text-2xl md:text-3xl font-bold gap-2.5" aria-label="logo">
|
235 |
+
<svg class="w-[10%] text-indigo-500" id="outputsvg" xmlns="http://www.w3.org/2000/svg" style="transform: none; transform-origin: 50% 50%; cursor: move; transition: none 0s ease 0s" viewBox="0 0 3500 3500">
|
236 |
+
<g id="l5TLm6F9JGem8YOQ8A41YML" fill="rgb(100,103,241)" style="transform: none">
|
237 |
+
<g><path id="pulsHdoRs" d="M1455 3470 c-164 -30 -323 -83 -480 -160 -487 -242 -829 -689 -935 -1226 -28 -139 -37 -389 -21 -534 64 -550 390 -1040 879 -1319 170 -98 440 -186 642 -211 203 -24 460 -7 658 45 609 160 1093 651 1246 1263 120 479 34 978 -238 1387 -258 387 -641 646 -1101 745 -149 33 -495 38 -650 10z m488 -574 c37 -7 70 -15 72 -18 3 -3 -39 -24 -92 -48 -214 -94 -369 -196 -520 -343 -336 -327 -433 -761 -242 -1084 19 -31 67 -89 107 -130 40 -40 70 -73 67 -73 -15 0 -143 54 -225 95 -221 111 -505 336 -517 410 -9 55 17 270 43 362 121 418 441 719 869 818 117 28 326 33 438 11z m360 -132 c271 -152 315 -279 149 -436 -70 -67 -94 -78 -165 -78 -46 0 -61 6 -127 51 -90 62 -156 92 -258 121 -65 17 -95 20 -187 15 -153 -7 -269 -48 -381 -133 -27 -21 -44 -31 -38 -23 110 147 205 237 364 343 100 67 296 166 395 199 l70 24 55 -23 c30 -12 85 -39 123 -60z m-1463 -1370 c262 -187 520 -287 807 -314 125 -12 210 -3 313 31 81 26 86 29 188 96 128 86 196 84 296 -8 59 -54 106 -135 106 -183 -1 -41 -30 -104 -66 -139 -47 -47 -187 -136 -271 -172 -299 -129 -612 -133 -916 -10 -250 102 -488 336 -599 590 -42 96 -74 194 -83 254 l-7 44 73 -64 c41 -36 112 -92 159 -125z"></path></g>
|
238 |
+
</g>
|
239 |
+
</svg>
|
240 |
+
Cloud Storage
|
241 |
+
</a>
|
242 |
+
</div>
|
243 |
+
<!-- logo - end -->
|
244 |
+
|
245 |
+
<p class="text-gray-500 sm:pr-8 mb-6">Our company wants to provide free and accessible storage service to everyone.</p>
|
246 |
+
|
247 |
+
<!-- social - start -->
|
248 |
+
<div class="flex gap-4">
|
249 |
+
<a href="https://www.instagram.com/thejagstudio/" target="_blank" class="text-gray-400 hover:text-gray-500 active:text-gray-600 transition duration-100">
|
250 |
+
<svg class="w-5 h-5" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
|
251 |
+
<path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z" />
|
252 |
+
</svg>
|
253 |
+
</a>
|
254 |
+
<a href="https://github.com/TheJagStudio" target="_blank" class="text-gray-400 hover:text-gray-500 active:text-gray-600 transition duration-100">
|
255 |
+
<svg class="w-5 h-5" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
|
256 |
+
<path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z" />
|
257 |
+
</svg>
|
258 |
+
</a>
|
259 |
+
</div>
|
260 |
+
<!-- social - end -->
|
261 |
+
</div>
|
262 |
+
</div>
|
263 |
+
|
264 |
+
<div class="text-gray-400 text-sm text-center border-t py-8">© 2022 - Present Cloud Storage. All rights reserved.</div>
|
265 |
+
</div>
|
266 |
+
</div>
|
267 |
+
</footer>
|
268 |
+
<script>
|
269 |
+
function inB(event) {
|
270 |
+
ass = document.getElementById("nav").getElementsByTagName("a");
|
271 |
+
for (let i = 0; i < ass.length; i++) {
|
272 |
+
ass[i].classList.remove("hidden");
|
273 |
+
}
|
274 |
+
}
|
275 |
+
function outB(event) {
|
276 |
+
ass = document.getElementById("nav").getElementsByTagName("a");
|
277 |
+
for (let i = 0; i < ass.length; i++) {
|
278 |
+
ass[i].classList.add("hidden");
|
279 |
+
}
|
280 |
+
}
|
281 |
+
function sendE() {
|
282 |
+
var name = document.getElementById("name").value;
|
283 |
+
var email = document.getElementById("email").value;
|
284 |
+
var subject = document.getElementById("subject").value;
|
285 |
+
var message = document.getElementById("message").value;
|
286 |
+
if (name == "" || email == "" || subject == "" || message == "") {
|
287 |
+
alert("All fileds are reqiured.");
|
288 |
+
} else {
|
289 |
+
alert("Thank You for your reply");
|
290 |
+
}
|
291 |
+
}
|
292 |
+
</script>
|
293 |
+
<script>
|
294 |
+
$.get("https://www.cloudflare.com/cdn-cgi/trace", function (data) {
|
295 |
+
data = data
|
296 |
+
.trim()
|
297 |
+
.split("\n")
|
298 |
+
.reduce(function (obj, pair) {
|
299 |
+
pair = pair.split("=");
|
300 |
+
return (obj[pair[0]] = pair[1]), obj;
|
301 |
+
}, {});
|
302 |
+
|
303 |
+
console.log(data["ip"]);
|
304 |
+
fetch("/ip?ip=" + data["ip"]).then(function (myJson) {
|
305 |
+
data["ip"];
|
306 |
+
});
|
307 |
+
});
|
308 |
+
</script>
|
309 |
+
</body>
|
310 |
+
</html>
|
templates/list.html
ADDED
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8" />
|
5 |
+
<title>List</title>
|
6 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
7 |
+
<style>
|
8 |
+
.issuu-embed-container {
|
9 |
+
position: relative;
|
10 |
+
padding-bottom: 56.25%; /* set the aspect ratio here as (height / width) * 100% */
|
11 |
+
height: 0;
|
12 |
+
overflow: hidden;
|
13 |
+
max-width: 100%;
|
14 |
+
}
|
15 |
+
.issuu-embed-container iframe {
|
16 |
+
position: absolute;
|
17 |
+
top: 0;
|
18 |
+
left: 0;
|
19 |
+
width: 100%;
|
20 |
+
height: 100%;
|
21 |
+
}
|
22 |
+
</style>
|
23 |
+
</head>
|
24 |
+
<body>
|
25 |
+
<div class="bg-white">
|
26 |
+
<header class="h-20 flex m-4 justify-between items-center mb-4">
|
27 |
+
<!-- logo - start -->
|
28 |
+
<a href="/" class="my-5 inline-flex items-center text-black-800 text-2xl md:text-3xl font-bold gap-2.5" aria-label="logo">
|
29 |
+
<svg class="w-[10%] text-indigo-500" id="outputsvg" xmlns="http://www.w3.org/2000/svg" style="transform: none; transform-origin: 50% 50%; cursor: move; transition: none 0s ease 0s" viewBox="0 0 3500 3500">
|
30 |
+
<g id="l5TLm6F9JGem8YOQ8A41YML" fill="rgb(100,103,241)" style="transform: none">
|
31 |
+
<g><path id="pulsHdoRs" d="M1455 3470 c-164 -30 -323 -83 -480 -160 -487 -242 -829 -689 -935 -1226 -28 -139 -37 -389 -21 -534 64 -550 390 -1040 879 -1319 170 -98 440 -186 642 -211 203 -24 460 -7 658 45 609 160 1093 651 1246 1263 120 479 34 978 -238 1387 -258 387 -641 646 -1101 745 -149 33 -495 38 -650 10z m488 -574 c37 -7 70 -15 72 -18 3 -3 -39 -24 -92 -48 -214 -94 -369 -196 -520 -343 -336 -327 -433 -761 -242 -1084 19 -31 67 -89 107 -130 40 -40 70 -73 67 -73 -15 0 -143 54 -225 95 -221 111 -505 336 -517 410 -9 55 17 270 43 362 121 418 441 719 869 818 117 28 326 33 438 11z m360 -132 c271 -152 315 -279 149 -436 -70 -67 -94 -78 -165 -78 -46 0 -61 6 -127 51 -90 62 -156 92 -258 121 -65 17 -95 20 -187 15 -153 -7 -269 -48 -381 -133 -27 -21 -44 -31 -38 -23 110 147 205 237 364 343 100 67 296 166 395 199 l70 24 55 -23 c30 -12 85 -39 123 -60z m-1463 -1370 c262 -187 520 -287 807 -314 125 -12 210 -3 313 31 81 26 86 29 188 96 128 86 196 84 296 -8 59 -54 106 -135 106 -183 -1 -41 -30 -104 -66 -139 -47 -47 -187 -136 -271 -172 -299 -129 -612 -133 -916 -10 -250 102 -488 336 -599 590 -42 96 -74 194 -83 254 l-7 44 73 -64 c41 -36 112 -92 159 -125z"></path></g>
|
32 |
+
</g>
|
33 |
+
</svg>
|
34 |
+
Cloud Storage
|
35 |
+
</a>
|
36 |
+
<!-- logo - end -->
|
37 |
+
|
38 |
+
<!-- nav - start -->
|
39 |
+
<nav class="hidden lg:flex gap-12">
|
40 |
+
<a href="../" class="text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">Home</a>
|
41 |
+
<a href="../list" class="text-indigo-500 text-lg font-semibold">List</a>
|
42 |
+
<a href="../upload" class="text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">Upload</a>
|
43 |
+
<a href="../logout" class="text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">Logout</a>
|
44 |
+
</nav>
|
45 |
+
<!-- nav - end -->
|
46 |
+
|
47 |
+
<!-- buttons - start -->
|
48 |
+
<div id="nav" onmouseout="outB()" onmouseover="inB()" class="overflow-visible z-10 mt-[150px] grid grid-cols-1 grid-rows-5">
|
49 |
+
<button type="button" class="shadow-xl inline-flex items-center lg:hidden bg-gray-200 hover:bg-gray-300 focus-visible:ring ring-indigo-300 text-gray-500 active:text-gray-700 text-sm md:text-base font-semibold rounded-lg gap-2 px-2.5 py-2">
|
50 |
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" viewBox="0 0 20 20" fill="currentColor">
|
51 |
+
<path fill-rule="evenodd" d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h6a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z" clip-rule="evenodd" />
|
52 |
+
</svg>
|
53 |
+
Menu
|
54 |
+
</button>
|
55 |
+
<a href="../" class="mt-2 hidden bg-white rounded-t-lg px-2 text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">Home</a>
|
56 |
+
<a href="../list" class="shadow-xl hidden bg-white px-2 text-indigo-500 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">List</a>
|
57 |
+
<a href="../upload" class="shadow-xl hidden bg-white px-2 text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">Upload</a>
|
58 |
+
<a href="../logout" class="shadow-xl hidden bg-white px-2 text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100 rounded-b-lg">Logout</a>
|
59 |
+
</div>
|
60 |
+
<!-- buttons - end -->
|
61 |
+
</header>
|
62 |
+
<div class="max-w-screen-2xl px-4 md:px-8 mx-auto">
|
63 |
+
<div class="grid sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-x-4 md:gap-x-6 gap-y-8">
|
64 |
+
{% for file in folders%}
|
65 |
+
<!-- product - start -->
|
66 |
+
<div onclick="location.href = '{{ file.1 }}';">
|
67 |
+
<a class="shadow-lg h-60 group block bg-gray-100 rounded-lg overflow-hidden relative mb-2 lg:mb-3 cursor-pointer">
|
68 |
+
<img style="max-width: 100%; max-height: 80%; display: block; margin-left: auto; margin-right: auto" src="https://cdn.icon-icons.com/icons2/1379/PNG/512/folderblue_92960.png" />
|
69 |
+
<div class="flex flex-nowrap">
|
70 |
+
<h1 class="w-[80%] m-3 text-gray-600 font-bold hover:gray-800 lg:text-lg transition duration-100 mb-1 truncate">{{ file.0 }}</h1>
|
71 |
+
<svg class="m-4 bi bi-trash" onclick="deleteB(this)" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
|
72 |
+
<path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z" />
|
73 |
+
<path fill-rule="evenodd" d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z" />
|
74 |
+
</svg>
|
75 |
+
</div>
|
76 |
+
</a>
|
77 |
+
</div>
|
78 |
+
<!-- product - end -->
|
79 |
+
{% endfor %} {% for file in files%}
|
80 |
+
<!-- product - start -->
|
81 |
+
<div>
|
82 |
+
<a class="shadow-lg h-60 group block bg-gray-100 rounded-lg overflow-hidden relative mb-2 lg:mb-3">
|
83 |
+
<iframe width="100%" height="80%" src="{{ file.1 }}" frameborder="0" seamless=""></iframe>
|
84 |
+
<div class="flex flex-nowrap">
|
85 |
+
<h1 class="w-[80%] m-3 text-gray-600 font-bold hover:gray-800 lg:text-lg transition duration-100 mb-1 truncate">{{ file.0 }}</h1>
|
86 |
+
<svg class="m-4 bi bi-trash" onclick="deleteB(this)" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
|
87 |
+
<path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z" />
|
88 |
+
<path fill-rule="evenodd" d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z" />
|
89 |
+
</svg>
|
90 |
+
</div>
|
91 |
+
</a>
|
92 |
+
</div>
|
93 |
+
<!-- product - end -->
|
94 |
+
{% endfor %}
|
95 |
+
</div>
|
96 |
+
</div>
|
97 |
+
</div>
|
98 |
+
<script>
|
99 |
+
function deleteB(element) {
|
100 |
+
element.parentNode.parentNode.parentNode.remove();
|
101 |
+
var id = element.parentNode.parentNode.children[0].src.split("/")[5];
|
102 |
+
fetch("../deleteFile/", {
|
103 |
+
method: "POST",
|
104 |
+
body: JSON.stringify({ file_id: id }),
|
105 |
+
});
|
106 |
+
}
|
107 |
+
</script>
|
108 |
+
<script>
|
109 |
+
function inB(event) {
|
110 |
+
ass = document.getElementById("nav").getElementsByTagName("a");
|
111 |
+
for (let i = 0; i < ass.length; i++) {
|
112 |
+
ass[i].classList.remove("hidden");
|
113 |
+
}
|
114 |
+
}
|
115 |
+
function outB(event) {
|
116 |
+
ass = document.getElementById("nav").getElementsByTagName("a");
|
117 |
+
for (let i = 0; i < ass.length; i++) {
|
118 |
+
ass[i].classList.add("hidden");
|
119 |
+
}
|
120 |
+
}
|
121 |
+
</script>
|
122 |
+
</body>
|
123 |
+
</html>
|
templates/login.html
ADDED
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
|
4 |
+
<head>
|
5 |
+
<meta charset="UTF-8">
|
6 |
+
<title>Login</title>
|
7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
8 |
+
</head>
|
9 |
+
|
10 |
+
<body>
|
11 |
+
|
12 |
+
<div class="bg-white pb-6 sm:pb-8 lg:pb-12">
|
13 |
+
<div class="max-w-screen-2xl px-4 md:px-8 mx-auto">
|
14 |
+
<header class="h-20 flex justify-between items-center py-4 md:py-8 mb-4">
|
15 |
+
<!-- logo - start -->
|
16 |
+
<a href="/" class="my-5 inline-flex items-center text-black-800 text-2xl md:text-3xl font-bold gap-2.5" aria-label="logo">
|
17 |
+
<svg class="w-[10%] text-indigo-500" id="outputsvg" xmlns="http://www.w3.org/2000/svg" style="transform: none; transform-origin: 50% 50%; cursor: move; transition: none 0s ease 0s;" viewBox="0 0 3500 3500">
|
18 |
+
<g id="l5TLm6F9JGem8YOQ8A41YML" fill="rgb(100,103,241)" style="transform: none;">
|
19 |
+
<g>
|
20 |
+
<path id="pulsHdoRs" d="M1455 3470 c-164 -30 -323 -83 -480 -160 -487 -242 -829 -689 -935 -1226 -28 -139 -37 -389 -21 -534 64 -550 390 -1040 879 -1319 170 -98 440 -186 642 -211 203 -24 460 -7 658 45 609 160 1093 651 1246 1263 120 479 34 978 -238 1387 -258 387 -641 646 -1101 745 -149 33 -495 38 -650 10z m488 -574 c37 -7 70 -15 72 -18 3 -3 -39 -24 -92 -48 -214 -94 -369 -196 -520 -343 -336 -327 -433 -761 -242 -1084 19 -31 67 -89 107 -130 40 -40 70 -73 67 -73 -15 0 -143 54 -225 95 -221 111 -505 336 -517 410 -9 55 17 270 43 362 121 418 441 719 869 818 117 28 326 33 438 11z m360 -132 c271 -152 315 -279 149 -436 -70 -67 -94 -78 -165 -78 -46 0 -61 6 -127 51 -90 62 -156 92 -258 121 -65 17 -95 20 -187 15 -153 -7 -269 -48 -381 -133 -27 -21 -44 -31 -38 -23 110 147 205 237 364 343 100 67 296 166 395 199 l70 24 55 -23 c30 -12 85 -39 123 -60z m-1463 -1370 c262 -187 520 -287 807 -314 125 -12 210 -3 313 31 81 26 86 29 188 96 128 86 196 84 296 -8 59 -54 106 -135 106 -183 -1 -41 -30 -104 -66 -139 -47 -47 -187 -136 -271 -172 -299 -129 -612 -133 -916 -10 -250 102 -488 336 -599 590 -42 96 -74 194 -83 254 l-7 44 73 -64 c41 -36 112 -92 159 -125z"></path>
|
21 |
+
</g>
|
22 |
+
</g>
|
23 |
+
</svg>
|
24 |
+
Cloud Storage
|
25 |
+
</a>
|
26 |
+
<!-- logo - end -->
|
27 |
+
|
28 |
+
<!-- nav - start -->
|
29 |
+
<nav class="hidden lg:flex gap-12">
|
30 |
+
<a href="#" class="text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">Home</a>
|
31 |
+
<a href="./login" class="text-indigo-500 text-lg font-semibold">Login</a>
|
32 |
+
<a href="../signup" class="text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">Signup</a>
|
33 |
+
</nav>
|
34 |
+
<!-- nav - end -->
|
35 |
+
|
36 |
+
<!-- buttons - start -->
|
37 |
+
<div id="nav" onmouseout="menu()" onmouseover="menu()" class="overflow-visible z-10 mt-[150px] grid grid-cols-1 grid-rows-5">
|
38 |
+
<button type="button" class="shadow-xl inline-flex items-center lg:hidden bg-gray-200 hover:bg-gray-300 focus-visible:ring ring-indigo-300 text-gray-500 active:text-gray-700 text-sm md:text-base font-semibold rounded-lg gap-2 px-2.5 py-2">
|
39 |
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" viewBox="0 0 20 20" fill="currentColor">
|
40 |
+
<path fill-rule="evenodd" d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h6a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z" clip-rule="evenodd" />
|
41 |
+
</svg>
|
42 |
+
Menu
|
43 |
+
</button>
|
44 |
+
<a href="../" class="shadow-xl hidden mt-2 rounded-t-lg bg-white px-2 text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">Home</a>
|
45 |
+
<a href="./login" class="shadow-xl hidden bg-white px-2 text-indigo-500 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">Login</a>
|
46 |
+
<a href="../signup" class="shadow-xl hidden bg-white px-2 text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">Signup</a>
|
47 |
+
</div>
|
48 |
+
<!-- buttons - end -->
|
49 |
+
</header>
|
50 |
+
</div>
|
51 |
+
</div>
|
52 |
+
<div class="bg-white py-6 sm:py-8 lg:py-12">
|
53 |
+
<div class="max-w-screen-2xl px-4 md:px-8 mx-auto">
|
54 |
+
<h2 class="text-gray-800 text-2xl lg:text-3xl font-bold text-center mb-4 md:mb-8">Login</h2>
|
55 |
+
|
56 |
+
<form method="POST" class="max-w-lg border rounded-lg mx-auto">
|
57 |
+
{% csrf_token %}
|
58 |
+
<div class="flex flex-col gap-4 p-4 md:p-8">
|
59 |
+
<div>
|
60 |
+
<label for="username" class="inline-block text-gray-800 text-sm sm:text-base mb-2">Username (email)</label>
|
61 |
+
<input name="username" type="email" placeholder="[email protected]" class="w-full bg-gray-50 text-gray-800 border focus:ring ring-indigo-300 rounded outline-none transition duration-100 px-3 py-2" />
|
62 |
+
</div>
|
63 |
+
|
64 |
+
<div>
|
65 |
+
<label for="password" class="inline-block text-gray-800 text-sm sm:text-base mb-2">Password</label>
|
66 |
+
<input name="password" type="password" class="w-full bg-gray-50 text-gray-800 border focus:ring ring-indigo-300 rounded outline-none transition duration-100 px-3 py-2" />
|
67 |
+
</div>
|
68 |
+
|
69 |
+
<button class="block bg-gray-800 hover:bg-gray-700 active:bg-gray-600 focus-visible:ring ring-gray-300 text-white text-sm md:text-base font-semibold text-center rounded-lg outline-none transition duration-100 px-8 py-3">Log in</button>
|
70 |
+
|
71 |
+
<div class="flex justify-center items-center bg-gray-100 p-4">
|
72 |
+
<p class="text-gray-500 text-sm text-center">Don't have an account? <a href="../signup" class="text-indigo-500 hover:text-indigo-600 active:text-indigo-700 transition duration-100">Register</a></p>
|
73 |
+
</div>
|
74 |
+
</form>
|
75 |
+
</div>
|
76 |
+
</div>
|
77 |
+
|
78 |
+
<script>
|
79 |
+
var flag = 1;
|
80 |
+
function menu(event) {
|
81 |
+
if (flag == 1) {
|
82 |
+
ass = document.getElementById("nav").getElementsByTagName('a');
|
83 |
+
for (let i = 0; i < ass.length; i++) {
|
84 |
+
ass[i].classList.remove("hidden");
|
85 |
+
}
|
86 |
+
flag = 0;
|
87 |
+
} else {
|
88 |
+
ass = document.getElementById("nav").getElementsByTagName('a');
|
89 |
+
for (let i = 0; i < ass.length; i++) {
|
90 |
+
ass[i].classList.add("hidden");
|
91 |
+
}
|
92 |
+
flag = 1;
|
93 |
+
}
|
94 |
+
}
|
95 |
+
</script>
|
96 |
+
</body>
|
97 |
+
|
98 |
+
</html>
|
templates/new.svg
ADDED
templates/signup.html
ADDED
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<title>SignUp</title>
|
6 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
7 |
+
</head>
|
8 |
+
<body>
|
9 |
+
|
10 |
+
<div class="bg-white pb-6 sm:pb-8 lg:pb-12">
|
11 |
+
<div class="max-w-screen-2xl px-4 md:px-8 mx-auto">
|
12 |
+
<header class="h-20 flex justify-between items-center py-4 md:py-8 mb-4">
|
13 |
+
<!-- logo - start -->
|
14 |
+
<a href="/" class="my-5 inline-flex items-center text-black-800 text-2xl md:text-3xl font-bold gap-2.5" aria-label="logo">
|
15 |
+
<svg class="w-[10%] text-indigo-500" id="outputsvg" xmlns="http://www.w3.org/2000/svg" style="transform: none; transform-origin: 50% 50%; cursor: move; transition: none 0s ease 0s;" viewBox="0 0 3500 3500"><g id="l5TLm6F9JGem8YOQ8A41YML" fill="rgb(100,103,241)" style="transform: none;"><g><path id="pulsHdoRs" d="M1455 3470 c-164 -30 -323 -83 -480 -160 -487 -242 -829 -689 -935 -1226 -28 -139 -37 -389 -21 -534 64 -550 390 -1040 879 -1319 170 -98 440 -186 642 -211 203 -24 460 -7 658 45 609 160 1093 651 1246 1263 120 479 34 978 -238 1387 -258 387 -641 646 -1101 745 -149 33 -495 38 -650 10z m488 -574 c37 -7 70 -15 72 -18 3 -3 -39 -24 -92 -48 -214 -94 -369 -196 -520 -343 -336 -327 -433 -761 -242 -1084 19 -31 67 -89 107 -130 40 -40 70 -73 67 -73 -15 0 -143 54 -225 95 -221 111 -505 336 -517 410 -9 55 17 270 43 362 121 418 441 719 869 818 117 28 326 33 438 11z m360 -132 c271 -152 315 -279 149 -436 -70 -67 -94 -78 -165 -78 -46 0 -61 6 -127 51 -90 62 -156 92 -258 121 -65 17 -95 20 -187 15 -153 -7 -269 -48 -381 -133 -27 -21 -44 -31 -38 -23 110 147 205 237 364 343 100 67 296 166 395 199 l70 24 55 -23 c30 -12 85 -39 123 -60z m-1463 -1370 c262 -187 520 -287 807 -314 125 -12 210 -3 313 31 81 26 86 29 188 96 128 86 196 84 296 -8 59 -54 106 -135 106 -183 -1 -41 -30 -104 -66 -139 -47 -47 -187 -136 -271 -172 -299 -129 -612 -133 -916 -10 -250 102 -488 336 -599 590 -42 96 -74 194 -83 254 l-7 44 73 -64 c41 -36 112 -92 159 -125z"></path></g></g></svg>
|
16 |
+
Cloud Storage
|
17 |
+
</a>
|
18 |
+
<!-- logo - end -->
|
19 |
+
|
20 |
+
<!-- nav - start -->
|
21 |
+
<nav class="hidden lg:flex gap-12">
|
22 |
+
<a href="#" class="text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">Home</a>
|
23 |
+
<a href="../login" class="text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">Login</a>
|
24 |
+
<a href="./signup" class="text-indigo-500 text-lg font-semibold">Signup</a>
|
25 |
+
</nav>
|
26 |
+
<!-- nav - end -->
|
27 |
+
|
28 |
+
<!-- buttons - start -->
|
29 |
+
<div id="nav" onmouseout="menu()" onmouseover="menu()" class="overflow-visible z-10 mt-[150px] grid grid-cols-1 grid-rows-5">
|
30 |
+
<button type="button" class="shadow-xl inline-flex items-center lg:hidden bg-gray-200 hover:bg-gray-300 focus-visible:ring ring-indigo-300 text-gray-500 active:text-gray-700 text-sm md:text-base font-semibold rounded-lg gap-2 px-2.5 py-2">
|
31 |
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" viewBox="0 0 20 20" fill="currentColor">
|
32 |
+
<path fill-rule="evenodd" d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h6a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z" clip-rule="evenodd" />
|
33 |
+
</svg>
|
34 |
+
Menu
|
35 |
+
</button>
|
36 |
+
<a href="../" class="shadow-xl hidden mt-2 rounded-t-lg bg-white px-2 text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">Home</a>
|
37 |
+
<a href="../login" class="shadow-xl hidden bg-white px-2 text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">Login</a>
|
38 |
+
<a href="./signup" class="shadow-xl hidden bg-white px-2 text-indigo-500 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">Signup</a>
|
39 |
+
</div>
|
40 |
+
<!-- buttons - end -->
|
41 |
+
</header>
|
42 |
+
</div>
|
43 |
+
</div>
|
44 |
+
<div class="bg-white py-6 sm:py-8 lg:py-12">
|
45 |
+
<div class="max-w-screen-2xl px-4 md:px-8 mx-auto">
|
46 |
+
<h2 class="text-gray-800 text-2xl lg:text-3xl font-bold text-center mb-4 md:mb-8">Signup</h2>
|
47 |
+
|
48 |
+
<form method="POST" class="max-w-lg border rounded-lg mx-auto">
|
49 |
+
{% csrf_token %}
|
50 |
+
<div class="flex flex-col gap-4 p-4 md:p-8">
|
51 |
+
<div>
|
52 |
+
<label for="name" class="inline-block text-gray-800 text-sm sm:text-base mb-2">Name</label>
|
53 |
+
<input name="name" id="name" type="text" class="w-full bg-gray-50 text-gray-800 border focus:ring ring-indigo-300 rounded outline-none transition duration-100 px-3 py-2" />
|
54 |
+
</div>
|
55 |
+
<div>
|
56 |
+
<label for="email" class="inline-block text-gray-800 text-sm sm:text-base mb-2">Email</label>
|
57 |
+
<input name="email" id="email" type="email" class="w-full bg-gray-50 text-gray-800 border focus:ring ring-indigo-300 rounded outline-none transition duration-100 px-3 py-2" />
|
58 |
+
</div>
|
59 |
+
|
60 |
+
<div>
|
61 |
+
<label for="password" class="inline-block text-gray-800 text-sm sm:text-base mb-2">Password</label>
|
62 |
+
<input name="password" id="password" type="password" class="w-full bg-gray-50 text-gray-800 border focus:ring ring-indigo-300 rounded outline-none transition duration-100 px-3 py-2" />
|
63 |
+
</div>
|
64 |
+
<div>
|
65 |
+
<label for="password1" class="inline-block text-gray-800 text-sm sm:text-base mb-2">Confirm Password</label>
|
66 |
+
<input name="password1" id="password1" type="password" class="w-full bg-gray-50 text-gray-800 border focus:ring ring-indigo-300 rounded outline-none transition duration-100 px-3 py-2" />
|
67 |
+
</div>
|
68 |
+
|
69 |
+
<button class="block bg-gray-800 hover:bg-gray-700 active:bg-gray-600 focus-visible:ring ring-gray-300 text-white text-sm md:text-base font-semibold text-center rounded-lg outline-none transition duration-100 px-8 py-3">Sign up</button>
|
70 |
+
|
71 |
+
<div class="flex justify-center items-center bg-gray-100 p-4">
|
72 |
+
<p class="text-gray-500 text-sm text-center">Already have an account? <a href="../login" class="text-indigo-500 hover:text-indigo-600 active:text-indigo-700 transition duration-100">Login</a></p>
|
73 |
+
</div>
|
74 |
+
</form>
|
75 |
+
</div>
|
76 |
+
</div>
|
77 |
+
|
78 |
+
<script>
|
79 |
+
var flag = 1;
|
80 |
+
function menu(event) {
|
81 |
+
if (flag == 1) {
|
82 |
+
ass =document.getElementById("nav").getElementsByTagName('a');
|
83 |
+
for(let i = 0; i < ass.length; i++){
|
84 |
+
ass[i].classList.remove("hidden");
|
85 |
+
}
|
86 |
+
flag = 0;
|
87 |
+
} else {
|
88 |
+
ass =document.getElementById("nav").getElementsByTagName('a');
|
89 |
+
for(let i = 0; i < ass.length; i++){
|
90 |
+
ass[i].classList.add("hidden");
|
91 |
+
}
|
92 |
+
flag = 1;
|
93 |
+
}
|
94 |
+
}
|
95 |
+
</script>
|
96 |
+
</body>
|
97 |
+
</html>
|
templates/upload.html
ADDED
@@ -0,0 +1,145 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8" />
|
5 |
+
<title>Uploader</title>
|
6 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
7 |
+
</head>
|
8 |
+
<body>
|
9 |
+
<div class="pt-1 h-screen bg-white px-2">
|
10 |
+
<header class="h-20 flex justify-between items-center py-4 md:py-8 mb-4">
|
11 |
+
<!-- logo - start -->
|
12 |
+
<a href="/" class="my-5 inline-flex items-center text-black-800 text-2xl md:text-3xl font-bold gap-2.5" aria-label="logo">
|
13 |
+
<svg class="w-[10%] text-indigo-500" id="outputsvg" xmlns="http://www.w3.org/2000/svg" style="transform: none; transform-origin: 50% 50%; cursor: move; transition: none 0s ease 0s" viewBox="0 0 3500 3500">
|
14 |
+
<g id="l5TLm6F9JGem8YOQ8A41YML" fill="rgb(100,103,241)" style="transform: none">
|
15 |
+
<g><path id="pulsHdoRs" d="M1455 3470 c-164 -30 -323 -83 -480 -160 -487 -242 -829 -689 -935 -1226 -28 -139 -37 -389 -21 -534 64 -550 390 -1040 879 -1319 170 -98 440 -186 642 -211 203 -24 460 -7 658 45 609 160 1093 651 1246 1263 120 479 34 978 -238 1387 -258 387 -641 646 -1101 745 -149 33 -495 38 -650 10z m488 -574 c37 -7 70 -15 72 -18 3 -3 -39 -24 -92 -48 -214 -94 -369 -196 -520 -343 -336 -327 -433 -761 -242 -1084 19 -31 67 -89 107 -130 40 -40 70 -73 67 -73 -15 0 -143 54 -225 95 -221 111 -505 336 -517 410 -9 55 17 270 43 362 121 418 441 719 869 818 117 28 326 33 438 11z m360 -132 c271 -152 315 -279 149 -436 -70 -67 -94 -78 -165 -78 -46 0 -61 6 -127 51 -90 62 -156 92 -258 121 -65 17 -95 20 -187 15 -153 -7 -269 -48 -381 -133 -27 -21 -44 -31 -38 -23 110 147 205 237 364 343 100 67 296 166 395 199 l70 24 55 -23 c30 -12 85 -39 123 -60z m-1463 -1370 c262 -187 520 -287 807 -314 125 -12 210 -3 313 31 81 26 86 29 188 96 128 86 196 84 296 -8 59 -54 106 -135 106 -183 -1 -41 -30 -104 -66 -139 -47 -47 -187 -136 -271 -172 -299 -129 -612 -133 -916 -10 -250 102 -488 336 -599 590 -42 96 -74 194 -83 254 l-7 44 73 -64 c41 -36 112 -92 159 -125z"></path></g>
|
16 |
+
</g>
|
17 |
+
</svg>
|
18 |
+
Cloud Storage
|
19 |
+
</a>
|
20 |
+
<!-- logo - end -->
|
21 |
+
|
22 |
+
<!-- nav - start -->
|
23 |
+
<nav class="hidden lg:flex gap-12">
|
24 |
+
<a href="../" class="text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">Home</a>
|
25 |
+
<a href="../list" class="text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">List</a>
|
26 |
+
<a href="../upload" class="text-indigo-500 text-lg font-semibold">Upload</a>
|
27 |
+
<a href="../logout" class="text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">Logout</a>
|
28 |
+
</nav>
|
29 |
+
<!-- nav - end -->
|
30 |
+
|
31 |
+
<!-- buttons - start -->
|
32 |
+
<div id="nav" onmouseout="outB()" onmouseover="inB()" class="overflow-visible z-10 mt-[150px] grid grid-cols-1 grid-rows-5">
|
33 |
+
<button type="button" class="shadow-xl inline-flex items-center lg:hidden bg-gray-200 hover:bg-gray-300 focus-visible:ring ring-indigo-300 text-gray-500 active:text-gray-700 text-sm md:text-base font-semibold rounded-lg gap-2 px-2.5 py-2">
|
34 |
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" viewBox="0 0 20 20" fill="currentColor">
|
35 |
+
<path fill-rule="evenodd" d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h6a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z" clip-rule="evenodd" />
|
36 |
+
</svg>
|
37 |
+
Menu
|
38 |
+
</button>
|
39 |
+
<a href="../" class="shadow-xl mt-2 hidden bg-white px-2 text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">Home</a>
|
40 |
+
<a href="../list" class="shadow-xl hidden bg-white px-2 text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">List</a>
|
41 |
+
<a href="../upload" class="shadow-xl hidden rounded-t-lg bg-white px-2 text-indigo-500 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">Upload</a>
|
42 |
+
<a href="../logout" class="shadow-xl hidden bg-white px-2 text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">Logout</a>
|
43 |
+
</div>
|
44 |
+
<!-- buttons - end -->
|
45 |
+
</header>
|
46 |
+
<div class="max-w-md mx-auto bg-indigo-500 rounded-lg overflow-hidden md:max-w-lg">
|
47 |
+
<div class="md:flex">
|
48 |
+
<div class="w-full">
|
49 |
+
<div class="p-4 border-b-2">
|
50 |
+
<span class="text-lg font-bold text-white">Upload documents</span>
|
51 |
+
</div>
|
52 |
+
<form action="../uploader/" id="myform" method="POST" enctype="multipart/form-data">
|
53 |
+
{% csrf_token %}
|
54 |
+
<div class="p-3">
|
55 |
+
<div class="mb-2">
|
56 |
+
<span class="text-sm text-white">Title</span>
|
57 |
+
<input type="text" id="title" name="title" class="h-12 px-3 w-full border-indigo-200 border rounded focus:outline-none focus:border-indigo-300" />
|
58 |
+
</div>
|
59 |
+
<div class="mb-2">
|
60 |
+
<span class="text-sm text-white">Attachments</span>
|
61 |
+
<div class="relative h-40 rounded-lg border-dashed border-2 border-gray-500 bg-white flex justify-center items-center hover:cursor-pointer">
|
62 |
+
<div class="absolute">
|
63 |
+
<div class="flex flex-col items-center" id="Attach">
|
64 |
+
<i class="fa fa-cloud-upload fa-3x text-indigo-200"></i>
|
65 |
+
<span class="block text-indigo-400 font-normal">Attach you files here</span>
|
66 |
+
<span class="block text-indigo-400 font-normal">or</span>
|
67 |
+
<span class="block text-blue-400 font-normal">Browse files</span>
|
68 |
+
</div>
|
69 |
+
<div class="flex flex-col items-center hidden" id="Fileinfo">
|
70 |
+
<i class="fa fa-cloud-upload fa-3x text-indigo-200"></i>
|
71 |
+
<span class="block text-indigo-800 font-normal" id="name">Attach you files here</span>
|
72 |
+
<span class="block text-indigo-800 font-normal" id="size">or</span>
|
73 |
+
<span class="block text-indigo-800 font-normal" id="type">Browse files</span>
|
74 |
+
</div>
|
75 |
+
</div>
|
76 |
+
<input type="file" onchange="showname()" class="h-full w-full m-auto opacity-0" id="file" name="file" action="http://localhost:5000/uploader" method="POST" enctype="multipart/form-data" />
|
77 |
+
</div>
|
78 |
+
</div>
|
79 |
+
<div class="mt-3 text-center pb-3">
|
80 |
+
<input type="submit" id="upload_btn" onclick="loading()" value="Upload" class="w-full h-12 text-lg w-32 hover:bg-white rounded hover:text-indigo-500 bg-indigo-800 text-white" />
|
81 |
+
</div>
|
82 |
+
</div>
|
83 |
+
</form>
|
84 |
+
</div>
|
85 |
+
</div>
|
86 |
+
</div>
|
87 |
+
</div>
|
88 |
+
<script>
|
89 |
+
function humanFileSize(bytes, si = false, dp = 1) {
|
90 |
+
const thresh = si ? 1000 : 1024;
|
91 |
+
|
92 |
+
if (Math.abs(bytes) < thresh) {
|
93 |
+
return bytes + " B";
|
94 |
+
}
|
95 |
+
|
96 |
+
const units = si ? ["kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"] : ["KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"];
|
97 |
+
let u = -1;
|
98 |
+
const r = 10 ** dp;
|
99 |
+
|
100 |
+
do {
|
101 |
+
bytes /= thresh;
|
102 |
+
++u;
|
103 |
+
} while (Math.round(Math.abs(bytes) * r) / r >= thresh && u < units.length - 1);
|
104 |
+
|
105 |
+
return bytes.toFixed(dp) + " " + units[u];
|
106 |
+
}
|
107 |
+
function showname() {
|
108 |
+
var name = document.getElementById("file");
|
109 |
+
var attach = document.getElementById("Attach");
|
110 |
+
var fileinfo = document.getElementById("Fileinfo");
|
111 |
+
if (name.files[0].size > 1000000000) {
|
112 |
+
alert("File size is too large , Limit is 1GB");
|
113 |
+
name.value = "";
|
114 |
+
} else {
|
115 |
+
fileinfo.classList.remove("hidden");
|
116 |
+
attach.classList.add("hidden");
|
117 |
+
document.getElementById("name").innerHTML = name.files[0].name;
|
118 |
+
document.getElementById("size").innerHTML = humanFileSize(name.files[0].size);
|
119 |
+
document.getElementById("type").innerHTML = name.files[0].type;
|
120 |
+
}
|
121 |
+
}
|
122 |
+
function loading() {
|
123 |
+
var upload_btn = document.getElementById("upload_btn");
|
124 |
+
upload_btn.value = "Uploading...";
|
125 |
+
upload_btn.disabled = true;
|
126 |
+
var form = document.getElementById("myform");
|
127 |
+
form.submit();
|
128 |
+
}
|
129 |
+
</script>
|
130 |
+
<script>
|
131 |
+
function inB(event) {
|
132 |
+
ass = document.getElementById("nav").getElementsByTagName("a");
|
133 |
+
for (let i = 0; i < ass.length; i++) {
|
134 |
+
ass[i].classList.remove("hidden");
|
135 |
+
}
|
136 |
+
}
|
137 |
+
function outB(event) {
|
138 |
+
ass = document.getElementById("nav").getElementsByTagName("a");
|
139 |
+
for (let i = 0; i < ass.length; i++) {
|
140 |
+
ass[i].classList.add("hidden");
|
141 |
+
}
|
142 |
+
}
|
143 |
+
</script>
|
144 |
+
</body>
|
145 |
+
</html>
|