Merge branch 'dev' into tweak/pretzel-backup-list

This commit is contained in:
Zedifus 2022-08-14 18:03:30 +01:00
commit ab5f587f50
8 changed files with 41 additions and 28 deletions

View File

@ -3,9 +3,11 @@
### New features
TBD
### Bug fixes
TBD
- Fix reaction tasks not firing ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/423))
- QOL task delay offset not following over on task edit ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/423))
- Fix Fresh Install Detection Logic issues ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/425))
### Tweaks
TBD
- Session Handling | Logout on browser close ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/424))
### Lang
TBD
<br><br>

View File

@ -107,6 +107,12 @@ class HelperUsers:
usernames.append(user.username)
return usernames
@staticmethod
def get_user_total():
count = Users.select().where(Users.username != "system").count()
print(count)
return count
@staticmethod
def get_all_user_ids() -> t.List[int]:
return [

View File

@ -30,9 +30,8 @@ class DatabaseBuilder:
def is_fresh_install(self):
try:
user = self.users_helper.get_by_id(1)
if user:
return False
num_user = self.users_helper.get_user_total()
return num_user <= 0
except:
return True

View File

@ -3,7 +3,7 @@ import time
import logging
import threading
import asyncio
from datetime import datetime
import datetime
from tzlocal import get_localzone
from tzlocal.utils import ZoneInfoNotFoundError
@ -199,7 +199,7 @@ class TasksManager:
"interval",
hours=12,
id="update_watcher",
start_date=datetime.now(),
start_date=datetime.datetime.now(),
)
# self.scheduler.add_job(
# self.scheduler.print_jobs, "interval", seconds=10, id="-1"

View File

@ -962,6 +962,7 @@ class PanelHandler(BaseHandler):
page_data["schedule"]["command"] = ""
page_data["schedule"]["one_time"] = False
page_data["schedule"]["cron_string"] = ""
page_data["schedule"]["delay"] = 0
page_data["schedule"]["time"] = ""
page_data["schedule"]["interval"] = ""
# we don't need to check difficulty here.
@ -1041,6 +1042,7 @@ class PanelHandler(BaseHandler):
page_data["schedule"]["command"] = schedule.command
else:
page_data["schedule"]["command"] = ""
page_data["schedule"]["delay"] = schedule.delay
page_data["schedule"]["enabled"] = schedule.enabled
page_data["schedule"]["one_time"] = schedule.one_time
page_data["schedule"]["cron_string"] = schedule.cron_string

View File

@ -105,21 +105,6 @@
],
"blurb": "Developer at work and at home, testing his own code is a pain, so his coding precept is \"Testing is Doubting\"",
"pic": "/static/assets/images/credits/silversthorn.png"
},
{
"name": "ThatOneLukas",
"title": "Software Engineer",
"loc": "Helsinki, FI",
"tags": [
"Staff",
[
"Developer",
"https://gitlab.com/LukasDoesDev"
],
null
],
"blurb": "Arch Linux enthusiast who likes 80s/90s music, Rust (The programming language) and light distros like Arch Linux btw. Dislikes C, C++, Go, and Microsoft. Also doesn't like Finnish weather that freezes molten snow to (deadly) ice.",
"pic": "/static/assets/images/credits/lukas.png"
}
],
"support": [
@ -217,6 +202,21 @@
],
"blurb": "His interests include learning, Linux, and programming. He loves pentesting apps and gaming.",
"pic": "/static/assets/images/credits/mcgaming.png"
},
{
"name": "ThatOneLukas",
"title": "Software Engineer",
"loc": "Helsinki, FI",
"tags": [
"Staff",
[
"Developer",
"https://gitlab.com/LukasDoesDev"
],
null
],
"blurb": "Arch Linux enthusiast who likes 80s/90s music, Rust (The programming language) and light distros like Arch Linux btw. Dislikes C, C++, Go, and Microsoft. Also doesn't like Finnish weather that freezes molten snow to (deadly) ice.",
"pic": "/static/assets/images/credits/lukas.png"
}
]
},

View File

@ -516,6 +516,9 @@
});
});
$(window).unload(function () {
jQuery.get("/public/logout")
});
</script>
{% block js %}

View File

@ -136,7 +136,8 @@
<label for="delay">{{ translate('serverScheduleConfig', 'offset' , data['lang']) }} <small
class="text-muted ml-1"> - {{ translate('serverScheduleConfig', 'offset-explain' ,
data['lang']) }}</small> </label>
<input type="number" class="form-control" name="delay" id="delay" value="0">
<input type="number" class="form-control" name="delay" id="delay"
value="{{ data['schedule']['delay']}}">
<br>
<br>
<label for="parent">{{ translate('serverScheduleConfig', 'parent' , data['lang']) }} <small