Skip to content

Commit

Permalink
UI BUG修复
Browse files Browse the repository at this point in the history
  • Loading branch information
Shawnsdaddy committed Oct 9, 2024
1 parent 171e10e commit 78cb477
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion arknights_mower/utils/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ def screenshot_cleanup():
start_time_ns = time.time_ns() - config.conf.screenshot * 3600 * 10**9
for i in screenshot_folder.iterdir():
if i.is_dir():
if i.name == "run_order":
continue
shutil.rmtree(i)
elif not i.stem.isnumeric():
i.unlink()
Expand All @@ -108,7 +110,11 @@ def screenshot_worker():
Thread(target=screenshot_worker, daemon=True).start()


def save_screenshot(img: bytes) -> None:
def save_screenshot(img: bytes, sub_folder=None) -> None:
filename = f"{time.time_ns()}.jpg"
logger.debug(filename)
if sub_folder:
sub_folder_path = Path(screenshot_folder) / sub_folder
sub_folder_path.mkdir(parents=True, exist_ok=True)
filename = f"{sub_folder}/{filename}"
screenshot_queue.put((img, filename))
2 changes: 1 addition & 1 deletion ui/src/components/PlanEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ function drop_facility(target, event) {
const allPlans = ['main', ...backup_plans.value]
allPlans.forEach((item, index) => {
if ((sub_plan.value === 'main' && item === 'main') || sub_plan.value === index) {
if ((sub_plan.value === 'main' && item === 'main') || sub_plan.value + 1 === index) {
return
}
// 执行更新操作
Expand Down

0 comments on commit 78cb477

Please sign in to comment.