")
+def delete(sku):
+ db, db_name = get_database(request)
+ db.delete_price(sku)
+
+ return redirect(f"/items?db={db_name}")
+
+
+@app.route("/edit", methods=["POST"])
+def edit():
+ db, db_name = get_database(request)
+ data = dict(request.form.items())
+
+ buy_keys = data["buy_keys"]
+ buy_metal = data["buy_metal"]
+
+ sell_keys = data["sell_keys"]
+ sell_metal = data["sell_metal"]
+
+ if not buy_keys:
+ buy_keys = 0
+
+ if not sell_keys:
+ sell_keys = 0
+
+ if not buy_metal:
+ buy_metal = 0.0
+
+ if not sell_metal:
+ sell_metal = 0.0
+
+ db.update_price(
+ sku=data["sku"],
+ buy={
+ "keys": int(buy_keys),
+ "metal": refinedify(float(buy_metal)),
+ },
+ sell={
+ "keys": int(sell_keys),
+ "metal": refinedify(float(sell_metal)),
+ },
+ autoprice=False,
+ )
+
+ return redirect(f"/items?db={db_name}")
+
+
+@app.route("/add", methods=["POST"])
+def add():
+ db, db_name = get_database(request)
+ data = dict(request.form.items())
+ items = data["items"].split(",")
+ skus = db.get_skus()
+ data = items_to_data(items, skus)
+ add_items_to_database(db, data)
+
+ return redirect(f"/items?db={db_name}")
+
+
+if __name__ == "__main__":
+ config = get_config()
+
+ for bot in config["bots"]:
+ options = bot.get("options", {})
+ db = options.get("database", "express")
+ host = options.get("host", "localhost")
+ port = options.get("port", 27017)
+
+ if not first_database:
+ first_database = db
+
+ databases[db] = Database(db, host, port)
+
+ name = config.get("name", "express user")
+
+ app.run(debug=True)
diff --git a/requirements.txt b/requirements.txt
index 2e0f08f..4ff8aad 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,7 +1,8 @@
-steampy
-colorama
+steampy>=1.1.0
+tf2-sku>=2.0.1
+tf2-data>=0.0.4
+tf2-utils>=2.0.6
requests
-python-socketio
pymongo
flask
-python-engineio==3.14.2
+black
diff --git a/start.bat b/start.bat
deleted file mode 100644
index dcc4dfe..0000000
--- a/start.bat
+++ /dev/null
@@ -1,4 +0,0 @@
-@echo off
-title tf2-express
-python main.py
-pause
diff --git a/static/favicon.ico b/static/favicon.ico
new file mode 100644
index 0000000..1975612
Binary files /dev/null and b/static/favicon.ico differ
diff --git a/static/main.css b/static/main.css
new file mode 100644
index 0000000..a570097
--- /dev/null
+++ b/static/main.css
@@ -0,0 +1,28 @@
+:root {
+ --green: #4CFF00;
+ --red: #BE1A1A;
+ --black: #1D1D1D;
+ --link-green: #72D587;
+}
+
+.table-dark {
+ --bs-table-bg: var(--black);
+}
+
+body {
+ background-color: var(--black);
+ color: white;
+}
+
+h1 {
+ color: var(--green);
+ margin-top: 5%;
+}
+
+h2 {
+ margin-top: 2.5%;
+}
+
+a {
+ color: var(--link-green);
+}
\ No newline at end of file
diff --git a/templates/base.html b/templates/base.html
new file mode 100644
index 0000000..c777ddc
--- /dev/null
+++ b/templates/base.html
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
+ {% block title %}{% endblock %} | tf2-express
+
+
+
+
+
+
+ {% block contents %}
+ {% endblock %}
+
+
+
+
\ No newline at end of file
diff --git a/templates/home.html b/templates/home.html
new file mode 100644
index 0000000..3d2e7b5
--- /dev/null
+++ b/templates/home.html
@@ -0,0 +1,36 @@
+{% extends "base.html" %}
+
+{% block title %}
+Home
+{% endblock %}
+
+{% block contents %}
+Welcome back, {{ name }}
+
+Useful information
+You are running
+
+ - tf2-express at v{{ tf2_express_version }} repository
+ - tf2-utils at v{{ tf2_utils_version }} repository
+ - tf2-data at v{{ tf2_data_version }} repository
+ - tf2-sku at v{{ tf2_sku_version }} repository
+
+
+
+Currently viewing data from "{{ db_name }}" database. If you are running multiple bots, you might want to change the
+ database you are viewing.
+Other links
+
+
+Support me?
+These sort of things takes time to make. Donations are not required, but greatly appericated!
+
+
+
+{% endblock %}
\ No newline at end of file
diff --git a/templates/item.html b/templates/item.html
new file mode 100644
index 0000000..e47273e
--- /dev/null
+++ b/templates/item.html
@@ -0,0 +1,42 @@
+{% extends "base.html" %}
+
+{% block title %}
+{{ item.name }}
+{% endblock %}
+
+{% block contents %}
+{{ item.sku }}
+
+{{ item.name }}
+{% if item.autoprice %}
+Autopriced
+{% else %}
+Not autopriced
+{% endif %}
+Last updated: {{ item.updated }}
+
+
+
+Buy
+Keys: {{ item["buy"]["keys"] }}
+Metal: {{ item["buy"]["metal"] }}
+
+Sell
+Keys: {{ item["sell"]["keys"] }}
+Metal: {{ item["sell"]["metal"] }}
+
+Stock
+In stock: TODO
+Max stock: TODO
+
+{% endblock %}
\ No newline at end of file
diff --git a/templates/items.html b/templates/items.html
new file mode 100644
index 0000000..643ee87
--- /dev/null
+++ b/templates/items.html
@@ -0,0 +1,81 @@
+{% extends "base.html" %}
+
+{% block title %}
+Items
+{% endblock %}
+
+{% block contents %}
+Items
+
+
+
+
+Items which are autopriced will get/update their price when starting the bot.
+
+
+
+
+ Icon |
+ SKU |
+ Autopriced |
+ Buy keys |
+ Buy refined |
+ Sell keys |
+ Sell refined |
+ Action |
+
+
+
+ {% for item in items %}
+
+ |
+
+ {{ item.sku }} ({{ item.name }}) |
+ {{ item.autoprice }} |
+
+
+
+
+ {% endfor %}
+
+
+{% endblock %}
\ No newline at end of file
diff --git a/templates/trades.html b/templates/trades.html
new file mode 100644
index 0000000..56a9dda
--- /dev/null
+++ b/templates/trades.html
@@ -0,0 +1,55 @@
+{% extends "base.html" %}
+
+{% block title %}
+Trades
+{% endblock %}
+
+{% block contents %}
+Trades
+
+
+
+
+Showing {{ start_index }}-{{ end_index }} ({{ end_index - start_index }}) of {{ total_trades }} total trades.
+
+
+
+{% for trade in trades %}
+
+
+
Trade #{{ trade.tradeofferid }}
+ {% if trade.message %}
+
Message: {{ trade.message }}
+ {% endif %}
+
Created: {{ trade.time_created }}
+
Accepted: {{ trade.time_updated }}
+
+ {% if trade.our_items %}
+
Our items ({{ trade.our_items|length }}x)
+
Our value: {{ trade.our_value }} refined
+ {% for item in trade.our_summary %}
+
+
+ {{ trade.our_summary[item].count }}x {{ item }}
+
+ {% endfor %}
+ {% endif %}
+
+ {% if trade.their_items %}
+
Their items ({{ trade.their_items|length }}x)
+
Their value: {{ trade.their_value }} refined
+ {% for item in trade.their_summary %}
+
+
+ {{ trade.their_summary[item].count }}x {{ item }}
+
+ {% endfor %}
+ {% endif %}
+
+{% endfor %}
+{% endblock %}
\ No newline at end of file