├── README.md
├── elevator_system
├── __init__.py
├── __pycache__
│ ├── __init__.cpython-312.pyc
│ ├── settings.cpython-312.pyc
│ ├── urls.cpython-312.pyc
│ └── wsgi.cpython-312.pyc
├── asgi.py
├── settings.py
├── urls.py
└── wsgi.py
├── elevators
├── __init__.py
├── __pycache__
│ ├── __init__.cpython-312.pyc
│ ├── admin.cpython-312.pyc
│ ├── apps.cpython-312.pyc
│ ├── models.cpython-312.pyc
│ ├── serializers.cpython-312.pyc
│ ├── urls.cpython-312.pyc
│ └── views.cpython-312.pyc
├── admin.py
├── apps.py
├── migrations
│ ├── 0001_initial.py
│ ├── __init__.py
│ └── __pycache__
│ │ ├── 0001_initial.cpython-312.pyc
│ │ └── __init__.cpython-312.pyc
├── models.py
├── serializers.py
├── tests.py
├── urls.py
└── views.py
├── manage.py
├── static
├── css
│ ├── app.css
│ ├── bootstrap.min.css
│ ├── font-awesome.min.css
│ └── login.css
├── fonts
│ ├── FontAwesome.otf
│ ├── fontawesome-webfont.eot
│ ├── fontawesome-webfont.svg
│ ├── fontawesome-webfont.ttf
│ ├── fontawesome-webfont.woff
│ └── fontawesome-webfont.woff2
└── js
│ ├── app.js
│ └── jquery.min.js
└── templates
├── base.html
├── elements
├── format.html
└── update_app.html
├── elevators.html
├── header.html
└── registration
└── login.html
/README.md:
--------------------------------------------------------------------------------
1 | # Elevator System #
2 |
3 | !(https://github.com/SolomonNewCentury/Elevator)
4 |
5 | A elevator system which goes up, down and stops built with Django(Django Rest Framework including Viewsets, Serializers and etc.)
6 |
7 | ## Architecture ##
8 | - When a user logs in, the frontend downloads the elevator list set already. In first case, there will be no elevator set in elevator list
9 | - So, users can set the number of elevators by clicking format button bellow login button. Then this elevator system is initialized.
10 | While using this system, users can initialize system like this.
11 | - After that, elevators are displayed in interface.
12 | - Each elevator is divided into two status: opened or closed
13 | - Each elevator contains follow things:
14 | . floor that elevator is located
15 | . floor to go up or down based on request of user
16 | . status to mark whether elevator is in maintenance or not
17 | . status to mark whether elevator is operational or not
18 | . status to mark whether elevator has to go up or down
19 | . status to mark whether elevator is running or not
20 | - Users can change all of these things by clicking Edit button
21 | - Users can use only elevator that is operational and not in maintenance, not in running and set clear destination
22 |
23 |
24 | ### Requests ###
25 |
26 |
27 | **update 04/06/19**
28 |
29 | - using pipenv for package management
30 | - move to Channels 2
31 | - use redis as the channel layer backing store. for more information, please check [channels_redis](https://github.com/django/channels_redis)
32 |
33 | ### Database ###
34 | For this system, I have used postgreSQL.
35 | In using of this, you has to consider about version of postgreSQL and django. I used django 5.0 and postgreSQL 16.1
36 |
37 | ## Assumptions ##
38 |
39 | Because of time constraints this project lacks of:
40 |
41 | - User Sign-Up / Forgot Password
42 | - Good Test Coverage
43 | - Better Comments / Documentation Strings
44 | - Frontend & Backend Tests
45 | - Modern Frontend Framework (like React)
46 | - Proper UX / UI design (looks plain bootstrap)
47 |
48 | ## Run ##
49 |
50 | 0. Download and Install latest version of python
51 |
52 | 1. Create and activate a virtualenv (Python 3)
53 | ```bash
54 | pipenv --python 3 shell
55 | ```
56 | 2. Install requirements
57 | ```bash
58 | pipenv install
59 | ```
60 | 3. Create a MySQL database
61 | ```sql
62 | CREATE DATABASE chat CHARACTER SET utf8;
63 | ```
64 | 4. Start Redis Server
65 | ```bash
66 | redis-server
67 | ```
68 |
69 | 5. Init database
70 | ```bash
71 | ./manage.py migrate
72 | ```
73 | 6. Run tests
74 | ```bash
75 | ./manage.py test
76 | ```
77 |
78 | 7. Create admin user
79 | ```bash
80 | ./manage.py createsuperuser
81 | ```
82 |
83 | 8. Run development server
84 | ```bash
85 | ./manage.py runserver
86 |
--------------------------------------------------------------------------------
/elevator_system/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SdDev0119/Elevator/d70b384ea8f36328a4fab4e5e52ea6a8d7dba198/elevator_system/__init__.py
--------------------------------------------------------------------------------
/elevator_system/__pycache__/__init__.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SdDev0119/Elevator/d70b384ea8f36328a4fab4e5e52ea6a8d7dba198/elevator_system/__pycache__/__init__.cpython-312.pyc
--------------------------------------------------------------------------------
/elevator_system/__pycache__/settings.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SdDev0119/Elevator/d70b384ea8f36328a4fab4e5e52ea6a8d7dba198/elevator_system/__pycache__/settings.cpython-312.pyc
--------------------------------------------------------------------------------
/elevator_system/__pycache__/urls.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SdDev0119/Elevator/d70b384ea8f36328a4fab4e5e52ea6a8d7dba198/elevator_system/__pycache__/urls.cpython-312.pyc
--------------------------------------------------------------------------------
/elevator_system/__pycache__/wsgi.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SdDev0119/Elevator/d70b384ea8f36328a4fab4e5e52ea6a8d7dba198/elevator_system/__pycache__/wsgi.cpython-312.pyc
--------------------------------------------------------------------------------
/elevator_system/asgi.py:
--------------------------------------------------------------------------------
1 | """
2 | ASGI config for elevator_system 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/5.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', 'elevator_system.settings')
15 |
16 | application = get_asgi_application()
17 |
--------------------------------------------------------------------------------
/elevator_system/settings.py:
--------------------------------------------------------------------------------
1 | """
2 | Django settings for elevator_system project.
3 |
4 | Generated by 'django-admin startproject' using Django 5.0.
5 |
6 | For more information on this file, see
7 | https://docs.djangoproject.com/en/5.0/topics/settings/
8 |
9 | For the full list of settings and their values, see
10 | https://docs.djangoproject.com/en/5.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/5.0/howto/deployment/checklist/
22 |
23 | # SECURITY WARNING: keep the secret key used in production secret!
24 | SECRET_KEY = 'django-insecure-#bo&+drcp=^59i#8%i!1@9g%5k-vq(v--egl_addef228622rx'
25 |
26 | # SECURITY WARNING: don't run with debug turned on in production!
27 | DEBUG = True
28 |
29 | ALLOWED_HOSTS = []
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 |
42 | #apps added by developer
43 | 'elevators',
44 | 'rest_framework',
45 | ]
46 |
47 | MIDDLEWARE = [
48 | 'django.middleware.security.SecurityMiddleware',
49 | 'django.contrib.sessions.middleware.SessionMiddleware',
50 | 'django.middleware.common.CommonMiddleware',
51 | # 'django.middleware.csrf.CsrfViewMiddleware',
52 | 'django.contrib.auth.middleware.AuthenticationMiddleware',
53 | 'django.contrib.messages.middleware.MessageMiddleware',
54 | 'django.middleware.clickjacking.XFrameOptionsMiddleware',
55 | ]
56 |
57 | ROOT_URLCONF = 'elevator_system.urls'
58 |
59 | TEMPLATES = [
60 | {
61 | 'BACKEND': 'django.template.backends.django.DjangoTemplates',
62 | 'DIRS': [os.path.join(BASE_DIR, 'templates')],
63 | 'APP_DIRS': True,
64 | 'OPTIONS': {
65 | 'context_processors': [
66 | 'django.template.context_processors.debug',
67 | 'django.template.context_processors.request',
68 | 'django.contrib.auth.context_processors.auth',
69 | 'django.contrib.messages.context_processors.messages',
70 | ],
71 | },
72 | },
73 | ]
74 |
75 | WSGI_APPLICATION = 'elevator_system.wsgi.application'
76 |
77 | # Database
78 | # https://docs.djangoproject.com/en/5.0/ref/settings/#databases
79 |
80 | DATABASES = {
81 | 'default': {
82 | 'ENGINE': 'django.db.backends.postgresql',
83 | 'NAME': 'elevator',
84 | 'USER': 'postgres',
85 | 'PASSWORD': 'passioner',
86 | 'OPTIONS': {
87 | }
88 | }
89 | }
90 |
91 |
92 | # Password validation
93 | # https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators
94 |
95 | AUTH_PASSWORD_VALIDATORS = [
96 | {
97 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
98 | },
99 | {
100 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
101 | },
102 | {
103 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
104 | },
105 | {
106 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
107 | },
108 | ]
109 |
110 | REST_FRAMEWORK = {
111 | 'DEFAULT_PERMISSION_CLASSES': [
112 | 'rest_framework.permissions.IsAuthenticated'
113 | ],
114 | 'DEFAULT_PAGINATION_CLASS':
115 | 'rest_framework.pagination.LimitOffsetPagination',
116 | 'PAGE_SIZE': 100
117 | }
118 |
119 | # Internationalization
120 | # https://docs.djangoproject.com/en/5.0/topics/i18n/
121 |
122 | LANGUAGE_CODE = 'en-us'
123 |
124 | TIME_ZONE = 'UTC'
125 |
126 | USE_I18N = True
127 |
128 | USE_TZ = True
129 |
130 |
131 | # Static files (CSS, JavaScript, Images)
132 | # https://docs.djangoproject.com/en/5.0/howto/static-files/
133 |
134 | # Collect static files here
135 | STATIC_ROOT = os.path.join(BASE_DIR, 'run', 'static_root')
136 |
137 | # look for static assets here
138 | STATICFILES_DIRS = [
139 | os.path.join(BASE_DIR, 'static'),
140 | ]
141 |
142 | STATIC_URL = 'static/'
143 |
144 | LOGIN_REDIRECT_URL = '/'
145 | LOGIN_URL = '/login/'
146 |
147 | # Default primary key field type
148 | # https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field
149 |
150 | DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
151 |
--------------------------------------------------------------------------------
/elevator_system/urls.py:
--------------------------------------------------------------------------------
1 | """
2 | URL configuration for elevator_system project.
3 |
4 | The `urlpatterns` list routes URLs to views. For more information please see:
5 | https://docs.djangoproject.com/en/5.0/topics/http/urls/
6 | Examples:
7 | Function views
8 | 1. Add an import: from my_app import views
9 | 2. Add a URL to urlpatterns: path('', views.home, name='home')
10 | Class-based views
11 | 1. Add an import: from other_app.views import Home
12 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
13 | Including another URLconf
14 | 1. Import the include() function: from django.urls import include, path
15 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
16 | """
17 | from django.contrib import admin
18 | from django.urls import path, include
19 | from django.contrib.auth import views as auth_views
20 |
21 | urlpatterns = [
22 | path('admin/', admin.site.urls),
23 | path('', include('elevators.urls')),
24 | path('login/', auth_views.LoginView.as_view(), name='login'),
25 | path('logout/', auth_views.LogoutView.as_view(), {'next_page': '/'}, name='logout')
26 | ]
27 |
--------------------------------------------------------------------------------
/elevator_system/wsgi.py:
--------------------------------------------------------------------------------
1 | """
2 | WSGI config for elevator_system 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/5.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', 'elevator_system.settings')
15 |
16 | application = get_wsgi_application()
17 |
--------------------------------------------------------------------------------
/elevators/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SdDev0119/Elevator/d70b384ea8f36328a4fab4e5e52ea6a8d7dba198/elevators/__init__.py
--------------------------------------------------------------------------------
/elevators/__pycache__/__init__.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SdDev0119/Elevator/d70b384ea8f36328a4fab4e5e52ea6a8d7dba198/elevators/__pycache__/__init__.cpython-312.pyc
--------------------------------------------------------------------------------
/elevators/__pycache__/admin.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SdDev0119/Elevator/d70b384ea8f36328a4fab4e5e52ea6a8d7dba198/elevators/__pycache__/admin.cpython-312.pyc
--------------------------------------------------------------------------------
/elevators/__pycache__/apps.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SdDev0119/Elevator/d70b384ea8f36328a4fab4e5e52ea6a8d7dba198/elevators/__pycache__/apps.cpython-312.pyc
--------------------------------------------------------------------------------
/elevators/__pycache__/models.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SdDev0119/Elevator/d70b384ea8f36328a4fab4e5e52ea6a8d7dba198/elevators/__pycache__/models.cpython-312.pyc
--------------------------------------------------------------------------------
/elevators/__pycache__/serializers.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SdDev0119/Elevator/d70b384ea8f36328a4fab4e5e52ea6a8d7dba198/elevators/__pycache__/serializers.cpython-312.pyc
--------------------------------------------------------------------------------
/elevators/__pycache__/urls.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SdDev0119/Elevator/d70b384ea8f36328a4fab4e5e52ea6a8d7dba198/elevators/__pycache__/urls.cpython-312.pyc
--------------------------------------------------------------------------------
/elevators/__pycache__/views.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SdDev0119/Elevator/d70b384ea8f36328a4fab4e5e52ea6a8d7dba198/elevators/__pycache__/views.cpython-312.pyc
--------------------------------------------------------------------------------
/elevators/admin.py:
--------------------------------------------------------------------------------
1 | from django.contrib import admin
2 | from elevators.models import Elevator, Request
3 |
4 | # Register your models here.
5 | admin.site.register(Elevator)
6 | admin.site.register(Request)
--------------------------------------------------------------------------------
/elevators/apps.py:
--------------------------------------------------------------------------------
1 | from django.apps import AppConfig
2 |
3 |
4 | class ElevatorsConfig(AppConfig):
5 | default_auto_field = 'django.db.models.BigAutoField'
6 | name = 'elevators'
7 |
--------------------------------------------------------------------------------
/elevators/migrations/0001_initial.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 5.0 on 2024-01-03 06:25
2 |
3 | import django.db.models.deletion
4 | from django.db import migrations, models
5 |
6 |
7 | class Migration(migrations.Migration):
8 |
9 | initial = True
10 |
11 | dependencies = [
12 | ]
13 |
14 | operations = [
15 | migrations.CreateModel(
16 | name='Elevator',
17 | fields=[
18 | ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
19 | ('operational', models.BooleanField(default=True)),
20 | ('in_maintenance', models.BooleanField(default=False)),
21 | ('current_floor', models.IntegerField(default=1)),
22 | ('moving_up', models.BooleanField(default=False)),
23 | ('door_open', models.BooleanField(default=False)),
24 | ],
25 | ),
26 | migrations.CreateModel(
27 | name='Request',
28 | fields=[
29 | ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
30 | ('requested_floor', models.IntegerField()),
31 | ('created_at', models.DateTimeField(auto_now_add=True)),
32 | ('elevator', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='elevators.elevator')),
33 | ],
34 | ),
35 | ]
36 |
--------------------------------------------------------------------------------
/elevators/migrations/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SdDev0119/Elevator/d70b384ea8f36328a4fab4e5e52ea6a8d7dba198/elevators/migrations/__init__.py
--------------------------------------------------------------------------------
/elevators/migrations/__pycache__/0001_initial.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SdDev0119/Elevator/d70b384ea8f36328a4fab4e5e52ea6a8d7dba198/elevators/migrations/__pycache__/0001_initial.cpython-312.pyc
--------------------------------------------------------------------------------
/elevators/migrations/__pycache__/__init__.cpython-312.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SdDev0119/Elevator/d70b384ea8f36328a4fab4e5e52ea6a8d7dba198/elevators/migrations/__pycache__/__init__.cpython-312.pyc
--------------------------------------------------------------------------------
/elevators/models.py:
--------------------------------------------------------------------------------
1 | # elevators/models.py
2 | from django.db import models
3 |
4 | # Create your models here.
5 |
6 | class Elevator(models.Model):
7 | operational = models.BooleanField(default=True)
8 | in_maintenance = models.BooleanField(default=False)
9 | current_floor = models.IntegerField(default=1)
10 | moving_up = models.BooleanField(default=False)
11 | door_open = models.BooleanField(default=False)
12 |
13 | class Request(models.Model):
14 | elevator = models.ForeignKey(Elevator, on_delete=models.CASCADE)
15 | requested_floor = models.IntegerField()
16 | created_at = models.DateTimeField(auto_now_add=True)
17 |
--------------------------------------------------------------------------------
/elevators/serializers.py:
--------------------------------------------------------------------------------
1 | # elevators/serializers.py
2 | from rest_framework import serializers
3 | from .models import Elevator, Request
4 |
5 | class ElevatorSerializer(serializers.ModelSerializer):
6 | class Meta:
7 | model = Elevator
8 | fields = '__all__'
9 |
10 | class RequestSerializer(serializers.ModelSerializer):
11 | class Meta:
12 | model = Request
13 | fields = '__all__'
--------------------------------------------------------------------------------
/elevators/tests.py:
--------------------------------------------------------------------------------
1 | from django.test import TestCase
2 |
3 | # Create your tests here.
4 |
--------------------------------------------------------------------------------
/elevators/urls.py:
--------------------------------------------------------------------------------
1 | # elevators/urls.py
2 | from rest_framework import routers
3 | from django.urls import path, include
4 | from django.views.generic import TemplateView
5 | from django.contrib.auth.decorators import login_required
6 | from .views import ElevatorViewSet, RequestViewSet, init_elevator_system, door_control, edit_system, run_system
7 | router = routers.DefaultRouter()
8 |
9 | router.register(r'elevators', ElevatorViewSet)
10 | router.register(r'requests', RequestViewSet)
11 |
12 | urlpatterns = [
13 | path(r'api/', include(router.urls)),
14 | path('', login_required(TemplateView.as_view(template_name='elevators.html')), name='home'),
15 | path(r'init/', login_required(init_elevator_system), name='init'),
16 | path(r'door/', login_required(door_control), name='door'),
17 | path(r'edit/', login_required(edit_system), name='edit'),
18 | path(r'run/', login_required(run_system), name='run'),
19 | ]
--------------------------------------------------------------------------------
/elevators/views.py:
--------------------------------------------------------------------------------
1 | # elevators/views.py
2 | from rest_framework import viewsets
3 | from .models import Elevator, Request
4 | from .serializers import ElevatorSerializer, RequestSerializer
5 | from django.http import HttpResponse
6 |
7 | from datetime import datetime
8 |
9 | from django.db import connection
10 |
11 | class ElevatorViewSet(viewsets.ModelViewSet):
12 | queryset = Elevator.objects.all()
13 | serializer_class = ElevatorSerializer
14 |
15 | class RequestViewSet(viewsets.ModelViewSet):
16 | queryset = Request.objects.all()
17 | serializer_class = RequestSerializer
18 |
19 | # Function to init elevator system
20 | def init_elevator_system(request):
21 | objects = Elevator.objects.all()
22 | # delete elevators set earlier
23 | objects.delete()
24 | # create new elevators according to the requested number of elevator
25 | for i in range(int(request.POST.get('num'))):
26 | newObjects = Elevator()
27 | newObjects.save()
28 | return HttpResponse('ok')
29 |
30 | # Function to open & close the door according to the requested id of elevator
31 | def door_control(request):
32 | id = int(request.POST.get('id'))
33 | with connection.cursor() as cursor:
34 | cursor.execute('UPDATE "elevators_elevator" SET "door_open" = %s WHERE id = %s', [request.POST.get('type'), id])
35 | return HttpResponse('ok')
36 |
37 | # Function to run given elevator
38 | def run_system(request):
39 | id = int(request.POST.get('id'))
40 | with connection.cursor() as cursor:
41 | cursor.execute('UPDATE "elevators_elevator" SET "moving_up" = %s, "current_floor" = %s WHERE id = %s', [request.POST.get('moving_up'), int(request.POST.get("current_floor")), id])
42 | return HttpResponse('ok')
43 |
44 | # Fucntion to update the status of given elevator
45 | def edit_system(request):
46 | id = int(request.POST.get("id"))
47 | with connection.cursor() as cursor:
48 | cursor.execute('UPDATE "elevators_elevator" SET "in_maintenance" = %s, "operational" = %s WHERE id = %s', [request.POST.get('in_maintenance'), request.POST.get("operational"), id])
49 | # Decide to go up or down to which floor
50 | if (int(request.POST.get("to_floor")) != 0):
51 | if (request.POST.get("edit_type") == 'true'):
52 | objects = Request.objects.get(elevator_id = id)
53 | objects.requested_floor = int(request.POST.get('to_floor'))
54 | objects.save()
55 | elif (request.POST.get("edit_type") == 'false'):
56 | objects = Request(
57 | requested_floor = int(request.POST.get('to_floor')), elevator_id = id,
58 | created_at = datetime.now()
59 | )
60 | objects.save()
61 | return HttpResponse('ok')
62 |
--------------------------------------------------------------------------------
/manage.py:
--------------------------------------------------------------------------------
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', 'elevator_system.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()
23 |
--------------------------------------------------------------------------------
/static/css/app.css:
--------------------------------------------------------------------------------
1 | .elevator-app {
2 | margin: 0 10px;
3 | background-color: rgb(225, 227, 235);
4 | height: 510px;
5 | overflow: auto;
6 | }
7 |
8 | #formatApp {
9 | position: absolute;
10 | background-color: white;
11 | border-radius: 5px;
12 | box-shadow: 0 0 4px 3px rgb(218, 215, 215);
13 | width:34%;
14 | height: auto;
15 | left: 33%;
16 | top: 30%;
17 | padding: 0 10px;
18 | display: none;
19 | }
20 |
21 | #updateApp {
22 | position: absolute;
23 | background-color: white;
24 | border-radius: 5px;
25 | box-shadow: 0 0 4px 3px rgb(218, 215, 215);
26 | width:34%;
27 | height: auto;
28 | left: 33%;
29 | top: 25%;
30 | padding: 0 10px;
31 | display: none;
32 | }
33 |
34 | #formatApp > .header {
35 | text-align: center;
36 | border-bottom: 2px solid lightgray;
37 | }
38 |
39 | #formatApp > .body {
40 | text-align: center;
41 | border-bottom: 2px solid lightgray;
42 | padding: 10px 0;
43 | }
44 |
45 | #formatApp > .footer {
46 | display: flex;
47 | justify-content: space-around;
48 | text-align: center;
49 | padding: 10px 0;
50 | }
51 |
52 | #updateApp > .header {
53 | text-align: center;
54 | border-bottom: 2px solid lightgray;
55 | }
56 |
57 | #updateApp > .body {
58 | text-align: center;
59 | border-bottom: 2px solid lightgray;
60 | padding: 10px 0;
61 | }
62 |
63 | #updateApp > .body > .item {
64 | display: flex;
65 | justify-content: space-around;
66 | font-size: 1.4em;
67 | border-bottom: 2px solid rgb(236, 230, 230)
68 | }
69 |
70 | #updateApp > .body > .item:last-child {
71 | border: none !important;
72 | }
73 |
74 | #updateApp > .footer {
75 | display: flex;
76 | justify-content: space-around;
77 | text-align: center;
78 | padding: 10px 0;
79 | }
80 |
81 | .item-right {
82 | width: 15%;
83 | }
84 |
85 | #editToFloor {
86 | width: 100%;
87 | }
88 |
89 | .elevator-app > .app-header {
90 | display: flex;
91 | justify-content: space-between;
92 | padding: 0 15px;
93 | border-bottom: 5px outset rgb(255, 255, 255);
94 | }
95 |
96 | .elevator-app > .app-body {
97 | width: 98%;
98 | min-height: 425px;
99 | margin: 5px 1%;
100 | background-color: rgb(240, 240, 247);
101 | }
102 |
103 | .elevator-app > .app-body > .elevators {
104 | display: flex;
105 | align-items: center;
106 | justify-content: space-around;
107 | padding: 20px 10px;
108 | flex-wrap: wrap;
109 | }
110 |
111 | .elevators > .elevator {
112 | width: 23%;
113 | padding: 0.2% 1%;
114 | border: 1px solid rgb(76, 14, 95);
115 | border-radius: 10px;
116 | height: auto;
117 | background-color: white;
118 | }
119 |
120 | .elevators > .elevator > .elevator-header {
121 | cursor: pointer;
122 | border-bottom: 1px solid blue;
123 | text-align: center;
124 | font-size: 1.7em;
125 | color: rgb(126, 54, 140)
126 | }
127 |
128 | .elevators > .elevator > .elevator-body {
129 | width: 100%;
130 | padding: 3% 5%;
131 |
132 | }
133 |
134 | .elevators > .elevator > .elevator-footer {
135 | border-top: 1px solid blue;
136 | width: 100%;
137 | display: flex;
138 | justify-content: space-between;
139 | padding: 2% 0;
140 | }
141 |
142 | .elevator-body > .elevator-item {
143 | display: flex;
144 | justify-content: space-between;
145 | border-bottom: 1px solid black;
146 | margin: 2px 0
147 | }
148 |
149 | .elevator-body > .elevator-item:last-child {
150 | border: none
151 | }
152 |
153 | .elevator-body > .elevator-item > .elevator-text {
154 | font-size: 1.3em;
155 | }
156 |
157 | .elevator-body > .elevator-item > .item {
158 | font-size: 1.2em;
159 | }
160 |
161 | .elevator-body > .elevator-item > .item-circle {
162 | cursor: pointer;
163 | text-align: center;
164 | color: white;
165 | min-width: 27px;
166 | height: 26px;
167 | border-radius: 100%;
168 | }
169 |
170 | .item-red {
171 | background-color: rgb(232, 21, 21);
172 | }
173 |
174 | .item-red:hover {
175 | background-color: red
176 | }
177 |
178 | .item-blue {
179 | background-color: rgb(62, 68, 181);
180 | }
181 |
182 | .item-blue:hover {
183 | background-color: rgb(59, 59, 234);
184 | }
185 |
186 | .item-default {
187 | background-color: rgb(171, 161, 161);
188 | }
189 |
190 | .item-default:hover {
191 | background-color: gray;
192 | }
193 |
194 | .item-orange {
195 | background-color: rgb(252, 201, 36);
196 | }
197 |
198 | .item-orange:hover {
199 | background-color: rgb(255, 221, 0);
200 | }
201 |
202 | .item-success:hover {
203 | background-color: rgb(43, 135, 206);
204 | }
205 |
206 | .item-success {
207 | background-color: rgb(43, 185, 217);
208 | }
209 |
210 | .item-success:hover {
211 | background-color: rgb(45, 204, 239);
212 | }
213 |
214 | ::-webkit-scrollbar {
215 | width: 8px;
216 | height: 8px;
217 | background-color: rgb(134, 146, 142);
218 | }
219 |
220 | ::-webkit-scrollbar:hover {
221 | background-color: rgb(98, 107, 104);
222 | }
--------------------------------------------------------------------------------
/static/css/font-awesome.min.css:
--------------------------------------------------------------------------------
1 | /*!
2 | * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome
3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
4 | */@font-face{font-family:'FontAwesome';src:url('../fonts/fontawesome-webfont.eot?v=4.7.0');src:url('../fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'),url('../fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'),url('../fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'),url('../fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');font-weight:normal;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left{margin-right:.3em}.fa.fa-pull-right{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-remove:before,.fa-close:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-warning:before,.fa-exclamation-triangle:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-gears:before,.fa-cogs:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook-f:before,.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-feed:before,.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-save:before,.fa-floppy-o:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-unsorted:before,.fa-sort:before{content:"\f0dc"}.fa-sort-down:before,.fa-sort-desc:before{content:"\f0dd"}.fa-sort-up:before,.fa-sort-asc:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-legal:before,.fa-gavel:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-flash:before,.fa-bolt:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-paste:before,.fa-clipboard:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-unlink:before,.fa-chain-broken:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:"\f150"}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:"\f151"}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:"\f152"}.fa-euro:before,.fa-eur:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-rupee:before,.fa-inr:before{content:"\f156"}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"\f157"}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"\f158"}.fa-won:before,.fa-krw:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before,.fa-gratipay:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-turkish-lira:before,.fa-try:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-institution:before,.fa-bank:before,.fa-university:before{content:"\f19c"}.fa-mortar-board:before,.fa-graduation-cap:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:"\f1c5"}.fa-file-zip-o:before,.fa-file-archive-o:before{content:"\f1c6"}.fa-file-sound-o:before,.fa-file-audio-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-resistance:before,.fa-rebel:before{content:"\f1d0"}.fa-ge:before,.fa-empire:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-y-combinator-square:before,.fa-yc-square:before,.fa-hacker-news:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-send:before,.fa-paper-plane:before{content:"\f1d8"}.fa-send-o:before,.fa-paper-plane-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:"\f1e3"}.fa-tty:before{content:"\f1e4"}.fa-binoculars:before{content:"\f1e5"}.fa-plug:before{content:"\f1e6"}.fa-slideshare:before{content:"\f1e7"}.fa-twitch:before{content:"\f1e8"}.fa-yelp:before{content:"\f1e9"}.fa-newspaper-o:before{content:"\f1ea"}.fa-wifi:before{content:"\f1eb"}.fa-calculator:before{content:"\f1ec"}.fa-paypal:before{content:"\f1ed"}.fa-google-wallet:before{content:"\f1ee"}.fa-cc-visa:before{content:"\f1f0"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-bell-slash:before{content:"\f1f6"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-trash:before{content:"\f1f8"}.fa-copyright:before{content:"\f1f9"}.fa-at:before{content:"\f1fa"}.fa-eyedropper:before{content:"\f1fb"}.fa-paint-brush:before{content:"\f1fc"}.fa-birthday-cake:before{content:"\f1fd"}.fa-area-chart:before{content:"\f1fe"}.fa-pie-chart:before{content:"\f200"}.fa-line-chart:before{content:"\f201"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-bicycle:before{content:"\f206"}.fa-bus:before{content:"\f207"}.fa-ioxhost:before{content:"\f208"}.fa-angellist:before{content:"\f209"}.fa-cc:before{content:"\f20a"}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:"\f20b"}.fa-meanpath:before{content:"\f20c"}.fa-buysellads:before{content:"\f20d"}.fa-connectdevelop:before{content:"\f20e"}.fa-dashcube:before{content:"\f210"}.fa-forumbee:before{content:"\f211"}.fa-leanpub:before{content:"\f212"}.fa-sellsy:before{content:"\f213"}.fa-shirtsinbulk:before{content:"\f214"}.fa-simplybuilt:before{content:"\f215"}.fa-skyatlas:before{content:"\f216"}.fa-cart-plus:before{content:"\f217"}.fa-cart-arrow-down:before{content:"\f218"}.fa-diamond:before{content:"\f219"}.fa-ship:before{content:"\f21a"}.fa-user-secret:before{content:"\f21b"}.fa-motorcycle:before{content:"\f21c"}.fa-street-view:before{content:"\f21d"}.fa-heartbeat:before{content:"\f21e"}.fa-venus:before{content:"\f221"}.fa-mars:before{content:"\f222"}.fa-mercury:before{content:"\f223"}.fa-intersex:before,.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-venus-double:before{content:"\f226"}.fa-mars-double:before{content:"\f227"}.fa-venus-mars:before{content:"\f228"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-neuter:before{content:"\f22c"}.fa-genderless:before{content:"\f22d"}.fa-facebook-official:before{content:"\f230"}.fa-pinterest-p:before{content:"\f231"}.fa-whatsapp:before{content:"\f232"}.fa-server:before{content:"\f233"}.fa-user-plus:before{content:"\f234"}.fa-user-times:before{content:"\f235"}.fa-hotel:before,.fa-bed:before{content:"\f236"}.fa-viacoin:before{content:"\f237"}.fa-train:before{content:"\f238"}.fa-subway:before{content:"\f239"}.fa-medium:before{content:"\f23a"}.fa-yc:before,.fa-y-combinator:before{content:"\f23b"}.fa-optin-monster:before{content:"\f23c"}.fa-opencart:before{content:"\f23d"}.fa-expeditedssl:before{content:"\f23e"}.fa-battery-4:before,.fa-battery:before,.fa-battery-full:before{content:"\f240"}.fa-battery-3:before,.fa-battery-three-quarters:before{content:"\f241"}.fa-battery-2:before,.fa-battery-half:before{content:"\f242"}.fa-battery-1:before,.fa-battery-quarter:before{content:"\f243"}.fa-battery-0:before,.fa-battery-empty:before{content:"\f244"}.fa-mouse-pointer:before{content:"\f245"}.fa-i-cursor:before{content:"\f246"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-sticky-note:before{content:"\f249"}.fa-sticky-note-o:before{content:"\f24a"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-diners-club:before{content:"\f24c"}.fa-clone:before{content:"\f24d"}.fa-balance-scale:before{content:"\f24e"}.fa-hourglass-o:before{content:"\f250"}.fa-hourglass-1:before,.fa-hourglass-start:before{content:"\f251"}.fa-hourglass-2:before,.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-3:before,.fa-hourglass-end:before{content:"\f253"}.fa-hourglass:before{content:"\f254"}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:"\f255"}.fa-hand-stop-o:before,.fa-hand-paper-o:before{content:"\f256"}.fa-hand-scissors-o:before{content:"\f257"}.fa-hand-lizard-o:before{content:"\f258"}.fa-hand-spock-o:before{content:"\f259"}.fa-hand-pointer-o:before{content:"\f25a"}.fa-hand-peace-o:before{content:"\f25b"}.fa-trademark:before{content:"\f25c"}.fa-registered:before{content:"\f25d"}.fa-creative-commons:before{content:"\f25e"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-tripadvisor:before{content:"\f262"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-get-pocket:before{content:"\f265"}.fa-wikipedia-w:before{content:"\f266"}.fa-safari:before{content:"\f267"}.fa-chrome:before{content:"\f268"}.fa-firefox:before{content:"\f269"}.fa-opera:before{content:"\f26a"}.fa-internet-explorer:before{content:"\f26b"}.fa-tv:before,.fa-television:before{content:"\f26c"}.fa-contao:before{content:"\f26d"}.fa-500px:before{content:"\f26e"}.fa-amazon:before{content:"\f270"}.fa-calendar-plus-o:before{content:"\f271"}.fa-calendar-minus-o:before{content:"\f272"}.fa-calendar-times-o:before{content:"\f273"}.fa-calendar-check-o:before{content:"\f274"}.fa-industry:before{content:"\f275"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-map-o:before{content:"\f278"}.fa-map:before{content:"\f279"}.fa-commenting:before{content:"\f27a"}.fa-commenting-o:before{content:"\f27b"}.fa-houzz:before{content:"\f27c"}.fa-vimeo:before{content:"\f27d"}.fa-black-tie:before{content:"\f27e"}.fa-fonticons:before{content:"\f280"}.fa-reddit-alien:before{content:"\f281"}.fa-edge:before{content:"\f282"}.fa-credit-card-alt:before{content:"\f283"}.fa-codiepie:before{content:"\f284"}.fa-modx:before{content:"\f285"}.fa-fort-awesome:before{content:"\f286"}.fa-usb:before{content:"\f287"}.fa-product-hunt:before{content:"\f288"}.fa-mixcloud:before{content:"\f289"}.fa-scribd:before{content:"\f28a"}.fa-pause-circle:before{content:"\f28b"}.fa-pause-circle-o:before{content:"\f28c"}.fa-stop-circle:before{content:"\f28d"}.fa-stop-circle-o:before{content:"\f28e"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-hashtag:before{content:"\f292"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-percent:before{content:"\f295"}.fa-gitlab:before{content:"\f296"}.fa-wpbeginner:before{content:"\f297"}.fa-wpforms:before{content:"\f298"}.fa-envira:before{content:"\f299"}.fa-universal-access:before{content:"\f29a"}.fa-wheelchair-alt:before{content:"\f29b"}.fa-question-circle-o:before{content:"\f29c"}.fa-blind:before{content:"\f29d"}.fa-audio-description:before{content:"\f29e"}.fa-volume-control-phone:before{content:"\f2a0"}.fa-braille:before{content:"\f2a1"}.fa-assistive-listening-systems:before{content:"\f2a2"}.fa-asl-interpreting:before,.fa-american-sign-language-interpreting:before{content:"\f2a3"}.fa-deafness:before,.fa-hard-of-hearing:before,.fa-deaf:before{content:"\f2a4"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-signing:before,.fa-sign-language:before{content:"\f2a7"}.fa-low-vision:before{content:"\f2a8"}.fa-viadeo:before{content:"\f2a9"}.fa-viadeo-square:before{content:"\f2aa"}.fa-snapchat:before{content:"\f2ab"}.fa-snapchat-ghost:before{content:"\f2ac"}.fa-snapchat-square:before{content:"\f2ad"}.fa-pied-piper:before{content:"\f2ae"}.fa-first-order:before{content:"\f2b0"}.fa-yoast:before{content:"\f2b1"}.fa-themeisle:before{content:"\f2b2"}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:"\f2b3"}.fa-fa:before,.fa-font-awesome:before{content:"\f2b4"}.fa-handshake-o:before{content:"\f2b5"}.fa-envelope-open:before{content:"\f2b6"}.fa-envelope-open-o:before{content:"\f2b7"}.fa-linode:before{content:"\f2b8"}.fa-address-book:before{content:"\f2b9"}.fa-address-book-o:before{content:"\f2ba"}.fa-vcard:before,.fa-address-card:before{content:"\f2bb"}.fa-vcard-o:before,.fa-address-card-o:before{content:"\f2bc"}.fa-user-circle:before{content:"\f2bd"}.fa-user-circle-o:before{content:"\f2be"}.fa-user-o:before{content:"\f2c0"}.fa-id-badge:before{content:"\f2c1"}.fa-drivers-license:before,.fa-id-card:before{content:"\f2c2"}.fa-drivers-license-o:before,.fa-id-card-o:before{content:"\f2c3"}.fa-quora:before{content:"\f2c4"}.fa-free-code-camp:before{content:"\f2c5"}.fa-telegram:before{content:"\f2c6"}.fa-thermometer-4:before,.fa-thermometer:before,.fa-thermometer-full:before{content:"\f2c7"}.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:"\f2c8"}.fa-thermometer-2:before,.fa-thermometer-half:before{content:"\f2c9"}.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:"\f2ca"}.fa-thermometer-0:before,.fa-thermometer-empty:before{content:"\f2cb"}.fa-shower:before{content:"\f2cc"}.fa-bathtub:before,.fa-s15:before,.fa-bath:before{content:"\f2cd"}.fa-podcast:before{content:"\f2ce"}.fa-window-maximize:before{content:"\f2d0"}.fa-window-minimize:before{content:"\f2d1"}.fa-window-restore:before{content:"\f2d2"}.fa-times-rectangle:before,.fa-window-close:before{content:"\f2d3"}.fa-times-rectangle-o:before,.fa-window-close-o:before{content:"\f2d4"}.fa-bandcamp:before{content:"\f2d5"}.fa-grav:before{content:"\f2d6"}.fa-etsy:before{content:"\f2d7"}.fa-imdb:before{content:"\f2d8"}.fa-ravelry:before{content:"\f2d9"}.fa-eercast:before{content:"\f2da"}.fa-microchip:before{content:"\f2db"}.fa-snowflake-o:before{content:"\f2dc"}.fa-superpowers:before{content:"\f2dd"}.fa-wpexplorer:before{content:"\f2de"}.fa-meetup:before{content:"\f2e0"}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}
5 |
--------------------------------------------------------------------------------
/static/css/login.css:
--------------------------------------------------------------------------------
1 | body {
2 | padding-bottom: 10px;
3 | background-color: #eee;
4 | }
5 |
6 | .form-signin {
7 | max-width: 330px;
8 | margin: 0 auto;
9 | padding: 30px 15px;
10 | }
11 |
12 | .form-signin .form-signin-heading,
13 | .form-signin .checkbox {
14 | margin-bottom: 10px;
15 | }
16 |
17 | .form-signin .checkbox {
18 | font-weight: normal;
19 | }
20 |
21 | .form-signin .form-control {
22 | position: relative;
23 | height: auto;
24 | -webkit-box-sizing: border-box;
25 | -moz-box-sizing: border-box;
26 | box-sizing: border-box;
27 | padding: 10px;
28 | font-size: 16px;
29 | }
30 |
31 | .form-signin .form-control:focus {
32 | z-index: 2;
33 | }
34 |
35 |
--------------------------------------------------------------------------------
/static/fonts/FontAwesome.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SdDev0119/Elevator/d70b384ea8f36328a4fab4e5e52ea6a8d7dba198/static/fonts/FontAwesome.otf
--------------------------------------------------------------------------------
/static/fonts/fontawesome-webfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SdDev0119/Elevator/d70b384ea8f36328a4fab4e5e52ea6a8d7dba198/static/fonts/fontawesome-webfont.eot
--------------------------------------------------------------------------------
/static/fonts/fontawesome-webfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SdDev0119/Elevator/d70b384ea8f36328a4fab4e5e52ea6a8d7dba198/static/fonts/fontawesome-webfont.ttf
--------------------------------------------------------------------------------
/static/fonts/fontawesome-webfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SdDev0119/Elevator/d70b384ea8f36328a4fab4e5e52ea6a8d7dba198/static/fonts/fontawesome-webfont.woff
--------------------------------------------------------------------------------
/static/fonts/fontawesome-webfont.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SdDev0119/Elevator/d70b384ea8f36328a4fab4e5e52ea6a8d7dba198/static/fonts/fontawesome-webfont.woff2
--------------------------------------------------------------------------------
/static/js/app.js:
--------------------------------------------------------------------------------
1 | let elevators = $("#elevators")
2 | let requestedStatus = false //variable to mark whether there is requested floor or not in requests list
3 |
4 | //Operation to get elevators set already when system runs
5 | $(document).ready(() => getElevators())
6 |
7 | /**
8 | * Function to get elevators set now
9 | */
10 | const getElevators = async () => {
11 | let requests = await getReqeusts() //To get requests in request list
12 |
13 | //Api to get elevators set from backend
14 | await $.getJSON('api/elevators/', (data) => {
15 | elevators.children('.elevator').remove() //Delete old elevators
16 |
17 | if (data.results && data.results.length) {
18 | for (let i = 0; i < data.results.length; i++) {
19 | let result = data.results[i]
20 | let id = result.id
21 | let current_floor = result.current_floor
22 | let door_open = result.door_open
23 | let request = requests.results && requests.results.length ? requests.results.filter((req) => req.elevator == id) : ''
24 |
25 | //Variable to decide floor that elevator has to go up or down
26 | let to_go = request && request.length ? request[0].requested_floor : 0
27 |
28 | //Variable to mark whether elevator is in maintenance or not
29 | let maintenanceStatus = result.in_maintenance ?
30 | `
Maintenance:
` :
31 | `
Maintenance:
`
32 |
33 | //Variable to mark whether elevator is operational or not
34 | let operationalStatus = result.operational ?
35 | `
Operational:
` :
36 | `
Operational:
`
37 |
38 | let moving_up = parseInt(current_floor) - parseInt(to_go)
39 |
40 | //Variablt to decide whether elevator has to go up or down
41 | let movingStatus = moving_up != 0 && parseInt(to_go)?
42 | moving_up < 0 ?
43 | `
Moving:
` :
44 | `
Moving:
` :
45 | `
Moving:
46 |
`
47 |
48 | //items for each elevators include current_floor, floor_to_go, maintenance, operational, movingup and two buttons.
49 | const eleItem = door_open ?
50 | `