From 8945ed0244626e2ed0da6f3d0df3fc9d2b736aa6 Mon Sep 17 00:00:00 2001 From: Perfectfire33 Date: Tue, 28 Jun 2022 22:32:38 -0400 Subject: [PATCH] Copied over old code to get started --- .gitattributes | 2 + .idea/encodings.xml | 4 + .idea/flaskr.iml | 11 + .idea/misc.xml | 7 + .idea/modules.xml | 8 + .idea/vcs.xml | 6 + .idea/workspace.xml | 456 ++++++++++++ 2to3.py | 5 + Readme.txt | 13 + __pycache__/app.cpython-37.pyc | Bin 0 -> 258 bytes __pycache__/flaskr.cpython-37.pyc | Bin 0 -> 7026 bytes feature_ideas.txt | 46 ++ flaskr - Copy.py | 835 ++++++++++++++++++++++ flaskr.db | Bin 0 -> 126976 bytes flaskr.py | 369 ++++++++++ flaskr.py.bak | 835 ++++++++++++++++++++++ schema.sql | 382 ++++++++++ sql/delete_file.sql | 2 + sql/delete_part.sql | 2 + sql/delete_settings.sql | 1 + sql/enable_foreign_keys.sql | 0 sql/insert_build.sql | 39 + sql/insert_case.sql | 43 ++ sql/insert_cpu.sql | 19 + sql/insert_cpuCool.sql | 15 + sql/insert_fan.sql | 13 + sql/insert_gpu.sql | 29 + sql/insert_hdd.sql | 17 + sql/insert_ledkit.sql | 13 + sql/insert_mobo.sql | 29 + sql/insert_os.sql | 13 + sql/insert_part.sql | 25 + sql/insert_psu.sql | 23 + sql/insert_ram.sql | 17 + sql/insert_settings.sql | 7 + sql/insert_ssd.sql | 13 + sql/select_all_items.sql | 10 + sql/select_all_pcparts.sql | 14 + sql/select_build.sql | 4 + sql/select_caseList.sql | 4 + sql/select_cpuCoolList.sql | 4 + sql/select_cpuList.sql | 4 + sql/select_fanList.sql | 4 + sql/select_fileToDelete.sql | 1 + sql/select_fileToDownload.sql | 1 + sql/select_gpuList.sql | 4 + sql/select_hddList.sql | 4 + sql/select_ledkitList.sql | 4 + sql/select_mediaserver_file_list.sql | 1 + sql/select_moboList.sql | 4 + sql/select_osList.sql | 4 + sql/select_part.sql | 1 + sql/select_part_details.sql | 1 + sql/select_psuList.sql | 4 + sql/select_ramList.sql | 4 + sql/select_row_count.sql | 1 + sql/select_settings.sql | 1 + sql/select_ssdList.sql | 4 + sql/update_part.sql | 13 + sql/update_part_ssd.sql | 6 + sql/upload_file.sql | 13 + static/style.css | 52 ++ templates/add_item.html | 47 ++ templates/dashboard.html | 18 + templates/display_addPart_details.html | 372 ++++++++++ templates/item_list.html | 18 + templates/layout.html | 20 + templates/login.html | 14 + templates/mediaserver_addFile.html | 18 + templates/mediaserver_file_list.html | 36 + templates/mediaserver_settings.html | 15 + templates/pcparts/select_ssd.html | 21 + templates/pcparts/updatePart.html | 44 ++ templates/pcparts/updatePart_details.html | 23 + templates/pcparts_addBuild.html | 105 +++ templates/pcparts_addPart.html | 50 ++ templates/pcparts_addPart_ssd.html | 23 + templates/pcparts_list.html | 34 + templates/pcparts_listBuilds.html | 28 + 79 files changed, 4352 insertions(+) create mode 100644 .gitattributes create mode 100644 .idea/encodings.xml create mode 100644 .idea/flaskr.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml create mode 100644 2to3.py create mode 100644 Readme.txt create mode 100644 __pycache__/app.cpython-37.pyc create mode 100644 __pycache__/flaskr.cpython-37.pyc create mode 100644 feature_ideas.txt create mode 100644 flaskr - Copy.py create mode 100644 flaskr.db create mode 100644 flaskr.py create mode 100644 flaskr.py.bak create mode 100644 schema.sql create mode 100644 sql/delete_file.sql create mode 100644 sql/delete_part.sql create mode 100644 sql/delete_settings.sql create mode 100644 sql/enable_foreign_keys.sql create mode 100644 sql/insert_build.sql create mode 100644 sql/insert_case.sql create mode 100644 sql/insert_cpu.sql create mode 100644 sql/insert_cpuCool.sql create mode 100644 sql/insert_fan.sql create mode 100644 sql/insert_gpu.sql create mode 100644 sql/insert_hdd.sql create mode 100644 sql/insert_ledkit.sql create mode 100644 sql/insert_mobo.sql create mode 100644 sql/insert_os.sql create mode 100644 sql/insert_part.sql create mode 100644 sql/insert_psu.sql create mode 100644 sql/insert_ram.sql create mode 100644 sql/insert_settings.sql create mode 100644 sql/insert_ssd.sql create mode 100644 sql/select_all_items.sql create mode 100644 sql/select_all_pcparts.sql create mode 100644 sql/select_build.sql create mode 100644 sql/select_caseList.sql create mode 100644 sql/select_cpuCoolList.sql create mode 100644 sql/select_cpuList.sql create mode 100644 sql/select_fanList.sql create mode 100644 sql/select_fileToDelete.sql create mode 100644 sql/select_fileToDownload.sql create mode 100644 sql/select_gpuList.sql create mode 100644 sql/select_hddList.sql create mode 100644 sql/select_ledkitList.sql create mode 100644 sql/select_mediaserver_file_list.sql create mode 100644 sql/select_moboList.sql create mode 100644 sql/select_osList.sql create mode 100644 sql/select_part.sql create mode 100644 sql/select_part_details.sql create mode 100644 sql/select_psuList.sql create mode 100644 sql/select_ramList.sql create mode 100644 sql/select_row_count.sql create mode 100644 sql/select_settings.sql create mode 100644 sql/select_ssdList.sql create mode 100644 sql/update_part.sql create mode 100644 sql/update_part_ssd.sql create mode 100644 sql/upload_file.sql create mode 100644 static/style.css create mode 100644 templates/add_item.html create mode 100644 templates/dashboard.html create mode 100644 templates/display_addPart_details.html create mode 100644 templates/item_list.html create mode 100644 templates/layout.html create mode 100644 templates/login.html create mode 100644 templates/mediaserver_addFile.html create mode 100644 templates/mediaserver_file_list.html create mode 100644 templates/mediaserver_settings.html create mode 100644 templates/pcparts/select_ssd.html create mode 100644 templates/pcparts/updatePart.html create mode 100644 templates/pcparts/updatePart_details.html create mode 100644 templates/pcparts_addBuild.html create mode 100644 templates/pcparts_addPart.html create mode 100644 templates/pcparts_addPart_ssd.html create mode 100644 templates/pcparts_list.html create mode 100644 templates/pcparts_listBuilds.html diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dfe0770 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..15a15b2 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/flaskr.iml b/.idea/flaskr.iml new file mode 100644 index 0000000..6711606 --- /dev/null +++ b/.idea/flaskr.iml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..ba24381 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..a73d108 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..b42d182 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,456 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + add + /pcpart_add_part + add_part + download + pcparts_list + delete_part + part_details + mediaserver_download + delete + download_ + default_path + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Item Subtitle: +
+
Item Description: +
+ +
Item Category: +
+
Item Condition: +
+
Item Condition Description: +
+
Item Cost: +
+
Item Pictures: +
+
Add Item: +
+ + + {% endif %} +
    + {% for item in items %} +
  • {{ item.item_name }}

    {{ item.item_subtitle|safe }} + {{ item.item_desc|safe }} + {{ item.item_category|safe }} + {{ item.item_condition|safe }} + {{ item.item_conditionDesc|safe }} + {{ item.item_cost|safe }} + {% else %} +
  • No Items Found! + {% endfor %} +
