@@ -13,6 +13,8 @@ $ui_unpatch_button_type = (strcmp($cfg['PATCH_UI'],"false") == 0 && isset($compo
13
13
14
14
$option_patch_ui = version_compare(parse_ini_file('/etc/unraid-version')['version'],'6.12.0-RC0', '>=');
15
15
$ui_patch_help_class = $option_patch_ui ? "hidden" : "inline_help";
16
+
17
+ $projects_exist = intval(shell_exec("ls -l ".$compose_root." | grep ^d | wc -l")) != 0;
16
18
?>
17
19
<style>
18
20
<?php
@@ -36,11 +38,42 @@ function unpatchWebui() {
36
38
window.location.reload();
37
39
})
38
40
}
41
+
42
+ function checkProjectFolder() {
43
+ var projects_folder_not_empty = <?php echo json_encode($projects_exist); ?>;
44
+ var original_folder = "<?php echo $cfg['PROJECTS_FOLDER'] ?>";
45
+
46
+ if(projects_folder_not_empty & ($(this).val() != original_folder))
47
+ {
48
+ $("#PROJECTS_FOLDER_WARNING").show();
49
+ }
50
+ else
51
+ {
52
+ $("#PROJECTS_FOLDER_WARNING").hide();
53
+ }
54
+ }
55
+
56
+ $(function() {
57
+ $('#PROJECTS_FOLDER').on("input", null, null, checkProjectFolder);
58
+ });
59
+
39
60
</script>
40
61
41
62
<form markdown="1" name="compose_manager_settings" method="POST" action="/update.php" target="progressFrame">
42
63
<input type="hidden" name="#file" value="<?=$sName?>/<?=$sName?>.cfg">
43
64
65
+ _(Compose Project Directory)_:
66
+ : <input type="text" name="PROJECTS_FOLDER" id="PROJECTS_FOLDER" autocomplete="off" spellcheck="false" value="<?=$cfg['PROJECTS_FOLDER']?>" placeholder="_(e.g.)_ /mnt/user/appdata/compose_projects" data-pickcloseonfile="true" data-pickfilter="img" data-pickroot="/mnt" data-pickfolders="true" required pattern="^\/(mnt\/.+\/.+)||(\/boot\/config\/plugins\/compose\.manager\/projects)$">
67
+ <a class='info nohand' id="PROJECTS_FOLDER_WARNING" onclick="HelpButton();return false;" style="display: none;">
68
+ <i class='fa fa-warning orb yellow-orb'></i>
69
+ <span style='left:18px'><strong>Projects exist that will not be moved to the new project folder.</strong></span>
70
+ </a>
71
+
72
+ <blockquote class="inline_help" id="PROJECTS_FOLDER_HELP" style="display: none;">
73
+ Choose the folder in which compose.manager will store your stacks.<br>
74
+ <strong>WARNING: Changing this path will not automatically move your existing project folders.</strong>
75
+ </blockquote>
76
+
44
77
_(Compose Command Progress Display)_:
45
78
: <select name="OUTPUTSTYLE">
46
79
<?=mk_option($cfg['OUTPUTSTYLE'], "basic", _("Basic"))?>
0 commit comments