diff --git a/parts/maps/here.png b/parts/maps/here.png index 5e357f5..9922c14 100644 Binary files a/parts/maps/here.png and b/parts/maps/here.png differ diff --git a/parts/maps/overlays/c1.png b/parts/maps/overlays/c1.png new file mode 100644 index 0000000..74fff46 Binary files /dev/null and b/parts/maps/overlays/c1.png differ diff --git a/parts/maps/overlays/c2.png b/parts/maps/overlays/c2.png new file mode 100644 index 0000000..d750de9 Binary files /dev/null and b/parts/maps/overlays/c2.png differ diff --git a/parts/maps/overlays/e3.png b/parts/maps/overlays/e3.png new file mode 100644 index 0000000..e478d93 Binary files /dev/null and b/parts/maps/overlays/e3.png differ diff --git a/parts/maps/overlays/e4.png b/parts/maps/overlays/e4.png new file mode 100644 index 0000000..a158f85 Binary files /dev/null and b/parts/maps/overlays/e4.png differ diff --git a/parts/maps/overlays/e5.png b/parts/maps/overlays/e5.png new file mode 100644 index 0000000..8f5f175 Binary files /dev/null and b/parts/maps/overlays/e5.png differ diff --git a/parts/maps/overlays/e6.png b/parts/maps/overlays/e6.png new file mode 100644 index 0000000..e1ed811 Binary files /dev/null and b/parts/maps/overlays/e6.png differ diff --git a/parts/maps/overlays/e7.png b/parts/maps/overlays/e7.png new file mode 100644 index 0000000..331f144 Binary files /dev/null and b/parts/maps/overlays/e7.png differ diff --git a/parts/maps/overlays/h1.png b/parts/maps/overlays/h1.png new file mode 100644 index 0000000..8f735c6 Binary files /dev/null and b/parts/maps/overlays/h1.png differ diff --git a/parts/maps/overlays/h2.png b/parts/maps/overlays/h2.png new file mode 100644 index 0000000..f347871 Binary files /dev/null and b/parts/maps/overlays/h2.png differ diff --git a/parts/maps/overlays/h3.png b/parts/maps/overlays/h3.png new file mode 100644 index 0000000..5bc3e2f Binary files /dev/null and b/parts/maps/overlays/h3.png differ diff --git a/parts/maps/overlays/h4.png b/parts/maps/overlays/h4.png new file mode 100644 index 0000000..98b4ce8 Binary files /dev/null and b/parts/maps/overlays/h4.png differ diff --git a/parts/maps/overlays/h5.png b/parts/maps/overlays/h5.png new file mode 100644 index 0000000..8cc1be4 Binary files /dev/null and b/parts/maps/overlays/h5.png differ diff --git a/parts/maps/overlays/h6.png b/parts/maps/overlays/h6.png new file mode 100644 index 0000000..5e986b5 Binary files /dev/null and b/parts/maps/overlays/h6.png differ diff --git a/parts/maps/overlays/h7.png b/parts/maps/overlays/h7.png new file mode 100644 index 0000000..166db9d Binary files /dev/null and b/parts/maps/overlays/h7.png differ diff --git a/parts/maps/overlays/l1.png b/parts/maps/overlays/l1.png new file mode 100644 index 0000000..1abfb35 Binary files /dev/null and b/parts/maps/overlays/l1.png differ diff --git a/parts/maps/overlays/l2.png b/parts/maps/overlays/l2.png new file mode 100644 index 0000000..b8c9e86 Binary files /dev/null and b/parts/maps/overlays/l2.png differ diff --git a/parts/maps/overlays/l3.png b/parts/maps/overlays/l3.png new file mode 100644 index 0000000..92bf9e2 Binary files /dev/null and b/parts/maps/overlays/l3.png differ diff --git a/parts/maps/overlays/l4.png b/parts/maps/overlays/l4.png new file mode 100644 index 0000000..e23d5ef Binary files /dev/null and b/parts/maps/overlays/l4.png differ diff --git a/parts/maps/overlays/l5.png b/parts/maps/overlays/l5.png new file mode 100644 index 0000000..0e9cad4 Binary files /dev/null and b/parts/maps/overlays/l5.png differ diff --git a/parts/maps/overlays/l6.png b/parts/maps/overlays/l6.png new file mode 100644 index 0000000..bc780b5 Binary files /dev/null and b/parts/maps/overlays/l6.png differ diff --git a/parts/maps/overlays/l7.png b/parts/maps/overlays/l7.png new file mode 100644 index 0000000..0cedb14 Binary files /dev/null and b/parts/maps/overlays/l7.png differ diff --git a/parts/maps/overlays/l8.png b/parts/maps/overlays/l8.png new file mode 100644 index 0000000..3af8581 Binary files /dev/null and b/parts/maps/overlays/l8.png differ diff --git a/parts/maps/overlays/l9.png b/parts/maps/overlays/l9.png new file mode 100644 index 0000000..6e08ca8 Binary files /dev/null and b/parts/maps/overlays/l9.png differ diff --git a/parts/maps/overlays/o1.png b/parts/maps/overlays/o1.png new file mode 100644 index 0000000..f89a068 Binary files /dev/null and b/parts/maps/overlays/o1.png differ diff --git a/parts/maps/overlays/s11.png b/parts/maps/overlays/s11.png new file mode 100644 index 0000000..9ce2e1b Binary files /dev/null and b/parts/maps/overlays/s11.png differ diff --git a/parts/maps/overlays/s13.png b/parts/maps/overlays/s13.png new file mode 100644 index 0000000..4bd2686 Binary files /dev/null and b/parts/maps/overlays/s13.png differ diff --git a/parts/maps/overlays/s14.png b/parts/maps/overlays/s14.png new file mode 100644 index 0000000..aff862f Binary files /dev/null and b/parts/maps/overlays/s14.png differ diff --git a/parts/maps/overlays/s7.png b/parts/maps/overlays/s7.png new file mode 100644 index 0000000..c91b527 Binary files /dev/null and b/parts/maps/overlays/s7.png differ diff --git a/parts/maps/overlays/s9.png b/parts/maps/overlays/s9.png new file mode 100644 index 0000000..688bca4 Binary files /dev/null and b/parts/maps/overlays/s9.png differ diff --git a/parts/maps/overlays/v1.png b/parts/maps/overlays/v1.png new file mode 100644 index 0000000..763eb04 Binary files /dev/null and b/parts/maps/overlays/v1.png differ diff --git a/parts/maps/overlays/v10.png b/parts/maps/overlays/v10.png new file mode 100644 index 0000000..2689105 Binary files /dev/null and b/parts/maps/overlays/v10.png differ diff --git a/parts/maps/overlays/v11.png b/parts/maps/overlays/v11.png new file mode 100644 index 0000000..1df180a Binary files /dev/null and b/parts/maps/overlays/v11.png differ diff --git a/parts/maps/overlays/v12.png b/parts/maps/overlays/v12.png new file mode 100644 index 0000000..fefb330 Binary files /dev/null and b/parts/maps/overlays/v12.png differ diff --git a/parts/maps/overlays/v13.png b/parts/maps/overlays/v13.png new file mode 100644 index 0000000..25843a7 Binary files /dev/null and b/parts/maps/overlays/v13.png differ diff --git a/parts/maps/overlays/v14.png b/parts/maps/overlays/v14.png new file mode 100644 index 0000000..f70c618 Binary files /dev/null and b/parts/maps/overlays/v14.png differ diff --git a/parts/maps/overlays/v2.png b/parts/maps/overlays/v2.png new file mode 100644 index 0000000..bd8c0f1 Binary files /dev/null and b/parts/maps/overlays/v2.png differ diff --git a/parts/maps/overlays/v3.png b/parts/maps/overlays/v3.png new file mode 100644 index 0000000..ec03a51 Binary files /dev/null and b/parts/maps/overlays/v3.png differ diff --git a/parts/maps/overlays/v4.png b/parts/maps/overlays/v4.png new file mode 100644 index 0000000..fffd0bd Binary files /dev/null and b/parts/maps/overlays/v4.png differ diff --git a/parts/maps/overlays/v5.png b/parts/maps/overlays/v5.png new file mode 100644 index 0000000..172da09 Binary files /dev/null and b/parts/maps/overlays/v5.png differ diff --git a/parts/maps/overlays/v6.png b/parts/maps/overlays/v6.png new file mode 100644 index 0000000..71f2c1d Binary files /dev/null and b/parts/maps/overlays/v6.png differ diff --git a/parts/maps/overlays/v7.png b/parts/maps/overlays/v7.png new file mode 100644 index 0000000..5f20e26 Binary files /dev/null and b/parts/maps/overlays/v7.png differ diff --git a/parts/maps/overlays/v8.png b/parts/maps/overlays/v8.png new file mode 100644 index 0000000..6ec12d1 Binary files /dev/null and b/parts/maps/overlays/v8.png differ diff --git a/parts/maps/overlays/v9.png b/parts/maps/overlays/v9.png new file mode 100644 index 0000000..ebd8898 Binary files /dev/null and b/parts/maps/overlays/v9.png differ diff --git a/parts/maps/overlays/ve1.png b/parts/maps/overlays/ve1.png new file mode 100644 index 0000000..d241e2b Binary files /dev/null and b/parts/maps/overlays/ve1.png differ diff --git a/parts/maps/overlays/ve2.png b/parts/maps/overlays/ve2.png new file mode 100644 index 0000000..d4e65ae Binary files /dev/null and b/parts/maps/overlays/ve2.png differ diff --git a/parts/maps/overlays/ve3.png b/parts/maps/overlays/ve3.png new file mode 100644 index 0000000..3188b18 Binary files /dev/null and b/parts/maps/overlays/ve3.png differ diff --git a/parts/maps/overlays/vgrid.png b/parts/maps/overlays/vgrid.png new file mode 100644 index 0000000..f43f5e0 Binary files /dev/null and b/parts/maps/overlays/vgrid.png differ diff --git a/parts/maps/valut.png b/parts/maps/valut.png deleted file mode 100644 index 0e858dd..0000000 Binary files a/parts/maps/valut.png and /dev/null differ diff --git a/parts/maps/vault_1.png b/parts/maps/vault_1.png new file mode 100644 index 0000000..82f806b Binary files /dev/null and b/parts/maps/vault_1.png differ diff --git a/parts/maps/vault_10.png b/parts/maps/vault_10.png new file mode 100644 index 0000000..68ea1e0 Binary files /dev/null and b/parts/maps/vault_10.png differ diff --git a/parts/maps/vault_12.png b/parts/maps/vault_12.png new file mode 100644 index 0000000..a2fca52 Binary files /dev/null and b/parts/maps/vault_12.png differ diff --git a/parts/maps/vault_14.png b/parts/maps/vault_14.png new file mode 100644 index 0000000..740bdce Binary files /dev/null and b/parts/maps/vault_14.png differ diff --git a/parts/maps/vault_2.png b/parts/maps/vault_2.png new file mode 100644 index 0000000..f040bd0 Binary files /dev/null and b/parts/maps/vault_2.png differ diff --git a/parts/maps/vault_4.png b/parts/maps/vault_4.png new file mode 100644 index 0000000..304e10b Binary files /dev/null and b/parts/maps/vault_4.png differ diff --git a/parts/maps/vault_6.png b/parts/maps/vault_6.png new file mode 100644 index 0000000..18ec0fa Binary files /dev/null and b/parts/maps/vault_6.png differ diff --git a/parts/maps/vault_8.png b/parts/maps/vault_8.png new file mode 100644 index 0000000..261fc76 Binary files /dev/null and b/parts/maps/vault_8.png differ diff --git a/parts/server.py b/parts/server.py index ddaee93..a2fa9d7 100644 --- a/parts/server.py +++ b/parts/server.py @@ -19,6 +19,15 @@ db_engine = {} db_metadata = {} parts = {} +def getContainers(): + query = "select id, name from containers order by UPPER(name);" + r = db_engine.execute(text(query)) + containers = [] + for row in r: + containers.append(dict(row)) + r.close() + return containers + def check_auth(username, password): admin_list = [] with open('edit_admin.json', 'r') as admin: @@ -47,13 +56,7 @@ def serveImage(img): @app.route('/parts') def index(): - query = "select id, name from containers order by UPPER(name);" - r = db_engine.execute(text(query)) - containers = [] - for row in r: - containers.append(dict(row)) - r.close() - return render_template('partsearch.html', containers=containers) + return render_template('partsearch.html', containers=getContainers()) @app.route('/parts/getlocationsInContainer/') def get_locations_in_container(containerID): @@ -77,15 +80,13 @@ def get_locationURL(locationID): @app.route('/parts/locationEditor') def locationEditor(): - query = 'select * from locations order by name;' + query = 'select c.name as container, l.name as name, l.id from locations as l inner join containers as c on l.container_id = c.id order by container, name;' r = db_engine.execute(text(query)) locations = [] for row in r: locations.append(dict(row)) r.close() - know_not_map_files = ['here.png', '404.png', '.DS_Store'] - mapfiles = [f for f in listdir('maps') if isfile(join('maps', f)) and f not in know_not_map_files] - return render_template('locationEditor.html', locations=locations, mapfiles=mapfiles, defaultMapfile="elab.png") + return render_template('locationEditor.html', locations=locations, containers=getContainers()) @app.route('/parts/alterLocation/', methods=['POST']) # @requires_auth diff --git a/parts/templates/locationEditor.html b/parts/templates/locationEditor.html index 973b1c4..fbdd1ed 100644 --- a/parts/templates/locationEditor.html +++ b/parts/templates/locationEditor.html @@ -18,15 +18,15 @@

Looking for a place to store your obsolete ICs discontinued years ago? Just toss them anywhere and mark that location here!

- + - + {% for location in locations %} - + - + {% endfor %}
IDContainer Location nameMap URLID
{{location['id']}}{{location['container']}} {{location['name']}}{{location['map']}}{{location['id']}}
@@ -41,8 +41,8 @@ MAP