+{% endblock %} \ No newline at end of file diff --git a/templates/dashboard.html b/templates/dashboard.html new file mode 100644 index 0000000..4b4fd01 --- /dev/null +++ b/templates/dashboard.html @@ -0,0 +1,18 @@ +{% extends "layout.html" %} +{% block body %} + +{% endblock %} \ No newline at end of file diff --git a/templates/display_addPart_details.html b/templates/display_addPart_details.html new file mode 100644 index 0000000..b463872 --- /dev/null +++ b/templates/display_addPart_details.html @@ -0,0 +1,372 @@ +{% extends "layout.html" %} +{% block body %} +
    +
  • PC Parts - Add Part - Details

    +
    + {% if session.logged_in %} + + {% if partType == "ssd" %} +
  • Add SSD Specifics +
    + + +
    +
    Form Factor: +
    +
    Storage Capacity: +
    GB +
    Interface: +
    +
    Add Part: +
    +
    +
    + {% endif %} + + {% if partType == "ram" %} +
  • Add RAM Specifics +
    + + +
    +
    Kit Size: +
    Sticks +
    Stick Size: +
    GB +
    Speed: +
    MHz +
    Type: +
    +
    CAS Latency: +
    CL +
    Add Part: +
    +
    +
    + {% endif %} + + {% if partType == "hdd" %} +
  • Add HDD Specifics +
    + + +
    +
    Form Factor: +
    +
    Size: +
    GB +
    Interface: +
    +
    Cache: +
    MB +
    RPM: +
    +
    Add Part: +
    +
    +
    + {% endif %} + + {% if partType == "case" %} +
  • Add Case Specifics +
    + + +
    +
    Form Factor: +
    Width: Inches +
    Height: Inches +
    Length: Inches +
    5.25" Bays: +
    3.5" Bays: +
    2.5" Bays: +
    +
    80mm Fan Slots: +
    120mm Fan Slots: +
    140mm Fan Slots: +
    240mm Fan Slots: +
    Other Fan Slots: +
    +
    Front Speaker Jack: +
    Front Microphone Jack: +
    Front USB 3.0 Slots: +
    Front USB 2.0 Slots: +
    +
    Case PSU Slots: +
    Watercooler Slots: +
    +
    Add Part: +
    +
    +
    + {% endif %} + + {% if partType == "gpu" %} +
  • Add Video Card Specifics +
    + + +
    +
    VRAM Type: +
    VRAM Size: MB +
    Slot Width: Slots +
    Interface: Inches +
    6-pin Power Connectors:: +
    +
    8-pin Power Connectors:: +
    +
    Clock Speed: MHz +
    +
    Memory Clock Speed: MHz +
    Bus Bandwidth: bit +
    Crossfire: +
    SLI: +
    +
    Add Part: +
    +
    +
    + {% endif %} + + {% if partType == "psu" %} +
  • Add Power Supply Specifics +
    + + +
    +
    Wattage: Watts +
    Efficency: +
    +
    8-pin Connectors: +
    6-pin Connectors: +
    4-pin Connectors: +
    Molex Connectors: +
    SATA Connectors: +
    Floppy Connectors: +
    +
    Add Part: +
    +
    +
    + {% endif %} + + {% if partType == "os" %} +
  • Add Operating System Specifics +
    + + +
    +
    Type: +
    Bit: +
    +
    Version: +
    +
    Add Part: +
    +
    +
    + {% endif %} + + {% if partType == "cpuCool" %} +
  • Add Processor Cooler Specifics +
    + + +
    +
    Type: +
    +
    Socket List: +
    Fan Count: +
    Fan Size: mm +
    +
    Add Part: +
    +
    +
    + {% endif %} + + {% if partType == "mobo" %} +
  • Add Motherboard Specifics +
    + + +
    +
    RAM Type: +
    +
    CPU Socket: +
    DIMM Slots: +
    PCI Slots: +
    PCIEx16 Slots: +
    PCIEx8 Slots: +
    PCIEx4 Slots: +
    PCIEx1 Slots: +
    Chipset: +
    +
    Add Part: +
    +
    +
    + {% endif %} + + {% if partType == "fan" %} +
  • Add Fan Specifics +
    + + +
    +
    Fan Size: mm +
    Fan Type: +
    Fan Color: +
    +
    Add Part: +
    +
    +
    + {% endif %} + + {% if partType == "ledkit" %} +
  • Add LED Kit Specifics +
    + + +
    +
    Color: +
    Type: +
    Notes: +
    +
    Add Part: +
    +
    +
    + {% endif %} + + {% if partType == "cpu" %} +
  • Add Processor Specifics +
    + + +
    +
    Socket: +
    Cores: +
    Threads: +
    Frequency: GHz +
    L3 Cache: MB +
    Wattage: Watts +
    +
    Add Part: +
    +
    +
    + {% endif %} + {% endif %} +
      +{% endblock %} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/templates/item_list.html b/templates/item_list.html new file mode 100644 index 0000000..664ac0e --- /dev/null +++ b/templates/item_list.html @@ -0,0 +1,18 @@ +{% extends "layout.html" %} +{% block body %} +
        + {% for item in items %} +
      • +

        {{ item.item_name }}

        + {{ item.item_subtitle|safe }} + {{ item.item_desc }} + {{ item.item_category|safe }} + {{ item.item_condition|safe }} + {{ item.item_conditionDesc|safe }} + {{ item.item_cost|safe }} + {% else %} +
      • + No Items Found! + {% endfor %} +
      +{% endblock %} \ No newline at end of file diff --git a/templates/layout.html b/templates/layout.html new file mode 100644 index 0000000..06c664c --- /dev/null +++ b/templates/layout.html @@ -0,0 +1,20 @@ + +Flaskr + +
      +

      Flaskr

      +
      + {% if not session.logged_in %} + Log In + {% else %} + Log Out +
      + Dashboard +
      + {% endif %} +
      + {% for message in get_flashed_messages() %} +
      {{ message }}
      + {% endfor %} + {% block body %}{% endblock %} +
      \ No newline at end of file diff --git a/templates/login.html b/templates/login.html new file mode 100644 index 0000000..a58504a --- /dev/null +++ b/templates/login.html @@ -0,0 +1,14 @@ +{% extends "layout.html" %} +{% block body %} +

      Login

      + {% if error %}

      Error: {{ error }}{% endif %} +

      +
      +
      Username: +
      +
      Password: +
      +
      +
      +
      +{% endblock %} \ No newline at end of file diff --git a/templates/mediaserver_addFile.html b/templates/mediaserver_addFile.html new file mode 100644 index 0000000..00ae620 --- /dev/null +++ b/templates/mediaserver_addFile.html @@ -0,0 +1,18 @@ +{% extends "layout.html" %} +{% block body %} + {% if session.logged_in %} + + +
      +
      +
      File Upload: +
      +
      Add File: +
      +
      +
      +
      + View Files +
      + {% endif %} +{% endblock %} \ No newline at end of file diff --git a/templates/mediaserver_file_list.html b/templates/mediaserver_file_list.html new file mode 100644 index 0000000..69ef2a3 --- /dev/null +++ b/templates/mediaserver_file_list.html @@ -0,0 +1,36 @@ +{% extends "layout.html" %} +{% block body %} +
        + {% for item in items %} +
      • +

        File Name:

        {{ item.file_name }} +
        +
        File path on server: {{ item.file_path }} + {% if item.file_size >= 1000000 %} +
        File size on server: {{ item.file_size / 1000000 }} megabytes + {% endif %} + {% if item.file_size >= 1000 %} + {% if item.file_size < 1000000 %} +
        File size on server: {{ item.file_size / 1000 }} kilobytes + {% endif %} + {% endif %} + {% if item.file_size < 1000 %} +
        File size on server: {{ item.file_size }} bytes + {% endif %} +
        File Upload Date: {{ item.file_today_date }} +
        +
        +
        + + +
        +
        + + +
        + {% else %} +
      • + No Items Found! + {% endfor %} +
      +{% endblock %} \ No newline at end of file diff --git a/templates/mediaserver_settings.html b/templates/mediaserver_settings.html new file mode 100644 index 0000000..b6c4e63 --- /dev/null +++ b/templates/mediaserver_settings.html @@ -0,0 +1,15 @@ +{% extends "layout.html" %} +{% block body %} + {% if session.logged_in %} + Upload File path on server: {{ default_upload_path[0].settings_uploadFilePath }} + +
      +
      +
      Save Location on Server: +
      +
      Save Settings: +
      +
      +
      + {% endif %} +{% endblock %} \ No newline at end of file diff --git a/templates/pcparts/select_ssd.html b/templates/pcparts/select_ssd.html new file mode 100644 index 0000000..f41d87a --- /dev/null +++ b/templates/pcparts/select_ssd.html @@ -0,0 +1,21 @@ +{% extends "layout.html" %} +{% block body %} +
        +
      • PC Parts - Solid State Drives

        +
      • List of Solid State Drives +
      • PC PART ID: {{ pcPartId }} +
        Form Factor: + {{ selected_row.ssd_formFactor }} +
        Storage Capacity: + {{ selected_row.ssd_size|safe }} MB +
        Interface: + {{ selected_row.ssd_interface }} + {% if session.logged_in %} +
        +
        Edit Part: +
        + +
        + {% endif %} +
      +{% endblock %} \ No newline at end of file diff --git a/templates/pcparts/updatePart.html b/templates/pcparts/updatePart.html new file mode 100644 index 0000000..f09d485 --- /dev/null +++ b/templates/pcparts/updatePart.html @@ -0,0 +1,44 @@ +{% extends "layout.html" %} +{% block body %} + {% if session.logged_in %} +
      +
      +
      Part Name: +
      +
      Part Type: +
      +
      Part Model Number: +
      +
      Part Price: +
      Dollars +
      Part Description: +
      +
      Part Brand: +
      +
      Part Condition: +
      +
      Part Notes: +
      +
      Part Age: +
      Years + +
      Update Part: +
      +
      +
      + {% endif %} +{% endblock %} \ No newline at end of file diff --git a/templates/pcparts/updatePart_details.html b/templates/pcparts/updatePart_details.html new file mode 100644 index 0000000..0f809f5 --- /dev/null +++ b/templates/pcparts/updatePart_details.html @@ -0,0 +1,23 @@ +{% extends "layout.html" %} +{% block body %} +
        +
      • PC Parts - Update Part - SSD

        +
      • Update Solid State Specifics +
        + {% if session.logged_in %} +
        +
        +
        Form Factor: +
        +
        Storage Capacity: +
        MB +
        Interface: +
        + +
        Update Part: +
        +
        +
        + {% endif %} +
          +{% endblock %} \ No newline at end of file diff --git a/templates/pcparts_addBuild.html b/templates/pcparts_addBuild.html new file mode 100644 index 0000000..a289aa2 --- /dev/null +++ b/templates/pcparts_addBuild.html @@ -0,0 +1,105 @@ +{% extends "layout.html" %} +{% block body %} + {% if session.logged_in %} +
          +
          +
          Build Name: +
          +
          Build Type: +
          +
          Select Motherboard: +
          +
          Select Case: +
          +
          Select PSU: +
          +
          Select RAM: +
          +
          Select Video Card: +
          +
          Select Solid State Drive: +
          +
          Select Hard Disk Drive: +
          +
          Select Processor: +
          +
          Select CPU Cooler: +
          +
          Select Hard Disk Drive: +
          +
          Select LED Kit: +
          +
          Select Operating System: +
          +
          PC Build Notes: +
          +
          Average Part Age: +
          Years +
          Color Scheme: +
          +
          Add Part: +
          +
          +
          + {% endif %} +{% endblock %} \ No newline at end of file diff --git a/templates/pcparts_addPart.html b/templates/pcparts_addPart.html new file mode 100644 index 0000000..39c3fbe --- /dev/null +++ b/templates/pcparts_addPart.html @@ -0,0 +1,50 @@ +{% extends "layout.html" %} +{% block body %} + {% if session.logged_in %} +
          +
          +
          Part Name: +
          +
          Part Type: +
          +
          Part Model Number: +
          +
          Part Price: Dollars +
          +
          Part Description: +
          +
          Part Brand: +
          +
          Part Condition: +
          +
          Part Notes: +
          +
          Part Age: +
          Years +
          PC Build: +
          +
          Add Part: +
          +
          +
          + {% endif %} +{% endblock %} \ No newline at end of file diff --git a/templates/pcparts_addPart_ssd.html b/templates/pcparts_addPart_ssd.html new file mode 100644 index 0000000..961e477 --- /dev/null +++ b/templates/pcparts_addPart_ssd.html @@ -0,0 +1,23 @@ +{% extends "layout.html" %} +{% block body %} +
            +
          • PC Parts - Add Part - SSD

            +
          • Add Solid State Specifics +
            + {% if session.logged_in %} +
            +
            +
            Form Factor: +
            +
            Storage Capacity: +
            MB +
            Interface: +
            + +
            Add Part: +
            +
            +
            + {% endif %} +
              +{% endblock %} \ No newline at end of file diff --git a/templates/pcparts_list.html b/templates/pcparts_list.html new file mode 100644 index 0000000..3a3207f --- /dev/null +++ b/templates/pcparts_list.html @@ -0,0 +1,34 @@ +{% extends "layout.html" %} +{% block body %} +
                + {% for item in items %} +
              • +

                Part Name: {{ item.pcPart_name }}

                +
                +
                Part Type: {{ item.pcPart_type|safe }} +
                Part Model Number: {{ item.pcPart_modelNumber }} +
                Part Price: ${{ item.pcPart_price }} +
                Part Description: +
                {{ item.pcPart_desc }} +
                Part Brand: {{ item.pcPart_brand }} +
                Part Condition: +
                {{ item.pcPart_condition }} +
                Part Notes: +
                {{ item.pcPart_notes }} +
                Part Age: {{ item.pcPart_age }} years +
                +
                +
                + + +
                +
                + + +
                + {% else %} +
              • + No Items Found! + {% endfor %} +
              +{% endblock %} \ No newline at end of file diff --git a/templates/pcparts_listBuilds.html b/templates/pcparts_listBuilds.html new file mode 100644 index 0000000..51324a4 --- /dev/null +++ b/templates/pcparts_listBuilds.html @@ -0,0 +1,28 @@ +{% extends "layout.html" %} +{% block body %} +
                + {% for pcBuild in pcBuildList %} +
              • +

                Build Name: {{ pcBuild.pcBuild_name }}

                +
                +
                Type: {{ pcBuild.pcBuild_type|safe }} +
                Avg Part Age: {{ pcBuild.pcBuild_avgPartAge }} years +
                Color Scheme: {{ pcBuild.pcBuild_colorScheme }} +
                Notes: +
                {{ pcBuild.pcBuild_notes }} +
                +
                +
                + + +
                +
                + + +
                + {% else %} +
              • + No Items Found! + {% endfor %} +
              +{% endblock %} \ No newline at end of file -- 2.30.2