From 2527f00d3c1ba71ce19a8c5aee42030b7efcd2bc Mon Sep 17 00:00:00 2001 From: Aidaho Date: Fri, 12 Dec 2025 12:36:40 +0300 Subject: [PATCH] v8.2.6: Update version migrations and enhance install template options - Added a new migration file to update the version to `8.2.6`. - Updated install templates to include new version options for HAProxy, Apache Exporter, and Node Exporter. - Modified default version in `ServerInstall` model to `3.3.0-1`. --- .../db/migrations/v8_2_8_update_version.py | 22 +++++++++++++++++++ app/modules/roxywi/class_models.py | 2 +- app/templates/install.html | 12 +++++----- 3 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 app/modules/db/migrations/v8_2_8_update_version.py diff --git a/app/modules/db/migrations/v8_2_8_update_version.py b/app/modules/db/migrations/v8_2_8_update_version.py new file mode 100644 index 00000000..562e7128 --- /dev/null +++ b/app/modules/db/migrations/v8_2_8_update_version.py @@ -0,0 +1,22 @@ +from playhouse.migrate import * +from app.modules.db.db_model import connect, Version + +migrator = connect(get_migrator=1) + + +def up(): + """Apply the migration.""" + try: + Version.update(version='8.2.6').execute() + except Exception as e: + print(f"Error updating version: {str(e)}") + raise e + + +def down(): + """Roll back the migration.""" + try: + Version.update(version='8.2.5').execute() + except Exception as e: + print(f"Error rolling back migration: {str(e)}") + raise e diff --git a/app/modules/roxywi/class_models.py b/app/modules/roxywi/class_models.py index cee44a49..37e23e00 100644 --- a/app/modules/roxywi/class_models.py +++ b/app/modules/roxywi/class_models.py @@ -235,7 +235,7 @@ class ChannelRequest(BaseModel): class ServerInstall(BaseModel): id: int master: Optional[bool] = 0 - version: Optional[str] = '3.1.7-1' + version: Optional[str] = '3.3.0-1' class ServiceInstall(BaseModel): diff --git a/app/templates/install.html b/app/templates/install.html index 2eb9172c..c2f26320 100644 --- a/app/templates/install.html +++ b/app/templates/install.html @@ -39,8 +39,8 @@ {% set values = dict() %} - {% set values = {'2.6.14-1':'2.6.14-1','2.7.9-1':'2.7.9-1','2.8.1-1':'2.8.1-1','2.9.6-1':'2.9.6-1','3.0.10-1':'3.0.10-1','3.1.7-1':'3.1.7-1'} %} - {{ select('hapver', values=values, selected='3.1.7-1', required='required') }} + {% set values = {'2.7.9-1':'2.7.9-1','2.8.1-1':'2.8.1-1','2.9.6-1':'2.9.6-1','3.0.10-1':'3.0.10-1','3.1.7-1':'3.1.7-1','3.3.0-1':'3.3.0-1'} %} + {{ select('hapver', values=values, selected='3.3.0-1', required='required') }} @@ -274,8 +274,8 @@ {% set values = dict() %} - {% set values = {'1.5.0':'1.5.0', '1.6.1':'1.6.1', '1.7.0':'1.7.0', '1.8.0':'1.8.0', '1.8.2':'1.8.2', '1.9.1':'1.9.1'} %} - {{ select('nodeexpver', values=values, selected='1.8.2') }} + {% set values = {'1.5.0':'1.5.0', '1.6.1':'1.6.1', '1.7.0':'1.7.0', '1.8.0':'1.8.0', '1.8.2':'1.8.2', '1.9.1':'1.9.1', '1.10.2':'1.10.2'} %} + {{ select('nodeexpver', values=values, selected='1.10.2') }}