mirror of
https://github.com/nextcloud/nextcloudpi.git
synced 2026-01-10 15:12:01 -03:30
add directory type
This commit is contained in:
parent
497edb8d94
commit
80cd216eac
@ -16,7 +16,8 @@
|
||||
"id": "DESTDIR",
|
||||
"name": "Destination Directory",
|
||||
"value": "/media/USBdrive/ncp-backups",
|
||||
"suggest": "/media/USBdrive/ncp-backups"
|
||||
"suggest": "/media/USBdrive/ncp-backups",
|
||||
"type": "directory"
|
||||
},
|
||||
{
|
||||
"id": "INCLUDEDATA",
|
||||
|
||||
@ -10,7 +10,8 @@
|
||||
"id": "DESTDIR",
|
||||
"name": "Destination directory",
|
||||
"value": "/media/USBdrive/ncp-backups",
|
||||
"suggest": "/media/USBdrive/ncp-backups"
|
||||
"suggest": "/media/USBdrive/ncp-backups",
|
||||
"type": "directory"
|
||||
},
|
||||
{
|
||||
"id": "INCLUDEDATA",
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
"value": "/media/USBdrive/ncdatabase",
|
||||
"suggest": "/media/USBdrive/ncdatabase",
|
||||
"default": "/var/lib/mysql",
|
||||
"type": "path"
|
||||
"type": "directory"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
"value": "/media/USBdrive/ncdata",
|
||||
"suggest": "/media/USBdrive/ncdata",
|
||||
"default": "/var/www/nextcloud/data",
|
||||
"type": "path"
|
||||
"type": "directory"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ HTML;
|
||||
$ret .= "<td><label for=\"$ncp_app-$param[id]\">$param[name]</label></td>";
|
||||
|
||||
// default to text input
|
||||
if (!array_key_exists('type', $param))
|
||||
if (!array_key_exists('type', $param) || $param['type'] == 'directory' || $param['type'] == 'file')
|
||||
{
|
||||
$suggest = '';
|
||||
if (array_key_exists('suggest', $param))
|
||||
@ -43,8 +43,14 @@ HTML;
|
||||
size=\"40\">";
|
||||
|
||||
if (array_key_exists('default', $param))
|
||||
{
|
||||
$ret .= "<img class=\"default-btn\" title=\"restore defaults\" src=\"../img/info.svg\">";
|
||||
|
||||
if ($param['type'] == 'directory')
|
||||
{
|
||||
if (file_exists($param['value']))
|
||||
$ret .= " <span class=\"ok-field\">directory exists</span>";
|
||||
else
|
||||
$ret .= " <span class=\"error-field\">directory doesn't exist</span>";
|
||||
}
|
||||
|
||||
$ret .= "</td>";
|
||||
@ -84,7 +90,7 @@ HTML;
|
||||
</table>
|
||||
</div>
|
||||
<div class="config-button-wrapper">
|
||||
<button id="$ncp_app-config-button" class="config-button">Run</button>
|
||||
<button id="$ncp_app-config-button" class="config-button">Apply</button>
|
||||
<img class="loading-gif" src="img/loading-small.gif">
|
||||
<div class="circle-retstatus" class="icon-red-circle"></div>
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user