Compare commits

..

283 Commits

Author SHA1 Message Date
Tom Mortensen
95c6913c62 small chang in how rc.cgroup2unaid is invoked 2024-10-11 02:24:43 -07:00
Tom Mortensen
b783d4b207 more killall and pgrep updates. 2024-10-11 02:24:43 -07:00
Tom Mortensen
a866de833a Revert "stop ntpd from complaining about multiple IP addresses" 2024-10-11 02:24:43 -07:00
tom mortensen
ee31e35849 Merge pull request #1882 from desertwitch/fix-rsyslogd
(bugfix) /etc/rc.d/rc.rsyslogd: OS-native PID for decisions
2024-10-10 17:13:35 -07:00
tom mortensen
50e7389c8a Merge pull request #1889 from SimonFair/ntp-fix
killall and pgrep updates.
2024-10-10 17:02:59 -07:00
tom mortensen
d536ef285b Merge pull request #1890 from dlandon/delete_DS_Store_files_when_deleting_user_share
Delete all '*.DS_Store' files when deleting share.
2024-10-10 16:57:08 -07:00
dlandon
2dc82b61de Delete all '*.DS_Store' files when deleting share. 2024-10-10 16:16:09 -05:00
SimonFair
57ec7909e5 Update rc.sshd 2024-10-10 21:54:16 +01:00
SimonFair
01c6f64b52 Revert sshd loops. 2024-10-10 21:03:02 +01:00
SimonFair
80d567dfde killall and pgrep updates.
Set --ns $$ on commands.
2024-10-10 19:18:54 +01:00
tom mortensen
99d60fa08a Merge pull request #1888 from SimonFair/ntp-fix
Samba update and to use smbcontrol for reload
2024-10-10 10:37:49 -07:00
tom mortensen
8bbf176b8b Merge pull request #1887 from unraid/fix-device-list
Fix PHP error in device_list
2024-10-10 10:36:50 -07:00
tom mortensen
ca51a3799b Merge pull request #1885 from dlandon/remove_ps.txt_file_from_diagnostics
Remove ps.txt from diagnostics.
2024-10-10 10:36:28 -07:00
tom mortensen
e4bb758b05 Merge pull request #1884 from dlandon/show_delete_on_shares_settings_page_at_all_times
Delete share is always visible.
2024-10-10 10:35:59 -07:00
SimonFair
3c007fa1d0 Samba update and to use smbcontrol for reload 2024-10-10 17:17:17 +01:00
ljm42
c062e4dd9c Fix PHP error in device_list
Was preventing the main page from populating with data in some cases
2024-10-10 09:09:39 -07:00
desertwitch
06b1c9a20f /etc/rc.d/rc.rsyslogd: check status before reload 2024-10-10 07:03:48 +02:00
desertwitch
bf6d5982be /etc/rc.d/rc.rsyslogd: use pgrep, killall with PID namespace 2024-10-10 06:51:05 +02:00
dlandon
d9bd5b56c8 Remove ps.txt from diagnostics. 2024-10-09 13:08:55 -05:00
dlandon
bc7c66fec9 Delete share is always visible and enabled only when it is safe to delete the share. 2024-10-09 12:06:48 -05:00
tom mortensen
dc50e7d2c2 Merge pull request #1881 from SimonFair/ntp-fix
Set NTP to use interfaces.
2024-10-09 08:56:07 -07:00
desertwitch
0061c66dfe /etc/rc.d/rc.rsyslogd: OS-native PID for decisions
bugfix: multiple running rsyslogd processes (e.g. spawned by Docker containers) caused the rc.d script to think that the OS-native process was already running, resulting in startup failure of the OSes daemon.
2024-10-09 14:52:44 +02:00
SimonFair
91caf869f5 Set NTP to use inferfaces. 2024-10-08 21:57:48 +01:00
tom mortensen
97c3a4621b Merge pull request #1877 from dlandon/cannot_change_share_settings_if_pools_missing
Fix a situation where the secondary pool device is missing.
2024-10-08 12:18:48 -07:00
tom mortensen
1ffb22bddf Merge pull request #1880 from ich777/ich777-docker-directory-fix
Fix for docker directory
2024-10-08 12:16:44 -07:00
tom mortensen
1d9e14f07c Merge pull request #1878 from SimonFair/VM-ZFS-Fixes
Fix virtiofsd pre processor + add virtiogpu option to gui.
2024-10-08 12:14:26 -07:00
6f7b97e37a Fix for docker directory
- store path outside from function to not shorten path if users switches multiple times between `image` and `folder`
- make sure overlay2 is selected by default
2024-10-07 14:54:08 +02:00
SimonFair
ed7219d9c7 Add virtio gpu option. 2024-10-06 11:29:57 +01:00
SimonFair
082d7d842b Revert "Add virtio gu(2d) as an option of template."
This reverts commit 9a502776a1.
2024-10-06 11:26:34 +01:00
SimonFair
9a502776a1 Add virtio gu(2d) as an option of template. 2024-10-06 11:17:19 +01:00
SimonFair
03346f4709 Update virtiofsd.php 2024-10-05 07:57:19 +01:00
dlandon
1cc84832ee Fix a situation where secondary pool device is missing and the Array is chosen for the primary device.. 2024-10-03 13:57:21 -05:00
Tom Mortensen
959df7e46c fx: Agent notifications don't work if there's a problem with email notifications 2024-10-02 09:55:44 -07:00
Tom Mortensen
3fb6c2147b Small change of var name CUSTOMFA to NGINX_CUSTOMFA. 2024-10-02 09:55:44 -07:00
Tom Mortensen
3db6fa9a1d update rc.bind (but not used) 2024-10-02 09:55:44 -07:00
tom mortensen
0c5987fab0 Merge pull request #1811 from unraid/kill-samba
Forcibly kill samba if needed
2024-10-02 09:52:46 -07:00
tom mortensen
fcbc8f700e Merge pull request #1876 from dkaser/check-container-networks
fix: prevent deleting containers that are assigned as a network
2024-10-01 14:00:08 -07:00
Derek Kaser
6fd88575b2 fix: prevent deleting containers that are assigned as a network 2024-10-01 04:21:51 +00:00
tom mortensen
bff0238f88 Merge pull request #1875 from dkaser/sanitize-tsnet
feat: sanitize ts.net domain names from nginx config
2024-09-30 15:45:50 -07:00
Derek Kaser
ee7f1f4a5b feat: sanitize ts.net domain names from nginx config 2024-09-30 02:29:37 +00:00
tom mortensen
c3dd62f1d5 Merge pull request #1874 from dlandon/container_device_not_showing
Container device not showing in Dockerman.
2024-09-27 09:19:24 -07:00
tom mortensen
7c0fb18e3c Merge pull request #1873 from unraid/add-csp-frame-ancestors
Improved "Content-Security-Policy frame-ancestors" support
2024-09-27 09:15:29 -07:00
ljm42
fe2e2ff897 define CUSTOMFA in /etc/defaults/nginx 2024-09-26 16:03:36 -07:00
ljm42
74530129ae Merge branch 'master' into add-csp-frame-ancestors 2024-09-26 15:52:44 -07:00
tom mortensen
968e3b1d72 Merge pull request #1870 from dkaser/tailscale-routes
feat: show routes from all routing tables, not just default
2024-09-26 12:25:30 -07:00
tom mortensen
6bdcb38c47 Merge pull request #1869 from ich777/ich777-rc.sshd-fix
Fix for rc.sshd
2024-09-26 12:25:09 -07:00
tom mortensen
8c7cdca4aa Merge pull request #1868 from unraid/ts-redirect
redirect http TS url to https TS url
2024-09-26 12:24:42 -07:00
tom mortensen
08024a0464 Merge pull request #1867 from ich777/ich777-docker-fix
Fix for 3rd party containers "not available" colour
2024-09-26 12:24:05 -07:00
dlandon
828cd7b747 Container device not showing in Dockerman. 2024-09-26 09:13:42 -05:00
ljm42
0ce3960de6 Improved "Content-Security-Policy frame-ancestors" support 2024-09-25 23:16:52 -07:00
tom mortensen
8b91d22796 Merge pull request #1872 from ich777/ich777-rc.docker-patch
Update rc.docker
2024-09-25 10:36:52 -07:00
b716920800 Update rc.docker
- Remove ID since not necessary
2024-09-24 16:55:21 +02:00
6d749a8b1a Update rc.docker
- Further improvement to stop containers only managed by Unraid or the Compose plugin
- Small fix for the notification
2024-09-24 16:46:02 +02:00
69b95ae27d Update rc.docker
- Only stop Unraid managed containers
- Don't kill containers since Docker will kill them if they won't stop after the set timeout when the daemon is stopping
- Increase timeout for daemon to die to 30 seconds (seems a bit short if 3rd party containers are installed)
- Rephrase message for daemon to die and display it only once
2024-09-24 15:51:46 +02:00
Derek Kaser
20e29ab5af feat: show routes from all routing tables, not just default 2024-09-23 21:32:13 +00:00
a75bc3d4d7 Fix for rc.sshd
- Remove trailing slash to be sure to grab the correct PIDs
2024-09-23 22:16:02 +02:00
ljm42
e8e5ccdf18 redirect http TS url to https TS url 2024-09-23 12:59:05 -07:00
020ed9a07f Small fix for 3rd party containers
- Fix orange text "not available" to use the default text colour.
2024-09-23 21:19:04 +02:00
Tom Mortensen
8f656e87b1 establish sensible zfs pool defaults 2024-09-23 10:57:13 -07:00
Tom Mortensen
54b1e81b38 unconditinally set directories to mode 0777 2024-09-23 10:54:57 -07:00
Tom Mortensen
4c6be23467 Clean up empty cgroups 2024-09-20 09:20:44 -07:00
Tom Mortensen
4a4983f7c5 rc.S: reboot should not invoke shutdown 2024-09-20 09:20:44 -07:00
tom mortensen
dcfaa1afa0 Merge pull request #1866 from SimonFair/VM-ZFS-Fixes
Fix VM usage stats value if timer > 1 sec.
2024-09-20 09:19:46 -07:00
SimonFair
e52813b626 Divide net and disk values by timer 2024-09-19 22:16:00 +01:00
tom mortensen
760aac71df Merge pull request #1863 from dlandon/default_array_file_system_message
Change default file system text.
2024-09-16 14:58:28 -07:00
tom mortensen
20ef176665 Merge pull request #1862 from ich777/patch-4
Fix for rc.docker for interfaces with higher index than 0
2024-09-16 14:57:48 -07:00
tom mortensen
66d7193dab Merge pull request #1858 from ich777/rc.sshd_fix
Only kill sshd from host
2024-09-16 14:56:54 -07:00
tom mortensen
9c9c79b1b3 Merge pull request #1857 from ich777/ich777-docker-container-network
Allow users to select Container networks in the WebUI
2024-09-16 14:55:54 -07:00
tom mortensen
8aac4ee119 Merge pull request #1856 from desertwitch/patch-1
en_US/helptext.txt: Fix broken link in GUI
2024-09-16 14:55:00 -07:00
tom mortensen
8120959c2f Merge pull request #1854 from desertwitch/fix-php-warning
dynamix/include/SysDevs.php: fix PHP warnings
2024-09-16 14:54:20 -07:00
tom mortensen
72abe50721 Merge pull request #1853 from Commifreak/libvirt-log-timeout-info
Add a log line noting how long we wait currently for a VM action.
2024-09-16 14:52:55 -07:00
tom mortensen
18e37ed045 Merge pull request #1852 from dkaser/tailscale-nginx
Add fastcgi_path_info to default nginx configuration
2024-09-16 14:51:36 -07:00
tom mortensen
6845c007a7 Merge pull request #1851 from ich777/page-builder-fix
Fix issue with plugin icons
2024-09-16 14:50:50 -07:00
tom mortensen
b844f941d0 Merge pull request #1850 from unraid/add-ts-certs
Add support for Tailscale certs in the webgui
2024-09-16 14:49:59 -07:00
tom mortensen
5883e767aa Merge pull request #1849 from dlandon/parity-check-shows-incorrect-results
Parity check wrong again.
2024-09-16 14:46:15 -07:00
tom mortensen
efc4fa2673 Merge pull request #1848 from ich777/ich777-not-dockerman-managed
Correctly identify/show non dockerman Managed containers
2024-09-16 14:45:11 -07:00
tom mortensen
0810fc5bd8 Merge pull request #1847 from SimonFair/VM-ZFS-Fixes
VM ZFS  dataset removal processing additional fixes
2024-09-16 14:44:14 -07:00
tom mortensen
897365a5de Merge pull request #1845 from Squidly271/patch-42
Adjust URL for CA installation
2024-09-16 14:42:52 -07:00
dlandon
8d628aad4f Change default file system text. 2024-09-13 11:47:57 -05:00
e3c4ff280d Small fix 2024-09-12 23:33:27 +02:00
19de7c1979 Fix for rc.docker for interfaces with higher index than 0
- Fix error in first if condition which always returned `false`
- Change name from variables so that it a bit easier to read
- Make sure that custom interfaces with a higher index then 0 are properly rebuilt
2024-09-12 23:12:03 +02:00
5ec695921a Fix sshd_update logic 2024-09-11 07:39:34 +02:00
171a77feec Change function
- return `1` if daemon is running and return `0` if it is not running
2024-09-11 07:38:15 +02:00
3e29f0b8b8 Only kill sshd from host 2024-09-10 22:32:07 +02:00
b62c8f5a12 Update Helpers.php 2024-09-09 17:09:15 +02:00
e9faee0d27 Update CreateDocker.php 2024-09-09 17:07:43 +02:00
Rysz
16823d07b1 en_US/helptext.txt: Fix broken link 2024-09-09 06:56:35 +02:00
desertwitch
73705b71fa dynamix/include/SysDevs.php: fix PHP warnings
test for exec-returned variable existence before usage
2024-09-08 20:21:18 +02:00
Robin Kluth
6b31532688 Add a log line noting how long we wait currently for a VM action. 2024-09-06 15:46:06 +02:00
Derek Kaser
039c798b43 Add fastcgi_path_info to default nginx configuration 2024-09-05 22:00:20 +00:00
1e43abc785 Fix issue with plugin icons
- make sure the maximum icon size for a plugin is 18x18px
2024-09-05 10:16:51 +02:00
ljm42
9b1081d2e1 Add support for Tailscale certs in the webgui 2024-09-04 21:37:08 -07:00
SimonFair
c27e018fdb Reduce Multifunction starting bus. 2024-09-04 21:11:44 +01:00
dlandon
ef5067584b Change file_put_contents_atomic() back to file_put_contents() since it is liable to change. 2024-09-04 12:34:23 -05:00
SimonFair
4ea425411a Add disable rename if snapshots found. 2024-09-03 21:45:50 +01:00
dlandon
24bdc5169d Parity check wrong again. 2024-09-03 15:36:12 -05:00
SimonFair
753d87c690 Additional VM ZFS delete fixes 2024-09-02 18:03:10 +01:00
07d02f579f Add files via upload 2024-09-02 17:48:25 +02:00
SimonFair
ceb97ab392 Disable dataset processing. 2024-09-01 21:17:05 +01:00
Squidly271
6a15afa2a8 Update Apps.page 2024-09-01 15:57:02 -04:00
tom mortensen
175d24afd2 Merge pull request #1842 from dlandon/rework-share-list
Fix condition where useCache is 'no' when there is no array.
2024-08-30 13:00:58 -07:00
Tom Mortensen
12828eec63 stop ntpd from complaining about multiple IP addresses 2024-08-30 09:04:48 -07:00
dlandon
156599031a Fix condition where useCache is 'no' when there is no array. 2024-08-30 07:25:33 -05:00
tom mortensen
15f4138c87 Merge pull request #1839 from SimonFair/VM-ZFS-Fixes
ZFS fixes
2024-08-29 11:58:12 -07:00
tom mortensen
fd6e4f1ba1 Merge pull request #1840 from dlandon/rework-share-list
Fix share list.
2024-08-29 11:57:17 -07:00
tom mortensen
72a47035ef Merge pull request #1841 from dlandon/rename-pool-message
Add warning message to rename pool dialog.
2024-08-29 11:55:57 -07:00
dlandon
d57bf205fa Add warning message to rename pool dialog. 2024-08-29 13:23:38 -05:00
dlandon
16a8e7092d Fix share list not showing invalid storage configurations and some code cleanup. 2024-08-29 13:00:06 -05:00
SimonFair
00b1f77742 ZFS fixes 2024-08-29 17:45:00 +01:00
Tom Mortensen
506270e413 Fixes zfs subpool creation issue.
Fixes DeviceInfo not populating for array devices when Started.
2024-08-29 02:04:38 -07:00
Tom Mortensen
303c76d7da rc.nfsd: the 'update' method only causes re-read of /etc/exports 2024-08-29 02:03:51 -07:00
Tom Mortensen
73ea1bb7b3 remove deprecated check 2024-08-29 02:02:55 -07:00
tom mortensen
9d4ca6a2c9 Merge pull request #1837 from ich777/docker_fix
Make sure to not show internal IP from stopped containers
2024-08-29 01:25:29 -07:00
49b82d0eb8 Make sure to not show internal IP from stopped containers 2024-08-28 20:33:25 +02:00
tom mortensen
106f155ecc Merge pull request #1835 from donbuehl/feature/1832
Feature Request: Use user's actual shell in OpenTerminal.php #1832
2024-08-27 21:14:52 -07:00
donbuehl
53704b58aa Final minimal viable solution 2024-08-27 21:43:46 +02:00
tom mortensen
da9add3637 Merge pull request #1836 from desertwitch/feature-default-file
update.php: add two optional methods to define defaults
2024-08-27 12:18:16 -07:00
donbuehl
db77c13552 MVP solution for zsh plugin
Implemented a minimal viable solution for the zsh plugin:
- Checks if the shell is /bin/zsh
- Falls back to bash if not

This approach prioritizes simplicity and reliability over a more general solution to avoid potential errors.
2024-08-26 14:29:24 +02:00
donbuehl
be22c0e1f8 Simplify shell detection for openterminal 2024-08-25 15:44:28 +02:00
donbuehl
cd9d20eaf3 Simplify shell detection for openterminal 2024-08-25 15:19:53 +02:00
Rysz
c4afbba9bc update.php: do not silence parse errors 2024-08-25 13:16:36 +02:00
Rysz
16089cd927 update.php: shorten var name and improve documentation 2024-08-25 13:13:26 +02:00
Rysz
1ede8e621b update.php: remove unneeded spaces 2024-08-25 08:43:54 +02:00
Rysz
64ead9a127 update.php: additional safeguards 2024-08-25 08:28:40 +02:00
Rysz
ff80906d11 update.php: add #defaultvalues parameter 2024-08-25 07:36:23 +02:00
tom mortensen
8981e8bb15 Merge pull request #1834 from ich777/grub_cpuisolation_fix
GRUB compatibility changes
2024-08-24 09:18:04 -07:00
tom mortensen
83675005d2 Merge pull request #1833 from SimonFair/VM-Unmap-support
Fix vmusage stopping/Unmap Defaults and Fix Multifunction.
2024-08-24 09:17:10 -07:00
SimonFair
4b7f2bfcee Default new disk to unmap. 2024-08-23 07:30:11 +01:00
SimonFair
72ff3c52c0 Unmap Default and Multifuncton
Set default for new VMs to discard="unmap"
Fix BSOD for VMs and Multifunction.
2024-08-22 23:24:18 +01:00
Tom Mortensen
69e11713e5 Dashboard: Soften messages during parity sync/check 2024-08-21 23:28:44 -07:00
desertwitch
67cf2db493 update.php: clarify paths in documentation 2024-08-21 12:38:40 +02:00
desertwitch
631479d27d update.php: follow #file behavior for more versatility 2024-08-21 12:36:56 +02:00
desertwitch
28b3d2ae71 update.php: clarify documentation comment 2024-08-21 12:02:09 +02:00
desertwitch
ec1689dc68 update.php: null coalescing to elvis operator 2024-08-21 11:11:47 +02:00
desertwitch
3615992dc4 update.php: add #defaultfile parameter 2024-08-21 10:51:37 +02:00
d9f83cc76b Fix diagnostics to support GRUB 2024-08-21 07:54:31 +02:00
donbuehl
7e6ad9512d Wrap getUserShell() call with escapeshellarg() for additional security 2024-08-20 09:08:31 +02:00
donbuehl
d7b4dfd44b Fixed missing $ in variable 2024-08-19 22:14:46 +02:00
donbuehl
c62ef28fc3 Refactor getUserShell() for improved clarity and maintainability
- Introduce  variable for better code readability
- Simplify return logic using the default shell variable
- Maintain comprehensive error handling with Throwable
2024-08-19 22:06:41 +02:00
donbuehl
07fa790411 Improve getUserShell() function for accuracy and consistency
- Refine username matching to prevent partial matches
- Use English for syslog error message
2024-08-19 21:49:31 +02:00
donbuehl
fb19a99ad4 Added function getUserShell() to OpenTerminal.php and use it for the execution 2024-08-19 18:16:38 +02:00
d0dcf6c314 Fix for GRUB bootloader 2024-08-19 16:58:31 +02:00
0d925a2471 Fix for GRUB bootloader 2024-08-19 16:54:19 +02:00
SimonFair
2b4eb1abad Fix vmusage stopping when you on a new page on a tab. 2024-08-19 13:16:50 +01:00
tom mortensen
251881d850 Merge pull request #1831 from SimonFair/VM-Unmap-support
Add Unmap Support
2024-08-18 10:34:35 -07:00
tom mortensen
24fce7582c Merge pull request #1828 from mtongnz/network-display-improvements
Network info display improvements (part 2)
2024-08-17 08:28:45 -07:00
SimonFair
b56f3e529c Add Discard option. 2024-08-17 00:34:52 +01:00
tom mortensen
130e3fcd44 Merge pull request #1829 from desertwitch/fix-php-settings
fix inconsistent PHP error reporting defaults (PHPSettings.page)
2024-08-16 09:15:35 -07:00
mtongnz
c1b2bb7435 fix: better display of container LAN IP for ipvlan & macvlan 2024-08-16 18:20:10 +12:00
mtongnz
840e19d322 fix: some networks not showing 2024-08-16 17:35:22 +12:00
SimonFair
2ae85fdd31 Add unmap on VM change. 2024-08-15 22:36:15 +01:00
SimonFair
0db0032648 Add Unmap Support 2024-08-15 19:29:20 +01:00
desertwitch
8d9e2a04c0 PHP constants for better read-/maintainability 2024-08-15 16:49:32 +02:00
desertwitch
31f81349a8 sanitize PHP setting constants for update.php
update.php encapsulates the PHP constants used by the OS default PHP error reporting level with double quotes, which breaks functionality as they are then treated as text. by turning the PHP constants into strings first this problem is avoided.
2024-08-15 16:29:45 +02:00
desertwitch
3de8e05432 fix inconsistent PHP error reporting defaults 2024-08-15 14:08:58 +02:00
Matt
1c019c8f08 fix: display LAN:IP for multiple external networks 2024-08-15 18:50:44 +12:00
Matt
8d76d6f1cc fix: display multiple networks for all types
This commit ensures containers with multiple networks are always displayed.
Previously, networks connected to containers (docker network connect...) don't show
2024-08-15 15:55:01 +12:00
tom mortensen
3e17f35e19 Merge pull request #1826 from zackspear/refactor/registration-page-transfer-ineligible-copy
refactor: registration transfer check ineligible copy
2024-08-14 11:15:46 -07:00
Zack Spear
6f51589547 refactor: registration page transfer check ineligible copy 2024-08-13 17:28:29 -07:00
Zack Spear
b18e734381 chore: update .gitignore for prettier usage 2024-08-13 17:27:26 -07:00
tom mortensen
b5a8223ffe Merge pull request #1820 from Garbee/ssh-key-regex
feat(user-edit): update allowed ssh key encryptions
2024-08-13 12:46:39 -07:00
tom mortensen
936adea879 Merge pull request #1824 from unraid/fix-typo
Fix typo in help text
2024-08-13 12:44:31 -07:00
tom mortensen
1572378824 Merge pull request #1822 from SimonFair/VM-Manager-PHP-Fixes
Add ZFS Checking
2024-08-13 12:39:12 -07:00
Tom Mortensen
0cf3585a0d update error messsage 2024-08-13 12:37:57 -07:00
Tom Mortensen
3f103f2089 DeviceInfo page improvements:
* Present confirmation dialog for Delete Pool operation
* Fix expansion of single device pool to multi-device zfs mirror or btrfs raid-1
2024-08-13 12:28:28 -07:00
Tom Mortensen
ed308c3a69 Display warning along side replacement and expansion devivces on Main if they will be initialized 2024-08-13 12:28:28 -07:00
Tom Mortensen
985d077af5 Samba smb.conf: set "nmbd bind explicit broadcast = no" if NetBIOS enabled 2024-08-13 12:28:28 -07:00
Tom Mortensen
86b8b170d1 Startup improvements in rc.S script:
* Automatically repair boot sector backup
* Detect bad root value in syslinux.cfg
* Explicitly unmount all file systems if cannot continue boot
2024-08-13 12:28:28 -07:00
Tom Mortensen
d351e51f58 remove wol source 2024-08-13 12:28:28 -07:00
tom mortensen
53c1788580 Merge pull request #1821 from Garbee/remove-document-write
fix: replace document write usages
2024-08-13 12:27:42 -07:00
tom mortensen
0870461731 Merge pull request #1818 from ich777/grub_vm_settings_fix
Grub VM settings fix
2024-08-13 10:27:49 -07:00
ljm42
043d2baaf7 Fix typo in help text 2024-08-12 12:21:57 -07:00
SimonFair
32bb9bb6d9 Add ZFS Checking
This will check VM name does not include characters that are not valid for ZFS.
Existing VMs are not modified but will throw error and disable update if invalid characters are found.
2024-08-12 17:18:28 +01:00
Jonathan Garbee
2ff8b77c9d fix: replace document write usages 2024-08-10 15:35:49 +00:00
Jonathan Garbee
654db74167 feat(user-edit): update allowed ssh key encryptions 2024-08-10 14:51:06 +00:00
fb2b66b5b0 Make VM Settings work with grub 2024-08-09 12:38:18 +02:00
663665a61b Make VM Settings work when using GRUB 2024-08-09 12:37:00 +02:00
tom mortensen
c9333ea955 Merge pull request #1616 from mtongnz/network-display-improvements
Network info display improvements
2024-08-08 23:16:15 -07:00
tom mortensen
bad23e7647 Merge pull request #1817 from dlandon/master
Sort users in natural order on shares page.
2024-08-08 09:48:11 -07:00
17909f889e Fix PHP Warning (#3)
- Fix PHP Warnings on Add Container page
2024-08-08 20:32:38 +12:00
8cabad6f0d Changes (#2)
* Changes

- Revert commit #ed5fe721d9cdfeb65148a5f12eebdf35729e1dfb
- Fix php errors

* Update DockerContainers.page

- Change `External IP:Port` to `LAN IP:Port`
2024-08-08 16:58:58 +12:00
dlandon
566113f86c Sort users in natural order. 2024-08-07 16:56:09 -05:00
tom mortensen
21e640184e Merge pull request #1814 from suzukua/master
Fixed an issue where routes could not be saved in languages ​​other t…
2024-08-07 10:07:55 -07:00
suzuki
202196f7d3 Fixed an issue where routes could not be saved in languages ​​other than English
fix  https://forums.unraid.net/bug-reports/stable-releases/%E3%80%9061211%E3%80%91%E3%80%90bug%E3%80%91cannot-save-static-route-r3156/
2024-08-03 22:17:51 +08:00
9c2aa45751 Minor improvements (#1)
* few changes, please test

* Change weird formatting

* Another formatting change

* Fix for `container:` networks

* Hide IPs/Ports when container is not running

* WebUI fix

- generate WebUI links correctly
- don't show WebUI from containers which use a `container:` network
2024-08-03 17:39:00 +12:00
ljm42
33a73b2fb5 Forcibly kill samba if needed 2024-08-02 10:33:34 -07:00
tom mortensen
06735f7a3e Merge pull request #1805 from SimonFair/VM-Manager-PHP-Fixes
Fix delete VM if in a dataset.
2024-08-01 14:18:51 -07:00
tom mortensen
e7f7ef43c0 Merge pull request #1809 from desertwitch/patch-1
update.php: release file pointer after usage
2024-08-01 14:13:53 -07:00
tom mortensen
c5b692e805 Merge pull request #1808 from ich777/overlay2-gui-support
Overlay2 GUI support
2024-08-01 12:30:57 -07:00
SimonFair
6a91f270e3 Fix Audio and PCI for Mutlifunction. 2024-08-01 19:13:14 +01:00
Rysz
6d3a7a3298 release file pointer after usage 2024-08-01 10:53:47 +02:00
f81118ffe3 Remove unnecessary comment 2024-07-31 21:33:50 +02:00
f9107ebe11 Always display storage driver when Docker is active 2024-07-31 12:02:05 +02:00
76f58d2995 overlay2 default 2024-07-31 11:05:54 +02:00
b4722f57aa Set default backingfs type to native for existing installations 2024-07-31 10:59:38 +02:00
3314860d31 Change the default to overlay2 2024-07-31 10:56:03 +02:00
9a6b62ae98 Bugfix for new installations 2024-07-31 10:55:30 +02:00
e0b1612633 Add helptext for docker storage driver when active 2024-07-30 21:26:54 +02:00
1e41ac637d Bugfix for helptexts 2024-07-30 21:26:10 +02:00
858a3aa999 Display storage driver with started array 2024-07-30 21:19:57 +02:00
79c484e2e5 Add helptext for Docker storage driver 2024-07-30 19:22:40 +02:00
49793ff602 Add DOCKER_BACKINGFS with native option 2024-07-30 19:07:49 +02:00
342619a567 Add WebUI option for overlay2
- switch between native and overlay2 storage drivers
2024-07-30 19:05:39 +02:00
mtongnz
27047c8832 fix: improve IP & port display further as per suggestions 2024-07-28 11:18:31 +12:00
tom mortensen
b850940f19 Merge pull request #1793 from jbtwo/fix-ups-settings-page
Fix UPS settings page when config contains empty values
2024-07-27 01:11:47 -07:00
tom mortensen
de3334b0d2 Merge pull request #1803 from bergware/master
Fix broken "show_interfaces" script (take 2)
2024-07-27 01:11:10 -07:00
tom mortensen
373bb9f2ee Merge pull request #1804 from unraid/detect-bad-root-in-syslinux
Detect bad root value in syslinux.cfg
2024-07-27 01:10:26 -07:00
bergware
833194705c Merge remote-tracking branch 'upstream/master' 2024-07-25 18:39:11 +02:00
Justin Brown
392cc77a20 switch to _var function for setting batteryLevel & batteryRuntime 2024-07-24 16:57:35 -04:00
SimonFair
d272bf78ac Fix delete VM if in a dataset. 2024-07-24 21:20:06 +01:00
ljm42
9430366eaf Detect bad root value in syslinux.cfg 2024-07-24 10:58:15 -07:00
bergware
71dc414592 Fix broken "show_interfaces" script (take 2) 2024-07-24 13:57:00 +02:00
Tom Mortensen
2b41f9a8d2 Device Info page:
* Prevent reducing pool slot count unless pool state is NEW_ARRAY
* Permit changing pool file system type only when Stopped
* Add "Delete Pool" button which unassigns all devices of a pool and then removes the pool
* Change button label "Erase" to "Erase Pool"
2024-07-24 02:13:22 -07:00
Tom Mortensen
70c01ec454 Include subpool devices in list of devices to be formatted when appropriate 2024-07-24 02:12:58 -07:00
Tom Mortensen
7840ae6d3c new handling of 'ntp.conf' and 'ntp.conf-' (similar to exports) 2024-07-24 00:41:27 -07:00
Tom Mortensen
5b009dfb39 remove unnecessary symlinks 2024-07-24 00:41:27 -07:00
tom mortensen
5565c02f74 Merge pull request #1796 from desertwitch/desertwitch-patch-1
fix table order breaking when cookie is left malformed
2024-07-24 00:37:19 -07:00
tom mortensen
793289bc7f Merge pull request #1792 from dlandon/master
Fix overlapping text on VPN Manager page; php warning; allow UD disks to show in file picker.
2024-07-24 00:31:21 -07:00
tom mortensen
7d92761860 Merge pull request #1797 from SimonFair/VM-Manager-PHP-Fixes
Fix memory Stats in VM Usage.
2024-07-24 00:29:01 -07:00
tom mortensen
1021adc33b Merge pull request #1799 from dlandon/diagnostocs-ipv6-fix
Diagnostics ipv6 fix
2024-07-24 00:28:11 -07:00
tom mortensen
c9374f7911 Merge pull request #1800 from unraid/use-docs-go-links
Use "go links" when linking to Docs
2024-07-24 00:27:20 -07:00
tom mortensen
73a17a0306 Merge pull request #1802 from bergware/master
Fix broken "show_interface" script
2024-07-24 00:26:44 -07:00
bergware
0729386af9 Fix broken "show_interface" script 2024-07-23 19:41:02 +02:00
bergware
4b8ec6e5a3 Fix broken "show_interface" script 2024-07-23 19:34:40 +02:00
dlandon
ea2fa8a8db Chmod on non-existent file causing php warning. 2024-07-22 09:58:06 -05:00
dlandon
d7e474257c Allow UD disks to be listed in file picker. 2024-07-21 04:55:49 -05:00
mtongnz
4b3e8f2d46 fix: handle webUI link generation correctly 2024-07-20 13:23:56 +12:00
mtongnz
54a6e3dd13 fix: better display of ip & ports to avoid beginner confusion - from suggestions by @ich777 2024-07-20 12:04:30 +12:00
SimonFair
e20f37d936 Update emhttp/plugins/dynamix/nchan/vm_dashusage
Co-authored-by: Shay Levy <levyshay1@gmail.com>
2024-07-19 21:04:17 +01:00
ljm42
4c1c566e78 Add trailing slash to go links
Eliminates an unnecessary redirect
2024-07-19 12:02:00 -07:00
ljm42
a6c50b208a Add trailing slash to go links
Eliminates an unnecessary redirect
2024-07-19 12:00:36 -07:00
SimonFair
9a23761dc8 Update vm_dashusage 2024-07-19 19:44:59 +01:00
dlandon
359334b85a Fix another php error. 2024-07-19 12:55:45 -05:00
SimonFair
f5ed6964dd Update vm_usage 2024-07-19 18:55:03 +01:00
SimonFair
882ee7f911 Hide Max if Current and Max are equal 2024-07-19 18:30:45 +01:00
ljm42
234a749b7f Use "go links" when linking to Docs 2024-07-19 10:01:50 -07:00
dlandon
a9891f557e Merge branch 'unraid:master' into master 2024-07-19 10:33:48 -05:00
dlandon
04640a5708 Anonimize IPv6 addresses with square braces. 2024-07-19 10:31:06 -05:00
SimonFair
fac92be4d4 Fix memory Stats in VM Usage.
Three columns inuse/Current/Maximum
2024-07-19 14:21:09 +01:00
Rysz
817ed5c1c1 fix table order breaking when cookie is left malformed 2024-07-18 22:13:13 +02:00
Tom Mortensen
a4abe0fa55 update firefox symlink 2024-07-18 12:14:35 -07:00
dlandon
6920542d6c Merge branch 'unraid:master' into master 2024-07-18 06:14:40 -05:00
Justin Brown
36f9e7402c fix UPS settings page when config contains empty values 2024-07-16 19:32:30 -04:00
dlandon
cfa547972e Fix overlapping text on VPN Manager page. 2024-07-16 13:24:15 -05:00
tom mortensen
84b5baf402 Merge pull request #1791 from ich777/docker-dashboard-patch
Show Docker RAM usage on Dashboard & minor changes
2024-07-16 10:01:16 -07:00
tom mortensen
1b162e2c21 Merge pull request #1790 from dlandon/master
Fix php warning in device_list; VPN Manager not showing tunnel status.
2024-07-16 10:00:44 -07:00
tom mortensen
75f0c2e4f6 Merge pull request #1788 from ich777/initial-overlay2-support
Initial Docker overlay2 support
2024-07-16 09:59:39 -07:00
tom mortensen
67369622fa Merge pull request #1787 from ich777/ipv6-forward
Add IPv6 forward rule
2024-07-16 09:58:49 -07:00
tom mortensen
17fdfb6f50 Merge pull request #1786 from ich777/proxy-fix
fix path
2024-07-16 09:58:10 -07:00
tom mortensen
9e80fb13c7 Merge pull request #1783 from SimonFair/VM-Manager-PHP-Fixes
Move restore favorites after plugin installs + VM Template formatting for PCI others
2024-07-16 09:57:34 -07:00
tom mortensen
1d6c3f4375 Merge pull request #1782 from zackspear/fix/vm-icon-edit
fix: AddVM & UpdateVM icon selection styles
2024-07-16 09:57:10 -07:00
58c31f4ef6 Show Docker RAM usage on Dashboard
- Add Docker RAM usage to Dashbaord page
- Rename 'Services' to 'System'
- Remove 'usage' suffix from Services naming scheme
2024-07-16 13:57:21 +02:00
dlandon
84b767ddcd Fix php[ warning. 2024-07-15 17:32:11 -05:00
dlandon
32d3f88b44 VPN Manager not showing tunnel status. 2024-07-15 17:28:20 -05:00
Zack Spear
6156a2582f fix: UpdateVM.css temlpate img chooser 2024-07-15 13:43:22 -07:00
SimonFair
8a55228b8e Update VMedit.php 2024-07-15 18:59:56 +01:00
SimonFair
fe7ab1fc43 FIX Issue with VM Template formatting for other PCI 2024-07-15 18:41:29 +01:00
30492ed2f2 Initial Docker overlay2 support
- override filesystem type to overlay2 if `DOCKER_BACKINGFS` in docker.cfg is set to `overlay2`
2024-07-15 17:40:10 +02:00
da1ef5c0e0 IPv6 forward
- Add `IPV6_FORWARD` to rc.docker and set it to `ACCEPT` instead of `DROP`
2024-07-15 17:22:48 +02:00
93054c2091 fix path
- fix path for generated proxy file
2024-07-15 15:47:50 +02:00
SimonFair
f2abfaf292 Move restore favorites after plugin installs 2024-07-13 15:33:37 +01:00
Zack Spear
5a42314c60 fix: AddVM & UpdateVM icon selection styles 2024-07-12 14:55:00 -07:00
Tom Mortensen
bbed6047e3 Introduce 'Allocation profile' config setting for specifying pool/subpool data layout
Fix: spindown delay setting missing for parity devices
2024-07-12 11:53:32 -07:00
Tom Mortensen
a7f6ac7389 maybe needed in future 2024-07-10 23:01:09 -07:00
Tom Mortensen
f7748f7619 make executable 2024-07-10 23:00:20 -07:00
Tom Mortensen
d4968e1b19 simplify display of file system type on Main 2024-07-10 22:59:53 -07:00
Tom Mortensen
fb680469ac fix git glitch which resulted in file not updated 2024-07-10 22:58:42 -07:00
tom mortensen
eaabbec7e0 Merge pull request #1780 from unraid/fix-trim
Make trim consistent between "trim now" and cron job
2024-07-10 21:41:39 -07:00
ljm42
693a0260af Make trim consistent between "Run now" and cron job 2024-07-10 17:59:15 -07:00
tom mortensen
130c9c6373 Merge pull request #1779 from ich777/ich777-agents-fix
Fix for notification agents
2024-07-10 14:22:17 -07:00
73c264e9fe Fix
- Fix PushBits and Pushbullet not showing up
2024-07-10 14:47:06 +02:00
667741129a Fix
- Fix PushBits and Pushbullet not showing up
2024-07-10 14:45:49 +02:00
tom mortensen
42fe45595f Merge pull request #1778 from dlandon/master
Parity check does not show completed on array operations page.
2024-07-09 13:44:58 -07:00
dlandon
ed9b8322d4 Fix clobbering CAs $cfg variable. 2024-07-09 14:57:58 -05:00
dlandon
cfb2daa531 Update help text for PID Limit. 2024-07-09 06:37:58 -05:00
dlandon
694d35b412 Parity check does not show completed on array operations page. 2024-07-09 06:21:29 -05:00
mtongnz
ffabb996fc fix: external ports not showing for non-bridge networks 2024-04-06 16:38:02 +13:00
Matt
4a4444229e Apply suggestions from code review
Co-authored-by: FunkeCoder23 <12570656+FunkeCoder23@users.noreply.github.com>
2024-04-06 13:04:22 +13:00
mtongnz
083cd984ea style: fix bizzare formatting glitches 2024-01-12 16:09:52 +13:00
mtongnz
3dda97319d fix: don't return template for containers not managed by dockerman 2024-01-12 15:51:04 +13:00
mtongnz
064cac1110 fix: suppress error on template fetch 2024-01-12 15:46:43 +13:00
mtongnz
3d1b53d0ea style: line up spacing 2024-01-12 15:45:53 +13:00
mtongnz
61e99a390e fix: docker network info display (non dockerman & multiple networks) 2024-01-12 15:45:04 +13:00
281 changed files with 5256 additions and 8577 deletions

View File

@@ -79,8 +79,5 @@
"zip",
"zlib",
"libvirt-php"
],
"search.exclude": {
"emhttp/webGui/**/*": true,
}
]
}

View File

@@ -1 +0,0 @@
/usr/libexec/unraid/firefox-119.0.r20231019122658-x86_64.AppImage

View File

@@ -1 +0,0 @@
/usr/libexec/unraid/unraidwold

View File

@@ -256,7 +256,7 @@ Unraid OS uses these default options when creating a multiple-device pool:
`-dconvert=raid1 -mconvert=raid1`
For more complete documentation, please refer to the btrfs-balance [Manpage](https://btrfs.wiki.kernel.org/index.php/Manpage/btrfs-balance)
For more complete documentation, please refer to the btrfs-balance [Manpage](https://man7.org/linux/man-pages/man8/btrfs-balance.8.html)
*Note: raid5 and raid6 are generally still considered **experimental** by the Linux community*
:end
@@ -1038,6 +1038,15 @@ You must specify a folder for Docker. The system will automatically create this
It is recommended to create this folder under a share which resides on the Cache pool (setting: cache=Only). For best performance SSD devices are preferred.
:end
:docker_storage_driver_help:
overlay2 (default): Will use overlay2 as the storage driver for Docker, regardless of the underlying filesystem.
native: The native storage driver for your underlying filesystem will be used (XFS: overlay2 | ZFS: zfs | BTRFS: btrfs).
ATTENTION: Changing the storage type from an existing Docker installation is not possible, you have to delete your Docker directory first, change the storage type and then reinstall your containers.
It is recommended to take a screenshot from your Docker containers before changing the storage type. After deleting and changing the storage type, reinstall the containers by clicking Add Container on the Docker page and select one by one from the drop down to reinstall them with your previous settings).
:end
:docker_appdata_location_help:
You can specify a folder to automatically generate and store subfolders containing configuration files for each Docker app (via the /config mapped volume).
@@ -1119,6 +1128,10 @@ This is the active Docker version.
This is the location of the Docker image.
:end
:docker_storage_driver_active_help:
This is the storage driver for Docker.
:end
:docker_appdata_location_active_help:
This is the storage location for Docker containers.
:end
@@ -1270,6 +1283,14 @@ The Local Access URLs shown above are based on your current settings.
To adjust URLs or redirects, see the help text for "Use SSL/TLS".
:end
:mgmt_wg_access_urls_help:
These URLs will only work when connected via the appropriate WireGuard tunnel as configured on ***Settings > VPN Manager***
:end
:mgmt_tailscale_access_urls_help:
These URLs will only work when connected to the appropriate Tailscale Tailnet.
:end
:mgmt_certificate_expiration_help:
**Provision** may be used to install a *free* myunraid.net SSL Certificate from
[Let's Encrypt](https://letsencrypt.org/).
@@ -2415,7 +2436,7 @@ Note to Cloudflare users: the Cloudflare proxy is designed for http traffic, it
:wg_local_server_uses_nat_help:
When NAT is enabled, the server uses its own LAN address when forwarding traffic from the tunnel to other devices in the LAN network.
Use this setting when no router modifications are desired, but this approach doesn't work with Docker containers using custom IP addressess.
Use this setting when no router modifications are desired, but this approach doesn't work with Docker containers using custom IP addresses.
When NAT is disabled, the server uses the WireGuard tunnel address when forwarding traffic.
In this case it is required that the default gateway (router) has a static route configured to refer tunnel address back to the server.

View File

@@ -14,10 +14,15 @@ Tag="battery-3"
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*/
$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
require_once "$docroot/webGui/include/Wrappers.php";
?>
<script>
function getUPSstatus() {
$.post('/plugins/dynamix.apcupsd/include/UPSstatus.php',{level:<?=$cfg['BATTERYLEVEL']?>,runtime:<?=$cfg['MINUTES']?>},function(data) {
var batteryLevel = "<?= _var($cfg,'BATTERYLEVEL',0) ?>";
var batteryRuntime = "<?= _var($cfg,'MINUTES',0) ?>";
$.post('/plugins/dynamix.apcupsd/include/UPSstatus.php',{level:batteryLevel,runtime:batteryRuntime},function(data) {
data = data.split('\n');
$('#ups_summary').html(data[0]);
$('#ups_status').html(data[1]);

View File

@@ -1,15 +1,4 @@
table.ups thead tr th {
width: 16.6%;
padding-left: 10px;
}
table.ups tbody tr td {
padding-left: 10px;
font-weight: bold;
}
tr.ups {
height: 3rem;
line-height: 3rem;
}
i.ups {
margin-right: 8px;
}
table.ups thead tr th{width:16.6%;padding-left:10px}
table.ups tbody tr td{padding-left:10px;font-weight:bold}
tr.ups{height:3rem;line-height:3rem}
i.ups{margin-right:8px}

View File

@@ -28,11 +28,11 @@ $cpus = cpu_list();
?>
<link type="text/css" rel="stylesheet" href="<?autov('/webGui/styles/jquery.ui.css')?>">
<link type="text/css" rel="stylesheet" href="<?autov('/webGui/styles/jquery.switchbutton.css')?>">
<link type="text/css" rel="stylesheet" href="<?autov("/plugins/dynamix.docker.manager/styles/DockerManager.css")?>">
<link type="text/css" rel="stylesheet" href="<?autov("/plugins/dynamix.docker.manager/styles/style-$theme.css")?>">
<table id="docker_containers" class="tablesorter shift">
<thead><tr><th><a id="resetsort" class="nohand" onclick="resetSorting()" title="_(Reset sorting)_"><i class="fa fa-th-list"></i></a>_(Application)_</th><th>_(Version)_</th><th>_(Network)_</th><th>_(Port Mappings)_ <small>(_(App to Host)_)</small></th><th>_(Volume Mappings)_ <small>(_(App to Host)_)</small></th><th class="load advanced">_(CPU & Memory load)_</th><th class="nine">_(Autostart)_</th><th class="five">_(Uptime)_</th></tr></thead>
<tbody id="docker_list"><tr><td colspan='8'></td></tr></tbody>
<thead><tr><th><a id="resetsort" class="nohand" onclick="resetSorting()" title="_(Reset sorting)_"><i class="fa fa-th-list"></i></a>_(Application)_</th><th>_(Version)_</th><th>_(Network)_</th><th>_(Container IP)_</th><th>_(Container Port)_</th><th>_(LAN IP:Port)_</th><th>_(Volume Mappings)_ <small>(_(App to Host)_)</small></th><th class="load advanced">_(CPU & Memory load)_</th><th class="nine">_(Autostart)_</th><th class="five">_(Uptime)_</th></tr></thead>
<tbody id="docker_list"><tr><td colspan='9'></td></tr></tbody>
</table>
<input type="button" onclick="addContainer()" value="_(Add Container)_" style="display:none">
<input type="button" onclick="startAll()" value="_(Start All)_" style="display:none">
@@ -183,3 +183,4 @@ window.onunload = function(){
dockerload.stop();
}
</script>

View File

@@ -103,6 +103,9 @@ function base_net($route) {
return substr(explode('/',$route)[0],0,-2);
}
$bgcolor = strstr('white,azure',$display['theme']) ? '#f2f2f2' : '#1c1c1c';
//Check if docker.cfg not exists
$no_dockercfg = !is_file('/boot/config/docker.cfg');
?>
<link type="text/css" rel="stylesheet" href="<?autov('/webGui/styles/jquery.filetree.css')?>">
<link type="text/css" rel="stylesheet" href="<?autov('/webGui/styles/jquery.switchbutton.css')?>">
@@ -188,6 +191,23 @@ _(Docker directory)_:
:docker_vdisk_directory_help:
</div>
<div markdown="1" id="backingfs_type" style="display:none">
_(Docker storage driver)_:
: <select id="DOCKER_BACKINGFS" name="DOCKER_BACKINGFS" onchange="updateBackingFS(this.value)">
<?=mk_option(_var($dockercfg,'DOCKER_BACKINGFS'), 'overlay2', _('overlay2'))?>
<?=mk_option(_var($dockercfg,'DOCKER_BACKINGFS'), 'native', _('native'))?>
</select>
<?if ($var['fsState'] != "Started"):?>
<span id="WARNING_BACKINGFS" style="display:none;"><i class="fa fa-warning icon warning"></i>_(Only modify if this is a new installation since this can lead to unwanted behaviour!)_</span>
<?elseif (is_dir(_var($dockercfg,'DOCKER_IMAGE_FILE'))):?>
<span id="WARNING_BACKINGFS" style="display:none;"><i class="fa fa-warning icon warning"></i>_(Switching the Storage Driver requires to delete and rebuild the Docker directory manually!)_</span>
<?endif;?>
:docker_storage_driver_help:
</div>
_(Default appdata storage location)_:
: <input type="text" id="DOCKER_APP_CONFIG_PATH" name="DOCKER_APP_CONFIG_PATH" autocomplete="off" spellcheck="false" value="<?=_var($dockercfg,'DOCKER_APP_CONFIG_PATH')?>" placeholder="_(e.g.)_ /mnt/user/appdata/" data-pickfilter="HIDE_FILES_FILTER" data-pickroot="/mnt" data-pickfolders="true" pattern="^[^\\]*/$">
<?if ($var['fsState'] != "Started"):?>
@@ -418,6 +438,7 @@ _(IPv6 custom network on interface)_ <?=$network?> (_(optional)_):
</div>
<?else: /* DOCKER STARTED */?>
_(Docker version)_:
: <?$arrInfo = $DockerClient->getInfo(); echo $arrInfo['Version']?>
@@ -433,6 +454,11 @@ _(Docker directory)_:
:docker_vdisk_location_active_help:
_(Docker storage driver)_:
: <?=_var($dockercfg,'DOCKER_BACKINGFS')?>
:docker_storage_driver_active_help:
_(Default appdata storage location)_:
: <?=_var($dockercfg,'DOCKER_APP_CONFIG_PATH')?>
@@ -592,6 +618,9 @@ function prepareDocker(form) {
$(form).find('input[name="DOCKER_IMAGE_FILE"]').val($('#DOCKER_IMAGE_TYPE').val()=='folder' ? $("#DOCKER_IMAGE_FILE2").val() : $("#DOCKER_IMAGE_FILE1").val());
$("#DOCKER_IMAGE_FILE1").prop('disabled',true);
$("#DOCKER_IMAGE_FILE2").prop('disabled',true);
<?if ($no_dockercfg):?>
$(form).find('input[name="DOCKER_BACKINGFS"]').val($('#DOCKER_IMAGE_TYPE').val()=='folder' ? $("#DOCKER_BACKINGFS").val() : $("#DOCKER_BACKINGFS").val('native'));
<?endif;?>
<?endif;?>
$(form).find('input:hidden[name^="DOCKER_DHCP_"]').each(function(){
var id = '#'+$(this).attr('name')+'_';
@@ -857,39 +886,54 @@ function btrfsScrub(path) {
}
});
}
var originalPath = $("#DOCKER_IMAGE_FILE2").val();
function updateLocation(val) {
var content1 = $("#DOCKER_IMAGE_FILE1");
var content2 = $("#DOCKER_IMAGE_FILE2");
var dropdown = $("#DOCKER_BACKINGFS");
var path = originalPath.split('/');
switch (val) {
case 'xfs':
var path = content2.val().split('/');
path.splice(-1,1);
content1.val((path.join('/') + '/docker-xfs.img'));
$('#vdisk_file').show('slow');
$('#vdisk_dir').hide('slow');
$('#backingfs_type').hide();
content1.prop('disabled',false).trigger('change');
content2.prop('disabled',true);
dropdown.val('native');
break;
case 'folder':
var path = content2.val().split('/');
if (path[path.length-1]=='') path.splice(-2,2); else path.splice(-1,1);
content2.val(path.join('/') + '/docker/');
content2.val(path.join('/') + '/');
$('#vdisk_file').hide('slow');
$('#vdisk_dir').show('slow');
$('#backingfs_type').show('slow');
content1.prop('disabled',true);
content2.prop('disabled',false).trigger('change');
break;
default:
var path = content2.val().split('/');
path.splice(-1,1);
content1.val((path.join('/') + '/docker.img'));
$('#vdisk_file').show('slow');
$('#vdisk_dir').hide('slow');
$('#backingfs_type').hide();
content1.prop('disabled',false).trigger('change');
content2.prop('disabled',true);
dropdown.val('native');
break;
}
}
function updateBackingFS(val) {
var backingfs = "<?= _var($dockercfg,'DOCKER_BACKINGFS') ?>";
var warning = document.getElementById("WARNING_BACKINGFS");
var checkbox = $(".deleteCheckbox");
if (val !== backingfs) {
warning.style.display = "inline";
} else {
warning.style.display = "none";
}
}
function checkbox_state(value) {
$.post('/plugins/dynamix.docker.manager/include/UpdateConfig.php',{action:'exist',name:value},function(state){state==0 ? $('.deleteLabel').fadeIn() : $('.deleteLabel').fadeOut();});
}
@@ -897,6 +941,7 @@ $(function() {
<?if ($DockerStopped):?>
if ($('#DOCKER_IMAGE_TYPE').val()=='folder') {
$('#vdisk_dir').show();
$('#backingfs_type').show();
checkbox_state($("#DOCKER_IMAGE_FILE2").val());
$("#DOCKER_IMAGE_FILE2").prop('disabled',false);
} else {

View File

@@ -9,3 +9,4 @@ DOCKER_ALLOW_ACCESS=""
DOCKER_TIMEOUT=10
DOCKER_READMORE="yes"
DOCKER_PID_LIMIT=""
DOCKER_BACKINGFS="overlay2"

View File

@@ -213,6 +213,9 @@ if (isset($_GET['xmlTemplate'])) {
if (is_file($xmlTemplate)) {
$xml = xmlToVar($xmlTemplate);
$templateName = $xml['Name'];
if (preg_match('/^container:(.*)/', $xml['Network'])) {
$xml['Network'] = explode(':', $xml['Network'], 2);
}
if ($xmlType == 'default') {
if (!empty($dockercfg['DOCKER_APP_CONFIG_PATH']) && file_exists($dockercfg['DOCKER_APP_CONFIG_PATH'])) {
// override /config
@@ -273,7 +276,7 @@ $bgcolor = strstr('white,azure',$display['theme']) ? '#f2f2f2' : '#1c1c1c';
<link type="text/css" rel="stylesheet" href="<?autov("/webGui/styles/jquery.ui.css")?>">
<link type="text/css" rel="stylesheet" href="<?autov("/webGui/styles/jquery.switchbutton.css")?>">
<link type="text/css" rel="stylesheet" href="<?autov("/webGui/styles/jquery.filetree.css")?>">
<link type="text/css" rel="stylesheet" href="<?autov("/plugins/dynamix.docker.manager/styles/DockerManager.css")?>">
<link type="text/css" rel="stylesheet" href="<?autov("/plugins/dynamix.docker.manager/styles/style-{$display['theme']}.css")?>">
<script src="<?autov('/webGui/javascript/jquery.switchbutton.js')?>"></script>
<script src="<?autov('/webGui/javascript/jquery.filetree.js')?>" charset="utf-8"></script>
@@ -423,6 +426,9 @@ function addConfigPopup() {
Opts.Buttons += "<button type='button' onclick='removeConfig("+confNum+")'>_(Remove)_</button>";
}
Opts.Number = confNum;
if (Opts.Type == "Device") {
Opts.Target = Opts.Value;
}
newConf = makeConfig(Opts);
$("#configLocation").append(newConf);
reloadTriggers();
@@ -491,6 +497,9 @@ function editConfigPopup(num,disabled) {
}
Opts.Number = num;
if (Opts.Type == "Device") {
Opts.Target = Opts.Value;
}
newConf = makeConfig(Opts);
if (config.hasClass("config_"+Opts.Display)) {
config.html(newConf);
@@ -858,6 +867,7 @@ _(Network Type)_:
: <select name="contNetwork" onchange="showSubnet(this.value)">
<?=mk_option(1,'bridge',_('Bridge'))?>
<?=mk_option(1,'host',_('Host'))?>
<?=mk_option(1,'container',_('Container'))?>
<?=mk_option(1,'none',_('None'))?>
<?foreach ($custom as $network):?>
<?$name = $network;
@@ -880,6 +890,21 @@ _(Fixed IP address)_ (_(optional)_):
:docker_fixed_ip_help:
</div>
<div markdown="1" class="netCONT noshow">
_(Container Network)_:
: <select name="netCONT" id="netCONT">
<?php
foreach ($DockerClient->getDockerContainers() as $ct) {
if ($ct['Name'] !== $xml['Name']) {
$list[] = $ct['Name'];
echo mk_option($ct['Name'], $ct['Name'], $ct['Name']);
}
}
?>
:docker_container_network_help:
</select>
</div>
_(Console shell command)_:
: <select name="contShell">
@@ -1013,9 +1038,18 @@ function showSubnet(bridge) {
if (bridge.match(/^(bridge|host|none)$/i) !== null) {
$('.myIP').hide();
$('input[name="contMyIP"]').val('');
$('.netCONT').hide();
$('#netCONT').val('');
} else if (bridge.match(/^(container)$/i) !== null) {
$('.netCONT').show();
$('#netCONT').val('<?php echo $xml['Network'][1]; ?>');
$('.myIP').hide();
$('input[name="contMyIP"]').val('');
} else {
$('.myIP').show();
$('#myIP').html('Subnet: '+subnet[bridge]);
$('.netCONT').hide();
$('#netCONT').val('');
}
}
@@ -1111,6 +1145,9 @@ $(function() {
Opts.Buttons += "<button type='button' onclick='removeConfig("+confNum+")'>_(Remove)_</button>";
}
Opts.Number = confNum;
if (Opts.Type == "Device") {
Opts.Target = Opts.Value;
}
newConf = makeConfig(Opts);
if (Opts.Display == 'advanced' || Opts.Display == 'advanced-hide') {
$("#configLocationAdvanced").append(newConf);

View File

@@ -49,11 +49,11 @@ $port = file_exists('/sys/class/net/br0') ? 'BR0' : (file_exists('/sys/class/net
// Docker configuration file - guaranteed to exist
$docker_cfgfile = '/boot/config/docker.cfg';
if (file_exists($docker_cfgfile)) {
exec("grep -Pom2 '_SUBNET_|_{$port}(_[0-9]+)?=' $docker_cfgfile",$cfg);
if (isset($cfg[0]) && $cfg[0]=='_SUBNET_' && empty($cfg[1])) {
# interface has changed, update configuration
exec("sed -ri 's/_(BR0|BOND0|ETH0)(_[0-9]+)?=/_{$port}\\2=/' $docker_cfgfile");
}
exec("grep -Pom2 '_SUBNET_|_{$port}(_[0-9]+)?=' $docker_cfgfile",$cfg);
if (isset($cfg[0]) && $cfg[0]=='_SUBNET_' && empty($cfg[1])) {
# interface has changed, update configuration
exec("sed -ri 's/_(BR0|BOND0|ETH0)(_[0-9]+)?=/_{$port}\\2=/' $docker_cfgfile");
}
}
$defaults = (array)@parse_ini_file("$docroot/plugins/dynamix.docker.manager/default.cfg");
@@ -255,7 +255,7 @@ class DockerTemplates {
$doc = new DOMDocument();
$doc->load($file['path']);
if ($name) {
if ($doc->getElementsByTagName('Name')->item(0)->nodeValue !== $name) continue;
if (@$doc->getElementsByTagName('Name')->item(0)->nodeValue !== $name) continue;
}
$TemplateRepository = DockerUtil::ensureImageTag($doc->getElementsByTagName('Repository')->item(0)->nodeValue??'');
if ($TemplateRepository && $TemplateRepository==$Repository) {
@@ -293,7 +293,7 @@ class DockerTemplates {
}
public function getAllInfo($reload=false,$com=true,$communityApplications=false) {
global $dockerManPaths, $host;
global $driver, $dockerManPaths, $host;
$DockerClient = new DockerClient();
$DockerUpdate = new DockerUpdate();
//$DockerUpdate->verbose = $this->verbose;
@@ -307,9 +307,8 @@ class DockerTemplates {
$tmp['paused'] = $ct['Paused'];
$tmp['autostart'] = in_array($name,$autoStart);
$tmp['cpuset'] = $ct['CPUset'];
$tmp['url'] = $tmp['url'] ?? '';
$tmp['url'] = $ct['Url'] ?? $tmp['url'] ?? '';
// read docker label for WebUI & Icon
if (isset($ct['Url']) && !$tmp['url']) $tmp['url'] = $ct['Url'];
if (isset($ct['Icon'])) $tmp['icon'] = $ct['Icon'];
if (isset($ct['Shell'])) $tmp['shell'] = $ct['Shell'];
if (!$communityApplications) {
@@ -322,8 +321,18 @@ class DockerTemplates {
// non-templated webui, user specified
$tmp['url'] = $webui;
} else {
$ip = ($ct['NetworkMode']=='host'||_var($port,'NAT')) ? $host : _var($port,'IP');
if ($ct['NetworkMode']=='host') {
$ip = $host;
} elseif (isset($driver[$ct['NetworkMode']]) && ($driver[$ct['NetworkMode']] == 'ipvlan' || $driver[$ct['NetworkMode']] == 'macvlan')) {
$ip = reset($ct['Networks'])['IPAddress'];
} elseif (!is_null(_var($port,'PublicPort'))) {
$ip = $host;
} else {
$ip = _var($port,'IP');
}
$tmp['url'] = $ip ? (strpos($tmp['url'],$ip)!==false ? $tmp['url'] : $this->getControlURL($ct, $ip, $tmp['url'])) : $tmp['url'];
if (strpos($ct['NetworkMode'], 'container:') === 0)
$tmp['url'] = '';
}
if ( ($tmp['shell'] ?? false) == false )
$tmp['shell'] = $this->getTemplateValue($image, 'Shell');
@@ -338,8 +347,12 @@ class DockerTemplates {
$tmp['updated'] = var_export($DockerUpdate->getUpdateStatus($image),true);
}
if (!$com) $tmp['updated'] = 'undef';
if (empty($tmp['template']) || $reload) $tmp['template'] = $this->getUserTemplate($name);
if ($reload) $DockerUpdate->updateUserTemplate($name);
if ($ct['Manager'] !== 'dockerman')
$tmp['template'] = null;
else if (empty($tmp['template']) || $reload) {
$tmp['template'] = $this->getUserTemplate($name);
if ($reload) $DockerUpdate->updateUserTemplate($name);
}
//$this->debug("\n$name");
//foreach ($tmp as $c => $d) $this->debug(sprintf(' %-10s: %s', $c, $d));
}
@@ -811,6 +824,13 @@ class DockerClient {
global $docroot, $dockerManPaths;
$id = $id ?: $name;
$info = DockerUtil::loadJSON($dockerManPaths['webui-info']);
// Check to see if the container is linked to other containers
$networks = array_map(function ($n) { return $n['NetworkMode']; }, $this->getDockerContainers());
if (in_array("container:{$name}", $networks)) {
return "Container currently assigned as network for another container.";
}
// Attempt to remove container
$this->getDockerJSON("/containers/$id?force=1", 'DELETE', $code);
if (isset($info[$name])) {
@@ -897,7 +917,7 @@ class DockerClient {
}
public function getDockerContainers() {
global $driver;
global $driver, $host;
// Return cached values
if (is_array($this::$containersCache)) return $this::$containersCache;
$this::$containersCache = [];
@@ -916,29 +936,57 @@ class DockerClient {
$c['Created'] = $this->humanTiming($ct['Created']);
$c['NetworkMode'] = $ct['HostConfig']['NetworkMode'];
$c['Manager'] = $info['Config']['Labels']['net.unraid.docker.managed'] ?? false;
if ($c['Manager'] == 'composeman') {
$c['ComposeProject'] = $info['Config']['Labels']['com.docker.compose.project'];
}
[$net, $id] = array_pad(explode(':',$c['NetworkMode']),2,'');
$c['CPUset'] = $info['HostConfig']['CpusetCpus'];
$c['BaseImage'] = $ct['Labels']['BASEIMAGE'] ?? false;
$c['Icon'] = $info['Config']['Labels']['net.unraid.docker.icon'] ?? false;
$c['Url'] = $info['Config']['Labels']['net.unraid.docker.webui'] ?? false;
$c['Shell'] = $info['Config']['Labels']['net.unraid.docker.shell'] ?? false;
$c['Manager'] = $info['Config']['Labels']['net.unraid.docker.managed'] ?? false;
$c['Ports'] = [];
$c['Networks'] = [];
if ($id) $c['NetworkMode'] = $net.str_replace('/',':',DockerUtil::ctMap($id)?:'/???');
if (isset($driver[$c['NetworkMode']])) {
if ($driver[$c['NetworkMode']]=='bridge') {
$ports = &$info['HostConfig']['PortBindings'];
$nat = true;
} elseif ($driver[$c['NetworkMode']]=='host') {
$c['Ports']['host'] = ['host' => ''];
} elseif ($driver[$c['NetworkMode']]=='ipvlan' || $driver[$c['NetworkMode']]=='macvlan') {
$i = $ct['NetworkSettings']['Networks'][$c['NetworkMode']]['IPAddress'];
$c['Ports']['vlan'] = ["$i" => $i];
} else {
$ports = &$info['Config']['ExposedPorts'];
$nat = false;
}
$ip = $ct['NetworkSettings']['Networks'][$c['NetworkMode']]['IPAddress'];
} else if (!$id) {
$c['NetworkMode'] = DockerUtil::ctMap($c['NetworkMode']);
$ports = &$info['Config']['ExposedPorts'];
}
foreach($ct['NetworkSettings']['Networks'] as $netName => $netVals) {
$i = $c['NetworkMode']=='host' ? $host : $netVals['IPAddress'];
$c['Networks'][$netName] = [ 'IPAddress' => $i ];
if ($driver[$netName]=='ipvlan' || $driver[$netName]=='macvlan') {
if (!isset($c['Ports']['vlan'])) $c['Ports']['vlan'] = [];
$c['Ports']['vlan']["$i"] = $i;
}
}
$ip = $c['NetworkMode']=='host' ? $host : $ct['NetworkSettings']['Networks'][$c['NetworkMode']]['IPAddress'] ?? null;
$c['Networks'][$c['NetworkMode']] = [ 'IPAddress' => $ip ];
$ports = (isset($ports) && is_array($ports)) ? $ports : [];
foreach ($ports as $port => $value) {
if (!isset($info['HostConfig']['PortBindings'][$port])) {
continue;
}
[$PrivatePort, $Type] = array_pad(explode('/', $port),2,'');
$c['Ports'][] = ['IP' => $ip, 'PrivatePort' => $PrivatePort, 'PublicPort' => $nat ? $value[0]['HostPort'] : $PrivatePort, 'NAT' => $nat, 'Type' => $Type];
$PublicPort = $info['HostConfig']['PortBindings']["$port"][0]['HostPort'] ?: null;
$nat = ($driver[$c['NetworkMode']]=='bridge');
if (array_key_exists($PrivatePort, $c['Ports']) && $Type != $c['Ports'][$PrivatePort]['Type'])
$Type = $c['Ports'][$PrivatePort]['Type'] . '/' . $Type;
$c['Ports'][$PrivatePort] = ['IP' => $ip, 'PrivatePort' => $PrivatePort, 'PublicPort' => $PublicPort, 'NAT' => $nat, 'Type' => $Type, 'Driver' => $driver[$c['NetworkMode']]];
}
ksort($c['Ports']);
$this::$containersCache[] = $c;
}
array_multisort(array_column($this::$containersCache,'Name'), SORT_NATURAL|SORT_FLAG_CASE, $this::$containersCache);

View File

@@ -69,7 +69,8 @@ foreach ($containers as $ct) {
$running = $info['running'] ? 1 : 0;
$paused = $info['paused'] ? 1 : 0;
$is_autostart = $info['autostart'] ? 'true':'false';
$updateStatus = substr($ct['NetworkMode'],-4)==':???' ? 2 : ($info['updated']=='true' ? 0 : ($info['updated']=='false' ? 1 : 3));
$composestack = isset($ct['ComposeProject']) ? $ct['ComposeProject'] : '';
$updateStatus = substr($ct['NetworkMode'], -4) == ':???' ? 2 : ($info['updated'] == 'true' ? 0 : ($info['updated'] == 'false' ? 1 : 3));
$template = $info['template']??'';
$shell = $info['shell']??'';
$webGui = html_entity_decode($info['url']??'');
@@ -83,15 +84,34 @@ foreach ($containers as $ct) {
$shape = $running ? ($paused ? 'pause' : 'play') : 'square';
$status = $running ? ($paused ? 'paused' : 'started') : 'stopped';
$color = $status=='started' ? 'green-text' : ($status=='paused' ? 'orange-text' : 'red-text');
$update = $updateStatus==1 ? 'blue-text' : '';
$update = $updateStatus==1 && !empty($compose) ? 'blue-text' : '';
$icon = $info['icon'] ?: '/plugins/dynamix.docker.manager/images/question.png';
$image = substr($icon,-4)=='.png' ? "<img src='$icon?".filemtime("$docroot{$info['icon']}")."' class='img' onerror=this.src='/plugins/dynamix.docker.manager/images/question.png';>" : (substr($icon,0,5)=='icon-' ? "<i class='$icon img'></i>" : "<i class='fa fa-$icon img'></i>");
$wait = var_split($autostart[array_search($name,$names)]??'',1);
$ports = [];
foreach ($ct['Ports'] as $port) {
$intern = $running ? ($ct['NetworkMode']=='host' ? $host : _var($port,'IP')) : $null;
$extern = $running ? (_var($port,'NAT') ? $host : $intern) : $null;
$ports[] = sprintf('%s:%s/%s<i class="fa fa-arrows-h" style="margin:0 6px"></i>%s:%s', $intern, _var($port,'PrivatePort'), strtoupper(_var($port,'Type')), $extern, _var($port,'PublicPort'));
$networks = [];
$network_ips = [];
$ports_internal = [];
$ports_external = [];
if (isset($ct['Ports']['vlan'])) {
foreach ($ct['Ports']['vlan'] as $i)
$ports_external[] = sprintf('%s', $i);
$ports_internal[0] = sprintf('%s', 'all');
}
foreach($ct['Networks'] as $netName => $netVals) {
$networks[] = $netName;
$network_ips[] = $running ? $netVals['IPAddress'] : null;
if (isset($ct['Networks']['host'])) {
$ports_external[] = sprintf('%s', $netVals['IPAddress']);
$ports_internal[0] = sprintf('%s', 'all');
} else if (!isset($ct['Ports']['vlan']) || strpos($ct['NetworkMode'], 'container:') != 0) {
foreach ($ct['Ports'] as $port) {
if (_var($port,'PublicPort') && _var($port,'Driver') == 'bridge')
$ports_external[] = sprintf('%s:%s', $host, strtoupper(_var($port,'PublicPort')));
if ((!isset($ct['Networks']['host'])) || (!isset($ct['Networks']['vlan'])))
$ports_internal[] = sprintf('%s:%s', _var($port,'PrivatePort'), strtoupper(_var($port,'Type')));
}
}
}
$paths = [];
$ct['Volumes'] = is_array($ct['Volumes']) ? $ct['Volumes'] : [];
@@ -100,12 +120,12 @@ foreach ($containers as $ct) {
$paths[] = sprintf('%s<i class="fa fa-%s" style="margin:0 6px"></i>%s', htmlspecialchars($container_path), $access_mode=='ro'?'long-arrow-left':'arrows-h', htmlspecialchars($host_path));
}
echo "<tr class='sortable'><td class='ct-name' style='width:220px;padding:8px'><i class='fa fa-arrows-v mover orange-text'></i>";
if ($template) {
if ($template && empty($composestack)) {
$appname = "<a class='exec' onclick=\"editContainer('".addslashes(htmlspecialchars($name))."','".addslashes(htmlspecialchars($template))."')\">".htmlspecialchars($name)."</a>";
} else {
$appname = htmlspecialchars($name);
}
echo "<span class='outer'><span id='$id' $menu class='hand'>$image</span><span class='inner'><span class='appname $update'>$appname</span><br><i id='load-$id' class='fa fa-$shape $status $color'></i><span class='state'>"._($status)."</span></span></span>";
echo "<span class='outer'><span id='$id' $menu class='hand'>$image</span><span class='inner'><span class='appname $update'>$appname</span><br><i id='load-$id' class='fa fa-$shape $status $color'></i><span class='state'>"._($status).(!empty($composestack) ? '<br/>Compose Stack: ' . $composestack : '')."</span></span></span>";
echo "<div class='advanced' style='margin-top:8px'>"._('Container ID').": $id<br>";
if ($ct['BaseImage']) echo "<i class='fa fa-cubes' style='margin-right:5px'></i>".htmlspecialchars($ct['BaseImage'])."<br>";
echo _('By').": ";
@@ -118,35 +138,64 @@ foreach ($containers as $ct) {
}
echo "</div></td><td class='updatecolumn'>";
switch ($updateStatus) {
case 0:
echo "<span class='green-text' style='white-space:nowrap;'><i class='fa fa-check fa-fw'></i> "._('up-to-date')."</span>";
if ($ct['Manager'] == "dockerman")
echo "<div class='advanced'><a class='exec' onclick=\"updateContainer('".addslashes(htmlspecialchars($name))."');\"><span style='white-space:nowrap;'><i class='fa fa-cloud-download fa-fw'></i> "._('force update')."</span></a></div>";
break;
case 0:
if ($ct['Manager'] == "dockerman") {
echo "<span class='green-text' style='white-space:nowrap;'><i class='fa fa-check fa-fw'></i> "._('up-to-date')."</span>";
echo "<div class='advanced'><a class='exec' onclick=\"updateContainer('".addslashes(htmlspecialchars($name))."');\"><span style='white-space:nowrap;'><i class='fa fa-cloud-download fa-fw'></i> "._('force update')."</span></a></div>";
} elseif (!empty($composestack)) {
echo "<div><span><i class='fa fa-docker fa-fw'/></i> Compose</span></div>";
echo "<span tyle='white-space:nowrap;'><i class='fa fa-check fa-fw'></i> "._('up-to-date')."</span>";
} else {
echo "<div><span><i class='fa fa-docker fa-fw'/></i> 3rd Party</span></div>";
echo "<span tyle='white-space:nowrap;'><i class='fa fa-check fa-fw'></i> "._('up-to-date')."</span>";
}
break;
case 1:
echo "<div class='advanced'><span class='orange-text' style='white-space:nowrap;'><i class='fa fa-flash fa-fw'></i> "._('update ready')."</span></div>";
if ($ct['Manager'] == "dockerman")
echo "<a class='exec' onclick=\"updateContainer('".addslashes(htmlspecialchars($name))."');\"><span style='white-space:nowrap;'><i class='fa fa-cloud-download fa-fw'></i> "._('apply update')."</span></a>";
else
if ($ct['Manager'] == "dockerman") {
echo "<a class='exec' onclick=\"updateContainer('".addslashes(htmlspecialchars($name))."');\"><span style='white-space:nowrap;'><i class='fa fa-cloud-download fa-fw'></i> "._('apply update')."</span></a>";
} elseif (!empty($composestack)) {
echo "<div><span><i class='fa fa-docker fa-fw'/></i> Compose</span></a></div>";
echo "<span style='white-space:nowrap;'><i class='fa fa-cloud-download fa-fw'></i> "._('update available')."</span>";
} else {
echo "<div><span><i class='fa fa-docker fa-fw'/></i> 3rd Party</span></div>";
echo "<span style='white-space:nowrap;'><i class='fa fa-cloud-download fa-fw'></i> "._('update available')."</span>";
}
break;
case 2:
echo "<div class='advanced'><span class='orange-text' style='white-space:nowrap;'><i class='fa fa-flash fa-fw'></i> "._('rebuild ready')."</span></div>";
echo "<a class='exec'><span style='white-space:nowrap;'><i class='fa fa-recycle fa-fw'></i> "._('rebuilding')."</span></a>";
break;
default:
echo "<span class='orange-text' style='white-space:nowrap;'><i class='fa fa-unlink'></i> "._('not available')."</span>";
if ($ct['Manager'] == "dockerman")
if ($ct['Manager'] == "dockerman") {
echo "<span class='orange-text' style='white-space:nowrap;'><i class='fa fa-unlink'></i> "._('not available')."</span>";
echo "<div class='advanced'><a class='exec' onclick=\"updateContainer('".addslashes(htmlspecialchars($name))."');\"><span style='white-space:nowrap;'><i class='fa fa-cloud-download fa-fw'></i> "._('force update')."</span></a></div>";
} elseif (!empty($composestack)) {
echo "<div><span><i class='fa fa-docker fa-fw'/></i> Compose</span></div>";
echo "<span style='white-space:nowrap;'><i class='fa fa-unlink'></i> "._('not available')."</span>";
} else {
echo "<div><span><i class='fa fa-docker fa-fw'/></i> 3rd Party</span></div>";
echo "<span style='white-space:nowrap;'><i class='fa fa-unlink'></i> "._('not available')."</span>";
}
break;
}
}
echo "<div class='advanced'><i class='fa fa-info-circle fa-fw'></i> ".compress(_($version),12,0)."</div></td>";
echo "<td>{$ct['NetworkMode']}</td>";
echo "<td style='white-space:nowrap'><span class='docker_readmore'>".implode('<br>',$ports)."</span></td>";
echo "<td style='white-space:nowrap'><span class='docker_readmore'> ".implode('<br>',$networks)."</span></td>";
echo "<td style='white-space:nowrap'><span class='docker_readmore'> ".implode('<br>',$network_ips)."</span></td>";
echo "<td style='white-space:nowrap'><span class='docker_readmore'>".implode('<br>',$ports_internal)."</span></td>";
echo "<td style='white-space:nowrap'><span class='docker_readmore'>".implode('<br>',$ports_external)."</span></td>";
echo "<td style='word-break:break-all'><span class='docker_readmore'>".implode('<br>',$paths)."</span></td>";
echo "<td class='advanced'><span class='cpu-$id'>0%</span><div class='usage-disk mm'><span id='cpu-$id' style='width:0'></span><span></span></div>";
echo "<br><span class='mem-$id'>0 / 0</span></td>";
echo "<td><input type='checkbox' id='$id-auto' class='autostart' container='".htmlspecialchars($name)."'".($info['autostart'] ? ' checked':'').">";
if (empty($composestack)) {
if ($ct['Manager'] == "dockerman") {
echo "<td><input type='checkbox' id='$id-auto' class='autostart' container='".htmlspecialchars($name)."'".($info['autostart'] ? ' checked':'').">";
} else {
echo "<td><i class='fa fa-docker fa-fw'/></i> 3rd Party";
}
} else {
echo "<td><i class='fa fa-docker'/></i> Compose";
}
echo "<span id='$id-wait' style='float:right;display:none'>"._('wait')."<input class='wait' container='".htmlspecialchars($name)."' type='number' value='$wait' placeholder='0' title=\""._('seconds')."\"></span></td>";
echo "<td><div style='white-space:nowrap'>".htmlspecialchars(str_replace('Up',_('Uptime').':',my_lang_log($ct['Status'])))."<div style='margin-top:4px'>"._('Created').": ".htmlspecialchars(my_lang_time($ct['Created']))."</div></div></td></tr>";
}
@@ -162,3 +211,4 @@ foreach ($images as $image) {
}
echo "\0".implode($docker)."\0".(pgrep('rc.docker')!==false ? 1:0);
?>

View File

@@ -12,11 +12,6 @@
*/
?>
<?
/* Read the docker configuration file. */
$cfgfile = "/boot/config/docker.cfg";
$config_ini = @parse_ini_file($cfgfile, true, INI_SCANNER_RAW);
$cfg = ($config_ini !== false) ? $config_ini : [];
function addRoute($ct) {
// add static route(s) for remote WireGuard access
[$pid,$net] = array_pad(explode(' ',exec("docker inspect --format='{{.State.Pid}} {{.NetworkSettings.Networks}}' $ct")),2,'');
@@ -45,7 +40,11 @@ function postToXML($post, $setOwnership=false) {
$xml->Name = xml_encode(preg_replace('/\s+/', '', $post['contName']));
$xml->Repository = xml_encode(trim($post['contRepository']));
$xml->Registry = xml_encode(trim($post['contRegistry']));
$xml->Network = xml_encode($post['contNetwork']);
if (!empty(trim($post['netCONT']))) {
$xml->Network = xml_encode($post['contNetwork'].':'.$post['netCONT']);
} else {
$xml->Network = xml_encode($post['contNetwork']);
}
$xml->MyIP = xml_encode($post['contMyIP']);
$xml->Shell = xml_encode($post['contShell']);
$xml->Privileged = strtolower($post['contPrivileged']??'')=='on' ? 'true' : 'false';
@@ -137,7 +136,11 @@ function xmlToVar($xml) {
$out['Network'] = xml_decode($xml->Networking->Mode);
}
// check if network exists
if (!key_exists($out['Network'],$subnet)) $out['Network'] = 'none';
if (preg_match('/^container:(.*)/', $out['Network'])) {
$out['Network'] = $out['Network'];
} elseif (!key_exists($out['Network'],$subnet)) {
$out['Network'] = 'none';
}
// V1 compatibility
if ($xml['version'] != '2') {
if (isset($xml->Description)) {
@@ -242,11 +245,15 @@ function xmlSecurity(&$template) {
}
function xmlToCommand($xml, $create_paths=false) {
global $docroot, $var, $cfg, $driver;
global $docroot, $var, $driver;
$xml = xmlToVar($xml);
$cmdName = strlen($xml['Name']) ? '--name='.escapeshellarg($xml['Name']) : '';
$cmdPrivileged = strtolower($xml['Privileged'])=='true' ? '--privileged=true' : '';
$cmdNetwork = preg_match('/\-\-net(work)?=/',$xml['ExtraParams']) ? "" : '--net='.escapeshellarg(strtolower($xml['Network']));
if (preg_match('/^container:(.*)/', $xml['Network'])) {
$cmdNetwork = preg_match('/\-\-net(work)?=/',$xml['ExtraParams']) ? "" : '--net='.escapeshellarg($xml['Network']);
} else {
$cmdNetwork = preg_match('/\-\-net(work)?=/',$xml['ExtraParams']) ? "" : '--net='.escapeshellarg(strtolower($xml['Network']));
}
$cmdMyIP = '';
foreach (explode(' ',str_replace(',',' ',$xml['MyIP'])) as $myIP) if ($myIP) $cmdMyIP .= (strpos($myIP,':')?'--ip6=':'--ip=').escapeshellarg($myIP).' ';
$cmdCPUset = strlen($xml['CPUset']) ? '--cpuset-cpus='.escapeshellarg($xml['CPUset']) : '';
@@ -307,12 +314,17 @@ function xmlToCommand($xml, $create_paths=false) {
}
}
/* Read the docker configuration file. */
$cfgfile = "/boot/config/docker.cfg";
$config_ini = @parse_ini_file($cfgfile, true, INI_SCANNER_RAW);
$docker_cfg = ($config_ini !== false) ? $config_ini : [];
// Add pid limit if user has not specified it as an extra parameter
$pidsLimit = preg_match('/--pids-limit (\d+)/', $xml['ExtraParams'], $matches) ? $matches[1] : null;
if ($pidsLimit === null) {
$pid_limit = "--pids-limit ";
if (($cfg['DOCKER_PID_LIMIT']??'') != "") {
$pid_limit .= $cfg['DOCKER_PID_LIMIT'];
if (($docker_cfg['DOCKER_PID_LIMIT']??'') != "") {
$pid_limit .= $docker_cfg['DOCKER_PID_LIMIT'];
} else {
$pid_limit .= "2048";
}
@@ -515,9 +527,15 @@ function getAllocations() {
$nat = $ip = false;
$list['Name'] = $ct['Name'];
foreach ($ct['Ports'] as $tmp) {
$nat = $tmp['NAT'];
$ip = $tmp['IP'];
$port[] = $tmp['PublicPort'];
if (isset($tmp['NAT'])) {
$nat = $tmp['NAT'];
}
if (isset($tmp['IP'])) {
$ip = $tmp['IP'];
}
if (isset($tmp['PublicPort'])) {
$port[] = $tmp['PublicPort'];
}
}
sort($port);
$ip = $ct['NetworkMode']=='host'||$nat ? $host : ($ip ?: DockerUtil::myIP($ct['Name']) ?: '0.0.0.0');

View File

@@ -24,7 +24,7 @@ $_SERVER['REQUEST_URI'] = "scripts";
$login_locale = _var($display,'locale');
require_once "$docroot/webGui/include/Translations.php";
exec("pgrep docker", $pid);
exec('pgrep --ns $$ docker', $pid);
if (count($pid) == 1) exit(0);
$DockerClient = new DockerClient();

View File

@@ -0,0 +1 @@
.fileTree{width:240px;max-height:200px;overflow-y:scroll;overflow-x:hidden;position:absolute;display:none;background:#f2f2f2}

View File

@@ -0,0 +1 @@
.fileTree{width:240px;max-height:200px;overflow-y:scroll;overflow-x:hidden;position:absolute;display:none;background:#1c1c1c}

View File

@@ -0,0 +1 @@
.fileTree{width:240px;max-height:200px;overflow-y:scroll;overflow-x:hidden;position:absolute;display:none;background:#1c1c1c}

View File

@@ -0,0 +1 @@
.fileTree{width:240px;max-height:200px;overflow-y:scroll;overflow-x:hidden;position:absolute;display:none;background:#f2f2f2}

View File

@@ -1,77 +1,14 @@
.noshow,
.advanced {
display: none;
}
.required:after {
content: " *";
color: var(--red-800);
}
span.boxed {
display: inline-block;
line-height: normal;
white-space: normal;
width: 60%;
}
span.cpu,
label.checkbox {
display: inline-block;
width: 32px;
}
span.ct {
display: inline-block;
width: 230px;
}
span.net {
display: inline-block;
width: 120px;
}
span.ip {
display: inline-block;
width: 160px;
}
dl,
dt,
dd {
line-height: normal !important;
height: auto !important;
}
dl {
padding: 8px 0 !important;
}
dl > dt:nth-of-type(2),
dl > dd:nth-of-type(2) {
padding: 20px 0 0 0 !important;
}
input.setting_input {
margin-right: 4rem;
}
input,
select {
margin-top: -0.8rem !important;
}
div#configLocation,
div#configLocation dl {
padding: 0 !important;
}
div#configLocation dt {
margin-top: -0.18rem !important;
}
:root {
--add-container-file-tree-background: var(--black);
}
.Theme--azure:root,
.Theme--white:root {
--add-container-file-tree-background: var(--gray-100);
}
.fileTree {
width: 240px;
max-height: 200px;
overflow-y: scroll;
overflow-x: hidden;
position: absolute;
display: none;
background: var(--add-container-file-tree-background);
}
.noshow,.advanced{display:none}
.required:after{content:" *";color:#E80000}
span.boxed{display:inline-block;line-height:normal;white-space:normal;width:60%}
span.cpu,label.checkbox{display:inline-block;width:32px}
span.ct{display:inline-block;width:230px}
span.net{display:inline-block;width:120px}
span.ip{display:inline-block;width:160px}
dl,dt,dd{line-height:normal!important;height:auto!important}
dl{padding:8px 0!important}
dl>dt:nth-of-type(2),dl>dd:nth-of-type(2){padding:20px 0 0 0!important}
input.setting_input{margin-right:4rem}
input,select{margin-top:-0.8rem!important}
div#configLocation,div#configLocation dl{padding:0!important}
div#configLocation dt{margin-top:-0.18rem!important}

View File

@@ -1,45 +1,12 @@
.basic {
display: block;
}
.advanced {
display: none;
white-space: nowrap;
}
.log {
cursor: zoom-in;
}
.exec {
cursor: pointer;
}
table#docker_containers {
text-align: left;
}
th.five {
width: 5%;
}
th.nine {
width: 9%;
}
th.load {
width: 140px;
}
input.wait {
width: 24px;
margin: 0 4px;
padding: 0 5px;
border: none;
box-shadow: none;
background-color: transparent;
}
table tbody td {
line-height: normal;
}
i.mover {
margin-right: 8px;
display: none;
}
#resetsort {
margin-left: 12px;
display: inline-block;
width: 32px;
}
.basic{display:block}
.advanced{display:none;white-space:nowrap}
.log{cursor:zoom-in}
.exec{cursor:pointer}
table#docker_containers{text-align:left}
th.five{width:5%}
th.nine{width:9%}
th.load{width:140px}
input.wait{width:24px;margin:0 4px;padding:0 5px;border:none;box-shadow:none;background-color:transparent}
table tbody td{line-height:normal}
i.mover{margin-right:8px;display:none}
#resetsort{margin-left:12px;display:inline-block;width:32px}

View File

@@ -0,0 +1,2 @@
.fileTree{background:#f2f2f2;width:300px;max-height:150px;overflow-y:scroll;overflow-x:hidden;position:absolute;z-index:100;display:none}
span.disabled{color:#B0B0B0}

View File

@@ -0,0 +1,2 @@
.fileTree{background:#1c1c1c;width:300px;max-height:150px;overflow-y:scroll;overflow-x:hidden;position:absolute;z-index:100;display:none}
span.disabled{color:#404040}

View File

@@ -0,0 +1,2 @@
.fileTree{background:#1c1c1c;width:300px;max-height:150px;overflow-y:scroll;overflow-x:hidden;position:absolute;z-index:100;display:none}
span.disabled{color:#404040}

View File

@@ -0,0 +1,2 @@
.fileTree{background:#f2f2f2;width:300px;max-height:150px;overflow-y:scroll;overflow-x:hidden;position:absolute;z-index:100;display:none}
span.disabled{color:#B0B0B0}

View File

@@ -1,90 +1,17 @@
:root {
--docker-settings-file-tree-background: var(--black);
--docker-settings-span-disabled-color: var(--gray-600);
}
.Theme--azure:root,
.Theme--white:root {
--docker-settings-file-tree-background: var(--gray-100);
--docker-settings-span-disabled-color: var(--gray-300); /* Condensed from: #b0b0b0 */
}
.errortext {
color: var(--red-800); /* Condensed from: #ef3d47 */
display: none;
margin-left: 20px;
}
.basic {
display: inline-block;
}
.advanced {
display: none;
}
select.mask {
min-width: 0;
margin: 0 10px 0 4px;
}
select.net {
min-width: 0;
margin: 0 4px 0 2px;
}
select option.hide {
display: none;
}
input.ip4 {
width: 100px;
margin: 0 4px 0 1px;
}
input.ip6 {
width: 140px;
margin: 0 4px;
}
input.gw4 {
width: 100px;
margin: 0 4px 0 1px;
}
input.gw6 {
width: 160px;
margin: 0 4px;
}
input.pool6 {
width: 40px;
margin: 0 4px 0 1px;
}
span.net {
margin-left: 4px;
margin-right: 2px;
}
span.ip4 {
display: inline-block;
width: 260px;
}
span.ip6 {
display: inline-block;
width: 310px;
}
span.gw4 {
display: inline-block;
width: 200px;
}
span.gw6 {
display: inline-block;
width: 270px;
}
span.nonexist {
margin-left: 20px;
}
.fileTree {
background: var(--docker-settings-file-tree-background);
width: 300px;
max-height: 150px;
overflow-y: scroll;
overflow-x: hidden;
position: absolute;
z-index: 100;
display: none;
}
span.disabled {
color: var(--docker-settings-span-disabled-color);
}
.errortext{color:#EF3D47;display:none;margin-left:20px}
.basic{display:inline-block}
.advanced{display:none}
select.mask{min-width:0;margin:0 10px 0 4px}
select.net{min-width:0;margin:0 4px 0 2px}
select option.hide{display:none}
input.ip4{width:100px;margin:0 4px 0 1px}
input.ip6{width:140px;margin:0 4px}
input.gw4{width:100px;margin:0 4px 0 1px}
input.gw6{width:160px;margin:0 4px}
input.pool6{width:40px;margin:0 4px 0 1px}
span.net{margin-left:4px;margin-right:2px}
span.ip4{display:inline-block;width:260px}
span.ip6{display:inline-block;width:310px}
span.gw4{display:inline-block;width:200px}
span.gw6{display:inline-block;width:270px}
span.nonexist{margin-left:20px}

View File

@@ -0,0 +1 @@
.fileTree{width:240px;max-height:200px;overflow-y:scroll;overflow-x:hidden;position:absolute;display:none;background:#f2f2f2}

View File

@@ -0,0 +1 @@
.fileTree{width:240px;max-height:200px;overflow-y:scroll;overflow-x:hidden;position:absolute;display:none;background:#1c1c1c}

View File

@@ -0,0 +1 @@
.fileTree{width:240px;max-height:200px;overflow-y:scroll;overflow-x:hidden;position:absolute;display:none;background:#1c1c1c}

View File

@@ -0,0 +1 @@
.fileTree{width:240px;max-height:200px;overflow-y:scroll;overflow-x:hidden;position:absolute;display:none;background:#f2f2f2}

View File

@@ -1,77 +1,14 @@
:root {
--update-container-file-tree-background: var(--black);
}
.Theme--azure:root,
.Theme--white:root {
--update-container-file-tree-background: var(--gray-100);
}
.noshow,
.advanced {
display: none;
}
.required:after {
content: " *";
color: var(--red-800);
}
span.boxed {
display: inline-block;
line-height: normal;
white-space: normal;
width: 60%;
}
span.cpu,
label.checkbox {
display: inline-block;
width: 32px;
}
span.ct {
display: inline-block;
width: 230px;
}
span.net {
display: inline-block;
width: 120px;
}
span.ip {
display: inline-block;
width: 160px;
}
dl,
dt,
dd {
line-height: normal !important;
height: auto !important;
}
dl {
padding: 8px 0 !important;
}
dl > dt:nth-of-type(2),
dl > dd:nth-of-type(2) {
padding: 20px 0 0 0 !important;
}
input.setting_input {
margin-right: 4rem;
}
input,
select {
margin-top: -0.8rem !important;
}
div#configLocation,
div#configLocation dl {
padding: 0 !important;
}
div#configLocation dt {
margin-top: -0.18rem !important;
}
.fileTree {
width: 240px;
max-height: 200px;
overflow-y: scroll;
overflow-x: hidden;
position: absolute;
display: none;
background: var(--update-container-file-tree-background);
}
.noshow,.advanced{display:none}
.required:after{content:" *";color:#E80000}
span.boxed{display:inline-block;line-height:normal;white-space:normal;width:60%}
span.cpu,label.checkbox{display:inline-block;width:32px}
span.ct{display:inline-block;width:230px}
span.net{display:inline-block;width:120px}
span.ip{display:inline-block;width:160px}
dl,dt,dd{line-height:normal!important;height:auto!important}
dl{padding:8px 0!important}
dl>dt:nth-of-type(2),dl>dd:nth-of-type(2){padding:20px 0 0 0!important}
input.setting_input{margin-right:4rem}
input,select{margin-top:-0.8rem!important}
div#configLocation,div#configLocation dl{padding:0!important}
div#configLocation dt{margin-top:-0.18rem!important}

View File

@@ -1,178 +0,0 @@
.Theme--azure:root,
.Theme--white:root {
--dockermanager-button-text-color: var(--orange-500);
--dockermanager-button-background-start: var(--red-800);
--dockermanager-button-background-end: var(--orange-500);
--dockermanager-button-hover-color: var(--gray-100);
--dockermanager-default-background: var(--gray-100);
--dockermanager-border-color: var(--black);
--dockermanager-header-background: var(--gray-150); /* Condensed from: #e3e3e3 */
--dockermanager-header-color: var(--black);
--dockermanager-content-background: var(--gray-100);
--dockermanager-content-color: var(--black);
--dockermanager-active-background: var(--gray-150);
--dockermanager-dropcontainer-background: var(--gray-100);
--dockermanager-disabled-color: var(--black);
--dockermanager-disabled-border-color: var(--gray-400); /* Condensed from: #a2a2a2 */
--dockermanager-disabled-background: var(--gray-150);
--dockermanager-text-color: var(--black);
}
.Theme--black:root,
.Theme--gray:root {
--dockermanager-button-text-color: var(--orange-500);
--dockermanager-button-background-start: var(--red-800);
--dockermanager-button-background-end: var(--orange-500);
--dockermanager-button-hover-color: var(--gray-100);
--dockermanager-default-background: var(--black);
--dockermanager-border-color: var(--gray-200); /* Condensed from: #e5e5e5 */
--dockermanager-header-background: var(--gray-800); /* Condensed from: #2b2b2b */
--dockermanager-header-color: var(--gray-100);
--dockermanager-content-background: var(--black);
--dockermanager-content-color: var(--gray-100);
--dockermanager-active-background: var(--gray-700); /* Condensed from: #262626 */
--dockermanager-dropcontainer-background: var(--black);
--dockermanager-disabled-color: var(--gray-100);
--dockermanager-disabled-border-color: var(--gray-500); /* Condensed from: #6c6c6c */
--dockermanager-disabled-background: var(--gray-700); /* Condensed from: #262626 */
--dockermanager-text-color: var(--gray-100);
}
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button {
font-family: clear-sans;
font-size: 1.1rem;
font-weight: bold;
letter-spacing: 2px;
text-transform: uppercase;
margin: 10px 12px 10px 0;
padding: 9px 18px;
text-decoration: none;
white-space: nowrap;
cursor: pointer;
outline: none;
border-radius: 4px;
border: 0;
color: var(--dockermanager-button-text-color);
background:
-webkit-gradient(
linear,
left top,
right top,
from(var(--dockermanager-button-background-start)),
to(var(--dockermanager-button-background-end))
)
0 0 no-repeat,
-webkit-gradient(
linear,
left top,
right top,
from(var(--dockermanager-button-background-start)),
to(var(--dockermanager-button-background-end))
) 0 100% no-repeat,
-webkit-gradient(
linear,
left bottom,
left top,
from(var(--dockermanager-button-background-start)),
to(var(--dockermanager-button-background-start))
) 0 100% no-repeat,
-webkit-gradient(
linear,
left bottom,
left top,
from(var(--dockermanager-button-background-end)),
to(var(--dockermanager-button-background-end))
) 100% 100% no-repeat;
background:
linear-gradient(90deg, var(--dockermanager-button-background-start) 0, var(--dockermanager-button-background-end)) 0 0 no-repeat,
linear-gradient(90deg, var(--dockermanager-button-background-start) 0, var(--dockermanager-button-background-end)) 0 100% no-repeat,
linear-gradient(0deg, var(--dockermanager-button-background-start) 0, var(--dockermanager-button-background-start)) 0 100% no-repeat,
linear-gradient(0deg, var(--dockermanager-button-background-end) 0, var(--dockermanager-button-background-end)) 100% 100% no-repeat;
background-size:
100% 2px,
100% 2px,
2px 100%,
2px 100%;
}
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button:hover {
color: var(--dockermanager-button-hover-color);
background: -webkit-gradient(
linear,
left top,
right top,
from(var(--dockermanager-button-background-start)),
to(var(--dockermanager-button-background-end))
);
background: linear-gradient(90deg, var(--dockermanager-button-background-start) 0, var(--dockermanager-button-background-end));
}
.ui-dropdownchecklist .ui-state-default {
background: var(--dockermanager-default-background);
border: none;
box-shadow: none;
outline: none;
cursor: pointer;
height: 2.2rem;
line-height: 2.2rem;
}
.ui-dropdownchecklist-group {
font-weight: normal;
font-style: italic;
padding: 1px 9px 1px 8px;
}
.ui-dropdownchecklist-selector {
border: 1px solid var(--dockermanager-border-color);
display: inline-block;
cursor: pointer;
padding: 1px 9px 1px 8px;
}
.ui-dropdownchecklist-selector-wrapper {
vertical-align: middle;
font-size: 0;
}
.ui-widget-header {
border: none;
background: var(--dockermanager-header-background);
color: var(--dockermanager-header-color);
font-weight: bold;
}
.ui-widget-content {
border: 1px solid var(--dockermanager-border-color);
background: var(--dockermanager-content-background);
color: var(--dockermanager-content-color);
}
.ui-state-active {
background: var(--dockermanager-active-background);
}
.ui-dropdownchecklist-dropcontainer {
background: var(--dockermanager-dropcontainer-background);
border: 1px solid var(--dockermanager-border-color);
}
.ui-state-disabled {
color: var(--dockermanager-disabled-color);
border-color: var(--dockermanager-disabled-border-color);
background: var(--dockermanager-disabled-background);
opacity: 0.5;
}
.ui-dropdownchecklist-indent {
padding-left: 7px;
}
.ui-dropdownchecklist-text {
color: var(--dockermanager-text-color);
font-size: 1.3rem;
}
.ui-dropdownchecklist .ui-widget-content .ui-state-default {
background: var(--dockermanager-default-background);
}

View File

@@ -0,0 +1,14 @@
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button{font-family:clear-sans;font-size:1.1rem;font-weight:bold;letter-spacing:2px;text-transform:uppercase;margin:10px 12px 10px 0;padding:9px 18px;text-decoration:none;white-space:nowrap;cursor:pointer;outline:none;border-radius:4px;border:0;color:#ff8c2f;background:-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f)) 0 0 no-repeat,-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#e22828),to(#e22828)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#ff8c2f),to(#ff8c2f)) 100% 100% no-repeat;background:linear-gradient(90deg,#e22828 0,#ff8c2f) 0 0 no-repeat,linear-gradient(90deg,#e22828 0,#ff8c2f) 0 100% no-repeat,linear-gradient(0deg,#e22828 0,#e22828) 0 100% no-repeat,linear-gradient(0deg,#ff8c2f 0,#ff8c2f) 100% 100% no-repeat;background-size:100% 2px,100% 2px,2px 100%,2px 100%}
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button:hover{color:#f2f2f2;background:-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f));background:linear-gradient(90deg,#e22828 0,#ff8c2f)}
.ui-dropdownchecklist .ui-state-default{background:#f2f2f2;border:none;box-shadow:none;outline:none;cursor:pointer;height:2.2rem;line-height:2.2rem}
.ui-dropdownchecklist-group{font-weight:normal;font-style:italic;padding:1px 9px 1px 8px}
.ui-dropdownchecklist-selector{border:1px solid #1c1c1c;display:inline-block;cursor:pointer;padding:1px 9px 1px 8px}
.ui-dropdownchecklist-selector-wrapper{vertical-align:middle;font-size:0}
.ui-widget-header{border:none;background:#e3e3e3;color:#1c1c1c;font-weight:bold}
.ui-widget-content{border:1px solid #1c1c1c;background:#f2f2f2;color:#1c1c1c}
.ui-state-active{background:#e8e8e8}
.ui-dropdownchecklist-dropcontainer{background:#f2f2f2;border:1px solid #1c1c1c}
.ui-state-disabled{color:#1c1c1c;border-color:#a2a2a2;background:#e8e8e8;opacity:0.5}
.ui-dropdownchecklist-indent{padding-left:7px}
.ui-dropdownchecklist-text{color:#1c1c1c;font-size:1.3rem}
.ui-dropdownchecklist .ui-widget-content .ui-state-default{background:#f2f2f2;border:0px}

View File

@@ -0,0 +1,14 @@
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button{font-family:clear-sans;font-size:1.1rem;font-weight:bold;letter-spacing:2px;text-transform:uppercase;margin:10px 12px 10px 0;padding:9px 18px;text-decoration:none;white-space:nowrap;cursor:pointer;outline:none;border-radius:4px;border:0;color:#ff8c2f;background:-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f)) 0 0 no-repeat,-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#e22828),to(#e22828)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#ff8c2f),to(#ff8c2f)) 100% 100% no-repeat;background:linear-gradient(90deg,#e22828 0,#ff8c2f) 0 0 no-repeat,linear-gradient(90deg,#e22828 0,#ff8c2f) 0 100% no-repeat,linear-gradient(0deg,#e22828 0,#e22828) 0 100% no-repeat,linear-gradient(0deg,#ff8c2f 0,#ff8c2f) 100% 100% no-repeat;background-size:100% 2px,100% 2px,2px 100%,2px 100%}
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button:hover{color:#f2f2f2;background:-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f));background:linear-gradient(90deg,#e22828 0,#ff8c2f)}
.ui-dropdownchecklist .ui-state-default{background:#1c1c1c;border:none;box-shadow:none;outline:none;cursor:pointer;height:2.2rem;line-height:2.2rem}
.ui-dropdownchecklist-group{font-weight:normal;font-style:italic;padding:1px 9px 1px 8px}
.ui-dropdownchecklist-selector{border:1px solid #e5e5e5;display:inline-block;cursor:pointer;padding:1px 9px 1px 8px}
.ui-dropdownchecklist-selector-wrapper{vertical-align:middle;font-size:0}
.ui-widget-header{border:none;background:#2b2b2b;color:#f2f2f2;font-weight:bold}
.ui-widget-content{border:1px solid #e5e5e5;background:#1c1c1c;color:#f2f2f2}
.ui-state-active{background:#262626}
.ui-dropdownchecklist-dropcontainer{background:#1c1c1c;border:1px solid #e5e5e5}
.ui-state-disabled{color:#f2f2f2;border-color:#6c6c6c;background:#262626;opacity:0.5}
.ui-dropdownchecklist-indent{padding-left:7px}
.ui-dropdownchecklist-text{color:#f2f2f2;font-size:1.3rem}
.ui-dropdownchecklist .ui-widget-content .ui-state-default{background:#1c1c1c;border:0px}

View File

@@ -0,0 +1,14 @@
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button{font-family:clear-sans;font-size:1.1rem;font-weight:bold;letter-spacing:2px;text-transform:uppercase;margin:10px 12px 10px 0;padding:9px 18px;text-decoration:none;white-space:nowrap;cursor:pointer;outline:none;border-radius:4px;border:0;color:#ff8c2f;background:-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f)) 0 0 no-repeat,-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#e22828),to(#e22828)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#ff8c2f),to(#ff8c2f)) 100% 100% no-repeat;background:linear-gradient(90deg,#e22828 0,#ff8c2f) 0 0 no-repeat,linear-gradient(90deg,#e22828 0,#ff8c2f) 0 100% no-repeat,linear-gradient(0deg,#e22828 0,#e22828) 0 100% no-repeat,linear-gradient(0deg,#ff8c2f 0,#ff8c2f) 100% 100% no-repeat;background-size:100% 2px,100% 2px,2px 100%,2px 100%}
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button:hover{color:#f2f2f2;background:-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f));background:linear-gradient(90deg,#e22828 0,#ff8c2f)}
.ui-dropdownchecklist .ui-state-default{background:#1c1c1c;border:none;box-shadow:none;outline:none;cursor:pointer;height:2.2rem;line-height:2.2rem}
.ui-dropdownchecklist-group{font-weight:normal;font-style:italic;padding:1px 9px 1px 8px}
.ui-dropdownchecklist-selector{border:1px solid #e5e5e5;display:inline-block;cursor:pointer;padding:1px 9px 1px 8px}
.ui-dropdownchecklist-selector-wrapper{vertical-align:middle;font-size:0}
.ui-widget-header{border:none;background:#2b2b2b;color:#f2f2f2;font-weight:bold}
.ui-widget-content{border:1px solid #e5e5e5;background:#1c1c1c;color:#f2f2f2}
.ui-state-active{background:#262626}
.ui-dropdownchecklist-dropcontainer{background:#1c1c1c;border:1px solid #e5e5e5}
.ui-state-disabled{color:#f2f2f2;border-color:#6c6c6c;background:#262626;opacity:0.5}
.ui-dropdownchecklist-indent{padding-left:7px}
.ui-dropdownchecklist-text{color:#f2f2f2;font-size:1.3rem}
.ui-dropdownchecklist .ui-widget-content .ui-state-default{background:#1c1c1c;border:0px}

View File

@@ -0,0 +1,14 @@
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button{font-family:clear-sans;font-size:1.1rem;font-weight:bold;letter-spacing:2px;text-transform:uppercase;margin:10px 12px 10px 0;padding:9px 18px;text-decoration:none;white-space:nowrap;cursor:pointer;outline:none;border-radius:4px;border:0;color:#ff8c2f;background:-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f)) 0 0 no-repeat,-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#e22828),to(#e22828)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#ff8c2f),to(#ff8c2f)) 100% 100% no-repeat;background:linear-gradient(90deg,#e22828 0,#ff8c2f) 0 0 no-repeat,linear-gradient(90deg,#e22828 0,#ff8c2f) 0 100% no-repeat,linear-gradient(0deg,#e22828 0,#e22828) 0 100% no-repeat,linear-gradient(0deg,#ff8c2f 0,#ff8c2f) 100% 100% no-repeat;background-size:100% 2px,100% 2px,2px 100%,2px 100%}
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button:hover{color:#f2f2f2;background:-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f));background:linear-gradient(90deg,#e22828 0,#ff8c2f)}
.ui-dropdownchecklist .ui-state-default{background:#f2f2f2;border:none;box-shadow:none;outline:none;cursor:pointer;height:2.2rem;line-height:2.2rem}
.ui-dropdownchecklist-group{font-weight:normal;font-style:italic;padding:1px 9px 1px 8px}
.ui-dropdownchecklist-selector{border:1px solid #1c1c1c;display:inline-block;cursor:pointer;padding:1px 9px 1px 8px}
.ui-dropdownchecklist-selector-wrapper{vertical-align:middle;font-size:0}
.ui-widget-header{border:none;background:#e3e3e3;color:#1c1c1c;font-weight:bold}
.ui-widget-content{border:1px solid #1c1c1c;background:#f2f2f2;color:#1c1c1c}
.ui-state-active{background:#e8e8e8}
.ui-dropdownchecklist-dropcontainer{background:#f2f2f2;border:1px solid #1c1c1c}
.ui-state-disabled{color:#1c1c1c;border-color:#a2a2a2;background:#e8e8e8;opacity:0.5}
.ui-dropdownchecklist-indent{padding-left:7px}
.ui-dropdownchecklist-text{color:#1c1c1c;font-size:1.3rem}
.ui-dropdownchecklist .ui-widget-content .ui-state-default{background:#f2f2f2;border:0px}

View File

@@ -0,0 +1,28 @@
#!/bin/bash
# Get active containers
ACTIVE_CONTAINERS="$(docker ps -q --no-trunc 2>/dev/null)"
# Exit if no containers are active and return zero
if [ -z "${ACTIVE_CONTAINERS}" ]; then
echo "0"
exit
fi
# Get all relevant memory entries from containers
for container in ${ACTIVE_CONTAINERS} ; do
CONT_MEMORY="$(cat /sys/fs/cgroup/docker/${container}/memory.stat 2>/dev/null | grep -Ew "anon|kernel|kernel_stack|pagetables|sec_pagetables|percpu|sock|vmalloc|shmem" | awk '{print $2}')"
# Add up memory values
for value in ${CONT_MEMORY} ; do
if [[ ${value} =~ ^[0-9]+$ ]]; then
((MEMORY_USAGE += value))
fi
done
unset CONT_MEMORY
done
# Check if value is a integer and return the value otherwiese return zero
if [[ ${MEMORY_USAGE} =~ ^[0-9]+$ ]]; then
echo "${MEMORY_USAGE}"
else
echo "0"
fi

View File

@@ -0,0 +1,2 @@
#guiSearchBoxSpan{display:inline-block;margin:0 0 0 20px;padding:0;height:auto;line-height:normal;font-size:1.3rem}
#guiSearchBox{position:relative;top:0;left:0;width:50rem;border:none;border-radius:20px;margin:0;padding:5px 12px;color:#1c1b1b;background-color:#feefb3}

View File

@@ -0,0 +1,3 @@
#guiSearchBoxSpan{display:inline-block;position:relative;margin:4px 2px 2px 2px;padding:0;text-align:left;height:auto;line-height:normal;font-size:1.3rem}
#guiSearchBoxSpan:after{font-family:unraid;content:'\e956';position:absolute;top:.8rem;left:1.5rem;font-size:1.3rem}
#guiSearchBox{width:50rem;border:none;border-radius:20px;padding-left:4rem;opacity:0.5;invert(100%)}

View File

@@ -0,0 +1,2 @@
#guiSearchBoxSpan{display:inline-block;margin:0 0 0 20px;padding:0;height:auto;line-height:normal;font-size:1.3rem}
#guiSearchBox{position:relative;top:0;left:0;width:50rem;border:none;border-radius:20px;margin:0;padding:5px 12px;color:#1c1b1b;background-color:#feefb3}

View File

@@ -0,0 +1,3 @@
#guiSearchBoxSpan{display:inline-block;position:relative;margin:4px 2px 2px 2px;padding:0;text-align:left;height:auto;line-height:normal;font-size:1.3rem}
#guiSearchBoxSpan:after{font-family:unraid;content:'\e956';position:absolute;top:.8rem;left:1.5rem;font-size:1.3rem}
#guiSearchBox{width:50rem;border:none;border-radius:20px;padding-left:4rem;opacity:0.5;invert(100%)}

View File

@@ -1,56 +0,0 @@
:root {
--gui-search-search-box-text-color: var(--white);
--gui-search-search-box-background-color: var(--gray-500);
}
#guiSearchBoxSpan {
display: inline-block;
padding: 0;
text-align: left;
height: auto;
line-height: normal;
font-size: 1.3rem;
}
#guiSearchBox {
width: 50rem;
border: none;
border-radius: 20px;
color: var(--gui-search-search-box-text-color);
background-color: var(--gui-search-search-box-background-color);
}
.Theme--black,
.Theme--white {
#guiSearchBoxSpan {
position: relative;
margin: 4px 2px 2px 2px;
}
#guiSearchBoxSpan:after {
font-family: unraid;
content: "\e956";
position: absolute;
top: 0.8rem;
left: 1.5rem;
font-size: 1.3rem;
}
#guiSearchBox {
padding-left: 4rem;
}
}
.Theme--sidebar {
--gui-search-search-box-text-color: var(--black);
--gui-search-search-box-background-color: var(--yellow-200);
#guiSearchBoxSpan {
margin: 0 0 0 20px;
}
#guiSearchBox {
position: relative;
top: 0;
left: 0;
margin: 0;
padding: 5px 12px;
}
}

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
{
".nuxt/nuxt-custom-elements/entries/unraid-components.client.mjs": {
"file": "_nuxt/unraid-components.client-CNGeANhD.js",
"file": "_nuxt/unraid-components.client-CQOXNcK4.js",
"name": "unraid-components.client",
"src": ".nuxt/nuxt-custom-elements/entries/unraid-components.client.mjs",
"isEntry": true,
@@ -8,5 +8,5 @@
"_nuxt/unraid-components-p_3YF86n.css"
]
},
"ts": 1716926465
"ts": 1723595088
}

View File

@@ -19,7 +19,7 @@ Code="e944"
?>
<?
// Remove stale /tmp/plugin/*.plg entries (check that script 'plugin' is not running to avoid clashes)
if (!exec("pgrep -f $docroot/plugins/dynamix.plugin.manager/scripts/plugin")) {
if (!exec('pgrep --ns $$ -f '."$docroot/plugins/dynamix.plugin.manager/scripts/plugin")) {
foreach (glob("/tmp/plugins/*.{plg,txt}", GLOB_NOSORT+GLOB_BRACE) as $entry) if (!file_exists("/var/log/plugins/".basename($entry))) @unlink($entry);
}
$check = $notify['version'] ? 0 : 1;

View File

@@ -1,30 +1,5 @@
.ca_element_notice {
padding-right: 20px;
width: 100%;
height: 40px;
line-height: 40px;
color: var(--orange-300);
background: var(--yellow-200);
border-bottom: var(--orange-300) 1px solid;
text-align: center;
font-size: 1.4rem;
z-index: 900;
}
a.ca_PluginUpdateInstall {
cursor: pointer;
}
span.ca_PluginUpdateDismiss {
float: right;
margin-right: 20px;
cursor: pointer;
}
span.bannerInfo {
cursor: pointer;
text-decoration: none;
margin: 0 12px 0 6px;
}
span.bannerInfo::before {
content: "\f05a";
font-family: fontAwesome;
color: var(--orange-300);
}
.ca_element_notice{padding-right:20px;width:100%;height:40px;line-height:40px;color:#e68a00;background:#feefb3;border-bottom:#e68a00 1px solid;text-align:center;font-size:1.4rem;z-index:900}
a.ca_PluginUpdateInstall{cursor:pointer}
span.ca_PluginUpdateDismiss{float:right;margin-right:20px;cursor:pointer}
span.bannerInfo {cursor:pointer;text-decoration:none;margin:0 12px 0 6px}
span.bannerInfo::before {content:"\f05a";font-family:fontAwesome;color:#e68a00}

View File

@@ -1,8 +1,2 @@
#plugin_tree {
width: 33%;
height: 200px;
overflow-y: scroll;
}
table tbody td {
line-height: normal;
}
#plugin_tree{width:33%;height:200px;overflow-y:scroll}
table tbody td{line-height:normal}

View File

@@ -0,0 +1 @@
span.vhshift{margin-top:13px!important}

View File

@@ -0,0 +1 @@
span.vhshift{margin-top:13px!important}

View File

@@ -1,52 +1,9 @@
ul,
li {
margin: 0;
padding-top: 0;
padding-bottom: 0;
}
pre.pre {
margin: 30px 0;
}
pre > p {
margin: 0;
padding: 0;
}
pre#swaltext {
height: 600px !important;
}
@media (max-width: 960px) {
pre#swaltext {
height: 400px !important;
}
}
@media (max-width: 960px) {
.sweet-alert.nchan {
height: 600px;
width: 900px;
margin-left: -470px;
}
}
@media (max-height: 768px) {
pre#swaltext {
height: 400px !important;
}
}
@media (max-height: 768px) {
.sweet-alert.nchan {
height: 600px;
width: 900px;
margin-left: -470px;
}
}
input[value="_(Install)_"],
input[value="_(Update)_"],
input[value="_(Restore)_"] {
margin: 0;
}
.Theme--black,
.Theme--white {
span.vhshift {
margin-top: 13px !important;
}
}
ul,li{margin:0;padding-top:0;padding-bottom:0}
pre.pre{margin:30px 0}
pre>p{margin:0;padding:0}
pre#swaltext{height:600px!important}
@media (max-width:960px){pre#swaltext{height:400px!important}}
@media (max-width:960px){.sweet-alert.nchan{height:600px;width:900px;margin-left:-470px}}
@media (max-height:768px){pre#swaltext{height:400px!important}}
@media (max-height:768px){.sweet-alert.nchan{height:600px;width:900px;margin-left:-470px}}
input[value="_(Install)_"],input[value="_(Update)_"],input[value="_(Restore)_"]{margin:0}

View File

@@ -111,7 +111,7 @@ if (empty($vms)) {
<link type="text/css" rel="stylesheet" href="<?autov('/webGui/styles/jquery.switchbutton.css')?>">
<link type="text/css" rel="stylesheet" href="<?autov("/webGui/styles/jquery.filetree.css")?>">
<link type="text/css" rel="stylesheet" href="<?autov("/webGui/styles/jquery.ui.css")?>">
<link type="text/css" rel="stylesheet" href="<?autov("/plugins/dynamix.docker.manager/styles/DockerManager.css")?>">
<link type="text/css" rel="stylesheet" href="<?autov("/plugins/dynamix.docker.manager/styles/style-$theme.css")?>">
<script src="<?autov('/webGui/javascript/jquery.switchbutton.js')?>"></script>
<script src="<?autov('/plugins/dynamix.vm.manager/javascript/dynamix.vm.manager.js')?>"></script>
@@ -489,6 +489,7 @@ $(function() {
<input type="button" onclick="stopAll()" value="_(Stop All)_" style="display:none">
<div id="dialogWindow"></div>
<div id="iframe-popup"></div>
<div id="templateISO" class="template">
<dl>

View File

@@ -24,36 +24,74 @@ require_once "$docroot/plugins/dynamix.vm.manager/include/libvirt_helpers.php";
$hardware = !empty(shell_exec("/etc/rc.d/rc.libvirt test"));
if (!$hardware) {
echo "<p class='notice'>"._('Your hardware does not have Intel VT-x or AMD-V capability').". "._('This is required to create VMs in KVM').". "._('Please disable the VM function').". ";
echo "<a href='https://docs.unraid.net/unraid-os/manual/vm-management#determining-hvmiommu-hardware-support' target='_blank'> "._('Click here to see the Unraid Wiki for more information')."</a></p>";
echo "<a href='https://docs.unraid.net/go/determining-hvmiommu-hardware-support/' target='_blank'> "._('View the Docs for more information')."</a></p>";
}
function scan($area, $text) {
return strpos($area,$text)!==false;
}
function detect(&$syslinux, $key) {
$size = count($syslinux);
$menu = $i = 0;
$value = '';
// find the default section
while ($i < $size) {
if (scan($syslinux[$i],'label ')) {
$n = $i + 1;
// find the current requested setting
while (!scan($syslinux[$n],'label ') && $n < $size) {
if (scan($syslinux[$n],'menu default')) $menu = 1;
if (scan($syslinux[$n],'append')) foreach (explode(' ',$syslinux[$n]) as $cmd) if (scan($cmd,$key)) {$value = explode('=',$cmd)[1]; break;}
$n++;
function detect(&$bootcfg, $bootenv, $key) {
if ($bootenv === 'syslinux') {
$size = count($bootcfg);
$menu = $i = 0;
$value = '';
// find the default section
while ($i < $size) {
if (scan($bootcfg[$i],'label ')) {
$n = $i + 1;
// find the current requested setting
while (!scan($bootcfg[$n],'label ') && $n < $size) {
if (scan($bootcfg[$n],'menu default')) $menu = 1;
if (scan($bootcfg[$n],'append')) foreach (explode(' ',$bootcfg[$n]) as $cmd) if (scan($cmd,$key)) {$value = explode('=',$cmd)[1]; break;}
$n++;
}
if ($menu) break; else $i = $n - 1;
}
if ($menu) break; else $i = $n - 1;
$i++;
}
$i++;
} elseif ($bootenv === 'grub') {
$menu_entries = [];
// find the current boot entry
foreach ($bootcfg as $line) {
if (preg_match('/set default=(\d+)/', $line, $match)) {
$bootentry = (int)$match[1];
break;
}
}
// split boot entries
foreach ($bootcfg as $line) {
if (strpos($line, 'menuentry ') === 0) {
$in_menuentry = true;
$current_entry = $line . "\n";
} elseif ($in_menuentry) {
$current_entry .= $line . "\n";
if (trim($line) === "}") {
$menu_entries[] = $current_entry;
$in_menuentry = false;
}
}
}
// search in selected menuentry
$menuentry = explode("\n", $menu_entries[$bootentry]);
foreach (explode(' ', $menu_entries[$bootentry]) as $cmd) {
if (scan($cmd,$key)) {
$value = explode('=',$cmd)[1];
break;
}
}
}
return $value;
return trim($value);
}
if (is_file('/boot/syslinux/syslinux.cfg')) {
$bootcfg = file('/boot/syslinux/syslinux.cfg',FILE_IGNORE_NEW_LINES+FILE_SKIP_EMPTY_LINES);
$bootenv = 'syslinux';
} elseif (is_file('/boot/grub/grub.cfg')) {
$bootcfg = file('/boot/grub/grub.cfg',FILE_IGNORE_NEW_LINES+FILE_SKIP_EMPTY_LINES);
$bootenv = 'grub';
}
$syslinux = file('/boot/syslinux/syslinux.cfg',FILE_IGNORE_NEW_LINES+FILE_SKIP_EMPTY_LINES);
$arrValidNetworks = getValidNetworks();
$pcie_acs_override = detect($syslinux, 'pcie_acs_override');
$vfio_allow_unsafe = detect($syslinux, 'allow_unsafe_interrupts');
$pcie_acs_override = detect($bootcfg, $bootenv, 'pcie_acs_override');
$vfio_allow_unsafe = detect($bootcfg, $bootenv, 'allow_unsafe_interrupts');
$bgcolor = strstr('white,azure',$display['theme']) ? '#f2f2f2' : '#1c1c1c';
$started = $var['fsState']=='Started';
$libvirt_up = $libvirt_running=='yes';
@@ -321,7 +359,7 @@ $(function(){
<?if ($safemode):?>
if (run) $("#settingsForm").submit();
<?else:?>
if (run) $.post("/plugins/dynamix.vm.manager/include/VMajax.php", {action:'syslinux',pcie:$('#pcie_acs_override').val(),vfio:$('#vfio_allow_unsafe').val()}, function(data){
if (run) $.post("/plugins/dynamix.vm.manager/include/VMajax.php", {action:'cmdlineoverride',pcie:$('#pcie_acs_override').val(),vfio:$('#vfio_allow_unsafe').val()}, function(data){
$("#settingsForm").submit();
});
<?endif;?>

View File

@@ -19,7 +19,7 @@ Cond="exec(\"grep -o '^USAGE=.Y' /boot/config/domain.cfg 2>/dev/null\") && is_fi
$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp');
?>
<table id="vmstats" class="tablesorter four shift">
<thead class='child'><tr><th class="th1">_(Name)_</th><th class="th2">_(Guest CPU)_</th><th>_(Host CPU)_</th><th>_(Memory)_</th><th>_(Disk IO)_</th><th>_(Network IO)_</th></tr></thead>
<thead class='child'><tr><th class="th1">_(Name)_</th><th class="th2">_(Guest CPU)_</th><th>_(Host CPU)_</th><th>_(Memory inuse/Current/Maximum)_</th><th>_(Disk IO)_</th><th>_(Network IO)_</th></tr></thead>
<tbody id ="vmstatsbody" class='child'>
</tbody>
</table>

View File

@@ -33,30 +33,60 @@ function scan($line, $text) {
return stripos($line,$text)!==false;
}
function embed(&$syslinux, $key, $value) {
$size = count($syslinux);
$make = false;
$new = strlen($value) ? "$key=$value" : false;
$i = 0;
while ($i < $size) {
// find sections and exclude safemode
if (scan($syslinux[$i],'label ') && !scan($syslinux[$i],'safe mode') && !scan($syslinux[$i],'safemode')) {
$n = $i + 1;
// find the current requested setting
while (!scan($syslinux[$n],'label ') && $n < $size) {
if (scan($syslinux[$n],'append ')) {
$cmd = preg_split('/\s+/',trim($syslinux[$n]));
// replace the existing setting
for ($c = 1; $c < count($cmd); $c++) if (scan($cmd[$c],$key)) {$make |= ($cmd[$c]!=$new); $cmd[$c] = $new; break;}
// or insert the new setting
if ($c==count($cmd) && $new) {array_splice($cmd,-1,0,$new); $make = true;}
$syslinux[$n] = ' '.str_replace(' ',' ',implode(' ',$cmd));
function embed(&$bootcfg, $env, $key, $value) {
if ($env === 'syslinux') {
$size = count($bootcfg);
$make = false;
$new = strlen($value) ? "$key=$value" : false;
$i = 0;
while ($i < $size) {
// find sections and exclude safemode
if (scan($bootcfg[$i],'label ') && !scan($bootcfg[$i],'safe mode') && !scan($bootcfg[$i],'safemode')) {
$n = $i + 1;
// find the current requested setting
while (!scan($bootcfg[$n],'label ') && $n < $size) {
if (scan($bootcfg[$n],'append ')) {
$cmd = preg_split('/\s+/',trim($bootcfg[$n]));
// replace the existing setting
for ($c = 1; $c < count($cmd); $c++) if (scan($cmd[$c],$key)) {$make |= ($cmd[$c]!=$new); $cmd[$c] = $new; break;}
// or insert the new setting
if ($c==count($cmd) && $new) {array_splice($cmd,-1,0,$new); $make = true;}
$bootcfg[$n] = ' '.str_replace(' ',' ',implode(' ',$cmd));
}
$n++;
}
$n++;
$i = $n - 1;
}
$i = $n - 1;
$i++;
}
} elseif ($env === 'grub') {
$size = count($bootcfg);
$make = false;
$new = strlen($value) ? "$key=$value" : false;
$i = 0;
while ($i < $size) {
// find sections and exclude safemode/memtest
if (scan($bootcfg[$i],'menuentry ') && !scan($bootcfg[$i],'safe mode') && !scan($bootcfg[$i],'safemode') && !scan($bootcfg[$i],'memtest')) {
$n = $i + 1;
// find the current requested setting
while (!scan($bootcfg[$n],'menuentry ') && $n < $size) {
if (scan($bootcfg[$n],'linux ')) {
$cmd = preg_split('/\s+/',trim($bootcfg[$n]));
// replace the existing setting
for ($c = 1; $c < count($cmd); $c++) if (scan($cmd[$c],$key)) {$make |= ($cmd[$c]!=$new); $cmd[$c] = $new; break;}
// or insert the new setting
if ($c == count($cmd) && $new) {
$cmd[] = $new;
$make = true;
}
$bootcfg[$n] = ' ' . str_replace(' ', ' ', implode(' ', $cmd));
}
$n++;
}
$i = $n - 1;
}
$i++;
}
$i++;
}
return $make;
}
@@ -422,6 +452,61 @@ case 'snap-desc':
: ['error' => $lv->get_last_error()];
break;
case 'get_storage_fstype':
$fstype = get_storage_fstype(unscript(_var($_REQUEST,'storage')));
$arrResponse = ['fstype' => $fstype , 'success' => true] ;
break;
case 'vm-removal':
requireLibvirt();
$arrResponse = ($data = getvmsnapshots($domName))
? ['success' => true]
: ['error' => $lv->get_last_error()];
$datartn = $disksrtn = "";
foreach($data as $snap=>$snapdetail) {
$snapshotdatetime = date("Y-m-d H:i:s",$snapdetail["creationtime"]) ;
$datartn .= "$snap $snapshotdatetime\n" ;
}
$disks = $lv->get_disk_stats($domName);
foreach($disks as $diskid=>$diskdetail) {
if ($diskid == 0) $pathinfo = pathinfo($diskdetail['file']);
}
$list = glob($pathinfo['dirname']."/*");
$uuid = $lv->domain_get_uuid($domName);
$list2 = glob("/etc/libvirt/qemu/nvram/*$uuid*");
$listnew = array();
$list=array_merge($list,$list2);
foreach($list as $key => $listent)
{
$pathinfo = pathinfo($listent);
$listnew[] = "{$pathinfo['basename']} ({$pathinfo['dirname']})";
}
sort($listnew,SORT_NATURAL);
$listcount = count($listnew);
$snapcount = count($data);
$disksrtn=implode("\n",$listnew);
if (strpos($dirname,'/mnt/user/')===0) {
$realdisk = trim(shell_exec("getfattr --absolute-names --only-values -n system.LOCATION ".escapeshellarg($dirname)." 2>/dev/null"));
if (!empty($realdisk)) {
$dirname = str_replace('/mnt/user/', "/mnt/$realdisk/", $dirname);
}
}
$fstype = trim(shell_exec(" stat -f -c '%T' $dirname"));
$html = '<table class="snapshot">
<tr><td>'._('VM Being removed').':</td><td><span id="VMBeingRemoved">'.$domName.'</span></td></tr>
<tr><td>'._('Remove all files').':</td><td><input type="checkbox" id="All" checked value="" ></td></tr>
<tr><td>'._('Files being removed').':</td><td><textarea id="textfiles" class="xml" rows="'.$listcount.'" style="white-space: pre; overflow: auto; width:600px" disabled>'.$disksrtn.'</textarea></td></tr>
<tr><td>'._('Snapshots being removed').':</td><td><textarea id="textsnaps" rows="'.$snapsount.'" cols="80" disabled>'.$datartn.'</textarea></td></tr>
</table>';
$arrResponse = ['html' => $html , 'success' => true] ;
break;
case 'disk-create':
$disk = $_REQUEST['disk'];
$driver = $_REQUEST['driver'];
@@ -536,26 +621,39 @@ case 'hot-detach-usb':
//TODO
break;
case 'syslinux':
$cfg = '/boot/syslinux/syslinux.cfg';
$syslinux = file($cfg, FILE_IGNORE_NEW_LINES+FILE_SKIP_EMPTY_LINES);
$m1 = embed($syslinux, 'pcie_acs_override', $_REQUEST['pcie']);
$m2 = embed($syslinux, 'vfio_iommu_type1.allow_unsafe_interrupts', $_REQUEST['vfio']);
if ($m1||$m2) file_put_contents($cfg, implode("\n",$syslinux)."\n");
case 'cmdlineoverride':
if (is_file('/boot/syslinux/syslinux.cfg')) {
$cfg = '/boot/syslinux/syslinux.cfg';
$env = 'syslinux';
$bootcfg = file($cfg, FILE_IGNORE_NEW_LINES+FILE_SKIP_EMPTY_LINES);
} elseif (is_file('/boot/grub/grub.cfg')) {
$cfg = '/boot/grub/grub.cfg';
$env = 'grub';
$bootcfg = file($cfg, FILE_IGNORE_NEW_LINES);
}
$m1 = embed($bootcfg, $env, 'pcie_acs_override', $_REQUEST['pcie']);
$m2 = embed($bootcfg, $env, 'vfio_iommu_type1.allow_unsafe_interrupts', $_REQUEST['vfio']);
if ($m1||$m2) file_put_contents($cfg, implode("\n",$bootcfg)."\n");
$arrResponse = ['success' => true, 'modified' => $m1|$m2];
break;
case 'reboot':
$cfg = '/boot/syslinux/syslinux.cfg';
$syslinux = file($cfg, FILE_IGNORE_NEW_LINES+FILE_SKIP_EMPTY_LINES);
if (is_file('/boot/syslinux/syslinux.cfg')) {
$cfg = '/boot/syslinux/syslinux.cfg';
$env = 'syslinux';
} elseif (is_file('/boot/grub/grub.cfg')) {
$cfg = '/boot/grub/grub.cfg';
$env = 'grub';
}
$bootcfg = file($cfg, FILE_IGNORE_NEW_LINES+FILE_SKIP_EMPTY_LINES);
$cmdline = explode(' ',file_get_contents('/proc/cmdline'));
$pcie = $vfio = '';
foreach ($cmdline as $cmd) {
if (scan($cmd,'pcie_acs_override')) $pcie = explode('=',$cmd)[1];
if (scan($cmd,'allow_unsafe_interrupts')) $vfio = explode('=',$cmd)[1];
}
$m1 = embed($syslinux, 'pcie_acs_override', $pcie);
$m2 = embed($syslinux, 'vfio_iommu_type1.allow_unsafe_interrupts', $vfio);
$m1 = embed($bootcfg, $env, 'pcie_acs_override', $pcie);
$m2 = embed($bootcfg, $env, 'vfio_iommu_type1.allow_unsafe_interrupts', $vfio);
$arrResponse = ['success' => true, 'modified' => $m1|$m2];
break;

View File

@@ -113,7 +113,7 @@ if (strpos($strSelectedTemplate,"User-") !== false) {
<table>
<tr>
<td>_(Icon)_:</td>
<td>
<td class="template_img_parent">
<input type="hidden" name="template[icon]" id="template_icon" value="<?=htmlspecialchars($arrLoad['icon'])?>" />
<img id="template_img" src="<?=htmlspecialchars($strIconURL)?>" width="48" height="48" title="_(Change Icon)_..."/>
<div id="template_img_chooser_outer">
@@ -189,13 +189,13 @@ $(function() {
});
$('.advancedview').switchButton({
labels_placement: "left",
labels_placement: "right",
on_label: "_(XML View)_",
off_label: "_(Form View)_",
checked: isVMXMLMode()
});
$('.inlineview').switchButton({
labels_placement: "left",
labels_placement: "right",
off_label: "_(Hide inline xml)_",
on_label: "_(Show Inline XML)_",
checked: isinlineXMLMode()

View File

@@ -267,6 +267,9 @@
if (!empty($disk['serial'])) {
$arrReturn['serial'] = $disk['serial'];
}
if (!empty($disk['discard'])) {
$arrReturn['discard'] = $disk['discard'];
}
}
}
@@ -699,8 +702,10 @@
if ($strDevType == 'file' || $strDevType == 'block') {
$strSourceType = ($strDevType == 'file' ? 'file' : 'dev');
if (isset($disk['discard'])) $strDevUnmap = " discard=\"{$disk['discard']}\" "; else $strDevUnmap = " discard=\"ignore\" ";
$diskstr .= "<disk type='" . $strDevType . "' device='disk'>
<driver name='qemu' type='" . $disk['driver'] . "' cache='writeback'/>
<driver name='qemu' type='" . $disk['driver'] . "' cache='writeback'".$strDevUnmap."/>
<source " . $strSourceType . "='" . htmlspecialchars($disk['image'], ENT_QUOTES | ENT_XML1) . "'/>
<target bus='" . $disk['bus'] . "' dev='" . $disk['dev'] . "' $rotation_rate />
$bootorder
@@ -905,10 +910,17 @@
}
if ($gpu['multi'] == "on"){
$newgpu_bus = dechex(hexdec($gpu_bus) + 0x20) ;
$newgpu_bus= 0x07;
if (!isset($multibus[$newgpu_bus])) {
$multibus[$newgpu_bus] = 0x07;
} else {
#Get next bus
$newgpu_bus = end($multibus) + 0x01;
$multibus[$newgpu_bus] = $newgpu_bus;
}
if ($machine_type == "pc") $newgpu_slot = "0x01" ; else $newgpu_slot = "0x00" ;
$strSpecialAddress = "<address type='pci' domain='0x0000' bus='0x$newgpu_bus' slot='$newgpu_slot' function='0x".$gpu_function."' multifunction='on' />" ;
$multidevices[$gpu_bus] = "0x$gpu_bus" ;
$strSpecialAddress = "<address type='pci' domain='0x0000' bus='$newgpu_bus' slot='$newgpu_slot' function='0x".$gpu_function."' multifunction='on' />" ;
$multidevices[$gpu_bus] = $newgpu_bus ;
}
@@ -926,9 +938,9 @@
}
}
$audiodevs_used=[];
$strSpecialAddressAudio = "" ;
if (!empty($audios)) {
foreach ($audios as $i => $audio) {
$strSpecialAddressAudio = "" ;
// Skip duplicate audio devices
if (empty($audio['id']) || in_array($audio['id'], $audiodevs_used)) {
continue;
@@ -937,9 +949,9 @@
[$audio_bus, $audio_slot, $audio_function] = my_explode(":", str_replace('.', ':', $audio['id']), 3);
if ($audio_function != 0) {
if (isset($multidevices[$audio_bus])) {
$newaudio_bus = dechex(hexdec($audio_bus) + 0x20) ;
$newaudio_bus = $multidevices[$audio_bus] ;
if ($machine_type == "pc") $newaudio_slot = "0x01" ; else $newaudio_slot = "0x00" ;
$strSpecialAddressAudio = "<address type='pci' domain='0x0000' bus='0x$newaudio_bus' slot='$newaudio_slot' function='0x".$audio_function."' />" ;
$strSpecialAddressAudio = "<address type='pci' domain='0x0000' bus='$newaudio_bus' slot='$newaudio_slot' function='0x".$audio_function."' />" ;
}
}
@@ -956,9 +968,9 @@
}
$pcidevs_used=[];
$strSpecialAddressOther = "" ;
if (!empty($pcis)) {
foreach ($pcis as $i => $pci_id) {
$strSpecialAddressOther = "" ;
// Skip duplicate other pci devices
if (empty($pci_id) || in_array($pci_id, $pcidevs_used)) {
continue;
@@ -968,9 +980,9 @@
if ($pci_function != 0) {
if (isset($multidevices[$pci_bus])) {
$newpci_bus = dechex(hexdec($pci_bus) + 0x20) ;
$newpci_bus = $multidevices[$pci_bus];
if ($machine_type == "pc") $newpci_slot = "0x01" ; else $newpci_slot = "0x00" ;
$strSpecialAddressOther = "<address type='pci' domain='0x0000' bus='0x$newpci_bus' slot='$newpci_slot' function='0x".$pci_function."' />" ;
$strSpecialAddressOther = "<address type='pci' domain='0x0000' bus='$newpci_bus' slot='$newpci_slot' function='0x".$pci_function."' />" ;
}
}
@@ -1339,6 +1351,7 @@
if ($tmp) {
$tmp['bus'] = $disk->target->attributes()->bus->__toString();
$tmp["boot order"] = $disk->boot->attributes()->order ?? "";
$tmp["discard"] = $disk->driver->attributes()->discard ?? "ignore";
$tmp["rotation"] = $disk->target->attributes()->rotation_rate ?? "0";
$tmp['serial'] = $disk->serial ;
@@ -1369,7 +1382,8 @@
'bus' => $disk->target->attributes()->bus->__toString(),
'boot order' => $disk->boot->attributes()->order ,
'rotation' => $disk->target->attributes()->rotation_rate ?? "0",
'serial' => $disk->serial
'serial' => $disk->serial,
'discard' => $disk->driver->attributes()->discard ?? "ignore"
];
}
}
@@ -1989,7 +2003,19 @@
if (is_file($disk)) unlink($disk);
if (is_file($cfg)) unlink($cfg);
if (is_file($xml)) unlink($xml);
if (is_dir($dir) && $this->is_dir_empty($dir)) rmdir($dir);
if (is_dir($dir) && $this->is_dir_empty($dir)) {
$result= my_rmdir($dir);
if ($result['type'] == "zfs") {
qemu_log("$domain","delete empty zfs $dir {$result['rtncode']}");
if (isset($result['dataset'])) qemu_log("$domain","dataset {$result['dataset']} ");
if (isset($result['cmd'])) qemu_log("$domain","Command {$result['cmd']} ");
if (isset($result['output'])) {
$outputlogs = implode(" ",$result['output']);
qemu_log("$domain","Output $outputlogs end");
}
}
else qemu_log("$domain","delete empty $dir {$result['rtncode']}");
}
}
return true;

View File

@@ -1091,6 +1091,15 @@ private static $encoding = 'UTF-8';
return $arrValidDiskBuses;
}
function getValidDiskDiscard() {
$arrValidDiskDiscard = [
'ignore' => 'Ignore(No Trim)',
'unmap' => 'Unmap(Trim)',
];
return $arrValidDiskDiscard;
}
function getValidCdromBuses() {
$arrValidCdromBuses = [
'scsi' => 'SCSI',
@@ -1106,6 +1115,7 @@ private static $encoding = 'UTF-8';
$arrValidVNCModels = [
'cirrus' => 'Cirrus',
'qxl' => 'QXL (best)',
'virtio' => 'Virtio(2d)',
'vmvga' => 'vmvga'
];
@@ -1316,6 +1326,7 @@ private static $encoding = 'UTF-8';
'driver' => $disk['type'],
'dev' => $disk['device'],
'bus' => $disk['bus'],
'discard' => $disk['discard'],
'boot' => $disk['boot order'],
'rotation' => $disk['rotation'],
'serial' => $disk['serial'],
@@ -1330,6 +1341,7 @@ private static $encoding = 'UTF-8';
'dev' => 'hda',
'select' => '',
'bus' => 'virtio',
'discard' => 'ignore',
'rotation' => "0"
];
}
@@ -1457,7 +1469,12 @@ private static $encoding = 'UTF-8';
// preserve existing disk driver settings
foreach ($new['devices']['disk'] as $key => $disk) {
$source = $disk['source']['@attributes']['file'];
foreach ($old['devices']['disk'] as $k => $d) if ($source==$d['source']['@attributes']['file']) $new['devices']['disk'][$key]['driver']['@attributes'] = $d['driver']['@attributes'];
if (isset($disk['driver']['@attributes']['discard'])) $discard = $disk['driver']['@attributes']['discard']; else $discard = null;
foreach ($old['devices']['disk'] as $k => $d)
if ($source==$d['source']['@attributes']['file']) {
if (isset($discard)) $d['driver']['@attributes']['discard'] = $discard;
$new['devices']['disk'][$key]['driver']['@attributes'] = $d['driver']['@attributes'];
}
}
// settings not in the GUI, but maybe customized
unset($old['clock']);
@@ -2661,8 +2678,8 @@ function get_vm_usage_stats($collectcpustats = true,$collectdiskstats = true,$co
# Memory Metrics
if ($state == 1 && $collectmemstats) {
$currentmem = $data["balloon.current"];
$unusedmem = $data["balloon.unused"];
$meminuse = $currentmem - $unusedmem;
$maximummem = $data["balloon.maximum"];
$meminuse = min($data["balloon.rss"],$data["balloon.current"]);
} else $currentmem = $meminuse = 0;
# Disk
@@ -2697,7 +2714,8 @@ function get_vm_usage_stats($collectcpustats = true,$collectdiskstats = true,$co
"cpuguest" => $cpuGuestPercent,
"timestamp" => $timestamp,
"mem" => $meminuse,
"maxmem" => $currentmem,
"curmem" => $currentmem,
"maxmem" => $maximummem,
"rxrate" => $rxrate,
"rxp" => $rx,
"txrate" => $txrate,
@@ -2822,4 +2840,26 @@ function get_vm_ip($dom) {
return $myIP;
}
function check_zfs_name($zfsname, $storage="default") {
global $lv,$domain_cfg;
if ($storage == "default") $storage = $domain_cfg['DOMAINDIR']; else $storage = "/mnt/$storage/";
$storage=transpose_user_path($storage);
$fstype = trim(shell_exec(" stat -f -c '%T' $storage"));
#Check if ZFS.
$allowed_chars = "/^[A-Za-z0-9][A-Za-z0-9\-_.: ]*$/";
if ($fstype == "zfs" && !preg_match($allowed_chars, $zfsname)) {
return false;
} else {
return true;
}
}
function get_storage_fstype($storage="default") {
global $domain_cfg;
if ($storage == "default") $storage = $domain_cfg['DOMAINDIR']; else $storage = "/mnt/$storage/";
$storage=transpose_user_path($storage);
$fstype = trim(shell_exec(" stat -f -c '%T' $storage"));
return $fstype;
}
?>

View File

@@ -75,11 +75,13 @@ while (true) {
if ($vmdata['state'] == 1) {
$running++;
$echodata .= "<tr><td>$vm</td>" ;
$echodata .= "<td class='advanced'><span class='cpug-".$vm."'>".$vmdata['cpuguest']."%</span><div class='usage-disk mm'><span id='cpug-".$vm."' style='width:".$vmdata['cpuguest']."%;'></span><span></span></div></td>";
$echodata .= "<td class='advanced'><span class='cpuh-".$vm."'>".$vmdata['cpuhost']."%</span><div class='usage-disk mm'><span id='cpuh-".$vm."' style='width:".$vmdata['cpuhost']."%;'></span><span></span></div></td><td>";
$echodata .= my_scale($vmdata['mem']*1024,$unit)."$unit / ".my_scale($vmdata['maxmem']*1024,$unit)."$unit</td><td>";
$echodata .= _("Read").": ".my_scale($vmdata['rdrate'],$unit)."$unit/s<br>"._("Write").": ".my_scale($vmdata['wrrate'],$unit)."$unit/s</td><td>";
$echodata .= _("RX").": ".my_scale($vmdata['rxrate'],$unit)."$unit/s<br>"._("TX").": ".my_scale($vmdata['txrate'],$unit)."$unit/s</td></tr>";
$echodata .= "<td class='advanced'><span class='cpug-".$vm."'>".$vmdata['cpuguest']."%</span><div class='usage-disk mm'><span id='cpug-".$vm."' style='width:".$vmdata['cpuguest']."%;'> </span><span></span></div></td>";
$echodata .= "<td class='advanced'><span class='cpuh-".$vm."'>".$vmdata['cpuhost']."%</span><div class='usage-disk mm'><span id='cpuh-".$vm."' style='width:".$vmdata['cpuhost']."%;'> </span><span></span></div></td><td>";
$echodata .= my_scale($vmdata['mem']*1024,$unit)."$unit / ".my_scale($vmdata['curmem']*1024,$unit)."$unit";
if ($vmdata['curmem'] === $vmdata['maxmem']) $echodata .= " </td><td>";
else $echodata .= " / " .my_scale($vmdata['maxmem']*1024,$unit)."$unit </td><td>";
$echodata .= _("Read").": ".my_scale($vmdata['rdrate']/$timer,$unit)."$unit/s<br>"._("Write").": ".my_scale($vmdata['wrrate']/$timer,$unit)."$unit/s</td><td>";
$echodata .= _("RX").": ".my_scale($vmdata['rxrate']/$timer,$unit)."$unit/s<br>"._("TX").": ".my_scale($vmdata['txrate']/$timer,$unit)."$unit/s</td></tr>";
}
$echo = $echodata ;
}

View File

@@ -27,7 +27,9 @@
}
# Check if options file exists. Each option should be on a new line.
if (is_file($file)) $options = explode("\n",file_get_contents($file)) ; else $options = ['--syslog','--inode-file-handles=mandatory','--announce-submounts'];
$options[] = "--fd=".$argoptions['fd'];
if (isset($argoptions['fd'])) {
$options[] = "--fd=".$argoptions['fd'];
}
if (isset($argoptions['o'])) {
$virtiofsoptions = explode(',',$argoptions["o"]);

View File

@@ -0,0 +1,4 @@
.fileTree{background:#f2f2f2;width:300px;max-height:150px;overflow-y:scroll;overflow-x:hidden;position:relative;z-index:100;display:none}
#vmform table.multiple{margin:10px 0;background:#f2f2f2;background-size:800px 100%;background-position:-800px;background-repeat:no-repeat;background-clip:content-box;transition:background 0.3s linear}
#template_img_chooser_outer{position:absolute;display:none;border-radius:5px;border:1px solid <?=$border?>;background:#f2f2f2;z-index:10}
span#dropbox{border:1px solid <?=$border?>;background:#f2f2f2;padding:28px 12px;line-height:72px;margin-right:16px;}

View File

@@ -0,0 +1,4 @@
.fileTree{background:#1c1c1c;width:300px;max-height:150px;overflow-y:scroll;overflow-x:hidden;position:relative;z-index:100;display:none}
#vmform table.multiple{margin:10px 0;background:#1c1c1c;background-size:800px 100%;background-position:-800px;background-repeat:no-repeat;background-clip:content-box;transition:background 0.3s linear}
#template_img_chooser_outer{position:absolute;display:none;border-radius:5px;border:1px solid <?=$border?>;background:#1c1c1c;z-index:10}
span#dropbox{border:1px solid <?=$border?>;background:#1c1c1c;padding:28px 12px;line-height:72px;margin-right:16px;}

View File

@@ -0,0 +1,4 @@
.fileTree{background:#1c1c1c;width:300px;max-height:150px;overflow-y:scroll;overflow-x:hidden;position:relative;z-index:100;display:none}
#vmform table.multiple{margin:10px 0;background:#1c1c1c;background-size:800px 100%;background-position:-800px;background-repeat:no-repeat;background-clip:content-box;transition:background 0.3s linear}
#template_img_chooser_outer{position:absolute;display:none;border-radius:5px;border:1px solid <?=$border?>;background:#1c1c1c;z-index:10}
span#dropbox{border:1px solid <?=$border?>;background:#1c1c1c;padding:28px 12px;line-height:72px;margin-right:16px;}

View File

@@ -0,0 +1,4 @@
.fileTree{background:#f2f2f2;width:300px;max-height:150px;overflow-y:scroll;overflow-x:hidden;position:relative;z-index:100;display:none}
#vmform table.multiple{margin:10px 0;background:#f2f2f2;background-size:800px 100%;background-position:-800px;background-repeat:no-repeat;background-clip:content-box;transition:background 0.3s linear}
#template_img_chooser_outer{position:absolute;display:none;border-radius:5px;border:1px solid <?=$border?>;background:#f2f2f2;z-index:10}
span#dropbox{border:1px solid <?=$border?>;background:#f2f2f2;padding:28px 12px;line-height:72px;margin-right:16px;}

View File

@@ -1,236 +1,46 @@
:root {
--add-vm-background: var(--black);
}
.Theme--azure:root,
.Theme--white:root {
--add-vm-background: var(--gray-100);
}
body {
-webkit-overflow-scrolling: touch;
}
#vmform table {
margin-top: 0;
}
#vmform div.title + table {
margin-top: 0;
}
#vmform table tr {
vertical-align: top;
line-height: 40px;
}
#vmform table tr td:nth-child(odd) {
width: 300px;
text-align: right;
padding-right: 10px;
}
#vmform table tr td:nth-child(even) {
width: 110px;
}
@media (max-width: 1280px) {
#vmform table tr td:first-child {
width: 35%;
padding-right: 4rem;
}
}
@media (min-width: 1281px) {
#vmform table tr td:first-child {
width: 30%;
padding-right: 4rem;
}
}
@media (min-width: 1921px) {
#vmform table tr td:first-child {
width: 25%;
padding-right: 4rem;
}
}
#vmform table tr td:last-child {
width: inherit;
}
#vmform .multiple {
position: relative;
}
#vmform .sectionbutton {
position: absolute;
left: 2px;
cursor: pointer;
opacity: 0.4;
font-size: 1.4rem;
line-height: 17px;
z-index: 10;
transition-property: opacity, left;
transition-duration: 0.1s;
transition-timing-function: linear;
}
#vmform .sectionbutton.remove {
top: 0;
opacity: 0.3;
}
#vmform .sectionbutton.add {
bottom: 0;
}
#vmform .sectionbutton:hover {
opacity: 1;
}
#vmform .sectiontab {
position: absolute;
top: 2px;
bottom: 2px;
left: 0;
width: 6px;
border-radius: 3px;
background-color: var(--gray-200); /* Condensed from: #dddddd */
transition-property: background, width;
transition-duration: 0.1s;
transition-timing-function: linear;
}
#vmform .multiple:hover .sectionbutton {
opacity: 0.7;
left: 4px;
}
#vmform .multiple:hover .sectionbutton.remove {
opacity: 0.6;
}
#vmform .multiple:hover .sectiontab {
background-color: var(--gray-300);
width: 8px;
}
#vmform table.multiple:hover {
background-position: 0 0;
}
#vmform table.multiple td {
padding: 5px 0;
}
span.advancedview_panel {
display: none;
line-height: 16px;
margin-top: 1px;
}
.basic {
display: none;
}
.advanced {
/*Empty placeholder*/
}
.switch-button-label.off {
color: inherit;
}
#template_img {
cursor: pointer;
}
#template_img:hover {
opacity: 0.5;
}
#template_img:hover i {
opacity: 1;
}
.template_img_chooser_inner {
display: inline-block;
width: 80px;
margin-bottom: 15px;
margin-right: 10px;
text-align: center;
}
.template_img_chooser_inner img {
width: 48px;
height: 48px;
}
.template_img_chooser_inner p {
text-align: center;
line-height: 8px;
}
#template_img_chooser {
width: 560px;
height: 300px;
overflow-y: scroll;
position: relative;
}
#template_img_chooser div:hover {
background-color: var(--gray-150); /* Condensed from: #eee */
cursor: pointer;
}
#form_content {
display: none;
}
#vmform .four {
overflow: hidden;
}
#vmform .four label {
float: left;
display: table-cell;
width: 15%;
}
#vmform .four label:nth-child(4n + 4) {
}
#vmform .four label.cpu1 {
width: 28%;
height: 16px;
line-height: 16px;
}
#vmform .four label.cpu2 {
width: 3%;
height: 16px;
line-height: 16px;
}
#vmform .mac_generate {
cursor: pointer;
margin-left: -5px;
color: var(--blue-700); /* Condensed from: #08c */
font-size: 1.3rem;
transform: translate(0px, 2px);
}
#vmform .disk {
display: none;
}
#vmform .disk_preview {
display: inline-block;
color: var(--gray-300); /* Condensed from: #bbb */
transform: translate(0px, 1px);
}
i.fa-plus-circle,
i.fa-minus-circle {
margin-left: 8px;
}
input[type="checkbox"] {
margin-left: 0;
}
#vmform table.timers td.present {
width: 150px;
}
.fileTree {
background: var(--add-vm-background);
width: 300px;
max-height: 150px;
overflow-y: scroll;
overflow-x: hidden;
position: relative;
z-index: 100;
display: none;
}
#vmform table.multiple {
margin: 10px 0;
background: var(--add-vm-background);
background-size: 800px 100%;
background-position: -800px;
background-repeat: no-repeat;
background-clip: content-box;
transition: background 0.3s linear;
}
#template_img_chooser_outer {
position: absolute;
display: none;
border-radius: 5px;
border: 1px solid <?=$border?>;
background: var(--add-vm-background);
z-index: 10;
}
span#dropbox {
border: 1px solid <?=$border?>;
background: var(--add-vm-background);
padding: 28px 12px;
line-height: 72px;
margin-right: 16px;
}
body{-webkit-overflow-scrolling:touch}
#vmform table{margin-top:0}
#vmform div.title + table{margin-top:0}
#vmform table tr{vertical-align:top;line-height:40px}
#vmform table tr td:nth-child(odd){width:300px;text-align:right;padding-right:10px}
#vmform table tr td:nth-child(even){width:110px}
@media (max-width:1280px){#vmform table tr td:first-child{width:35%;padding-right:4rem}}
@media (min-width:1281px){#vmform table tr td:first-child{width:30%;padding-right:4rem}}
@media (min-width:1921px){#vmform table tr td:first-child{width:25%;padding-right:4rem}}
#vmform table tr td:last-child{width:inherit}
#vmform .multiple{position:relative}
#vmform .sectionbutton{position:absolute;left:2px;cursor:pointer;opacity:0.4;font-size:1.4rem;line-height:17px;z-index:10;transition-property:opacity,left;transition-duration:0.1s;transition-timing-function:linear}
#vmform .sectionbutton.remove{top:0;opacity:0.3}
#vmform .sectionbutton.add{bottom:0}
#vmform .sectionbutton:hover{opacity:1.0}
#vmform .sectiontab{position:absolute;top:2px;bottom:2px;left:0;width:6px;border-radius:3px;background-color:#DDDDDD;transition-property:background,width;transition-duration:0.1s;transition-timing-function:linear}
#vmform .multiple:hover .sectionbutton{opacity:0.7;left:4px}
#vmform .multiple:hover .sectionbutton.remove{opacity:0.6}
#vmform .multiple:hover .sectiontab{background-color:#CCCCCC;width:8px}
#vmform table.multiple:hover{background-position:0 0;}
#vmform table.multiple td{padding:5px 0}
span.advancedview_panel{display:none;line-height:16px;margin-top:1px}
.basic{display:none}
.advanced{/*Empty placeholder*/}
.switch-button-label.off{color:inherit}
.template_img_parent{position:relative}
#template_img{cursor:pointer}
#template_img:hover{opacity:0.5}
#template_img:hover i{opacity:1.0}
.template_img_chooser_inner{display:inline-block;width:80px;margin-bottom:15px;margin-right:10px;text-align:center;}
.template_img_chooser_inner img{width:48px;height:48px}
.template_img_chooser_inner p{text-align:center;line-height:8px;}
#template_img_chooser{width:560px;height:300px;overflow-y:scroll;position:relative;display:grid;grid-template-columns: repeat(6, minmax(0, 1fr));}
#template_img_chooser div:hover{color:#ff8c2f;cursor:pointer;}
#form_content{display:none}
#vmform .four{overflow:hidden}
#vmform .four label{float:left;display:table-cell;width:15%;}
#vmform .four label:nth-child(4n+4){}
#vmform .four label.cpu1{width:28%;height:16px;line-height:16px}
#vmform .four label.cpu2{width:3%;height:16px;line-height:16px}
#vmform .mac_generate{cursor:pointer;margin-left:-5px;color:#08C;font-size:1.3rem;transform:translate(0px, 2px)}
#vmform .disk{display:none}
#vmform .disk_preview{display:inline-block;color:#BBB;transform:translate(0px, 1px)}
i.fa-plus-circle,i.fa-minus-circle{margin-left:8px}
input[type=checkbox]{margin-left:0}
#vmform table.timers td.present {width:150px;}

View File

@@ -0,0 +1,4 @@
.fileTree{background:#f2f2f2;width:300px;max-height:150px;overflow-y:scroll;overflow-x:hidden;position:relative;z-index:100;display:none}
#vmform table.multiple{margin:10px 0;background:#f2f2f2;background-size:800px 100%;background-position:-800px;background-repeat:no-repeat;background-clip:content-box;transition:background 0.3s linear}
#template_img_chooser_outer{position:absolute;display:none;border-radius:5px;border:1px solid <?=$border?>;background:#f2f2f2;z-index:10}
span#dropbox{border:1px solid <?=$border?>;background:#f2f2f2;padding:28px 12px;line-height:72px;margin-right:16px;}

View File

@@ -0,0 +1,4 @@
.fileTree{background:#1c1c1c;width:300px;max-height:150px;overflow-y:scroll;overflow-x:hidden;position:relative;z-index:100;display:none}
#vmform table.multiple{margin:10px 0;background:#1c1c1c;background-size:800px 100%;background-position:-800px;background-repeat:no-repeat;background-clip:content-box;transition:background 0.3s linear}
#template_img_chooser_outer{position:absolute;display:none;border-radius:5px;border:1px solid <?=$border?>;background:#1c1c1c;z-index:10}
span#dropbox{border:1px solid <?=$border?>;background:#1c1c1c;padding:28px 12px;line-height:72px;margin-right:16px;}

View File

@@ -0,0 +1,4 @@
.fileTree{background:#1c1c1c;width:300px;max-height:150px;overflow-y:scroll;overflow-x:hidden;position:relative;z-index:100;display:none}
#vmform table.multiple{margin:10px 0;background:#1c1c1c;background-size:800px 100%;background-position:-800px;background-repeat:no-repeat;background-clip:content-box;transition:background 0.3s linear}
#template_img_chooser_outer{position:absolute;display:none;border-radius:5px;border:1px solid <?=$border?>;background:#1c1c1c;z-index:10}
span#dropbox{border:1px solid <?=$border?>;background:#1c1c1c;padding:28px 12px;line-height:72px;margin-right:16px;}

View File

@@ -0,0 +1,4 @@
.fileTree{background:#f2f2f2;width:300px;max-height:150px;overflow-y:scroll;overflow-x:hidden;position:relative;z-index:100;display:none}
#vmform table.multiple{margin:10px 0;background:#f2f2f2;background-size:800px 100%;background-position:-800px;background-repeat:no-repeat;background-clip:content-box;transition:background 0.3s linear}
#template_img_chooser_outer{position:absolute;display:none;border-radius:5px;border:1px solid <?=$border?>;background:#f2f2f2;z-index:10}
span#dropbox{border:1px solid <?=$border?>;background:#f2f2f2;padding:28px 12px;line-height:72px;margin-right:16px;}

View File

@@ -1,236 +1,46 @@
:root {
--update-vm-background: var(--black);
}
.Theme--azure:root,
.Theme--white:root {
--update-vm-background: var(--gray-100);
}
body {
-webkit-overflow-scrolling: touch;
}
#vmform table {
margin-top: 0;
}
#vmform div.title + table {
margin-top: 0;
}
#vmform table tr {
vertical-align: top;
line-height: 40px;
}
#vmform table tr td:nth-child(odd) {
width: 300px;
text-align: right;
padding-right: 10px;
}
#vmform table tr td:nth-child(even) {
width: 110px;
}
@media (max-width: 1280px) {
#vmform table tr td:first-child {
width: 35%;
padding-right: 4rem;
}
}
@media (min-width: 1281px) {
#vmform table tr td:first-child {
width: 30%;
padding-right: 4rem;
}
}
@media (min-width: 1921px) {
#vmform table tr td:first-child {
width: 25%;
padding-right: 4rem;
}
}
#vmform table tr td:last-child {
width: inherit;
}
#vmform .multiple {
position: relative;
}
#vmform .sectionbutton {
position: absolute;
left: 2px;
cursor: pointer;
opacity: 0.4;
font-size: 1.4rem;
line-height: 17px;
z-index: 10;
transition-property: opacity, left;
transition-duration: 0.1s;
transition-timing-function: linear;
}
#vmform .sectionbutton.remove {
top: 0;
opacity: 0.3;
}
#vmform .sectionbutton.add {
bottom: 0;
}
#vmform .sectionbutton:hover {
opacity: 1;
}
#vmform .sectiontab {
position: absolute;
top: 2px;
bottom: 2px;
left: 0;
width: 6px;
border-radius: 3px;
background-color: var(--gray-200); /* Condensed from: #dddddd */
transition-property: background, width;
transition-duration: 0.1s;
transition-timing-function: linear;
}
#vmform .multiple:hover .sectionbutton {
opacity: 0.7;
left: 4px;
}
#vmform .multiple:hover .sectionbutton.remove {
opacity: 0.6;
}
#vmform .multiple:hover .sectiontab {
background-color: var(--gray-300);
width: 8px;
}
#vmform table.multiple:hover {
background-position: 0 0;
}
#vmform table.multiple td {
padding: 5px 0;
}
span.advancedview_panel {
display: none;
line-height: 16px;
margin-top: 1px;
}
.basic {
display: none;
}
.advanced {
/*Empty placeholder*/
}
.switch-button-label.off {
color: inherit;
}
#template_img {
cursor: pointer;
}
#template_img:hover {
opacity: 0.5;
}
#template_img:hover i {
opacity: 1;
}
.template_img_chooser_inner {
display: inline-block;
width: 80px;
margin-bottom: 15px;
margin-right: 10px;
text-align: center;
}
.template_img_chooser_inner img {
width: 48px;
height: 48px;
}
.template_img_chooser_inner p {
text-align: center;
line-height: 8px;
}
#template_img_chooser {
width: 560px;
height: 300px;
overflow-y: scroll;
position: relative;
}
#template_img_chooser div:hover {
background-color: var(--gray-150); /* Condensed from: #eee */
cursor: pointer;
}
#form_content {
display: none;
}
#vmform .four {
overflow: hidden;
}
#vmform .four label {
float: left;
display: table-cell;
width: 15%;
}
#vmform .four label:nth-child(4n + 4) {
}
#vmform .four label.cpu1 {
width: 28%;
height: 16px;
line-height: 16px;
}
#vmform .four label.cpu2 {
width: 3%;
height: 16px;
line-height: 16px;
}
#vmform .mac_generate {
cursor: pointer;
margin-left: -5px;
color: var(--blue-700); /* Condensed from: #08c */
font-size: 1.3rem;
transform: translate(0px, 2px);
}
#vmform .disk {
display: none;
}
#vmform .disk_preview {
display: inline-block;
color: var(--gray-300); /* Condensed from: #bbb */
transform: translate(0px, 1px);
}
i.fa-plus-circle,
i.fa-minus-circle {
margin-left: 8px;
}
input[type="checkbox"] {
margin-left: 0;
}
#vmform table.timers td.present {
width: 150px;
}
.fileTree {
background: var(--update-vm-background);
width: 300px;
max-height: 150px;
overflow-y: scroll;
overflow-x: hidden;
position: relative;
z-index: 100;
display: none;
}
#vmform table.multiple {
margin: 10px 0;
background: var(--update-vm-background);
background-size: 800px 100%;
background-position: -800px;
background-repeat: no-repeat;
background-clip: content-box;
transition: background 0.3s linear;
}
#template_img_chooser_outer {
position: absolute;
display: none;
border-radius: 5px;
border: 1px solid <?=$border?>;
background: var(--update-vm-background);
z-index: 10;
}
span#dropbox {
border: 1px solid <?=$border?>;
background: var(--update-vm-background);
padding: 28px 12px;
line-height: 72px;
margin-right: 16px;
}
body{-webkit-overflow-scrolling:touch}
#vmform table{margin-top:0}
#vmform div.title + table{margin-top:0}
#vmform table tr{vertical-align:top;line-height:40px}
#vmform table tr td:nth-child(odd){width:300px;text-align:right;padding-right:10px}
#vmform table tr td:nth-child(even){width:110px}
@media (max-width:1280px){#vmform table tr td:first-child{width:35%;padding-right:4rem}}
@media (min-width:1281px){#vmform table tr td:first-child{width:30%;padding-right:4rem}}
@media (min-width:1921px){#vmform table tr td:first-child{width:25%;padding-right:4rem}}
#vmform table tr td:last-child{width:inherit}
#vmform .multiple{position:relative}
#vmform .sectionbutton{position:absolute;left:2px;cursor:pointer;opacity:0.4;font-size:1.4rem;line-height:17px;z-index:10;transition-property:opacity,left;transition-duration:0.1s;transition-timing-function:linear}
#vmform .sectionbutton.remove{top:0;opacity:0.3}
#vmform .sectionbutton.add{bottom:0}
#vmform .sectionbutton:hover{opacity:1.0}
#vmform .sectiontab{position:absolute;top:2px;bottom:2px;left:0;width:6px;border-radius:3px;background-color:#DDDDDD;transition-property:background,width;transition-duration:0.1s;transition-timing-function:linear}
#vmform .multiple:hover .sectionbutton{opacity:0.7;left:4px}
#vmform .multiple:hover .sectionbutton.remove{opacity:0.6}
#vmform .multiple:hover .sectiontab{background-color:#CCCCCC;width:8px}
#vmform table.multiple:hover{background-position:0 0;}
#vmform table.multiple td{padding:5px 0}
span.advancedview_panel{display:none;line-height:16px;margin-top:1px}
.basic{display:none}
.advanced{/*Empty placeholder*/}
.switch-button-label.off{color:inherit}
.template_img_parent{position:relative}
#template_img{cursor:pointer}
#template_img:hover{opacity:0.5}
#template_img:hover i{opacity:1.0}
.template_img_chooser_inner{display:inline-block;width:80px;margin-bottom:15px;margin-right:10px;text-align:center;}
.template_img_chooser_inner img{width:48px;height:48px}
.template_img_chooser_inner p{text-align:center;line-height:8px;}
#template_img_chooser{width:560px;height:300px;overflow-y:scroll;position:relative;display:grid;grid-template-columns: repeat(6, minmax(0, 1fr));}
#template_img_chooser div:hover{color:#ff8c2f;cursor:pointer;}
#form_content{display:none}
#vmform .four{overflow:hidden}
#vmform .four label{float:left;display:table-cell;width:15%;}
#vmform .four label:nth-child(4n+4){}
#vmform .four label.cpu1{width:28%;height:16px;line-height:16px}
#vmform .four label.cpu2{width:3%;height:16px;line-height:16px}
#vmform .mac_generate{cursor:pointer;margin-left:-5px;color:#08C;font-size:1.3rem;transform:translate(0px, 2px)}
#vmform .disk{display:none}
#vmform .disk_preview{display:inline-block;color:#BBB;transform:translate(0px, 1px)}
i.fa-plus-circle,i.fa-minus-circle{margin-left:8px}
input[type=checkbox]{margin-left:0}
#vmform table.timers td.present {width:150px;}

View File

@@ -0,0 +1 @@
.fileTree{background:#f2f2f2;width:500px;max-height:320px;overflow-y:scroll;overflow-x:hidden;position:absolute;z-index:100;display:none}

View File

@@ -0,0 +1 @@
.fileTree{background:#1c1c1c;width:500px;max-height:320px;overflow-y:scroll;overflow-x:hidden;position:absolute;z-index:100;display:none}

View File

@@ -0,0 +1 @@
.fileTree{background:#1c1c1c;width:500px;max-height:320px;overflow-y:scroll;overflow-x:hidden;position:absolute;z-index:100;display:none}

View File

@@ -0,0 +1 @@
.fileTree{background:#f2f2f2;width:500px;max-height:320px;overflow-y:scroll;overflow-x:hidden;position:absolute;z-index:100;display:none}

View File

@@ -1,140 +1,23 @@
:root {
--vm-machines-file-tree-background: var(--black);
}
.Theme--azure:root,
.Theme--white:root {
--vm-machines-file-tree-background: var(--gray-100);
}
th.th1 {
width: 25%;
}
th.th2 {
width: 15%;
}
th.th3 {
width: 80px;
}
div.four {
font-size: 1.1rem;
width: 260px;
}
div.four label {
float: left;
display: table-cell;
width: 25%;
}
div.four label:nth-child(4n + 4) {
float: none;
clear: both;
}
div.four label.cpu1 {
width: 32%;
}
div.four label.cpu2 {
width: 26%;
}
div.template,
div#dialogWindow,
input#upload {
display: none;
}
table.domdisk thead tr th:nth-child(1) {
width: 56% !important;
}
table.domdisk thead tr th:nth-child(n + 2) {
width: 8% !important;
}
table.domdisk thead tr th:nth-child(1) {
padding-left: 72px;
}
table.domdisk tbody tr td:nth-child(1) {
padding-left: 72px;
}
table.domdisk tbody tr:nth-child(even) {
background-color: transparent !important;
}
table.domdisk tbody tr:nth-child(4n-1) {
background-color: transparent !important;
}
table.snapshot {
margin-top: 0;
}
table tbody td {
line-height: normal;
}
i.mover {
margin-right: 8px;
display: none;
}
i.fa-dot-circle-o {
padding-left: 12px;
}
#resetsort {
margin-left: 12px;
display: inline-block;
width: 32px;
}
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button[disabled] {
cursor: default;
color: var(--gray-500);
background:
-webkit-gradient(
linear,
left top,
right top,
from(var(--gray-600)),
to(var(--gray-500))
)
0 0 no-repeat,
-webkit-gradient(
linear,
left top,
right top,
from(var(--gray-600)),
to(var(--gray-500))
) 0 100% no-repeat,
-webkit-gradient(
linear,
left bottom,
left top,
from(var(--gray-600)),
to(var(--gray-600))
) 0 100% no-repeat,
-webkit-gradient(
linear,
left bottom,
left top,
from(var(--gray-500)),
to(var(--gray-500))
) 100% 100% no-repeat;
background:
linear-gradient(90deg, var(--gray-600) 0, var(--gray-500)) 0 0 no-repeat,
linear-gradient(90deg, var(--gray-600) 0, var(--gray-500)) 0 100% no-repeat,
linear-gradient(0deg, var(--gray-600) 0, var(--gray-600)) 0 100% no-repeat,
linear-gradient(0deg, var(--gray-500) 0, var(--gray-500)) 100% 100% no-repeat;
background-size:
100% 2px,
100% 2px,
2px 100%,
2px 100%;
}
.dropdown-menu {
z-index: 10001;
}
span.vmgraphics {
font-size: 1.1rem;
text-align: left;
}
.fileTree {
background: var(--vm-machines-file-tree-background);
width: 500px;
max-height: 320px;
overflow-y: scroll;
overflow-x: hidden;
position: absolute;
z-index: 100;
display: none;
}
th.th1{width:25%}
th.th2{width:15%}
th.th3{width:80px}
div.four{font-size:1.1rem;width:260px}
div.four label{float:left;display:table-cell;width:25%}
div.four label:nth-child(4n+4){float:none;clear:both}
div.four label.cpu1{width:32%}
div.four label.cpu2{width:26%}
div.template,div#dialogWindow,input#upload{display:none}
table.domdisk thead tr th:nth-child(1){width:56%!important}
table.domdisk thead tr th:nth-child(n+2){width:8%!important}
table.domdisk thead tr th:nth-child(1){padding-left:72px}
table.domdisk tbody tr td:nth-child(1){padding-left:72px}
table.domdisk tbody tr:nth-child(even){background-color:transparent!important}
table.domdisk tbody tr:nth-child(4n-1){background-color:transparent!important}
table.snapshot{margin-top:0}
table tbody td{line-height:normal}
i.mover{margin-right:8px;display:none}
i.fa-dot-circle-o{padding-left:12px}
#resetsort{margin-left:12px;display:inline-block;width:32px}
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button[disabled]{cursor:default;color:#808080;background:-webkit-gradient(linear,left top,right top,from(#404040),to(#808080)) 0 0 no-repeat,-webkit-gradient(linear,left top,right top,from(#404040),to(#808080)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#404040),to(#404040)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#808080),to(#808080)) 100% 100% no-repeat;background:linear-gradient(90deg,#404040 0,#808080) 0 0 no-repeat,linear-gradient(90deg,#404040 0,#808080) 0 100% no-repeat,linear-gradient(0deg,#404040 0,#404040) 0 100% no-repeat,linear-gradient(0deg,#808080 0,#808080) 100% 100% no-repeat;background-size:100% 2px,100% 2px,2px 100%,2px 100%}
.dropdown-menu{z-index:10001}
span.vmgraphics{font-size:1.1rem;text-align:left}

View File

@@ -0,0 +1 @@
.fileTree{background:#f2f2f2;width:300px;max-height:150px;overflow-y:scroll;overflow-x:hidden;position:absolute;z-index:100;display:none}

View File

@@ -0,0 +1 @@
.fileTree{background:#1c1c1c;width:300px;max-height:150px;overflow-y:scroll;overflow-x:hidden;position:absolute;z-index:100;display:none}

View File

@@ -0,0 +1 @@
.fileTree{background:#1c1c1c;width:300px;max-height:150px;overflow-y:scroll;overflow-x:hidden;position:absolute;z-index:100;display:none}

View File

@@ -0,0 +1 @@
.fileTree{background:#f2f2f2;width:300px;max-height:150px;overflow-y:scroll;overflow-x:hidden;position:absolute;z-index:100;display:none}

View File

@@ -1,69 +1,12 @@
:root {
--vm-machines-file-tree-background: var(--black);
}
.Theme--azure:root,
.Theme--white:root {
--vm-machines-file-tree-background: var(--gray-100);
}
body {
-webkit-overflow-scrolling: touch;
}
.errortext {
color: var(--red-800); /* Condensed from: #ef3d47 */
display: none;
}
.basic {
display: block;
}
.advanced {
display: none;
}
#winvirtio {
display: none;
}
#download_status {
margin-left: 5px;
color: var(--gray-500); /* Condensed from: #777 */
display: none;
}
#download_button {
cursor: pointer;
margin-left: -2px;
color: var(--blue-700); /* Condensed from: #08c */
display: none;
transform: translate(0px, 2px);
}
#download_button.fa-spin {
cursor: default;
color: var(--gray-500); /* Condensed from: #777 */
}
#download_button span {
font-family: clear-sans;
}
#download_button.fa-spin span {
font-family: clear-sans;
display: none;
}
#remove_button {
cursor: pointer;
margin-left: -2px;
color: var(--red-800); /* Condensed from: #ef3d47 */
display: none;
transform: translate(0px, 2px);
}
#remove_button span {
font-family: clear-sans;
}
.fileTree {
background: var(--vm-machines-file-tree-background);
width: 300px;
max-height: 150px;
overflow-y: scroll;
overflow-x: hidden;
position: absolute;
z-index: 100;
display: none;
}
body{-webkit-overflow-scrolling:touch}
.errortext{color:#EF3D47;display:none}
.basic{display:block}
.advanced{display:none}
#winvirtio{display:none}
#download_status{margin-left:5px;color:#777;display:none}
#download_button{cursor:pointer;margin-left:-2px;color:#08C;display:none;transform:translate(0px,2px)}
#download_button.fa-spin{cursor:default;color:#777}
#download_button span{font-family:clear-sans}
#download_button.fa-spin span{font-family:clear-sans;display:none}
#remove_button{cursor:pointer;margin-left:-2px;color:#EF3D47;display:none;transform:translate(0px,2px)}
#remove_button span{font-family:clear-sans}

View File

@@ -1,24 +1,4 @@
.vmheader {
padding: 10px;
font-size: 1.4rem;
text-align: left;
color: var(--gray-500); /* Condensed from: #888 */
}
.vmtemplate {
display: inline-block;
width: 80px;
height: 90px;
margin-bottom: 15px;
margin-left: 10px;
text-align: center;
vertical-align: top;
}
.vmtemplate img {
width: 48px;
height: 48px;
}
.vmtemplate p {
text-align: center;
margin-top: 8px;
line-height: 12px;
}
.vmheader{padding:10px;font-size:1.4rem;text-align:left;color:#888}
.vmtemplate{display:inline-block;width:80px;height:90px;margin-bottom:15px;margin-left:10px;text-align:center;vertical-align:top}
.vmtemplate img{width:48px;height:48px}
.vmtemplate p{text-align:center;margin-top:8px;line-height:12px}

View File

@@ -31,6 +31,7 @@
$arrValidUSBDevices = getValidUSBDevices();
$arrValidDiskDrivers = getValidDiskDrivers();
$arrValidDiskBuses = getValidDiskBuses();
$arrValidDiskDiscard = getValidDiskDiscard();
$arrValidCdromBuses = getValidCdromBuses();
$arrValidVNCModels = getValidVNCModels();
$arrValidProtocols = getValidVMRCProtocols();
@@ -88,7 +89,8 @@
'select' => $domain_cfg['VMSTORAGEMODE'],
'bus' => 'virtio' ,
'boot' => 1,
'serial' => 'vdisk1'
'serial' => 'vdisk1',
'discard' => 'unmap'
]
],
'gpu' => [
@@ -315,6 +317,18 @@
}
if ($usertemplate == 1) unset($arrConfig['domain']['uuid']);
$xml2 = build_xml_templates($strXML);
#disable rename if snapshots exist
$snapshots = getvmsnapshots($arrConfig['domain']['name']) ;
if ($snapshots != null && count($snapshots) && !$boolNew)
{
$snaprenamehidden = "";
$namedisable = "disabled";
$snapcount = count($snapshots);
} else {
$snaprenamehidden = "hidden";
$namedisable = "";
$snapcount = "0";
};
?>
<link rel="stylesheet" href="<?autov('/plugins/dynamix.vm.manager/scripts/codemirror/lib/codemirror.css')?>">
@@ -334,9 +348,12 @@
<input type="hidden" name="domain[memoryBacking]" id="domain_memorybacking" value="<?=htmlspecialchars($arrConfig['domain']['memoryBacking'])?>">
<table>
<tr><td></td><td>
<span <?=$snaprenamehidden?> id="snap-rename" class="orange-text"><i class="fa fa-warning"></i> _(Rename disabled, <?=$snapcount?> snapshot(s) exists.)_</span>
<span hidden id="zfs-name" class="orange-text"><i class="fa fa-warning"></i> _(Name contains invalid characters or does not start with an alphanumberic for a ZFS storage location<br>Only these special characters are valid Underscore (_) Hyphen (-) Colon (:) Period (.))_</span></td></tr>
<tr>
<td>_(Name)_:</td>
<td><input type="text" name="domain[name]" id="domain_name" class="textTemplate" title="_(Name of virtual machine)_" placeholder="_(e.g.)_ _(My Workstation)_" value="<?=htmlspecialchars($arrConfig['domain']['name'])?>" required /></td>
<td><input <?=$namedisable?> type="text" name="domain[name]" id="domain_name" oninput="checkName(this.value)" class="textTemplate" title="_(Name of virtual machine)_" placeholder="_(e.g.)_ _(My Workstation)_" value="<?=htmlspecialchars($arrConfig['domain']['name'])?>" required /></td>
<td><textarea class="xml" id="xmlname" rows=1 disabled ><?=htmlspecialchars($xml2['name'])."\n".htmlspecialchars($xml2['uuid'])."\n".htmlspecialchars($xml2['metadata'])?></textarea></td>
</tr>
</table>
@@ -377,7 +394,7 @@
<tr>
<?if (!$boolNew) $disablestorage = " disabled "; else $disablestorage = "";?>
<td>_(Override Storage Location)_:</td><td>
<select <?=$disablestorage?> name="template[storage]" class="disk_select narrow" id="storage_location" title="_(Location of virtual machine files)_">
<select <?=$disablestorage?> name="template[storage]" onchange="get_storage_fstype(this)" class="disk_select narrow" id="storage_location" title="_(Location of virtual machine files)_">
<?
$default_storage=htmlspecialchars($arrConfig['template']['storage']);
echo mk_option($default_storage, 'default', _('Default'));
@@ -847,6 +864,10 @@
</select>
_(Boot Order)_:
<input type="number" size="5" maxlength="5" id="disk[<?=$i?>][boot]" class="narrow bootorder" style="width: 50px;" name="disk[<?=$i?>][boot]" title="_(Boot order)_" value="<?=$arrDisk['boot']?>" >
_(Discard)_:
<select name="disk[<?=$i?>][discard]" class="disk_driver narrow" title="_(Set discard option)_">
<?mk_dropdown_options($arrValidDiskDiscard, $arrDisk['discard']);?>
</select>
<? if ($arrDisk['bus'] == "virtio" || $arrDisk['bus'] == "usb") $ssddisabled = "hidden "; else $ssddisabled = " ";?>
<span id="disk[<?=$i?>][rotatetext]" <?=$ssddisabled?>>_(SSD)_:</span>
<input type="checkbox" id="disk[<?=$i?>][rotation]" class="narrow rotation" onchange="updateSSDCheck(this)"style="width: 50px;" name="disk[<?=$i?>][rotation]" <?=$ssddisabled ?> <?=$arrDisk['rotation'] ? "checked ":"";?> title="_(Set SDD flag)_" value="<?=$arrDisk['rotation']?>" >
@@ -897,6 +918,11 @@
Specify the order the devices are used for booting.
</p>
<p class="advanced">
<b>vDisk Discard</b><br>
Specify if unmap(Trim) requests are sent to underlaying filesystem.
</p>
<p class="advanced">
<b>vDisk SSD Flag</b><br>
Specify the vdisk shows as SSD within the guest, only supported on SCSI, SATA and IDE bus types.
@@ -1001,6 +1027,10 @@
_(Boot Order)_:
<input type="number" size="5" maxlength="5" id="disk[{{INDEX}}][boot]" class="narrow bootorder" style="width: 50px;" name="disk[{{INDEX}}][boot]" title="_(Boot order)_" value="" >
_(Discard)_:
<select name="disk[{{INDEX}}][discard]" class="disk_driver narrow" title="_(Set discard option)_">
<?mk_dropdown_options($arrValidDiskDiscard, "unmap");?>
</select>
<span id="disk[{{INDEX}}][rotatetext]" hidden>_(SSD)_:</span>
<input type="checkbox" id="disk[{{INDEX}}][rotation]" class="narrow rotation" onchange="updateSSDCheck(this)"style="width: 50px;" name="disk[{{INDEX}}[rotation]" hidden title="_(Set SSD flag)_" value='0' >
</td>
@@ -1532,7 +1562,6 @@
<table>
<tr><td></td>
<td>_(Select)_&nbsp&nbsp_(Boot Order)_</td></tr></div>
<tr>
<tr>
<td>_(Other PCI Devices)_:</td>
<td>
@@ -1557,7 +1586,6 @@
<label for="pci<?=$i?>">&nbsp&nbsp&nbsp&nbsp<input type="checkbox" name="pci[]" id="pci<?=$i?>" value="<?=htmlspecialchars($arrDev['id'])?>" <?=$extra?>/> &nbsp
<input type="number" size="5" maxlength="5" id="pciboot<?=$i?>" class="narrow pcibootorder" <?=$bootdisable?> style="width: 50px;" name="pciboot[<?=htmlspecialchars($arrDev['id'])?>]" title="_(Boot order)_" value="<?=$pciboot?>" >
<?=htmlspecialchars($arrDev['name'])?> | <?=htmlspecialchars($arrDev['type'])?> (<?=htmlspecialchars($arrDev['id'])?>)</label><br/>
<td><textarea class="xml" id="xmlpci<?=$i?>" rows=5 disabled ><?=htmlspecialchars($xml2['devices']['other'][$arrDev['id']])?></textarea></td>
<?
}
}
@@ -1567,6 +1595,7 @@
}
?>
</div>
<td><textarea class="xml" id="xmlpci<?=$i?>" rows=2 disabled ><?=htmlspecialchars($xml2['devices']['other']["allotherpci"])?></textarea></td>
</td>
</tr>
@@ -1881,6 +1910,8 @@
<script src="<?autov('/plugins/dynamix.vm.manager/scripts/codemirror/addon/hint/libvirt-schema.js')?>"></script>
<script src="<?autov('/plugins/dynamix.vm.manager/scripts/codemirror/mode/xml/xml.js')?>"></script>
<script type="text/javascript">
var storageType = "<?=get_storage_fstype($arrConfig['template']['storage']);?>";
var storageLoc = "<?=$arrConfig['template']['storage']?>";
function ShareChange(share) {
var value = share.value;
@@ -1992,6 +2023,36 @@ function SetBootorderfields(usbbootvalue) {
}
}
/* Remove characters not allowed in share name. */
function checkName(name) {
/* Declare variables at the function scope */
var isValidName
$('#zfs-name').hide();
isValidName = /^[A-Za-z0-9][A-Za-z0-9\-_.: ]*$/.test(name);
if (isValidName) {
$('#btnSubmit').prop("disabled", false);
} else {
if (storageType == "zfs")
{ $('#btnSubmit').prop("disabled", true); $('#zfs-name').show(); }
else $('#btnSubmit').prop("disabled", false);
}
}
function get_storage_fstype(item) {
storageLoc = item.value;
$.post("/plugins/dynamix.vm.manager/include/VMajax.php", {action:"get_storage_fstype", storage:item.value}, function( data ) {
if (data.success) {
if (data.fstype) {
storageType=data.fstype;
checkName(document.getElementById("domain_name").value);
}}
if (data.error) {
}
}, "json");
}
function USBBootChange(usbboot) {
// Remove all boot orders if changed to Yes
var value = usbboot.value ;

View File

@@ -23,7 +23,7 @@ function installPlugin(file) {
<div class="notice">_(Click **Install** to download and install the **Community Applications** plugin)_</div>
<form markdown="1" name="ca_install" method="POST" target="progressFrame">
<input type="hidden" name="file" value="https://raw.githubusercontent.com/Squidly271/community.applications/master/plugins/community.applications.plg">
<input type="hidden" name="file" value="https://ca.unraid.net/dl/https://raw.githubusercontent.com/Squidly271/community.applications/master/plugins/community.applications.plg">
&nbsp;
: <input type="button" value="_(Install)_" onclick="installPlugin(this.form.file.value)">

View File

@@ -18,22 +18,18 @@ Nchan="device_list,disk_load,parity_list"
<?
$keyfile = file_exists(_var($var,'luksKeyfile'));
$missing = file_exists('/var/tmp/missing.tmp');
$encrypt = false;
$spot = _var($var,'mdResyncPos',0)>0;
$poolsOnly = (_var($var,'SYS_ARRAY_SLOTS') == 0 ) ? true : false;
/* only one of $present, $missing, or $wrong will be true, or all will be false */
$forced = $present = $wrong = false;
foreach ($disks as $disk) {
if (!isset($disk['fsType'])) continue;
if (strpos(_var($disk,'fsType'),'luks:')!==false || (_var($disk,'fsType')=='auto' && (strpos(_var($var,'defaultFsType'),'luks:')!==false || _var($disk,'luksState',0)==2 || _var($disk,'luksState',0)==3))) {
$encrypt = true;
if (_var($disk,'luksState',0)==0) $forced = true;
if (_var($disk,'luksState',0)==1) $present = true;
if (_var($disk,'luksState',0)==2) $missing = true;
if (_var($disk,'luksState',0)==3) $wrong = true;
}
if (strpos(_var($disk,'fsType'),'luks:')!==false || (_var($disk,'fsType')=='auto' && strpos(_var($var,'defaultFsType'),'luks:')!==false)) $forced = true;
if (_var($disk,'luksState',0)==1) $present = true;
if (_var($disk,'luksState',0)==2) $missing = true;
if (_var($disk,'luksState',0)==3) $wrong = true;
}
$encrypt = $forced || $present || $missing || $wrong;
if ($forced && ($present || $missing || $wrong)) $forced = false;
function check_encryption() {
@@ -383,7 +379,7 @@ devices.on('message', function(msg,meta) {
$.each(get,function(k,v) {if ($('#line'+k).length>0) $('#line'+k).html(v);});
// button control
if ($('#pauseButton').length>0 && $('#pauseButton').prop('disabled')==false) {
if (!msg && $('#cancelButton').length>0 && $('#cancelButton').val()=="_(Cancel)_") {
if ((get === "") && $('#cancelButton').val()=="_(Cancel)_") {
$('#cancelButton').val("_(Done)_").prop('onclick',null).off('click').click(function(){refresh();});
$('#pauseButton').prop('disabled',true);
$('#cancelText').html('');
@@ -464,7 +460,7 @@ window.onunload = function(){
<? if (_var($var,'fsNumUnmountable',0)>0):?>
<tr><td>**<?=_('Unmountable disk'.(_var($var,'fsNumUnmountable',0)==1?'':'s').' present')?>:**<br>
<? $cache = [];
foreach ($disks as $disk) if (substr(_var($disk,'fsStatus'),0,11)=='Unmountable' || in_array(prefix(_var($disk,'name')),$cache)) {
foreach ($disks as $disk) if (substr(_var($disk,'fsStatus'),0,11)=='Unmountable' || in_array(pool_name(_var($disk,'name')),$cache)) {
if (strlen(_var($disk,'id'))) echo "<span class='blue-text'>".my_disk(_var($disk,'name'))."</span> &bullet; ".my_id(_var($disk,'id'))." ("._var($disk,'device').")<br>";
if (in_array(_var($disk,'name'),$pools)) $cache[] = $disk['name'];
}

View File

@@ -24,7 +24,7 @@ function sharename($share) {
}
?>
<link type="text/css" rel="stylesheet" href="<?autov("/webGui/styles/jquery.ui.css")?>">
<link type="text/css" rel="stylesheet" href="<?autov("/plugins/dynamix.docker.manager/styles/DockerManager.css")?>">
<link type="text/css" rel="stylesheet" href="<?autov("/plugins/dynamix.docker.manager/styles/style-$theme.css")?>">
<script>
function validate(poolname) {

View File

@@ -1,5 +1,5 @@
Menu="Dashboard"
Nchan="wg_poller,update_1,update_2,update_3,ups_status:stop,vm_dashusage:stop"
Nchan="wg_poller,update_1,update_2,update_3,ups_status:stop,vm_dashusage"
---
<?PHP
/* Copyright 2005-2023, Lime Technology * Copyright 2012-2023, Bergware International.
@@ -69,7 +69,7 @@ $cache_type = $cache_rate = [];
$parity = _var($var,'mdResync');
$mover = file_exists('/var/run/mover.pid');
$btrfs = exec('pgrep -cf /sbin/btrfs');
$btrfs = exec('pgrep --ns $$ -cf /sbin/btrfs');
$vdisk = exec("grep -Pom1 '^DOCKER_IMAGE_TYPE=\"\\K[^\"]+' /boot/config/docker.cfg 2>/dev/null")!='folder' ? _('Docker vdisk') : _('Docker folder');
$dot = _var($display,'number','.,')[0];
$zfs = count(array_filter(array_column($disks,'fsType'),function($fs){return str_replace('luks:','',$fs??'')=='zfs';}));
@@ -79,7 +79,7 @@ $domain_cfg = parse_ini_file($domain_cfgfile);
if (!isset($domain_cfg['USAGE'])) $vmusage = "N" ; else $vmusage = $domain_cfg['USAGE'];
// enable/disable graph elements by making hook script executable or not
chmod("$docroot/webGui/system/VM_usage",$libvirtd ? 0755 : 0644);
chmod("$docroot/webGui/system/VM",$libvirtd ? 0755 : 0644);
chmod("$docroot/webGui/system/ZFS_cache",$zfs ? 0755 : 0644);
foreach ($disks as $disk) {
@@ -187,7 +187,7 @@ switch ($theme) {
?>
<link type="text/css" rel="stylesheet" href="<?autov('/webGui/styles/jquery.switchbutton.css')?>">
<link type="text/css" rel="stylesheet" href="<?autov('/webGui/styles/jquery.ui.css')?>">
<link type="text/css" rel="stylesheet" href="<?autov("/plugins/dynamix.docker.manager/styles/DockerManager.css")?>">
<link type="text/css" rel="stylesheet" href="<?autov("/plugins/dynamix.docker.manager/styles/style-$theme.css")?>">
<script src="<?autov('/webGui/javascript/jquery.apexcharts.js')?>"></script>
<script src="<?autov('/webGui/javascript/jquery.switchbutton.js')?>"></script>
@@ -1049,7 +1049,7 @@ function portSelect(name) {
}
function moreInfo(data,table) {
var info = [];
if (data[1]>0) info.push(data[1]+' '+(data[1]==1 ? "_(failed device)_" : "_(failed devices)_"));
if (data[1]>0) info.push(data[1]+' '+(data[1]==1 ? "_(device warning)_" : "_(device warnings)_"));
if (data[2]>0) info.push(data[2]+' '+(data[2]==1 ? "_(heat warning)_" : "_(heat warnings)_"));
if (data[3]>0) info.push(data[3]+' '+(data[3]==1 ? "_(SMART error)_" : "_(SMART errors)_"));
if (data[4]>0) info.push(data[4]+' '+(data[4]==1 ? "_(utilization warning)_" : "_(utilization warnings)_"));
@@ -1188,6 +1188,7 @@ function SleepNow() {
function sortTables() {
$('table.dashboard').each(function(){
var table = $(this);
sanitizeMultiCookie(table.prop('id'), ';', true);
var index = $.cookie(table.prop('id'));
// sorting list exists
if (index != null) {

View File

@@ -20,13 +20,28 @@ require_once "$docroot/webGui/include/Preselect.php";
$unassigned = array_key_exists($name,$devs);
$disk = $disks[$name] ?? $devs[$name] ?? [];
$dev = _var($disk,'device');
$disk['id'] = _var($disk,'id');
$events = explode('|',$disk['smEvents'] ?? $var['smEvents'] ?? $numbers);
$mode = ['Disabled','Hourly','Daily','Weekly','Monthly'];
$days = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];
$sheets = [];
$i = $n = 0;
function hasSubpools($name) {
global $disks, $subpools;
foreach ($subpools as $subpool) {
$index = "$name~$subpool";
if (isset($disks[$index])) return true;
}
return false;
}
if (!isSubpool($name)) {
$fsTypeImmutable = !(_var($var,'fsState')=='Stopped' && !hasSubpools($name) && (empty(_var($disk,'uuid')) || _var($disk,'slots',1)==1));
$fsProfileImmutable = $fsTypeImmutable;
} else {
$fsTypeImmutable = true;
$fsProfileImmutable = !(_var($var,'fsState')=='Stopped' && empty(_var($disk,'fsGroups','1')));
}
foreach ($disks as $sheet) {
if (_var($sheet,'type')=="Flash" || _var($sheet,'color')=="grey-off" || empty($sheet['name'])) continue;
$sheets[] = $sheet['name'];
@@ -43,7 +58,8 @@ $tag = _var($disk,'name');
$end = count($sheets)-1;
$prev = $i>0 ? $sheets[$i-1] : $sheets[$end];
$next = $i<$end ? $sheets[$i+1] : $sheets[0];
$text = isPool($name) ? _('This will ERASE content of ALL devices in the pool') : _('This will ERASE ALL device content');
$textErase = isPool($name) ? _('This will ERASE content of ALL devices in the pool') : _('This will ERASE ALL device content');
$textDelete = _('This will unassign all devices from the pool but will NOT modify any device contents');
function disabled_if($condition) {
if ($condition !== false) echo ' disabled';
@@ -111,15 +127,15 @@ function isPool($name) {
}
?>
<link type="text/css" rel="stylesheet" href="<?autov("/webGui/styles/jquery.ui.css")?>">
<link type="text/css" rel="stylesheet" href="<?autov("/plugins/dynamix.docker.manager/styles/DockerManager.css")?>">
<link type="text/css" rel="stylesheet" href="<?autov("/plugins/dynamix.docker.manager/styles/style-$theme.css")?>">
<script>
<?if (empty($disk)):?>
done();
<?endif;?>
String.prototype.celsius = function(){return Math.round((parseInt(this)-32)*5/9).toString();}
if ($.cookie('deletepool')) {
$.removeCookie('deletepool');
done();
}
function setFloor() {
if ($('#shareFloor').length==0) return;
const fsSize = {<?=fsSize()?>};
@@ -198,103 +214,172 @@ function prepareZFS(form) {
}
<?endif;?>
function selectDiskFsWidth() {
var num_slots = <?=_var($disk,'slots',0)?>;
var selected_width = <?=_var($disk,'fsWidth',0)?>;
$('#diskFsWidthZFS').empty();
if (num_slots == 0) {
$('#diskFsWidthZFS').prop('disabled',true).append($('<option>', {
value: 0,
text: "<?=_('no devices')?>"
}));
} else if ($('#diskFsProfileZFS').val() == '') {
var label = (num_slots == 1) ? "device" : "devices";
$('#diskFsWidthZFS').append($('<option>', {
function setDiskFsWidth(slots) {
$('#diskFsWidth').empty();
$('#diskFsWidth').append($('<option>', {value: slots, text:''}));
$('#diskFsWidth').val(slots);
$('#diskFsProfile').off('change');
}
function selectDiskFsProfileAuto() {
$('#diskFsProfile').empty();
$('#diskFsProfile').append($('<option>', {value: '', text:''}));
$('#diskFsProfile').val('');
setDiskFsWidth('');
}
function selectDiskFsProfileXFS() {
$('#diskFsProfile').empty();
$('#diskFsProfile').append($('<option>', {value: '', text:''}));
$('#diskFsProfile').val('');
setDiskFsWidth(1);
}
function selectDiskFsProfileBTRFS(slots,init) {
$('#diskFsProfile').empty();
$('#diskFsProfile').append($('<option>', {value: 'single', text:_('single')}));
if (slots >= 2) $('#diskFsProfile').append($('<option>', {value: 'raid0', text:_('raid0')}));
if (slots >= 2) $('#diskFsProfile').append($('<option>', {value: 'raid1', text:_('raid1')}));
if (slots >= 3) $('#diskFsProfile').append($('<option>', {value: 'raid1c3', text:_('raid1c3')}));
if (slots >= 4) $('#diskFsProfile').append($('<option>', {value: 'raid1c4', text:_('raid1c4')}));
if (slots >= 4) $('#diskFsProfile').append($('<option>', {value: 'raid10', text:_('raid10')}));
if (slots >= 3) $('#diskFsProfile').append($('<option>', {value: 'raid5', text:_('raid5')}));
if (slots >= 4) $('#diskFsProfile').append($('<option>', {value: 'raid6', text:_('raid6')}));
if (init) {
$('#diskFsProfile').val("<?=_var($disk,'fsProfile')?>");
} else {
if (slots == 1) $('#diskFsProfile').val('');
if (slots >= 2) $('#diskFsProfile').val('raid1');
}
setDiskFsWidth(slots);
}
function selectDiskFsWidthZFS(slots,init) {
var selected_width = init ? Number("<?=_var($disk,'fsWidth')?>") : 0;
$('#diskFsWidth').empty();
if ($('#diskFsProfile').val() == '') {
var label = (slots == 1) ? "device" : "devices";
$('#diskFsWidth').append($('<option>', {
value: 1,
text: _(sprintf('%s '+label,num_slots))
text: _(sprintf('%s '+label,slots))
}));
} else if ($('#diskFsProfileZFS').val() == 'mirror') {
if (selected_width == 0) selected_width = 1;
} else if ($('#diskFsProfile').val() == 'mirror') {
var width;
for (width=2; width<=Math.min(num_slots,4); width++) {
if ((num_slots % width) == 0) {
var groups = num_slots / width;
var label = (groups == 1) ? "group" : "groups";
$('#diskFsWidthZFS').append($('<option>', {
for (width=2; width<=Math.min(slots,4); width++) {
if ((slots % width) == 0) {
var groups = slots / width;
var label = (groups == 1) ? "vdev" : "vdevs";
$('#diskFsWidth').append($('<option>', {
value: width,
text: _(sprintf('%s '+label+' of %s devices',groups,width)),
selected: (width == selected_width)
}));
if (selected_width == 0) selected_width = width;
}
}
} else {
var width, min_width;
if ($('#diskFsProfileZFS').val() == 'raidz1') min_width = 3;
else if ($('#diskFsProfileZFS').val() == 'raidz2') min_width = 3;
else if ($('#diskFsProfileZFS').val() == 'raidz3') min_width = 4;
for (width=min_width; width<=num_slots; width++) {
if ((num_slots % width) == 0) {
var groups = num_slots / width;
var label = (groups == 1) ? "group" : "groups";
$('#diskFsWidthZFS').append($('<option>', {
if ($('#diskFsProfile').val() == 'raidz1') min_width = 3;
else if ($('#diskFsProfile').val() == 'raidz2') min_width = 3;
else if ($('#diskFsProfile').val() == 'raidz3') min_width = 4;
for (width=min_width; width<=slots; width++) {
if ((slots % width) == 0) {
var groups = slots / width;
var label = (groups == 1) ? "vdev" : "vdevs";
$('#diskFsWidth').append($('<option>', {
value: width,
text: _(sprintf('%s '+label+' of %s devices',groups,width)),
selected: (width == selected_width)
}));
if (selected_width == 0) selected_width = width;
}
}
}
$('#diskFsWidth').val(selected_width);
}
function selectDiskFsProfile(init) {
var num_slots = <?=_var($disk,'slots',0)?>;
var t = init ? null : 'slow';
if (($('#diskFsType').val()||'').indexOf('auto') != -1) {
$('#diskFsProfileBTRFS').prop('disabled',true).hide();
$('#diskFsProfileZFS').prop('disabled',true).hide();
$('#diskFsWidthZFS').prop('disabled',true).hide();;
$('#compression').hide(t);
$('#autotrim').hide(t);
} else if (($('#diskFsType').val()||'').indexOf('btrfs') != -1) {
if (!init) $('#diskFsProfileBTRFS').prop('disabled',false);
$('#diskFsProfileBTRFS').show();
$('#diskFsProfileZFS').prop('disabled',true).hide();
$('#diskFsWidthZFS').prop('disabled',true).hide();
$('#compression').show(t);
<?if (diskType('Cache')):?>
$('#autotrim').show(t);
if (!init) {
if (num_slots == 1) $('#diskFsProfileBTRFS').val('');
if (num_slots > 1) $('#diskFsProfileBTRFS').val('raid1');
function selectDiskFsProfileZFS(slots,init,subpool) {
$('#diskFsProfile').empty();
if (slots == 1) $('#diskFsProfile').append($('<option>', {value: '', text: _('single')}));
if (slots >= 2) $('#diskFsProfile').append($('<option>', {value: '', text: _('stripe')}));
if (subpool != 'cache' && subpool != 'spares') {
if (slots%2 == 0 || slots%3 == 0 || slots%4 == 0) $('#diskFsProfile').append($('<option>', {value: 'mirror', text: _('mirror')}));
if (subpool == '') {
if (slots >= 3 && subpool == '') $('#diskFsProfile').append($('<option>', {value: 'raidz1', text: _('raidz1')}));
if (slots >= 3 && subpool == '') $('#diskFsProfile').append($('<option>', {value: 'raidz2', text: _('raidz2')}));
if (slots >= 4 && subpool == '') $('#diskFsProfile').append($('<option>', {value: 'raidz3', text: _('raidz3')}));
}
<?endif;?>
} else if (($('#diskFsType').val()||'').indexOf('zfs') != -1) {
$('#diskFsProfileBTRFS').prop('disabled',true).hide();
if (!init) {
$('#diskFsProfileZFS').prop('disabled',false);
$('#diskFsWidthZFS').prop('disabled',false);
}
$('#diskFsProfileZFS').show();
$('#diskFsWidthZFS').show();
if (!init) {
if (num_slots == 1) $('#diskFsProfileZFS').val('');
if (num_slots == 2) $('#diskFsProfileZFS').val('mirror');
if (num_slots > 2) $('#diskFsProfileZFS').val('raidz1');
}
selectDiskFsWidth();
$('#compression').show(t);
<?if (diskType('Cache')):?>
$('#autotrim').show(t);
} else if (($('#diskFsType').val()||'').indexOf('xfs') != -1) {
$('#autotrim').show(t);
<?endif;?>
}
if (init) {
$('#diskFsProfile').val("<?=_var($disk,'fsProfile')?>");
} else {
if (slots == 1) $('#diskFsProfile').val('');
if (slots == 2) $('#diskFsProfile').val('mirror');
if (slots >= 3) $('#diskFsProfile').val('raidz1');
}
selectDiskFsWidthZFS(slots,init);
$('#diskFsProfile').on('change', function() {
selectDiskFsWidthZFS(slots,false);
});
}
function changeFsType() {
var fstype = ($('#diskFsType').val()||'').replace('luks:','');
if (['btrfs', 'zfs'].includes(fstype)) $('#compression').show('slow'); else $('#compression').hide('slow');
<?if (diskType('Cache')):?>
if (['xfs', 'btrfs', 'zfs'].includes(fstype)) $('#autotrim').show('slow'); else $('#autotrim').hide('slow');
/* called upon page load (init==true) and when user changes file system type (init==false) */
function selectDiskFsProfile(init) {
var t = init ? null : 'slow';
/* for array disks, 'slots', 'fsWidth', and 'fsGroups' is not defined */
var slots = Number("<?=_var($disk,'fsWidth',1)?>") * Number("<?=_var($disk,'fsGroups',1)?>");
if (slots == 0) slots = <?=_var($disk,'slots',1)?>;
var subpool = "<?=isSubpool($name) ?: ''?>";
var fsType;
if (subpool == '') {
fsType = init ? "<?=_var($disk,'fsType','')?>" : $('#diskFsType').val();
} else {
fsType = 'zfs';
}
if (slots == 1 || fsType == 'auto') {
$('#profile').hide(t);
} else {
$('#profile').show(t);
if (fsType.indexOf('zfs') != -1) {
if (subpool != 'cache' && subpool != 'spares') {
$('#diskFsProfile').show();
} else {
$('#diskFsProfile').hide();
}
$('#diskFsWidth').show();
} else {
$('#diskFsProfile').show();
$('#diskFsWidth').hide()
}
}
if (fsType == 'auto') {
selectDiskFsProfileAuto();
} else if (fsType.indexOf('btrfs') != -1) {
selectDiskFsProfileBTRFS(slots,init);
} else if (fsType.indexOf('zfs') != -1) {
selectDiskFsProfileZFS(slots,init,subpool);
} else if (fsType.indexOf('xfs') != -1) {
selectDiskFsProfileXFS();
}
if (subpool != '' || fsType == 'auto' || fsType.indexOf('xfs') != -1) {
$('#compression').hide(t);
$('#diskCompression').prop('disabled',true);
} else {
$('#compression').show(t);
$('#diskCompression').prop('disabled',false);
}
<?if (diskType('Data') || isSubpool($name)):?>
$('#autotrim').hide(t);
$('#diskAutotrim').prop('disabled',true);
<?else:?>
if (fsType == 'auto') {
$('#autotrim').hide(t);
$('#diskAutotrim').prop('disabled',true);
} else {
$('#autotrim').show(t);
$('#diskAutotrim').prop('disabled',false);
}
<?endif;?>
if (fstype=='reiserfs') $('#reiserfs').show(); else $('#reiserfs').hide();
}
function prepareDeviceInfo(form) {
var events = [];
@@ -529,14 +614,10 @@ function renamePoolPopup() {
});
dialogStyle();
}
function deletePool() {
$.cookie('deletepool','deletepool');
document.deletepool.submit();
}
function eraseDisk(name) {
swal({
title:"_(Erase Device Content)_?",
text:"<?=$text?><p style='font-weight:bold;color:red;margin:8px 0'>_(Existing content is permanently lost)_</p>",
text:"<?=$textErase?><p style='font-weight:bold;color:red;margin:8px 0'>_(Existing content is permanently lost)_</p>",
html:true,
type:'input',
inputPlaceholder:"<?=sprintf(_('To confirm your action type: %s'),$name)?>",
@@ -550,8 +631,37 @@ function eraseDisk(name) {
swal.close();
$('#doneButton').prop('disabled',true);
$('#eraseButton').prop('disabled',true);
$('#removeButton').prop('disabled',true);
$('div.spinner.fixed').show();
$.get("/update.htm",{cmdWipefs:name,csrf_token:"<?=_var($var,'csrf_token')?>"},function(){
$.post("/update.htm",{cmdWipefs:name},function(){
$('div.spinner.fixed').hide();
refresh();
});
} else {
if (confirm.length) swal({title:"_(Incorrect confirmation)_",text:"_(Please try again)_!",type:'error',html:true,confirmButtonText:"_(Ok)_"});
}
});
}
function removePool(name) {
swal({
title:"_(Remove pool)_?",
text:"<?=$textDelete?>",
html:true,
type:'input',
inputPlaceholder:"<?=sprintf(_('To confirm your action type: %s'),$name)?>",
showCancelButton:true,
closeOnConfirm:false,
confirmButtonText:"_(Proceed)_",
cancelButtonText:"_(Cancel)_"
},
function(confirm){
if (confirm == "<?=$name?>") {
swal.close();
$('#doneButton').prop('disabled',true);
$('#eraseButton').prop('disabled',true);
$('#removeButton').prop('disabled',true);
$('div.spinner.fixed').show();
$.post("/update.htm",{changeSlots:"apply",poolName:name,poolSlots:0},function(){
$('div.spinner.fixed').hide();
refresh();
});
@@ -601,7 +711,7 @@ _(Spinup group(s))_:
: <input type="text" name="diskSpinupGroup.<?=_var($disk,'idx',0)?>" maxlength="256" value="<?=_var($disk,'spinupGroup')?>">
<?endif;?>
<?if (diskType('Data') || isPool($tag)):?>
<?if (diskType('Data','Parity') || isPool($tag)):?>
_(Spin down delay)_:
: <select name="diskSpindownDelay.<?=_var($disk,'idx',0)?>">
<?=mk_option(_var($disk,'spindownDelay'), "-1", _('Use default'))?>
@@ -620,87 +730,36 @@ _(Spin down delay)_:
<?=mk_option(_var($disk,'spindownDelay'), "9", "9 "._('hours'))?>
</select><span id="smart_selftest" class='orange-text'></span>
<?endif;?>
<?if (diskType('Data') || (isPool($tag) && !isSubpool($tag))):?>
_(File system status)_:
: <?=_(_var($disk,'fsStatus'))?>&nbsp;
<?$fsTypeImmutable = (_var($var,'fsState')=="Stopped" && !empty(_var($disk,'uuid'))) || (_var($var,'fsState')=="Started" && _var($disk,'fsType')!='auto')?>
<?if (diskType('Data') || (!isSubpool($name) && _var($disk,'slots',0)==1)):?>
_(File system type)_:
: <select id="diskFsType" name="diskFsType.<?=_var($disk,'idx',0)?>" onchange="changeFsType()" <?=disabled_if($fsTypeImmutable)?>>
: <select id="diskFsType" name="diskFsType.<?=_var($disk,'idx')?>" onchange="selectDiskFsProfile(false)" <?=disabled_if($fsTypeImmutable)?>>
<?=mk_option(_var($disk,'fsType'), "auto", _('auto'))?>
<?=mk_option(_var($disk,'fsType'), "xfs", _('xfs'))?>
<?if (_var($disk,'slots',1) == 1) echo mk_option(_var($disk,'fsType'), "xfs", _('xfs'))?>
<?=mk_option(_var($disk,'fsType'), "zfs", _('zfs'))?>
<?=mk_option(_var($disk,'fsType'), "btrfs", _('btrfs'))?>
<?=mk_option(_var($disk,'fsType'), "reiserfs", _('reiserfs'), "disabled")?>
<?=mk_option(_var($disk,'fsType'), "luks:xfs", _('xfs')." - "._('encrypted'))?>
<?if (_var($disk,'slots',1) == 1) echo mk_option(_var($disk,'fsType'), "reiserfs", _('reiserfs'), "disabled")?>
<?if (_var($disk,'slots',1) == 1) echo mk_option(_var($disk,'fsType'), "luks:xfs", _('xfs')." - "._('encrypted'))?>
<?=mk_option(_var($disk,'fsType'), "luks:zfs", _('zfs')." - "._('encrypted'))?>
<?=mk_option(_var($disk,'fsType'), "luks:btrfs", _('btrfs')." - "._('encrypted'))?>
<?=mk_option(_var($disk,'fsType'), "luks:reiserfs", _('reiserfs')." - "._('encrypted'), "disabled")?>
<?if (_var($disk,'slots',1) == 1) echo mk_option(_var($disk,'fsType'), "luks:reiserfs", _('reiserfs')." - "._('encrypted'), "disabled")?>
</select><span id="reiserfs" class="warning"<?if (!fsType('reiserfs')):?> style="display:none"<?endif;?>><i class="fa fa-warning"></i>&nbsp;_(ReiserFS is deprecated, please use another file system)_!</span>
:info_file_system_help:
<?elseif (!isSubpool($name) && _var($disk,'slots',0)>1):?>
_(File system type)_:
: <select id="diskFsType" name="diskFsType.<?=_var($disk,'idx',0)?>" onchange="selectDiskFsProfile(false)" <?=disabled_if($fsTypeImmutable)?>>
<?=mk_option(_var($disk,'fsType'), "auto", _('auto'))?>
<?=mk_option(_var($disk,'fsType'), "zfs", _('zfs'))?>
<?=mk_option(_var($disk,'fsType'), "btrfs", _('btrfs'))?>
<?=mk_option(_var($disk,'fsType'), "luks:zfs", _('zfs')." - "._('encrypted'))?>
<?=mk_option(_var($disk,'fsType'), "luks:btrfs", _('btrfs')." - "._('encrypted'))?>
</select>
<select id="diskFsProfileBTRFS" name="diskFsProfile.<?=_var($disk,'idx',0)?>" style="display:none" <?=disabled_if($fsTypeImmutable)?>>
<?=mk_option(_var($disk,'fsProfile'),"single", _('single'))?>
<?if (_var($disk,'slots',0)>=2) echo mk_option(_var($disk,'fsProfile'),"raid0", _('raid0'))?>
<?if (_var($disk,'slots',0)>=2) echo mk_option(_var($disk,'fsProfile'),"raid1", _('raid1'))?>
<?if (_var($disk,'slots',0)>=3) echo mk_option(_var($disk,'fsProfile'),"raid1c3", _('raid1c3'))?>
<?if (_var($disk,'slots',0)>=4) echo mk_option(_var($disk,'fsProfile'),"raid1c4", _('raid1c4'))?>
<?if (_var($disk,'slots',0)>=4) echo mk_option(_var($disk,'fsProfile'),"raid10", _('raid10'))?>
<?if (_var($disk,'slots',0)>=3) echo mk_option(_var($disk,'fsProfile'),"raid5", _('raid5'))?>
<?if (_var($disk,'slots',0)>=4) echo mk_option(_var($disk,'fsProfile'),"raid6", _('raid6'))?>
</select>
<select id="diskFsProfileZFS" name="diskFsProfile.<?=_var($disk,'idx',0)?>" style="display:none" onchange="selectDiskFsWidth()" <?=disabled_if($fsTypeImmutable)?>>
<?if (_var($disk,'slots',0)==1) echo mk_option(_var($disk,'fsProfile'),"", _('single'))?>
<?if (_var($disk,'slots',0)>=2) echo mk_option(_var($disk,'fsProfile'),"", _('stripe'))?>
<?if ((_var($disk,'slots',0)%2)==0 || (_var($disk,'slots',0)%3)==0 || (_var($disk,'slots',0)%4)==0) echo mk_option(_var($disk,'fsProfile'),"mirror", _('mirror'))?>
<?if (_var($disk,'slots',0)>=3) echo mk_option(_var($disk,'fsProfile'),"raidz1", _('raidz'))?>
<?if (_var($disk,'slots',0)>=3) echo mk_option(_var($disk,'fsProfile'),"raidz2", _('raidz2'))?>
<?if (_var($disk,'slots',0)>=4) echo mk_option(_var($disk,'fsProfile'),"raidz3", _('raidz3'))?>
</select>
<select id="diskFsWidthZFS" name="diskFsWidth.<?=_var($disk,'idx',0)?>" style="display:none" <?=disabled_if($fsTypeImmutable)?>>
</select>
<?elseif (isSubpool($name)=="special" || isSubpool($name)=="logs" || isSubpool($name)=="dedup"):?>
_(File system type)_:
: <select id="diskFsType" name="diskFsType.<?=_var($disk,'idx',0)?>" onchange="selectDiskFsProfile(false)" <?=disabled_if($fsTypeImmutable)?>>
<?=mk_option(_var($disk,'fsType'), "zfs", _('zfs'))?>
</select>
<select id="diskFsProfileZFS" name="diskFsProfile.<?=_var($disk,'idx',0)?>" onchange="selectDiskFsWidth()" <?=disabled_if($fsTypeImmutable)?>>
<?if (_var($disk,'slots',0)==1) echo mk_option(_var($disk,'fsProfile'),"", _('single'))?>
<?if (_var($disk,'slots',0)>=2) echo mk_option(_var($disk,'fsProfile'),"", _('stripe'))?>
<?if ((_var($disk,'slots',0)%2)==0 || (_var($disk,'slots',0)%3)==0 || (_var($disk,'slots',0)%4)==0) echo mk_option(_var($disk,'fsProfile'),"mirror", _('mirror'))?>
</select>
<select id="diskFsWidthZFS" name="diskFsWidth.<?=_var($disk,'idx',0)?>" style="display:none" <?=disabled_if($fsTypeImmutable)?>>
</select>
<?elseif (isSubpool($name)=="cache"):?>
_(File system type)_:
: <select id="diskFsType" name="diskFsType.<?=_var($disk,'idx',0)?>" onchange="selectDiskFsProfile(false)" <?=disabled_if($fsTypeImmutable)?>>
<?=mk_option(_var($disk,'fsType'), "zfs", _('zfs'))?>
</select>
<select id="diskFsProfileZFS" name="diskFsProfile.<?=_var($disk,'idx',0)?>" onchange="selectDiskFsWidth()" <?=disabled_if($fsTypeImmutable)?>>
<?if (_var($disk,'slots',0)==1) echo mk_option(_var($disk,'fsProfile'),"", _('single'))?>
<?if (_var($disk,'slots',0)>=2) echo mk_option(_var($disk,'fsProfile'),"", _('stripe'))?>
</select>
<select id="diskFsWidthZFS" name="diskFsWidth.<?=_var($disk,'idx',0)?>" style="display:none" <?=disabled_if($fsTypeImmutable)?>>
</select>
<?elseif (isSubpool($name)=="spares"):?>
_(File system type)_:
: <select id="diskFsType" name="diskFsType.<?=_var($disk,'idx',0)?>" onchange="selectDiskFsProfile(false)" <?=disabled_if($fsTypeImmutable)?>>
<?=mk_option(_var($disk,'fsType'), "zfs", _('zfs'))?>
</select>
<?endif;?>
<?if (isSubpool($name)===false):?>
<div markdown="1" id="compression" style="display:none">
<?if (diskType('Data') || isPool($tag)):?>
<div markdown="1" id="profile">
_(Allocation profile)_:
: <select id="diskFsProfile" name="diskFsProfile.<?=_var($disk,'idx')?>" <?=disabled_if($fsProfileImmutable)?>>
</select>
<select id="diskFsWidth" name="diskFsWidth.<?=_var($disk,'idx')?>" <?=disabled_if($fsProfileImmutable)?>>
</select>
:info_profile_help:
</div>
<div markdown="1" id="compression">
_(Compression)_:
: <select id="diskCompression" name="diskCompression.<?=_var($disk,'idx',0)?>" <?=disabled_if(_var($disk,'fsStatus')=='Mounted')?>>
<?=mk_option(_var($disk,'compression'), "off", _('Off'))?>
@@ -709,8 +768,7 @@ _(Compression)_:
:info_compression_help:
</div>
<div markdown="1" id="autotrim" style="display:none">
<div markdown="1" id="autotrim">
_(Autotrim)_:
: <select id="diskAutotrim" name="diskAutotrim.<?=_var($disk,'idx',0)?>" <?=disabled_if(_var($disk,'fsStatus')=='Mounted')?>>
<?=mk_option(_var($disk,'autotrim'), "on", _('On'))?>
@@ -719,7 +777,8 @@ _(Autotrim)_:
:info_autotrim_help:
</div>
<?if (isPool($name)):?>
<?endif;?>
<?if (isPool($tag) && !isSubpool($tag)):?>
_(Enable user share assignment)_:
: <select id="shareEnabled" name="diskShareEnabled.<?=_var($disk,'idx',0)?>" onchange="freeSpace(this.value)" <?=disabled_if(_var($var,'fsState')!="Stopped")?>>
<?=mk_option(_var($disk,'shareEnabled'), "yes", _('Yes'))?>
@@ -735,6 +794,7 @@ _(Minimum free space)_:
:info_free_space_help:
<?endif;?>
<?if (diskType('Data') || (isPool($tag) && !isSubpool($tag))):?>
_(Warning disk utilization threshold)_ (%):
: <input type="number" min="0" max="100" name="diskWarning.<?=_var($disk,'idx',0)?>" autocomplete="off" spellcheck="false" class="narrow" value="<?=_var($disk,'warning')?>" placeholder="<?=_var($display,'warning')?>">
@@ -745,23 +805,21 @@ _(Critical disk utilization threshold)_ (%):
:info_critical_utilization_help:
<?endif;?>
<?endif;?>
&nbsp;
: <input type="submit" name="changeDisk" value="_(Apply)_" disabled><input type="button" id="doneButton" value="_(Done)_" onclick="done()">
<?$erasable=false?>
<?$removeable=false?>
<?if (diskType('Parity','Data')):?>
<?if (_var($var,'fsState')=="Stopped" && diskStatus('_NEW')): $erasable=true; endif;?>
<?if (_var($var,'fsState')=="Started" && _var($var,'startMode')!="Normal" && diskType('Data')): $erasable=true; endif;?>
<input type="button" id="eraseButton" value="_(Erase)_" onclick="eraseDisk('<?=$name?>')"<?=$erasable?'':' disabled'?>>
<?endif;?>
<?if (isPool($name) && strpos($name,$_tilde_)===false):?>
<?if (isPool($name) && isSubpool($name)===false):?>
<?if (_var($var,'fsState')=="Stopped" || (_var($var,'fsState')=="Started" && _var($var,'startMode')!="Normal")): $erasable=true; endif;?>
<input type="button" id="eraseButton" value="_(Erase)_" onclick="eraseDisk('<?=$name?>')"<?=$erasable?'':' disabled'?>>
<?endif;?>
<?if (_var($var,'fsState')=="Stopped" && isPool($name)):?>
<?$empty = _var($disk,'devices',0)==0?>
<input type="button" value="_(Delete Pool)_" onclick="deletePool()"<?=$empty?'':' disabled'?>><?if (!$empty):?>_(Unassign **ALL** devices to delete this pool)_<?endif;?>
<input type="button" id="eraseButton" value="_(Erase Pool)_" onclick="eraseDisk('<?=$name?>')"<?=$erasable?'':' disabled'?>>
<?if (_var($var,'fsState')=="Stopped"): $removeable=true; endif;?>
<input type="button" id="removeButton" value="_(Remove Pool)_" onclick="removePool('<?=$name?>')"<?=$removeable?'':' disabled'?>>
<?endif;?>
</form>
@@ -1359,19 +1417,13 @@ _(SMART attribute notifications)_:
<form markdown="1" method="POST" action="/update.htm" target="progressFrame" onsubmit="return validate(this.poolName.value)">
<input type="hidden" name="poolNameOrig" value="<?=$name?>">
<input type="hidden" name="changeSlots" value="apply">
<p>_(Caution)_: _(Renaming the pool will change the share storage allocations)_. _(After renaming the pool, check that your shares are assigned to the proper primary and secondary storage locations)_.</p>
_(Name)_:
: <input type="text" name="poolName" maxlength="40" value="<?=$name?>">
</form>
</div>
<form name="deletepool" method="POST" action="/update.htm" target="progressFrame" style="display:none">
<input type="hidden" name="changeSlots" value="apply">
<input type="hidden" name="poolName" value="<?=$name?>">
<input type="hidden" name="poolSlots" value="0">
<input type='hidden' name='csrf_token' value='<?=_var($var,'csrf_token')?>'>
</form>
<script>
$(function() {
<?if (count($sheets)>1):?>

View File

@@ -154,7 +154,7 @@ _(Enable spinup groups)_:
:disk_spinup_groups_help:
_(Default file system)_:
_(Default file system for Array disks)_:
: <select name="defaultFsType">
<?=mk_option($var['defaultFsType'], "xfs", _('xfs'));?>
<?=mk_option($var['defaultFsType'], "zfs", _('zfs'));?>

View File

@@ -251,10 +251,9 @@ _(Temperature unit)_:
_(Dynamix color theme)_:
: <select name="theme">
<?foreach (glob("$docroot/webGui/styles/themes/*.css") as $themes):?>
<?= var_dump($themes);?>
<?$theme = basename($themes, '.css');?>
<?=mk_option($display['theme'], $theme, _(ucfirst($theme)))?>
<?foreach (glob("$docroot/webGui/styles/dynamix-*.css") as $themes):?>
<?$theme = substr(basename($themes,'.css'),8);?>
<?=mk_option($display['theme'], $theme, _(ucfirst($theme)))?>
<?endforeach;?>
</select>

View File

@@ -60,8 +60,8 @@ foreach ($ports as $ethX) {
}
}
// enable interface only when VMs and Docker are stopped
$service = exec("pgrep libvirt") ? _('VM manager') : '';
$service .= exec("pgrep docker") ? ($service ? ' '._('and').' ' : '')._('Docker service') : '';
$service = exec('pgrep --ns $$ libvirt') ? _('VM manager') : '';
$service .= exec('pgrep --ns $$ docker') ? ($service ? ' '._('and').' ' : '')._('Docker service') : '';
// eth0 port status
$no_eth0 = exec("ip link show eth0|grep -Pom1 '(NO-CARRIER|state DOWN)'");

View File

@@ -22,7 +22,7 @@ $installed = ['English'];
$plugins = '/var/log/plugins';
$keys = parse_ini_file('webGui/include/languages.key',false,INI_SCANNER_RAW);
$head = '<i class="fa fa-fw fa-trash" title="_(Remove the installed language)_" style="cursor:pointer" onclick="removeLanguage(&quot;';
$head = '<i class="fa fa-fw fa-trash" title="_(Remove the installed language)_" style="cursor:pointer" onclick="remove(&quot;';
$tail = '&quot;)"></i>';
foreach (glob("$plugins/lang-*.xml",GLOB_NOSORT) as $xml_file) $installed[] = language('LanguageLocal',$xml_file).$head.str_replace('lang-','',basename($xml_file,'.xml')).$tail;
@@ -47,7 +47,7 @@ function execute(cmd,title,language,name,filedata) {
}
});
}
function removeLanguage(language) {
function remove(language) {
execute('rm', "_(Language support deleted)_", language, '', '');
}
function upload(form) {

View File

@@ -117,51 +117,122 @@ if ($cert2Present) {
}
}
// Tailscale LE cert
$cert3File = "/boot/config/ssl/certs/ts_bundle.pem";
$cert3Present = file_exists("$cert3File");
if ($cert3Present) {
$cert3Subject = exec("/usr/bin/openssl x509 -in $cert3File -noout -subject -nameopt multiline 2>/dev/null|sed -n 's/ *commonName *= //p'");
$cert3Issuer = exec("/usr/bin/openssl x509 -in $cert3File -noout -text | sed -n -e 's/^.*Issuer: //p'");
$cert3Expires = exec("/usr/bin/openssl x509 -in $cert3File -noout -text | sed -n -e 's/^.*Not After : //p'");
}
// Note: this disables FQDN6 urls since they are not supported by myunraid.net DNS currently
if (!empty($nginx['NGINX_LANFQDN6'])) unset($nginx['NGINX_LANFQDN6']);
$http_port = _var($var,'PORT','80') != '80' ? ":{$var['PORT']}" : '';
$https_port = _var($var,'PORTSSL','443') != '443' ? ":{$var['PORTSSL']}" : '';
$http_ip_url = "http://"._var($nginx,'NGINX_LANIP')."{$http_port}/";
$https_ip_url = "https://"._var($nginx,'NGINX_LANIP')."{$https_port}/";
$http_ip6_url = "http://["._var($nginx,'NGINX_LANIP6')."]{$http_port}/";
$https_ip6_url = "https://["._var($nginx,'NGINX_LANIP6')."]{$https_port}/";
$http_mdns_url = "http://"._var($nginx,'NGINX_LANMDNS')."{$http_port}/";
$https_mdns_url = "https://"._var($nginx,'NGINX_LANMDNS')."{$https_port}/";
$https_fqdn_url = "https://"._var($nginx,'NGINX_LANFQDN')."{$https_port}/";
$https_fqdn6_url = "https://"._var($nginx,'NGINX_LANFQDN6')."{$https_port}/";
$http_ip_url = 'http://'._var($nginx,'NGINX_LANIP').$http_port.'/';
$https_ip_url = 'https://'._var($nginx,'NGINX_LANIP').$https_port.'/';
// bare IPv6 addresses need to be surrounded in brackets
$http_ip6_url = 'http://'.'['._var($nginx,'NGINX_LANIP6').']'.$http_port.'/';
$https_ip6_url = 'https://'.'['._var($nginx,'NGINX_LANIP6').']'.$https_port.'/';
$http_mdns_url = 'http://'._var($nginx,'NGINX_LANMDNS').$http_port.'/';
$https_mdns_url = 'https://'._var($nginx,'NGINX_LANMDNS').$https_port.'/';
$https_fqdn_url = 'https://'._var($nginx,'NGINX_LANFQDN').$https_port.'/';
$https_fqdn6_url = 'https://'._var($nginx,'NGINX_LANFQDN6').$https_port.'/';
$urls = [];
// push an array of four values into the $urls array:
// 0 - the url
// 1 - the url it redirects to, or null
// 2 - the certificate file used, or null
// 3 - self-signed certificate, or false
// push an array of five values into the $urls array:
// 0 - type of url ['LAN','WAN','WG','TAILSCALE']
// 1 - the url
// 3 - the url it redirects to, or null
// 4 - the certificate file used, or null
// 5 - self-signed certificate, or false
// define LAN access urls and redirects that change based on USE_SSL setting
switch(_var($var,'USE_SSL','no')) {
case 'no':
if (!empty($nginx['NGINX_LANIP'])) $urls[] = [$http_ip_url, null, null, false];
if (!empty($nginx['NGINX_LANIP6'])) $urls[] = [$http_ip6_url, null, null, false];
if (!empty($nginx['NGINX_LANMDNS'])) $urls[] = [$http_mdns_url, null, null, false];
if (!empty($nginx['NGINX_LANFQDN'])) $urls[] = [$https_fqdn_url, null, "certificate_bundle.pem", false];
if (!empty($nginx['NGINX_LANFQDN6'])) $urls[] = [$https_fqdn6_url, null, "certificate_bundle.pem", false];
if (!empty($nginx['NGINX_LANIP'])) $urls[] = ['LAN', $http_ip_url, null, null, false];
if (!empty($nginx['NGINX_LANIP6'])) $urls[] = ['LAN', $http_ip6_url, null, null, false];
if (!empty($nginx['NGINX_LANMDNS'])) $urls[] = ['LAN', $http_mdns_url, null, null, false];
break;
case 'yes':
if (!empty($nginx['NGINX_LANIP'])) $urls[] = [$http_ip_url, $https_ip_url, null, false];
if (!empty($nginx['NGINX_LANIP'])) $urls[] = [$https_ip_url, null, "{$var['NAME']}_unraid_bundle.pem", $cert1SelfSigned];
if (!empty($nginx['NGINX_LANIP6'])) $urls[] = [$http_ip6_url, $https_ip6_url, null, false];
if (!empty($nginx['NGINX_LANIP6'])) $urls[] = [$https_ip6_url, null, "{$var['NAME']}_unraid_bundle.pem", $cert1SelfSigned];
if (!empty($nginx['NGINX_LANMDNS'])) $urls[] = [$http_mdns_url, $https_mdns_url, null, false];
if (!empty($nginx['NGINX_LANMDNS'])) $urls[] = [$https_mdns_url, null, "{$var['NAME']}_unraid_bundle.pem", $cert1SelfSigned];
if (!empty($nginx['NGINX_LANFQDN'])) $urls[] = [$https_fqdn_url, null, "certificate_bundle.pem", false];
if (!empty($nginx['NGINX_LANFQDN6'])) $urls[] = [$https_fqdn6_url, null, "certificate_bundle.pem", false];
if (!empty($nginx['NGINX_LANIP'])) $urls[] = ['LAN', $http_ip_url, $https_ip_url, null, false];
if (!empty($nginx['NGINX_LANIP'])) $urls[] = ['LAN', $https_ip_url, null, "{$var['NAME']}_unraid_bundle.pem", $cert1SelfSigned];
if (!empty($nginx['NGINX_LANIP6'])) $urls[] = ['LAN', $http_ip6_url, $https_ip6_url, null, false];
if (!empty($nginx['NGINX_LANIP6'])) $urls[] = ['LAN', $https_ip6_url, null, "{$var['NAME']}_unraid_bundle.pem", $cert1SelfSigned];
if (!empty($nginx['NGINX_LANMDNS'])) $urls[] = ['LAN', $http_mdns_url, $https_mdns_url, null, false];
if (!empty($nginx['NGINX_LANMDNS'])) $urls[] = ['LAN', $https_mdns_url, null, "{$var['NAME']}_unraid_bundle.pem", $cert1SelfSigned];
break;
case 'auto': // aka strict
if (!empty($nginx['NGINX_LANIP'])) $urls[] = [$http_ip_url, $https_fqdn_url, null, false];
if (!empty($nginx['NGINX_LANIP6'])) $urls[] = [$http_ip6_url, $https_fqdn6_url, null, false];
if (!empty($nginx['NGINX_LANMDNS'])) $urls[] = [$http_mdns_url, $https_fqdn_url, null, false];
if (!empty($nginx['NGINX_LANFQDN'])) $urls[] = [$https_fqdn_url, null, "certificate_bundle.pem", false];
if (!empty($nginx['NGINX_LANFQDN6'])) $urls[] = [$https_fqdn6_url, null, "certificate_bundle.pem", false];
if (!empty($nginx['NGINX_LANIP']) && !empty($nginx['NGINX_LANFQDN'])) $urls[] = ['LAN', $http_ip_url, $https_fqdn_url, null, false];
if (!empty($nginx['NGINX_LANIP6']) && !empty($nginx['NGINX_LANFQDN6'])) $urls[] = ['LAN', $http_ip6_url, $https_fqdn6_url, null, false];
if (!empty($nginx['NGINX_LANMDNS']) && !empty($nginx['NGINX_LANFQDN'])) $urls[] = ['LAN', $http_mdns_url, $https_fqdn_url, null, false];
break;
}
// define FQDN urls for each interface
// when multiple FQDN urls are available for a given interface, make sure they are sorted
asort($nginx);
foreach ($nginx as $key => $host) {
if (!$host) continue;
// Only process keys that include 'FQDN'
if (strpos($key, 'FQDN') === false) continue;
// Extract the interface from the key, e.g., 'NGINX_LANFQDN' -> 'LAN', 'NGINX_WANFQDN' -> 'WAN', NGINX_WG0FQDN -> WG, NGINX_TAILSCALE1FQDN -> TAILSCALE
// Note: this specifically excludes FQDN6 urls since they are not supported by myunraid.net DNS currently
if (preg_match('/^NGINX_([A-Z]+)(\d*)FQDN$/', $key, $matches)) {
$interface = $matches[1]; // Interface type (LAN, WAN, WG, TAILSCALE, etc.)
// ignore the WAN interface because we don't have access to the WANPORT here
if ($interface == "WAN") continue;
$pem = null;
if (str_ends_with($host, '.myunraid.net')) $pem = 'certificate_bundle.pem';
elseif (str_ends_with($host, '.ts.net')) $pem = 'ts_bundle.pem';
$url = 'https://'.$host.$https_port."/";
$urls[] = [$interface, $url, null, $pem, false];
}
}
// determine whether there are urls for a given interface
function has_urls($interface) {
global $urls;
foreach($urls as $url) {
if ($url[0] == $interface) return true;
}
return false;
}
// show all urls for a given interface
function show_urls($interface) {
global $urls;
// 0 - type of url ['LAN','WAN','WG','TAILSCALE']
// 1 - the url
// 3 - the url it redirects to, or null
// 4 - the certificate file used, or null
// 5 - self-signed certificate, or false
$output = "";
$linestart = "<dt>&nbsp;</dt><dd>";
$lineend = "</dd>\n";
$first = true;
foreach($urls as $url) {
if ($url[0] == $interface) {
$msg = "<a href='$url[1]'>$url[1]</a>";
if ($url[2]) $msg .= " "._("redirects to")." <a href='$url[2]'>$url[2]</a>";
if ($url[3]) $msg .= " "._("uses")." ".$url[3];
if ($url[4]) $msg .= "<span class='warning'> <i class='fa fa-warning fa-fw'></i> "._("is a self-signed certificate, ignore the browser's warning and proceed to the GUI")."</span>";
// 2nd+ urls need leading $linestart
$output .= ($first ? "" : $linestart).$msg.$lineend;
$first = false;
}
}
if ($first) {
$output = "none";
} else {
// strip final trailing $lineend as it will be added by markdown
$output = substr($output, 0, strlen($lineend)*-1);
}
echo $output;
}
$cert_time_format = $display['date'].($display['date']!='%c' ? ', '.str_replace(['%M','%R'],['%M:%S','%R:%S'],$display['time']):'');
$provisionlabel = $isWildcardCert ? _('Renew') : _('Provision');
$disabled_provision = $keyfile===false || ($isWildcardCert && $retval_expired===0) || !$addr ? 'disabled' : '';
@@ -334,24 +405,34 @@ _(Local TLD)_:
</form>
<hr>
_(Local access URLs)_:
: <?
// url[0] = url
// url[1] = redirect url or null
// url[2] = certificate used or null
// url[3] = is certificate self-signed T/F
$n = 0;
foreach($urls as $url) {
$msg = "";
if ($url[1]) $msg .= " "._("redirects to")." <a href='$url[1]'>$url[1]</a>";
if ($url[2]) $msg .= " "._("uses")." ".$url[2];
if ($url[3]) $msg .= "<span class='warning'> <i class='fa fa-warning fa-fw'></i> "._("is a self-signed certificate, ignore the browser's warning and proceed to the GUI")."</span>";
echo ($n ? "<dt>&nbsp;</dt><dd>" : ""),"<a href='$url[0]'>$url[0]</a>$msg",($n++ ? "</dd>" : "");
}?>
: <? show_urls('LAN'); ?>
:mgmt_local_access_urls_help:
<?if (has_urls('WG')): ?>
_(WireGuard URLs)_:
: <? show_urls('WG'); ?>
:mgmt_wg_access_urls_help:
<?endif;?>
<?if (has_urls('TAILSCALE')): ?>
_(Tailscale URLs)_:
: <? show_urls('TAILSCALE'); ?>
:mgmt_tailscale_access_urls_help:
<?endif;?>
<?if ($cert1Present):?>
<hr>
_(Self-signed or user-provided certificate)_:
: <?=$cert1File?>
@@ -386,6 +467,9 @@ _(Self-signed certificate file)_:
<input type="hidden" name="server_name" value="<?=strtok(_var($_SERVER,'HTTP_HOST'),":")?>">
<input type="hidden" name="server_addr" value="<?=_var($_SERVER,'SERVER_ADDR')?>">
<?if ($cert2Present):?>
<hr>
_(Unraid Let's Encrypt certificate)_:
: <?=$cert2File?>
@@ -415,6 +499,31 @@ _(CA-signed certificate file)_:
&nbsp;
: <button type="submit" name="changePorts" value="Provision" <?=$disabled_provision?>><?=$provisionlabel?></button><button type="submit" name="changePorts" value="Delete" <?=$disabled_delete?> >_(Delete)_</button><?=$disabled_provision_msg?>
<?if ($cert3Present):?>
<hr>
_(Tailscale Let's Encrypt certificate)_:
: <?=$cert3File?>
_(Certificate URL)_:
: <?="<a href='https://$cert3Subject$https_port'>$cert3Subject</a>"?>
_(Certificate issuer)_:
: <?=$cert3Issuer?>
_(Certificate expiration)_:
: <?=_(my_date($cert_time_format, strtotime($cert3Expires)),0)?>
<?endif;?>
:mgmt_certificate_expiration_help:
</form>
<?if (has_urls('WG')): ?>
<small>"WireGuard" and the "WireGuard" logo are registered trademarks of Jason A. Donenfeld</small>
<?endif;?>

View File

@@ -88,7 +88,7 @@ _(Select Proxy)_:
>
> Outgoing connections from the webgui and some system processes will use the specified http proxy. Docker container installs and updates will use the proxy, but the container itself will not, neither will any VMs.
>
> For a more comprehensive solution you might consider setting up <u><a href='https://docs.unraid.net/unraid-os/manual/security/vpn/#configuring-vpn-tunneled-access-for-system/' target='_blank'>_(VPN tunnel access for System)_</a></u>.
> For a more comprehensive solution you might consider setting up <u><a href='https://docs.unraid.net/go/configuring-vpn-tunneled-access-for-system/' target='_blank'>_(VPN tunnel access for System)_</a></u>.
:end
<p><strong>_(Outgoing Proxy)_ 1</strong></p>

View File

@@ -22,13 +22,13 @@ $conf = file_exists($ini) ? parse_ini_file($ini) : [];
if (!file_exists($log)) touch($log);
?>
<link type="text/css" rel="stylesheet" href="<?autov("/webGui/styles/jquery.ui.css")?>">
<link type="text/css" rel="stylesheet" href="<?autov("/plugins/dynamix.docker.manager/styles/DockerManager.css")?>">
<link type="text/css" rel="stylesheet" href="<?autov("/plugins/dynamix.docker.manager/styles/style-$theme.css")?>">
<div markdown="1" style="width:43%;margin-bottom:40px;padding:5px 15px;border:solid 1px">
:php_settings_plug:
This utility is used for development purposes only and allows Plugin Authors to verify their PHP code by enabling different levels of PHP error reporting.
By default error logging is minimum and any errors are shown on screen. Changing the **Error reporting level** will capture the selected level of errors
By default error logging is minimum and errors are not shown on screen. Changing the **Error reporting level** will capture the selected level of errors
into a LOG file, which can be opened in a separate window to monitor in real-time the events when visiting various GUI pages or executing background
processes on the server.
@@ -46,12 +46,12 @@ under normal running conditions.
<input type="hidden" name="log_errors" value="1">
_(Error reporting level)_:
: <select name="error_reporting" onchange="toggleScreen(this.selectedIndex)">
<?=mk_option(_var($conf,'error_reporting'), "", "_(Default)_");?>
<?=mk_option(_var($conf,'error_reporting'), "32767", "_(All Categories)_");?>
<?=mk_option(_var($conf,'error_reporting'), "1", "_(Errors Only)_");?>
<?=mk_option(_var($conf,'error_reporting'), "2", "_(Warnings Only)_");?>
<?=mk_option(_var($conf,'error_reporting'), "8", "_(Notices Only)_");?>
<?=mk_option(_var($conf,'error_reporting'), "8192", "_(Deprecated Only)_");?>
<?=mk_option(_var($conf,'error_reporting'), strval(E_ALL & ~E_NOTICE & ~E_WARNING & ~E_DEPRECATED), "_(Default)_");?>
<?=mk_option(_var($conf,'error_reporting'), strval(E_ALL), "_(All Categories)_");?>
<?=mk_option(_var($conf,'error_reporting'), strval(E_ERROR), "_(Errors Only)_");?>
<?=mk_option(_var($conf,'error_reporting'), strval(E_WARNING), "_(Warnings Only)_");?>
<?=mk_option(_var($conf,'error_reporting'), strval(E_NOTICE), "_(Notices Only)_");?>
<?=mk_option(_var($conf,'error_reporting'), strval(E_DEPRECATED), "_(Deprecated Only)_");?>
</select>
&nbsp;
@@ -147,11 +147,12 @@ function PHPinfo() {
}
function preset(form) {
// reset to default settings
// derived from default .ini file installed at boot
if (form.error_reporting.selectedIndex==0) {
form.error_log.value = "";
form.display_startup_errors.value = "";
form.display_errors.value = "";
form.log_errors.value = "";
form.error_log.value = "<?=$log?>";
form.display_startup_errors.value = "0";
form.display_errors.value = "0";
form.log_errors.value = "1";
}
$.cookie('reload_php',1);
}

View File

@@ -86,11 +86,11 @@ _(Enter route + gateway + metric)_:
<input type="text" name="gateway" class="fixed" value="" list="device" placeholder="_(gateway name or address)_" required>
<datalist id="device"><?foreach ($list as $port):?><?echo "<option value='$port'>"?><?endforeach;?></datalist>
<input type="text" name="metric" min="1" max="9999" value="" class="trim" placeholder="1"><i class="fa fa-sort-numeric-asc"></i> *_(optional metric (lowest is preferred))_*
<input type="hidden" name="task" value="Add Route">
:eth_routing_table_help:
&nbsp;
: <input type="submit" name="task" value="_(Add Route)_"><input type="button" value="_(Done)_" class="lock" onclick="done()">
: <input type="submit" value="_(Add Route)_"><input type="button" value="_(Done)_" class="lock" onclick="done()">
</form>
</div>
</div>

View File

@@ -19,6 +19,8 @@ Cond="(($var['shareSMBEnabled']!='no') && (isset($name)?array_key_exists($name,$
require_once "$docroot/webGui/include/InputSecurity.php";
$width = [123,300];
/* Sort user array by keys in natural order */
uksort($users, 'strnatcmp');
?>
:smb_security_help:

View File

@@ -50,6 +50,12 @@ $pools = array_filter($pools, function($pool) {
return !isSubpool($pool);
});
/* Check for cachePool2 only which is a situation where the primary device is the cachePool2 device. */
if ((! $share['cachePool']) && ($share['cachePool2'])) {
$share['cachePool'] = $share['cachePool2'];
$share['cachePool2'] = "";
}
/* Check for non existent pool device. */
if ($share['cachePool'] && !in_array($share['cachePool'], $pools)) {
$poolDefined = false;
@@ -61,16 +67,16 @@ if ($share['cachePool'] && !in_array($share['cachePool'], $pools)) {
/* Check for pool 2 (or array) being defined. */
if ((($share['useCache'] == "yes") || ($share['useCache'] == "prefer")) && ($poolsOnly) && (!$share['cachePool2'])) {
$poolDefined2 = false;
$share['useCache'] = "yes";
$poolDefined2 = true;
$share['useCache'] = "only";
} else if ($share['cachePool2']) {
$poolDefined2 = in_array($share['cachePool2'], $pools);
} else {
$poolDefined2 = true;
}
$cachePoolCapitalized = ucfirst($share['cachePool']);
$cachePoolCapitalized2 = $share['cachePool2'] ? ucfirst($share['cachePool2']) : _("Array");
$cachePoolCapitalized = compress(my_disk($share['cachePool'],$display['raw']));
$cachePoolCapitalized2 = $share['cachePool2'] ? compress(my_disk($share['cachePool2'],$display['raw'])) : _("Array");
function globalInclude($name) {
global $var;
@@ -535,14 +541,10 @@ _(Mover action)_:
&nbsp;
: <input type="submit" name="cmdEditShare" value="_(Add Share)_" onclick="this.value='Add Share'"><input type="button" value="_(Done)_" onclick="done()">
<?else:?>
<div markdown="1" class="empty">
_(Delete)_<input type="checkbox" name="confirmDelete" onchange="chkDelete(this.form, document.getElementById('cmdEditShare'));">
<div markdown="1">
<label id="deleteLabel" title="">_(Delete)_</label><input type="checkbox" name="confirmDelete" onchange="chkDelete(this.form, document.getElementById('cmdEditShare'));" title="" disabled>
: <input type="submit" id="cmdEditShare" name="cmdEditShare" value="_(Apply)_" onclick="if (this.value=='_(Delete)_') this.value='Delete'; else this.value='Apply'; return handleDeleteClick(this)" disabled><input type="button" value="_(Done)_" onclick="done()">
</div>
<div markdown="1" class="full">
&nbsp;
: <input type="submit" name="cmdEditShare" value="_(Apply)_" onclick="this.value='Apply'" disabled><input type="button" value="_(Done)_" onclick="done()">
</div>
<?endif;?>
</form>
@@ -638,6 +640,7 @@ function updateScreen(cache, slow) {
secondaryDropdown.options[i].disabled = true;
}
secondaryDropdown.selectedIndex = 0;
checkRequiredSecondary = false;
if (poolsOnly) {
$('#moverDirection2').hide();
@@ -1291,13 +1294,24 @@ function handleDeleteClick(button) {
$(function() {
<?if ($name):?>
<?
$tooltip_enabled = _('Share is empty and is safe to delete');
$tooltip_disabled = _('Share must be empty to be deleted');
?>
$.post('/webGui/include/ShareList.php', { scan: "<?=$name?>" }, function(e) {
if (e == 1) {
$('.empty').show();
$('.full').hide();
/* Enable delete checkbox and update tooltip. */
$('input[name="confirmDelete"]').prop('disabled', false).attr('title', '<?= $tooltip_enabled ?>');
$('#deleteLabel').attr('title', '<?= $tooltip_enabled ?>');
} else {
$('.full1').hide();
$('.full2').show();
/* Disable delete checkbox and update tooltip. */
$('input[name="confirmDelete"]').prop('disabled', true).attr('title', '<?= $tooltip_disabled ?>');
$('#deleteLabel').attr('title', '<?= $tooltip_disabled ?>');
}
});
<?endif;?>

View File

@@ -18,7 +18,7 @@ Cond="_var($var,'fsState')!='Stopped' && _var($var,'shareUser')=='e'"
<?
/* Function to filter out unwanted disks, check if any valid disks exist, and ignore disks with a blank device. */
function checkDisks($disks) {
global $pools, $poolsOnly;
global $pools;
$rc = false;
@@ -35,9 +35,6 @@ function checkDisks($disks) {
return $rc;
}
/* If the configuration is pools only, then no array disks are available. */
$poolsOnly = ((int)$var['SYS_ARRAY_SLOTS'] <= 2) ? true : false;
/* Are there any array disks? */
$disks = parse_ini_file('state/disks.ini',true) ?? [];
$nodisks = checkDisks($disks) ? "" : "disabled";

View File

@@ -103,7 +103,7 @@ function checkKey(form) {
// check syntax of ssh keys
var rows = form.text.value.split('\n');
for (var i=0,row; row=rows[i]; i++) {
if (row.search(/^(ssh-ed25519 AAAAC3NzaC1lZDI1NTE5|sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29t|ssh-rsa AAAAB3NzaC1yc2)[0-9A-Za-z+/]+[=]{0,3}(\s.*)?$/)==-1) {
if (row.search(/^(ssh-dss AAAAB3NzaC1kc3|ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNT|sk-ecdsa-sha2-nistp256@openssh.com AAAAInNrLWVjZHNhLXNoYTItbmlzdHAyNTZAb3BlbnNzaC5jb2|ssh-ed25519 AAAAC3NzaC1lZDI1NTE5|sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29t|ssh-rsa AAAAB3NzaC1yc2)[0-9A-Za-z+/]+[=]{0,3}(\s.*)?$/)==-1) {
swal({title:"_(Invalid Key)_",text:"["+(i+1)+"] "+row.split(' ')[0]+": _(Syntax of the key is incorrect)_!",type:"error",html:true,confirmButtonText:"_(Ok)_"});
return false;
}

View File

@@ -1032,14 +1032,13 @@ tstate['wg0'] = "<?=$check_wg0 ? 'active' : 'passive'?>";
var statistics = new NchanSubscriber('/sub/wireguard',{subscriber:'websocket'});
statistics.on('message', function(data) {
var list = [];
var rows = data.split('\0');
var list = [], n = [];
var x = 0; var vtun = '';
// get all existing tunnels
$('div[id^="block-wg"]').each(function(){list.push($(this).prop('id').split('-')[1]);});
// update active tunnels
for (var i=0,row; row=rows[i]; i++) {
var info = row.split(';');
var rows = JSON.parse(data);
for (var i=0,info; info=rows[i]; i++) {
if (info[0] != vtun) {
vtun = info[0];
// remove tunnel from inactive list
@@ -1281,7 +1280,7 @@ _(Local tunnel address IPv6)_:
</div>
</div>
_(Local endpoint)_:
: <span class="input"><input type="text" id="endpoint-wg0" name="Endpoint:0" class="subnet" value="<?=$vpn_wg0?'':_var($wg0,'Endpoint:0')?>" onchange="toLC(this);quickValidate(this);" pattern="<?=$validText?>" title="_(IP address or FQDN)_" placeholder="<?=$vpn_wg0?'(_(not used)_)':preg_replace('/^(.+?\.)[0-9a-zA-Z]+(\.(my)?unraid.net)$/','$1<hash>$2',$public)?>">:
: <span class="input"><input type="text" class="width:10%;" id="endpoint-wg0" name="Endpoint:0" class="subnet" value="<?=$vpn_wg0?'':_var($wg0,'Endpoint:0')?>" onchange="toLC(this);quickValidate(this);" pattern="<?=$validText?>" title="_(IP address or FQDN)_" placeholder="<?=$vpn_wg0?'(_(not used)_)':preg_replace('/^(.+?\.)[0-9a-zA-Z]+(\.(my)?unraid.net)$/','$1<hash>$2',$public)?>">:
<input type="number" name="gui:ListenPort:0" class="port" min="1" max="65535" value="<?=$vpn_wg0?'':_var($wg0,'ListenPort:0')?>" onchange="if(quickValidate(this)) {portRemark($(document.wg0),'wg0',this.value)}" placeholder="<?=$vpn_wg0?'':_var($netport,'wg0')?>"></span>
<span class="remark block" style="display:none">_(Remark)_: _(configure your router with port forwarding of port)_ **<span id="my-port-wg0"><?=_var($wg0,'ListenPort:0')?:_var($netport,'wg0')?></span>/_(UDP)_** _(to)_ **<?=$server?>:<?=_var($wg0,'ListenPort:0')?:_var($netport,'wg0')?>**</span><span class="upnp wg0 block"></span>
<input type="hidden" name="ListenPort:0" value=""><dl id="endpoint4-wg0" style="display:none"></dl><dl id="endpoint6-wg0" style="display:none"></dl>
@@ -1318,7 +1317,7 @@ _(Local tunnel firewall)_:
:wg_local_tunnel_firewall_help:
_(MTU size)_:
: <span class="input"><input type="number" name="MTU:0" class="trim" min="68" max="9198" value="<?=_var($wg0,'MTU:0')?>" onchange="quickValidate(this);" placeholder="(_(automatic)_)">_(bytes)_</span>
: <span class="input"><input type="number" name="MTU:0" class="trim" min="68" max="9198" value="<?=_var($wg0,'MTU:0')?>" onchange="quickValidate(this);" placeholder="(_(auto)_)">_(bytes)_</span>
:wg_mtu_size_help:
@@ -1362,7 +1361,7 @@ _(Peer type of access)_:
<?=mk_option(_var($wg0,"TYPE:$i"), "7", _("VPN tunneled access for system"),count($peer_wg0)==1?'':'disabled')?>
<?=mk_option(_var($wg0,"TYPE:$i"), "8", _("VPN tunneled access for docker"),count($peer_wg0)==1?'':'disabled')?>
</select></span>
<span id="access-type-<?=$i?>" class="access-type"></span>
<span id="access-type-<?=$i?>"</span>
<?if ($i==1):?>
> ![](<?=autov('/webGui/images/wireguard-help.png')?>)
@@ -1426,8 +1425,8 @@ _(Persistent keepalive)_:
:wg_persistent_keepalive_help:
</div>
<span class="pin">_(Data received)_: <span class="rx-wg0-<?=$i?>">0 B</span>_(Data sent)_: <span class="tx-wg0-<?=$i?>">0 B</span><br>_(Last handshake)_: <span class="hs-wg0-<?=$i?>">_(unknown)_</span></span>
</div>
<span class="pin">_(Data received)_: <span class="rx-wg0-<?=$i?>">0 B</span>_(Data sent)_: <span class="tx-wg0-<?=$i?>">0 B</span><br>_(Last handshake)_: <span class="hs-wg0-<?=$i?>">_(unknown)_</span></span>
<?endforeach;?>
&nbsp;

View File

@@ -224,7 +224,7 @@ _(Local tunnel address IPv6)_:
</div>
</div>
_(Local endpoint)_:
: <span class="input"><input type="text" id="endpoint-wgX" name="Endpoint:0" class="subnet" value="<?=$vpn_wgX?'':_var($wgX,'Endpoint:0')?>" onchange="toLC(this);quickValidate(this);" pattern="<?=$validText?>" title="_(IP address or FQDN)_" placeholder="<?=$vpn_wgX?'(_(not used)_)':preg_replace('/^(www\.).+(\.unraid.net)$/','$1<hash>$2',$public)?>">:
: <span class="input"><input type="text" class="width:10%;" id="endpoint-wgX" name="Endpoint:0" class="subnet" value="<?=$vpn_wgX?'':_var($wgX,'Endpoint:0')?>" onchange="toLC(this);quickValidate(this);" pattern="<?=$validText?>" title="_(IP address or FQDN)_" placeholder="<?=$vpn_wgX?'(_(not used)_)':preg_replace('/^(www\.).+(\.unraid.net)$/','$1<hash>$2',$public)?>">:
<input type="number" name="gui:ListenPort:0" class="port" min="1" max="65535" value="<?=$vpn_wgX?'':_var($wgX,'ListenPort:0')?>" onchange="if(quickValidate(this)) {portRemark($(document.wgX),'wgX',this.value)}" placeholder="<?=$vpn_wgX?'':_var($netport,'wgX')?>"></span>
<span class="remark block" style="display:none">_(Remark)_: _(configure your router with port forwarding of port)_ **<span id="my-port-wgX"><?=_var($wgX,'ListenPort:0')?:_var($netport,'wgX')?></span>/_(UDP)_** _(to)_ **<?=$server?>:<?=_var($wgX,'ListenPort:0')?:_var($netport,'wgX')?>**</span><span class="upnp wgX block"></span>
<input type="hidden" name="ListenPort:0" value=""><dl id="endpoint4-wgX" style="display:none"></dl><dl id="endpoint6-wgX" style="display:none"></dl>
@@ -261,7 +261,7 @@ _(Local tunnel firewall)_:
:wg_local_tunnel_firewall_help:
_(MTU size)_:
: <span class="input"><input type="number" name="MTU:0" class="trim" min="68" max="9198" value="<?=_var($wgX,'MTU:0')?>" onchange="quickValidate(this);" placeholder="(_(automatic)_)">_(bytes)_</span>
: <span class="input"><input type="number" name="MTU:0" class="trim" min="68" max="9198" value="<?=_var($wgX,'MTU:0')?>" onchange="quickValidate(this);" placeholder="(_(auto)_)">_(bytes)_</span>
:wg_mtu_size_help:
@@ -305,7 +305,7 @@ _(Peer type of access)_:
<?=mk_option(_var($wgX,"TYPE:$i"), "7", _("VPN tunneled access for system"),count($peer_wgX)==1?'':'disabled')?>
<?=mk_option(_var($wgX,"TYPE:$i"), "8", _("VPN tunneled access for docker"))?>
</select></span>
<span id="access-type-<?=$i?>" class="access-type"></span>
<span id="access-type-<?=$i?>"></span>
<?if ($i==1):?>
> ![](<?=autov('/webGui/images/wireguard-help.png')?>)
@@ -369,8 +369,8 @@ _(Persistent keepalive)_:
:wg_persistent_keepalive_help:
</div>
<span class="pin">_(Data received)_: <span class="rx-wgX-<?=$i?>">0 B</span>_(Data sent)_: <span class="tx-wgX-<?=$i?>">0 B</span><br>_(Last handshake)_: <span class="hs-wgX-<?=$i?>">_(unknown)_</span></span>
</div>
<span class="pin">_(Data received)_: <span class="rx-wgX-<?=$i?>">0 B</span>_(Data sent)_: <span class="tx-wgX-<?=$i?>">0 B</span><br>_(Last handshake)_: <span class="hs-wgX-<?=$i?>">_(unknown)_</span></span>
<?endforeach;?>
&nbsp;

Some files were not shown because too many files have changed in this diff Show More