* Add infrastructure and tools for new webgui.

* Adapt plugins.

Fixes: https://github.com/openmediavault/openmediavault/issues/684

Signed-off-by: Volker Theile <votdev@gmx.de>
This commit is contained in:
Volker Theile 2020-08-16 10:45:23 +02:00
parent c2e4f9718a
commit 5fe10a120e
702 changed files with 4574 additions and 41261 deletions

View File

@ -22,3 +22,7 @@ trim_trailing_whitespace = false
[*.j2]
max_line_length = off
[*.mk]
indent_size = 4
indent_style = tab

View File

@ -1,7 +0,0 @@
/libjs-extjs6/
/files
/*.debhelper.log
/*.postinst.debhelper
/*.postrm.debhelper
/*.substvars
/*-stamp

View File

@ -1,11 +0,0 @@
libjs-extjs6 (6.2.0.981-2) stable; urgency=low
* Fix bug in debian/libjs6.postinst script.
-- Volker Theile <volker.theile@openmediavault.org> Thu, 11 May 2017 23:33:55 +0200
libjs-extjs6 (6.2.0.981-1) stable; urgency=low
* Initial release.
-- Volker Theile <volker.theile@openmediavault.org> Fri, 24 Feb 2017 10:31:18 +0100

View File

@ -1 +0,0 @@
9

View File

@ -1,14 +0,0 @@
Source: libjs-extjs6
Section: web
Priority: extra
Maintainer: Volker Theile <volker.theile@openmediavault.org>
Build-Depends: debhelper (>= 9), unzip
Standards-Version: 3.9.4
Homepage: http://www.sencha.com
Package: libjs-extjs6
Architecture: all
Depends: ${misc:Depends}
Description: Ext JS is a cross-browser JavaScript library for building rich internet applications.
ExtJS is a JavaScript library for building interactive web applications using
techniques such as Ajax, DHTML and DOM scripting.

View File

@ -1,79 +0,0 @@
Format: http://dep.debian.net/deps/dep5
Upstream-Contact: Volker Theile <volker.theile@openmediavault.org>
Source: https://www.sencha.com/legal/gpl/
Ext JS 6.2.0.981 - JavaScript Library
Copyright (c) 2006-2016, Sencha Inc.
All rights reserved.
licensing@sencha.com
http://www.sencha.com/license
Open Source License
------------------------------------------------------------------------------------------
This version of Ext JS is licensed under the terms of the Open Source GPL 3.0 license.
http://www.gnu.org/licenses/gpl.html
There are several FLOSS exceptions available for use with this release for
open source applications that are distributed under a license other than GPL.
* Open Source License Exception for Applications
http://www.sencha.com/products/floss-exception.php
* Open Source License Exception for Development
http://www.sencha.com/products/ux-exception.php
Alternate Licensing
------------------------------------------------------------------------------------------
Commercial and OEM Licenses are available for an alternate download of Ext JS.
This is the appropriate option if you are creating proprietary applications and you are
not prepared to distribute and share the source code of your application under the
GPL v3 license. Please visit http://www.sencha.com/license for more details.
Third Party Content
------------------------------------------------------------------------------------------
The following third party software is distributed with Ext JS and is
provided under other licenses and/or has source available from other locations.
Library: YUI 0.6 - drag-and-drop code
License: BSD
Location: http://developer.yahoo.com/yui
Library: JSON parser
License: Public Domain
Location: http://www.JSON.org/js.html
Library: flexible-js-formatting - date parsing and formatting
License: MIT
Location: http://code.google.com/p/flexible-js-formatting/
Library: sparkline.js - micro charts
License: BSD
Location: http://omnipotent.net/jquery.sparkline
Library: DeftJS
License: MIT
Location: http://deftjs.org/
Library: Open-Sans
License: Apache
Location: http://www.fontsquirrel.com/fonts/open-sans
Examples
Library: Silk icons
License: Creative Commons Attribution 2.5 License.
Location: http://www.famfamfam.com/lab/icons/silk/
--
THIS SOFTWARE IS DISTRIBUTED "AS-IS" WITHOUT ANY WARRANTIES, CONDITIONS AND REPRESENTATIONS WHETHER EXPRESS OR IMPLIED,
INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, MERCHANTABLE QUALITY, FITNESS FOR A
PARTICULAR PURPOSE, DURABILITY, NON-INFRINGEMENT, PERFORMANCE AND THOSE ARISING BY STATUTE OR FROM CUSTOM OR USAGE OF TRADE
OR COURSE OF DEALING.

View File

@ -1,4 +0,0 @@
build/classic/ usr/share/javascript/extjs6
build/modern/ usr/share/javascript/extjs6
build/packages/ usr/share/javascript/extjs6
build/*.js usr/share/javascript/extjs6

View File

@ -1,20 +0,0 @@
#!/bin/sh
set -e
case "$1" in
configure)
chmod 755 /usr/share/javascript/extjs6/*
chown -R www-data:www-data /usr/share/javascript/extjs6/*
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument '$1'" >&2
exit 1
;;
esac
exit 0

View File

@ -1,30 +0,0 @@
#!/usr/bin/make -f
#export DH_VERBOSE=1
EXTJSVERSION=6.2.0
%:
dh $@
override_dh_auto_clean:
find . -maxdepth 1 -not -iname "debian" -not -name ".*" \
-exec rm -r -v '{}' \;
extract: extract-stamp
extract-stamp:
unzip $(CURDIR)/../sources/ext-$(EXTJSVERSION)-gpl.zip
mv $(CURDIR)/ext-$(EXTJSVERSION)/* $(CURDIR)
rm -rf $(CURDIR)/ext-$(EXTJSVERSION)
touch extract-stamp
override_dh_auto_build: extract
override_dh_prep:
dh_prep
# Remove useless files.
for name in classic modern packages; do \
find build/$$name/ \( -iname "*.rb" -o -iname "*.scss" \
-o -iname "*.md" \) -exec rm -r '{}' \; ;\
done
.PHONY: extract

View File

@ -1 +0,0 @@
3.0 (quilt)

View File

@ -1,3 +1,9 @@
openmediavault-clamav (6.0-1) UNRELEASED; urgency=low
* Reimplement UI.
-- Volker Theile <volker.theile@openmediavault.org> Sun, 13 Dec 2020 21:23:54 +0100
openmediavault-clamav (5.0.11-1) stable; urgency=low
* Issue #812: Cron script erroneously reports success though failed.

View File

@ -1 +1 @@
9
12

View File

@ -3,7 +3,7 @@ Section: utils
XB-Plugin-Section: utilities
Priority: optional
Maintainer: Volker Theile <volker.theile@openmediavault.org>
Build-Depends: debhelper (>> 7), gettext
Build-Depends: debhelper (>= 12), gettext
Standards-Version: 3.9.6
Homepage: http://www.openmediavault.org

View File

@ -1,4 +1,3 @@
usr/share/openmediavault/* usr/share/openmediavault/
var/www/openmediavault/* var/www/openmediavault/
etc/* etc/
srv/* srv/

View File

@ -39,11 +39,9 @@ case "$1" in
fi
########################################################################
# Activate package triggers. These triggers are only set during the
# package installation.
# Activate trigger to rebuild workbench configuration files.
########################################################################
dpkg-trigger update-fixperms
dpkg-trigger update-locale
dpkg-trigger update-workbench
########################################################################
# Initialize and migrate configuration database.

View File

@ -25,8 +25,8 @@ set -e
. /usr/share/openmediavault/scripts/helper-functions
remove_action() {
# Activate trigger to purge cached files.
dpkg-trigger update-fixperms
# Activate trigger to rebuild workbench configuration files.
dpkg-trigger update-workbench
}
case "$1" in

View File

@ -0,0 +1,5 @@
version: "1.0"
type: component
data:
name: omv-services-clamav-navigation-page
type: navigationPage

View File

@ -0,0 +1,43 @@
version: "1.0"
type: component
data:
name: omv-services-clamav-onaccess-scan-datatable-page
type: datatablePage
config:
autoReload: false
stateId: ff76df7a-8cf5-11e7-8a62-0800278dc04d
sorters:
- dir: asc
prop: sharedfoldername
store:
proxy:
service: ClamAV
get:
method: getOnAccessPathList
columns:
- name: _("Enabled")
prop: enable
flexGrow: 1
sortable: true
cellTemplateName: checkIcon
- name: _("Shared folder")
prop: sharedfoldername
flexGrow: 1
sortable: true
actions:
- template: create
execute:
type: url
url: "/services/clamav/onaccess-scans/create"
- template: edit
execute:
type: url
url: "/services/clamav/onaccess-scans/edit/{{ _selected[0].uuid }}"
- template: delete
execute:
type: request
request:
service: ClamAV
method: deleteOnAccessPath
params:
uuid: "{{ _selected[0].uuid }}"

View File

@ -0,0 +1,35 @@
version: "1.0"
type: component
data:
name: omv-services-clamav-onaccess-scan-form-page
type: formPage
config:
request:
service: ClamAV
get:
method: getOnAccessPath
params:
uuid: "{{ _routeParams.uuid }}"
post:
method: setOnAccessPath
fields:
- type: confObjUuid
- type: checkbox
name: enable
label: _("Enabled")
value: false
- type: sharedFolderSelect
name: sharedfolderref
label: _("Shared folder")
hint: _("The location of the files to scan on-access.")
validators:
required: true
buttons:
- template: submit
execute:
type: url
url: "/services/clamav/onaccess-scans"
- template: cancel
execute:
type: url
url: "/services/clamav/onaccess-scans"

View File

@ -0,0 +1,74 @@
version: "1.0"
type: component
data:
name: omv-services-clamav-scan-datatable-page
type: datatablePage
config:
autoReload: false
stateId: f8a8cf1c-a107-11e1-a5a0-00221568ca88
sorters:
- dir: asc
prop: sharedfoldername
store:
proxy:
service: ClamAV
get:
method: getJobList
columns:
- name: _("Enabled")
prop: enable
flexGrow: 1
sortable: true
cellTemplateName: checkIcon
- name: _("Shared folder")
prop: sharedfoldername
flexGrow: 1
sortable: true
- name: _("Scheduling")
prop: ""
flexGrow: 1
cellTemplateName: template
cellTemplateConfig: |
{% set _minute = minute %}
{% set _hour = hour %}
{% set _dayofmonth = dayofmonth %}
{% if everynminute %}{% set _minute %}*/{{ minute }}{% endset %}{% endif %}
{% if everynhour %}{% set _hour %}*/{{ hour }}{% endset %}{% endif %}
{% if everyndayofmonth %}{% set _dayofmonth %}*/{{ dayofmonth }}{% endset %}{% endif %}
{{ _minute }} {{ _hour }} {{ _dayofmonth }} {{ month }} {{ dayofweek }}
- name: _("Comment")
prop: comment
flexGrow: 1
sortable: true
actions:
- template: create
execute:
type: url
url: "/services/clamav/scans/create"
- template: edit
execute:
type: url
url: "/services/clamav/scans/edit/{{ _selected[0].uuid }}"
- type: iconButton
icon: start
tooltip: _("Run")
enabledConstraints:
minSelected: 1
maxSelected: 1
execute:
type: taskDialog
taskDialog:
title: _("Execute scheduled scan")
request:
service: ClamAV
method: executeJob
params:
uuid: "{{ _selected[0].uuid }}"
- template: delete
execute:
type: request
request:
service: ClamAV
method: deleteJob
params:
uuid: "{{ _selected[0].uuid }}"

View File

@ -0,0 +1,398 @@
version: "1.0"
type: component
data:
name: omv-services-clamav-scan-form-page
type: formPage
config:
request:
service: ClamAV
get:
method: getJob
params:
uuid: "{{ _routeParams.uuid }}"
post:
method: setJob
fields:
- type: confObjUuid
- type: checkbox
name: enable
label: _("Enabled")
value: false
- type: sharedFolderSelect
name: sharedfolderref
label: _("Shared folder")
hint: _("The location of the files to scan.")
validators:
required: true
- type: container
fields:
- type: select
name: minute
label: _("Minute")
value: "{{ moment('H:mm:ss') | split(':') | get(1) }}"
store:
data:
- - "*"
- "*"
- - "0"
- "0"
- - "1"
- "1"
- - "2"
- "2"
- - "3"
- "3"
- - "4"
- "4"
- - "5"
- "5"
- - "6"
- "6"
- - "7"
- "7"
- - "8"
- "8"
- - "9"
- "9"
- - "10"
- "10"
- - "11"
- "11"
- - "12"
- "12"
- - "13"
- "13"
- - "14"
- "14"
- - "15"
- "15"
- - "16"
- "16"
- - "17"
- "17"
- - "18"
- "18"
- - "19"
- "19"
- - "20"
- "20"
- - "21"
- "21"
- - "22"
- "22"
- - "23"
- "23"
- - "24"
- "24"
- - "25"
- "25"
- - "26"
- "26"
- - "27"
- "27"
- - "28"
- "28"
- - "29"
- "29"
- - "30"
- "30"
- - "31"
- "31"
- - "32"
- "32"
- - "33"
- "33"
- - "34"
- "34"
- - "35"
- "35"
- - "36"
- "36"
- - "37"
- "37"
- - "38"
- "38"
- - "39"
- "39"
- - "40"
- "40"
- - "41"
- "41"
- - "42"
- "42"
- - "43"
- "43"
- - "44"
- "44"
- - "45"
- "45"
- - "46"
- "46"
- - "47"
- "47"
- - "48"
- "48"
- - "49"
- "49"
- - "50"
- "50"
- - "51"
- "51"
- - "52"
- "52"
- - "53"
- "53"
- - "54"
- "54"
- - "55"
- "55"
- - "56"
- "56"
- - "57"
- "57"
- - "58"
- "58"
- - "59"
- "59"
- type: checkbox
name: everynminute
label: _("Every N minute")
value: false
- type: container
fields:
- type: select
name: hour
label: _("Hour")
value: "{{ moment('H:mm:ss') | split(':') | get(0) }}"
store:
data:
- - "*"
- "*"
- - "0"
- "0"
- - "1"
- "1"
- - "2"
- "2"
- - "3"
- "3"
- - "4"
- "4"
- - "5"
- "5"
- - "6"
- "6"
- - "7"
- "7"
- - "8"
- "8"
- - "9"
- "9"
- - "10"
- "10"
- - "11"
- "11"
- - "12"
- "12"
- - "13"
- "13"
- - "14"
- "14"
- - "15"
- "15"
- - "16"
- "16"
- - "17"
- "17"
- - "18"
- "18"
- - "19"
- "19"
- - "20"
- "20"
- - "21"
- "21"
- - "22"
- "22"
- - "23"
- "23"
- type: checkbox
name: everynhour
label: _("Every N hour")
value: false
- type: container
fields:
- type: select
name: dayofmonth
label: _("Day of month")
value: "*"
store:
data:
- - "*"
- "*"
- - "0"
- "0"
- - "1"
- "1"
- - "2"
- "2"
- - "3"
- "3"
- - "4"
- "4"
- - "5"
- "5"
- - "6"
- "6"
- - "7"
- "7"
- - "8"
- "8"
- - "9"
- "9"
- - "10"
- "10"
- - "11"
- "11"
- - "12"
- "12"
- - "13"
- "13"
- - "14"
- "14"
- - "15"
- "15"
- - "16"
- "16"
- - "17"
- "17"
- - "18"
- "18"
- - "19"
- "19"
- - "20"
- "20"
- - "21"
- "21"
- - "22"
- "22"
- - "23"
- "23"
- - "24"
- "24"
- - "25"
- "25"
- - "26"
- "26"
- - "27"
- "27"
- - "28"
- "28"
- - "29"
- "29"
- - "30"
- "30"
- - "31"
- "31"
- type: checkbox
name: everyndayofmonth
label: _("Every N day of month")
value: false
- type: select
name: month
label: _("Month")
value: "*"
store:
data:
- - "*"
- "*"
- - "1"
- _("January")
- - "2"
- _("February")
- - "3"
- _("March")
- - "4"
- _("April")
- - "5"
- _("May")
- - "6"
- _("June")
- - "7"
- _("July")
- - "8"
- _("August")
- - "9"
- _("September")
- - "10"
- _("October")
- - "11"
- _("November")
- - "12"
- _("December")
- type: select
name: dayofweek
label: _("Day of week")
value: "*"
store:
data:
- - "*"
- "*"
- - "1"
- _("Monday")
- - "2"
- _("Tuesday")
- - "3"
- _("Wednesday")
- - "4"
- _("Thursday")
- - "5"
- _("Friday")
- - "6"
- _("Saturday")
- - "7"
- _("Sunday")
- type: hidden
name: onaccess
value: false
- type: select
name: virusaction
label: _("Infected files")
hint: _("The option, how to handle infected files.")
value: "nothing"
store:
data:
- - "nothing"
- _("Perform nothing")
- - "quarantine"
- _("Move to quarantine")
- - "delete"
- _("Delete immediately")
- type: checkbox
name: multiscan
label: _("Multiscan")
hint: _("Scan the directory contents in parallel using available threads.")
value: false
- type: checkbox
name: verbose
label: _("Verbose")
hint: _("Be verbose.")
value: false
- type: checkbox
name: sendemail
label: _("Send email")
hint: _("An email message with the command output (if any produced) is send to the administrator.")
value: false
- type: textInput
name: comment
label: _("Comment")
value: ""
buttons:
- template: submit
execute:
type: url
url: "/services/clamav/onaccess-scans"
- template: cancel
execute:
type: url
url: "/services/clamav/onaccess-scans"

View File

@ -0,0 +1,103 @@
version: "1.0"
type: component
data:
name: omv-services-clamav-settings-form-page
type: formPage
config:
request:
service: ClamAV
get:
method: getSettings
post:
method: setSettings
fields:
- type: checkbox
name: enable
label: _("Enabled")
value: false
- type: numberInput
name: checks
label: _("Database checks")
value: 24
hint: _("Number of database update checks per day. Set to 0 to disable.")
validators:
min: 0
max: 50
required: true
- type: sharedFolderSelect
name: quarantine_sharedfolderref
label: _("Quarantine")
hint: _("The location which is used as quarantine.")
validators:
required: true
- type: checkbox
name: logclean
label: _("Log clean files")
hint: _("Log clean files. This drastically increases the log size.")
value: false
- type: checkbox
name: scanpe
label: _("Scan Portable Executable")
hint: _("Perform a deeper analysis of executable files.")
value: true
- type: checkbox
name: scanole2
label: _("Scan OLE2")
hint: _("Enable scanning of OLE2 files, such as Microsoft Office documents and .msi files.")
value: true
- type: checkbox
name: scanhtml
label: _("Scan HTML")
hint: _("Enable HTML detection and normalisation.")
value: true
- type: checkbox
name: scanpdf
label: _("Scan PDF")
hint: _("Enable scanning within PDF files.")
value: true
- type: checkbox
name: scanelf
label: _("Scan ELF")
hint: _("Enable scanning of ELF files.")
value: true
- type: checkbox
name: scanarchive
label: _("Scan archives")
hint: _("Enable archive scanning.")
value: true
- type: checkbox
name: detectbrokenexecutables
label: _("Detect broken executables")
hint: _("Enable the detection of broken executables (both PE and ELF).")
value: false
- type: checkbox
name: detectpua
label: _("Detect PUA")
hint: _("Enable the detection of possibly unwanted applications.")
value: false
- type: checkbox
name: algorithmicdetection
label: _("Algorithmic detection")
hint: _("Enable the algorithmic detection.")
value: true
- type: checkbox
name: followdirectorysymlinks
label: _("Follow directory symlinks")
hint: _("Follow directory symlinks.")
value: false
- type: checkbox
name: followfilesymlinks
label: _("Follow file symlinks")
hint: _("Follow regular file symlinks.")
value: false
- type: textarea
name: extraoptions
label: _("Extra options")
hints: _("Please check the <a href='https://github.com/vrtadmin/clamav-faq/raw/master/manual/clamdoc.pdf' target='_blank'>manual page</a> for more details.")
value: ""
rows: 5
buttons:
- template: submit
url: "/services/clamav"
- template: cancel
url: "/services/clamav"

View File

@ -0,0 +1,20 @@
version: "1.0"
type: log
data:
id: clamav
text: _("Antivirus")
columns:
- name: _("Date & Time")
sortable: true
prop: ts
cellTemplateName: localeDateTime
flexGrow: 1
- name: _("Message")
sortable: true
prop: message
flexGrow: 2
request:
service: LogFile
method: getList
params:
id: clamav

View File

@ -0,0 +1,8 @@
version: "1.0"
type: navigation-item
data:
path: "services.clamav.onaccess-scans"
text: _("On Access Scans")
position: 20
icon: "mdi:file-eye"
url: "/services/clamav/onaccess-scans"

View File

@ -0,0 +1,8 @@
version: "1.0"
type: navigation-item
data:
path: "services.clamav.scans"
text: _("Scheduled Scans")
position: 30
icon: "mdi:calendar-clock"
url: "/services/clamav/scans"

View File

@ -0,0 +1,8 @@
version: "1.0"
type: navigation-item
data:
path: "services.clamav.settings"
text: _("Settings")
position: 10
icon: "tune"
url: "/services/clamav/settings"

View File

@ -0,0 +1,7 @@
version: "1.0"
type: navigation-item
data:
path: "services.clamav"
text: _("Antivirus")
icon: "mdi:biohazard"
url: "/services/clamav"

View File

@ -0,0 +1,7 @@
version: "1.0"
type: route
data:
url: "/services/clamav/onaccess-scans/create"
title: _("Create")
notificationTitle: _("Created on-access scan.")
component: omv-services-clamav-onaccess-scan-form-page

View File

@ -0,0 +1,8 @@
version: "1.0"
type: route
data:
url: "/services/clamav/onaccess-scans/edit/:uuid"
title: _("Edit")
editing: true
notificationTitle: _("Updated on-access scan.")
component: omv-services-clamav-onaccess-scan-form-page

View File

@ -0,0 +1,6 @@
version: "1.0"
type: route
data:
url: "/services/clamav/onaccess-scans"
title: _("On Access Scans")
component: omv-services-clamav-onaccess-scan-datatable-page

View File

@ -0,0 +1,7 @@
version: "1.0"
type: route
data:
url: "/services/clamav/scans/create"
title: _("Create")
notificationTitle: _("Created on-access scan.")
component: omv-services-clamav-scan-form-page

View File

@ -0,0 +1,8 @@
version: "1.0"
type: route
data:
url: "/services/clamav/scans/edit/:uuid"
title: _("Edit")
editing: true
notificationTitle: _("Updated scheduled scan.")
component: omv-services-clamav-scan-form-page

View File

@ -0,0 +1,6 @@
version: "1.0"
type: route
data:
url: "/services/clamav/scans"
title: _("Scheduled Scans")
component: omv-services-clamav-scan-datatable-page

View File

@ -0,0 +1,6 @@
version: "1.0"
type: route
data:
url: "/services/clamav/settings"
title: _("Settings")
component: omv-services-clamav-settings-form-page

View File

@ -0,0 +1,6 @@
version: "1.0"
type: route
data:
url: "/services/clamav"
title: _("Antivirus")
component: omv-services-clamav-navigation-page

View File

@ -1,65 +0,0 @@
/**
* This file is part of OpenMediaVault.
*
* @license http://www.gnu.org/licenses/gpl.html GPL Version 3
* @author Volker Theile <volker.theile@openmediavault.org>
* @copyright Copyright (c) 2009-2021 Volker Theile
*
* OpenMediaVault is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* OpenMediaVault is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenMediaVault. If not, see <http://www.gnu.org/licenses/>.
*/
// require("js/omv/grid/column/WhiteSpace.js")
// require("js/omv/module/admin/diagnostic/log/plugin/Plugin.js")
/**
* @class OMV.module.admin.diagnostic.log.plugin.ClamAV
* @derived OMV.module.admin.diagnostic.log.plugin.Plugin
* Class that implements the 'ClamAV' logfile diagnostics plugin.
*/
Ext.define("OMV.module.admin.diagnostic.log.plugin.ClamAV", {
extend: "OMV.module.admin.diagnostic.log.plugin.Plugin",
alias: "omv.plugin.diagnostic.log.clamav",
requires: [
"OMV.grid.column.WhiteSpace"
],
id: "clamav",
text: _("Antivirus"),
stateful: true,
stateId: "487886d0-97cc-11e1-9f42-000c29f7c0eb",
columns: [{
text: _("Date & Time"),
sortable: true,
dataIndex: "rownum",
stateId: "date",
renderer: function(value, metaData, record) {
return record.get("date");
}
},{
xtype: "whitespacecolumn",
text: _("Message"),
sortable: true,
dataIndex: "message",
stateId: "message",
flex: 1
}],
rpcParams: {
id: "clamav"
},
rpcFields: [
{ name: "rownum", type: "int" },
{ name: "ts", type: "int" },
{ name: "date", type: "string" },
{ name: "message", type: "string" }
]
});

View File

@ -1,28 +0,0 @@
/**
* This file is part of OpenMediaVault.
*
* @license http://www.gnu.org/licenses/gpl.html GPL Version 3
* @author Volker Theile <volker.theile@openmediavault.org>
* @copyright Copyright (c) 2009-2021 Volker Theile
*
* OpenMediaVault is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* OpenMediaVault is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenMediaVault. If not, see <http://www.gnu.org/licenses/>.
*/
// require("js/omv/WorkspaceManager.js")
OMV.WorkspaceManager.registerNode({
id: "clamav",
path: "/service",
text: _("Antivirus"),
iconCls: "mdi mdi-biohazard"
});

View File

@ -1,468 +0,0 @@
/**
* This file is part of OpenMediaVault.
*
* @license http://www.gnu.org/licenses/gpl.html GPL Version 3
* @author Volker Theile <volker.theile@openmediavault.org>
* @copyright Copyright (c) 2009-2021 Volker Theile
*
* OpenMediaVault is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* OpenMediaVault is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenMediaVault. If not, see <http://www.gnu.org/licenses/>.
*/
// require("js/omv/WorkspaceManager.js")
// require("js/omv/workspace/grid/Panel.js")
// require("js/omv/workspace/window/Form.js")
// require("js/omv/workspace/window/plugin/ConfigObject.js")
// require("js/omv/Rpc.js")
// require("js/omv/data/Store.js")
// require("js/omv/data/Model.js")
// require("js/omv/data/proxy/Rpc.js")
// require("js/omv/window/Execute.js")
// require("js/omv/form/field/SharedFolderComboBox.js")
/**
* @class OMV.module.admin.service.clamav.Job
* @derived OMV.workspace.window.Form
*/
Ext.define("OMV.module.admin.service.clamav.Job", {
extend: "OMV.workspace.window.Form",
uses: [
"OMV.form.field.SharedFolderComboBox",
"OMV.workspace.window.plugin.ConfigObject"
],
rpcService: "ClamAV",
rpcGetMethod: "getJob",
rpcSetMethod: "setJob",
plugins: [{
ptype: "configobject"
}],
width: 540,
height: 375,
/**
* The class constructor.
* @fn constructor
* @param uuid The UUID of the database/configuration object. Required.
*/
getFormItems: function() {
return [{
xtype: "checkbox",
name: "enable",
fieldLabel: _("Enable"),
checked: true
},{
xtype: "sharedfoldercombo",
name: "sharedfolderref",
fieldLabel: _("Shared folder"),
plugins: [{
ptype: "fieldinfo",
text: _("The location of the files to scan.")
}]
},{
xtype: "compositefield",
fieldLabel: _("Minute"),
combineErrors: false,
items: [{
xtype: "combo",
name: "minute",
queryMode: "local",
store: Ext.Array.insert(Ext.Array.range(0, 59, 1, true),
0, [ "*" ]),
allowBlank: false,
editable: false,
triggerAction: "all",
value: String(new Date().getMinutes()),
flex: 1
},{
xtype: "checkbox",
name: "everynminute",
fieldLabel: "",
checked: false,
boxLabel: _("Every N minute"),
width: 140
}]
},{
xtype: "compositefield",
fieldLabel: _("Hour"),
combineErrors: false,
items: [{
xtype: "combo",
name: "hour",
queryMode: "local",
store: Ext.create("Ext.data.ArrayStore", {
fields: [ "value", "text" ],
data: Date.mapHour
}),
displayField: "text",
valueField: "value",
allowBlank: false,
editable: false,
triggerAction: "all",
value: String(new Date().getHours()),
flex: 1
},{
xtype: "checkbox",
name: "everynhour",
fieldLabel: "",
checked: false,
boxLabel: _("Every N hour"),
width: 140
}]
},{
xtype: "compositefield",
fieldLabel: _("Day of month"),
combineErrors: false,
items: [{
xtype: "combo",
name: "dayofmonth",
queryMode: "local",
store: Ext.create("Ext.data.ArrayStore", {
fields: [ "value", "text" ],
data: Date.mapDayOfMonth
}),
displayField: "text",
valueField: "value",
allowBlank: false,
editable: false,
triggerAction: "all",
value: "*",
flex: 1
},{
xtype: "checkbox",
name: "everyndayofmonth",
fieldLabel: "",
checked: false,
boxLabel: _("Every N day of month"),
width: 140
}]
},{
xtype: "combo",
name: "month",
fieldLabel: _("Month"),
queryMode: "local",
store: Ext.create("Ext.data.ArrayStore", {
fields: [ "value", "text" ],
data: Date.mapMonth
}),
displayField: "text",
valueField: "value",
allowBlank: false,
editable: false,
triggerAction: "all",
value: "*"
},{
xtype: "combo",
name: "dayofweek",
fieldLabel: _("Day of week"),
queryMode: "local",
store: Ext.create("Ext.data.ArrayStore", {
fields: [ "value", "text" ],
data: Date.mapDayOfWeek
}),
displayField: "text",
valueField: "value",
allowBlank: false,
editable: false,
triggerAction: "all",
value: "*"
},{
xtype: "checkbox",
name: "onaccess",
fieldLabel: _("On-access"),
checked: false,
hidden: true,
boxLabel: _("Enable on-access virus scanning"),
plugins: [{
ptype: "fieldinfo",
text: _("Monitor the shared folder and scan new or modified files.")
}]
},{
xtype: "combo",
name: "virusaction",
fieldLabel: _("Infected files"),
queryMode: "local",
store: [
[ "nothing", "Perform nothing" ],
[ "quarantine", "Move to quarantine" ],
[ "delete", "Delete immediately" ]
],
displayField: "text",
valueField: "value",
allowBlank: false,
editable: false,
triggerAction: "all",
value: "nothing",
plugins: [{
ptype: "fieldinfo",
text: _("The option, how to handle infected files.")
}]
},{
xtype: "checkbox",
name: "multiscan",
fieldLabel: _("Multiscan"),
boxLabel: _("Scan the directory contents in parallel using available threads."),
checked: false
},{
xtype: "checkbox",
name: "verbose",
fieldLabel: _("Verbose"),
boxLabel: _("Be verbose."),
checked: false
},{
xtype: "checkbox",
name: "sendemail",
fieldLabel: _("Send email"),
checked: false,
boxLabel: _("Send command output via email"),
plugins: [{
ptype: "fieldinfo",
text: _("An email message with the command output (if any produced) is send to the administrator.")
}]
},{
xtype: "textfield",
name: "comment",
fieldLabel: _("Comment"),
allowBlank: true,
vtype: "comment"
}];
}
});
/**
* @class OMV.module.admin.service.clamav.Jobs
* @derived OMV.workspace.grid.Panel
*/
Ext.define("OMV.module.admin.service.clamav.Jobs", {
extend: "OMV.workspace.grid.Panel",
requires: [
"OMV.Rpc",
"OMV.data.Store",
"OMV.data.Model",
"OMV.data.proxy.Rpc",
"OMV.util.Format",
"OMV.window.Execute"
],
uses: [
"OMV.module.admin.service.clamav.Job"
],
hidePagingToolbar: false,
stateful: true,
stateId: "f8a8cf1c-a107-11e1-a5a0-00221568ca88",
columns: [{
xtype: "enabledcolumn",
text: _("Enabled"),
sortable: true,
dataIndex: "enable",
stateId: "enable"
},{
xtype: "textcolumn",
text: _("Shared folder"),
sortable: true,
dataIndex: "sharedfoldername",
stateId: "sharedfoldername"
},{
text: _("Minute"),
sortable: true,
dataIndex: "minute",
stateId: "minute",
renderer: function(value, metaData, record) {
var everynminute = record.get("everynminute");
if(everynminute == true) {
value = "*/" + value;
}
return value;
}
},{
text: _("Hour"),
sortable: true,
dataIndex: "hour",
stateId: "hour",
renderer: function(value, metaData, record) {
var everynhour = record.get("everynhour");
var func = OMV.util.Format.arrayRenderer(Date.mapHour);
value = func(value);
if(everynhour == true) {
value = "*/" + value;
}
return value;
}
},{
text: _("Day of month"),
sortable: true,
dataIndex: "dayofmonth",
stateId: "dayofmonth",
renderer: function(value, metaData, record) {
var everyndayofmonth = record.get("everyndayofmonth");
var func = OMV.util.Format.arrayRenderer(
Date.mapDayOfMonth);
value = func(value);
if(everyndayofmonth == true) {
value = "*/" + value;
}
return value;
}
},{
text: _("Month"),
sortable: true,
dataIndex: "month",
stateId: "month",
renderer: OMV.util.Format.arrayRenderer(Date.mapMonth)
},{
text: _("Day of week"),
sortable: true,
dataIndex: "dayofweek",
stateId: "dayofweek",
renderer: OMV.util.Format.arrayRenderer(Date.mapDayOfWeek)
},{
xtype: "textcolumn",
text: _("Comment"),
sortable: true,
dataIndex: "comment",
stateId: "comment"
}],
initComponent: function() {
var me = this;
Ext.apply(me, {
store: Ext.create("OMV.data.Store", {
autoLoad: true,
model: OMV.data.Model.createImplicit({
idProperty: "uuid",
fields: [
{ name: "uuid", type: "string" },
{ name: "enable", type: "boolean" },
{ name: "sharedfoldername", type: "string" },
{ name: "minute", type: "string" },
{ name: "everynminute", type: "boolean" },
{ name: "hour", type: "string" },
{ name: "everynhour", type: "boolean" },
{ name: "dayofmonth", type: "string" },
{ name: "everyndayofmonth", type: "boolean" },
{ name: "month", type: "string" },
{ name: "dayofweek", type: "string" },
{ name: "comment", type: "string" }
]
}),
proxy: {
type: "rpc",
rpcData: {
service: "ClamAV",
method: "getJobList"
}
},
remoteSort: true,
sorters: [{
direction: "ASC",
property: "sharedfoldername"
}]
})
});
me.callParent(arguments);
},
getTopToolbarItems: function() {
var me = this;
var items = me.callParent(arguments);
// Add 'Run' button to top toolbar.
Ext.Array.insert(items, 2, [{
id: me.getId() + "-run",
xtype: "button",
text: _("Run"),
iconCls: "x-fa fa-play",
handler: Ext.Function.bind(me.onRunButton, me, [ me ]),
scope: me,
disabled: true,
selectionConfig: {
minSelections: 1,
maxSelections: 1
}
}]);
return items;
},
onAddButton: function() {
var me = this;
Ext.create("OMV.module.admin.service.clamav.Job", {
title: _("Add scheduled job"),
uuid: OMV.UUID_UNDEFINED,
listeners: {
scope: me,
submit: function() {
this.doReload();
}
}
}).show();
},
onEditButton: function() {
var me = this;
var record = me.getSelected();
Ext.create("OMV.module.admin.service.clamav.Job", {
title: _("Edit scheduled job"),
uuid: record.get("uuid"),
listeners: {
scope: me,
submit: function() {
this.doReload();
}
}
}).show();
},
doDeletion: function(record) {
var me = this;
OMV.Rpc.request({
scope: me,
callback: me.onDeletion,
rpcData: {
service: "ClamAV",
method: "deleteJob",
params: {
uuid: record.get("uuid")
}
}
});
},
onRunButton: function() {
var me = this;
var record = me.getSelected();
Ext.create("OMV.window.Execute", {
title: _("Execute scheduled job"),
rpcService: "ClamAV",
rpcMethod: "executeJob",
rpcParams: {
uuid: record.get("uuid")
},
listeners: {
scope: me,
finish: function(wnd, response) {
wnd.appendValue(_("Done ..."));
},
exception: function(wnd, error) {
OMV.MessageBox.error(null, error);
}
}
}).show();
}
});
OMV.WorkspaceManager.registerPanel({
id: "jobs",
path: "/service/clamav",
text: _("Scheduled Jobs"),
position: 30,
className: "OMV.module.admin.service.clamav.Jobs"
});

View File

@ -1,188 +0,0 @@
/**
* This file is part of OpenMediaVault.
*
* @license http://www.gnu.org/licenses/gpl.html GPL Version 3
* @author Volker Theile <volker.theile@openmediavault.org>
* @copyright Copyright (c) 2009-2021 Volker Theile
*
* OpenMediaVault is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* OpenMediaVault is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenMediaVault. If not, see <http://www.gnu.org/licenses/>.
*/
// require("js/omv/WorkspaceManager.js")
// require("js/omv/workspace/grid/Panel.js")
// require("js/omv/workspace/window/Form.js")
// require("js/omv/workspace/window/plugin/ConfigObject.js")
// require("js/omv/Rpc.js")
// require("js/omv/data/Store.js")
// require("js/omv/data/Model.js")
// require("js/omv/data/proxy/Rpc.js")
// require("js/omv/form/field/SharedFolderComboBox.js")
/**
* @class OMV.module.admin.service.clamav.OnAccessScan
* @derived OMV.workspace.window.Form
*/
Ext.define("OMV.module.admin.service.clamav.OnAccessScan", {
extend: "OMV.workspace.window.Form",
requires: [
"OMV.form.field.SharedFolderComboBox",
"OMV.workspace.window.plugin.ConfigObject"
],
rpcService: "ClamAV",
rpcGetMethod: "getOnAccessPath",
rpcSetMethod: "setOnAccessPath",
plugins: [{
ptype: "configobject"
}],
width: 400,
/**
* The class constructor.
* @fn constructor
* @param uuid The UUID of the database/configuration object. Required.
*/
getFormItems: function() {
return [{
xtype: "checkbox",
name: "enable",
fieldLabel: _("Enable"),
checked: true
},{
xtype: "sharedfoldercombo",
name: "sharedfolderref",
fieldLabel: _("Shared folder"),
plugins: [{
ptype: "fieldinfo",
text: _("The location of the files to scan on-access.")
}]
}];
}
});
/**
* @class OMV.module.admin.service.clamav.OnAccessScans
* @derived OMV.workspace.grid.Panel
*/
Ext.define("OMV.module.admin.service.clamav.OnAccessScans", {
extend: "OMV.workspace.grid.Panel",
requires: [
"OMV.Rpc",
"OMV.data.Store",
"OMV.data.Model",
"OMV.data.proxy.Rpc"
],
uses: [
"OMV.module.admin.service.clamav.OnAccessScan"
],
hidePagingToolbar: false,
stateful: true,
stateId: "ff76df7a-8cf5-11e7-8a62-0800278dc04d",
columns: [{
xtype: "enabledcolumn",
text: _("Enabled"),
sortable: true,
dataIndex: "enable",
stateId: "enable"
},{
xtype: "textcolumn",
text: _("Shared folder"),
sortable: true,
dataIndex: "sharedfoldername",
stateId: "sharedfoldername"
}],
initComponent: function() {
var me = this;
Ext.apply(me, {
store: Ext.create("OMV.data.Store", {
autoLoad: true,
model: OMV.data.Model.createImplicit({
idProperty: "uuid",
fields: [
{ name: "uuid", type: "string" },
{ name: "enable", type: "boolean" },
{ name: "sharedfoldername", type: "string" }
]
}),
proxy: {
type: "rpc",
rpcData: {
service: "ClamAV",
method: "getOnAccessPathList"
}
},
remoteSort: true,
sorters: [{
direction: "ASC",
property: "sharedfoldername"
}]
})
});
me.callParent(arguments);
},
onAddButton: function() {
var me = this;
Ext.create("OMV.module.admin.service.clamav.OnAccessScan", {
title: _("Add on-access scan"),
uuid: OMV.UUID_UNDEFINED,
listeners: {
scope: me,
submit: function() {
this.doReload();
}
}
}).show();
},
onEditButton: function() {
var me = this;
var record = me.getSelected();
Ext.create("OMV.module.admin.service.clamav.OnAccessScan", {
title: _("Edit on-access scan"),
uuid: record.get("uuid"),
listeners: {
scope: me,
submit: function() {
this.doReload();
}
}
}).show();
},
doDeletion: function(record) {
var me = this;
OMV.Rpc.request({
scope: me,
callback: me.onDeletion,
rpcData: {
service: "ClamAV",
method: "deleteOnAccessPath",
params: {
uuid: record.get("uuid")
}
}
});
}
});
OMV.WorkspaceManager.registerPanel({
id: "onaccessscans",
path: "/service/clamav",
text: _("On Access Scans"),
position: 20,
className: "OMV.module.admin.service.clamav.OnAccessScans"
});

View File

@ -1,166 +0,0 @@
/**
* This file is part of OpenMediaVault.
*
* @license http://www.gnu.org/licenses/gpl.html GPL Version 3
* @author Volker Theile <volker.theile@openmediavault.org>
* @copyright Copyright (c) 2009-2021 Volker Theile
*
* OpenMediaVault is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* OpenMediaVault is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenMediaVault. If not, see <http://www.gnu.org/licenses/>.
*/
// require("js/omv/WorkspaceManager.js")
// require("js/omv/workspace/form/Panel.js")
// require("js/omv/form/field/SharedFolderComboBox.js")
/**
* @class OMV.module.admin.service.clamav.Settings
* @derived OMV.workspace.form.Panel
*/
Ext.define("OMV.module.admin.service.clamav.Settings", {
extend: "OMV.workspace.form.Panel",
uses: [
"OMV.form.field.SharedFolderComboBox"
],
rpcService: "ClamAV",
rpcGetMethod: "getSettings",
rpcSetMethod: "setSettings",
getFormItems: function() {
return [{
xtype: "fieldset",
title: _("General settings"),
fieldDefaults: {
labelSeparator: ""
},
items: [{
xtype: "checkbox",
name: "enable",
fieldLabel: _("Enable"),
checked: false
},{
xtype: "numberfield",
name: "checks",
fieldLabel: _("Database checks"),
minValue: 0,
maxValue: 50,
allowDecimals: false,
allowBlank: false,
value: 24,
plugins: [{
ptype: "fieldinfo",
text: _("Number of database update checks per day. Set to 0 to disable.")
}]
},{
xtype: "sharedfoldercombo",
name: "quarantine_sharedfolderref",
fieldLabel: _("Quarantine"),
allowNone: true,
allowBlank: true,
plugins: [{
ptype: "fieldinfo",
text: _("The location which is used as quarantine.")
}]
},{
xtype: "checkbox",
name: "logclean",
fieldLabel: _("Log clean files"),
boxLabel: _("Log clean files. This drastically increases the log size."),
checked: false
},{
xtype: "checkbox",
name: "scanpe",
fieldLabel: _("Scan Portable Executable"),
boxLabel: _("Perform a deeper analysis of executable files."),
checked: true
},{
xtype: "checkbox",
name: "scanole2",
fieldLabel: _("Scan OLE2"),
boxLabel: _("Enable scanning of OLE2 files, such as Microsoft Office documents and .msi files."),
checked: true
},{
xtype: "checkbox",
name: "scanhtml",
fieldLabel: _("Scan HTML"),
boxLabel: _("Enable HTML detection and normalisation."),
checked: true
},{
xtype: "checkbox",
name: "scanpdf",
fieldLabel: _("Scan PDF"),
boxLabel: _("Enable scanning within PDF files."),
checked: true
},{
xtype: "checkbox",
name: "scanelf",
fieldLabel: _("Scan ELF"),
boxLabel: _("Enable scanning of ELF files."),
checked: true
},{
xtype: "checkbox",
name: "scanarchive",
fieldLabel: _("Scan archives"),
boxLabel: _("Enable archive scanning."),
checked: true
},{
xtype: "checkbox",
name: "detectbrokenexecutables",
fieldLabel: _("Detect broken executables"),
boxLabel: _("Enable the detection of broken executables (both PE and ELF)."),
checked: false
},{
xtype: "checkbox",
name: "detectpua",
fieldLabel: _("Detect PUA"),
boxLabel: _("Enable the detection of possibly unwanted applications."),
checked: false
},{
xtype: "checkbox",
name: "algorithmicdetection",
fieldLabel: _("Algorithmic detection"),
boxLabel: _("Enable the algorithmic detection."),
checked: true
},{
xtype: "checkbox",
name: "followdirectorysymlinks",
fieldLabel: _("Follow directory symlinks"),
boxLabel: _("Follow directory symlinks."),
checked: false
},{
xtype: "checkbox",
name: "followfilesymlinks",
fieldLabel: _("Follow file symlinks"),
boxLabel: _("Follow regular file symlinks."),
checked: false
},{
xtype: "textarea",
name: "extraoptions",
fieldLabel: _("Extra options"),
allowBlank: true,
plugins: [{
ptype: "fieldinfo",
text: _("Please check the <a href='https://github.com/vrtadmin/clamav-faq/raw/master/manual/clamdoc.pdf' target='_blank'>manual page</a> for more details."),
}]
}]
}];
}
});
OMV.WorkspaceManager.registerPanel({
id: "settings",
path: "/service/clamav",
text: _("Settings"),
position: 10,
className: "OMV.module.admin.service.clamav.Settings"
});

View File

@ -1,3 +1,9 @@
openmediavault-diskstats (6.0-1) UNRELEASED; urgency=low
* Reimplement UI.
-- Volker Theile <volker.theile@openmediavault.org> Mon, 07 Dec 2020 19:01:34 +0100
openmediavault-diskstats (5.1.0-1) stable; urgency=low
* Adapt to modified OMV Python API.

View File

@ -1 +1 @@
9
12

View File

@ -3,7 +3,7 @@ Section: net
XB-Plugin-Section: monitoring
Priority: optional
Maintainer: Volker Theile <volker.theile@openmediavault.org>
Build-Depends: debhelper (>> 7), gettext
Build-Depends: debhelper (>= 12), gettext
Standards-Version: 3.9.6
Homepage: http://www.openmediavault.org

View File

@ -1,3 +1,2 @@
usr/share/openmediavault/* usr/share/openmediavault/
var/www/openmediavault/* var/www/openmediavault/
srv/* srv/

View File

@ -31,11 +31,9 @@ case "$1" in
fi
########################################################################
# Activate package triggers. These triggers are only set during the
# package installation.
# Activate trigger to rebuild workbench configuration files.
########################################################################
dpkg-trigger update-fixperms
dpkg-trigger update-locale
dpkg-trigger update-workbench
;;
abort-upgrade|abort-remove|abort-deconfigure)

View File

@ -30,8 +30,8 @@ case "$1" in
remove)
LANG=C.UTF-8 omv-salt deploy run --no-color --quiet collectd
# Activate trigger to purge cached files.
dpkg-trigger update-fixperms
# Activate trigger to rebuild workbench configuration files.
dpkg-trigger update-workbench
;;
upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)

View File

@ -0,0 +1,24 @@
version: "1.0"
type: component
data:
name: omv-diagnostics-performance-statistics-diskio-rrd-page
type: rrdPage
config:
graphs:
- name: "disk-octets-{{ parentdevicefile | replace('/dev/', '') }}"
label: _("Traffic")
- name: "disk-ops-{{ parentdevicefile | replace('/dev/', '') }}"
label: _("Operations")
- name: "disk-time-{{ parentdevicefile | replace('/dev/', '') }}"
label: _("Time per operation")
label: '{{ parentdevicefile }}'
store:
proxy:
service: FileSystemMgmt
get:
method: enumerateMountedFilesystems
params:
includeroot: true
sorters:
- prop: parentdevicefile
dir: asc

View File

@ -0,0 +1,7 @@
version: "1.0"
type: navigation-item
data:
path: "diagnostics.performance-statistics.diskio"
text: _("Disk I/O")
icon: "mdi:harddisk"
url: "/diagnostics/performance-statistics/diskio"

View File

@ -0,0 +1,6 @@
version: "1.0"
type: route
data:
url: "/diagnostics/performance-statistics/diskio"
title: _("Disk I/O")
component: omv-diagnostics-performance-statistics-diskio-rrd-page

View File

@ -1,99 +0,0 @@
/**
* This file is part of OpenMediaVault.
*
* @license http://www.gnu.org/licenses/gpl.html GPL Version 3
* @author Volker Theile <volker.theile@openmediavault.org>
* @copyright Copyright (c) 2009-2021 Volker Theile
*
* OpenMediaVault is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* OpenMediaVault is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenMediaVault. If not, see <http://www.gnu.org/licenses/>.
*/
// require("js/omv/Rpc.js")
// require("js/omv/data/Store.js")
// require("js/omv/data/Model.js")
// require("js/omv/workspace/panel/Panel.js")
// require("js/omv/workspace/panel/RrdGraph.js")
// require("js/omv/workspace/tab/Panel.js")
/**
* @class OMV.module.admin.diagnostic.system.plugin.DiskIO
* @derived OMV.workspace.tab.Panel
*/
Ext.define("OMV.module.admin.diagnostic.system.plugin.DiskIO", {
extend: "OMV.workspace.tab.Panel",
alias: "omv.plugin.diagnostic.system.diskio",
requires: [
"OMV.Rpc",
"OMV.data.Store",
"OMV.data.Model"
],
title: _("Disk I/O"),
initComponent: function() {
var me = this;
me.items = [];
me.callParent(arguments);
// Execute RPC to get the information required to add tab panels.
OMV.Rpc.request({
callback: function(id, success, response) {
var store = Ext.create("OMV.data.Store", {
model: OMV.data.Model.createImplicit({
idProperty: "parentdevicefile",
fields: [{
name: "parentdevicefile",
type: "string"
}]
}),
sorters: [{
direction: "ASC",
property: "parentdevicefile"
}],
data: response
});
store.filter("parentdevicefile", /^\/dev\/.+$/);
store.each(function(record) {
var deviceName = record.get("parentdevicefile").replace(
/^\/dev\//, "");
// Create a tab panel for each disk.
var tab = Ext.create("OMV.workspace.tab.Panel", {
title: record.get("parentdevicefile")
});
tab.add(Ext.create("OMV.workspace.panel.RrdGraph", {
title: _("Traffic"),
rrdGraphName: "disk-octets-" + deviceName
}));
tab.add(Ext.create("OMV.workspace.panel.RrdGraph", {
title: _("Operations"),
rrdGraphName: "disk-ops-" + deviceName
}));
tab.add(Ext.create("OMV.workspace.panel.RrdGraph", {
title: _("Time per operation"),
rrdGraphName: "disk-time-" + deviceName
}));
tab.setActiveTab(0);
this.add(tab);
}, me);
me.setActiveTab(0);
},
relayErrors: false,
rpcData: {
service: "FileSystemMgmt",
method: "enumerateMountedFilesystems",
params: {
includeroot: true
}
}
});
}
});

View File

@ -1,3 +1,9 @@
openmediavault-forkeddaapd (6.0-1) UNRELEASED; urgency=low
* Reimplement UI.
-- Volker Theile <volker.theile@openmediavault.org> Sun, 06 Dec 2020 23:35:43 +0100
openmediavault-forkeddaapd (5.0.3-2) stable; urgency=low
* Backported #951 to fix bug in forked-daapd.conf.

View File

@ -1 +1 @@
9
12

View File

@ -3,7 +3,7 @@ Section: sound
XB-Plugin-Section: multimedia
Priority: optional
Maintainer: Volker Theile <volker.theile@openmediavault.org>
Build-Depends: debhelper (>> 7), gettext
Build-Depends: debhelper (>= 12), gettext
Standards-Version: 3.9.6
Homepage: http://www.openmediavault.org

View File

@ -1,3 +1,2 @@
usr/share/openmediavault/* usr/share/openmediavault/
var/www/openmediavault/* var/www/openmediavault/
srv/* srv/

View File

@ -37,11 +37,9 @@ case "$1" in
fi
########################################################################
# Activate package triggers. These triggers are only set during the
# package installation.
# Activate trigger to rebuild workbench configuration files.
########################################################################
dpkg-trigger update-fixperms
dpkg-trigger update-locale
dpkg-trigger update-workbench
########################################################################
# Initialize and migrate configuration database.

View File

@ -29,8 +29,8 @@ remove_action() {
# way we can simply purge this service configuration file. Finally
# reload the monit configuration.
omv-salt deploy run --no-color monit
# Activate trigger to purge cached files.
dpkg-trigger update-fixperms
# Activate trigger to rebuild workbench configuration files.
dpkg-trigger update-workbench
}
case "$1" in

View File

@ -0,0 +1,71 @@
version: "1.0"
type: component
data:
name: omv-services-daapd-form-page
type: formPage
config:
request:
service: ForkedDaapd
get:
method: get
post:
method: set
fields:
- type: checkbox
name: enable
label: _("Enabled")
value: false
- type: textInput
name: libraryname
label: _("Library name")
hint: _("The name of the library as displayed by the clients.")
value: ""
validators:
required: true
- type: numberInput
name: port
label: _("Port")
hint: _("Port to listen on.")
value: 3689
validators:
min: 0
max: 65535
patternType: port
required: true
- type: sharedFolderSelect
name: sharedfolderref
label: _("Shared folder")
hint: _("The location of the media files to share.")
hasEmptyOption: true
validators:
requiredIf:
operator: truthy
arg0:
prop: enable
- type: checkbox
name: passwordrequired
label: _("Authentication")
hint: _("A password is required to access the library.")
value: false
- type: passwordInput
name: password
label: _("Password")
autocomplete: new-password
value: ""
modifiers:
- type: readonly
constraint:
operator: truthy
arg0:
prop: passwordrequired
validators:
requiredIf:
operator: truthy
arg0:
prop: passwordrequired
buttons:
- template: submit
- template: cancel
execute:
type: url
url: "/services"

View File

@ -0,0 +1,7 @@
version: "1.0"
type: navigation-item
data:
path: "services.daapd"
text: _("iTunes/DAAP")
icon: "mdi:volume-high"
url: "/services/daapd"

View File

@ -0,0 +1,8 @@
version: "1.0"
type: route
data:
url: "/services/daapd"
title: _("iTunes/DAAP")
editing: true
notificationTitle: _("Updated iTunes/DAAP settings.")
component: omv-services-daapd-form-page

View File

@ -1,129 +0,0 @@
/**
* This file is part of OpenMediaVault.
*
* @license http://www.gnu.org/licenses/gpl.html GPL Version 3
* @author Volker Theile <volker.theile@openmediavault.org>
* @copyright Copyright (c) 2009-2021 Volker Theile
*
* OpenMediaVault is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* OpenMediaVault is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenMediaVault. If not, see <http://www.gnu.org/licenses/>.
*/
// require("js/omv/WorkspaceManager.js")
// require("js/omv/workspace/form/Panel.js")
// require("js/omv/form/field/SharedFolderComboBox.js")
/**
* @class OMV.module.admin.service.daapd.Settings
* @derived OMV.workspace.form.Panel
*/
Ext.define("OMV.module.admin.service.daapd.Settings", {
extend: "OMV.workspace.form.Panel",
requires: [
"OMV.form.field.SharedFolderComboBox"
],
rpcService: "ForkedDaapd",
plugins: [{
ptype: "linkedfields",
correlations: [{
name: "password",
conditions: [
{ name: "passwordrequired", value: true }
],
properties: [
"!allowBlank",
"!readOnly"
]
},{
name: "sharedfolderref",
conditions: [
{ name: "enable", value: true }
],
properties: "!allowBlank"
}]
}],
getFormItems: function() {
return [{
xtype: "fieldset",
title: _("General settings"),
fieldDefaults: {
labelSeparator: ""
},
items: [{
xtype: "checkbox",
name: "enable",
fieldLabel: _("Enable"),
checked: false
},{
xtype: "textfield",
name: "libraryname",
fieldLabel: _("Library name"),
allowBlank: false,
plugins: [{
ptype: "fieldinfo",
text: _("The name of the library as displayed by the clients.")
}]
},{
xtype: "numberfield",
name: "port",
fieldLabel: _("Port"),
vtype: "port",
minValue: 0,
maxValue: 65535,
allowDecimals: false,
allowBlank: false,
value: 3689,
plugins: [{
ptype: "fieldinfo",
text: _("Port to listen on.")
}]
},{
xtype: "sharedfoldercombo",
name: "sharedfolderref",
fieldLabel: _("Shared folder"),
allowNone: true,
plugins: [{
ptype: "fieldinfo",
text: _("The location of the media files to share.")
}]
},{
xtype: "checkbox",
name: "passwordrequired",
fieldLabel: _("Authentication"),
checked: false,
boxLabel: _("A password is required to access the library.")
},{
xtype: "passwordfield",
name: "password",
fieldLabel: _("Password"),
allowBlank: true
}]
}];
}
});
OMV.WorkspaceManager.registerNode({
id: "daapd",
path: "/service",
text: _("iTunes/DAAP"),
iconCls: "mdi mdi-volume-high"
});
OMV.WorkspaceManager.registerPanel({
id: "settings",
path: "/service/daapd",
text: _("Settings"),
position: 10,
className: "OMV.module.admin.service.daapd.Settings"
});

View File

@ -1,3 +1,9 @@
openmediavault-keyring (1.0.1) stable; urgency=low
* Bump compat level to 12, build depending on debhelper (>= 12)
-- Volker Theile <volker.theile@openmediavault.org> Tue, 23 Mar 2021 10:28:35 +0100
openmediavault-keyring (1.0) stable; urgency=low
* Add new key.

View File

@ -1 +1 @@
9
12

View File

@ -2,7 +2,7 @@ Source: openmediavault-keyring
Priority: important
Section: misc
Maintainer: Volker Theile <volker.theile@openmediavault.org>
Build-Depends: debhelper (>= 5), gnupg
Build-Depends: debhelper (>= 12), gnupg
Standards-Version: 3.7.3
Homepage: http://www.openmediavault.org

View File

@ -1 +1 @@
9
12

View File

@ -3,7 +3,7 @@ Section: admin
XB-Plugin-Section: filesystems
Priority: optional
Maintainer: Volker Theile <volker.theile@openmediavault.org>
Build-Depends: debhelper (>> 7), gettext
Build-Depends: debhelper (>= 12), gettext
Standards-Version: 3.9.6
Homepage: http://www.openmediavault.org

View File

@ -1,3 +1,2 @@
usr/share/openmediavault/* usr/share/openmediavault/
usr/share/php/openmediavault/* usr/share/php/openmediavault/
var/www/openmediavault/* var/www/openmediavault/

View File

@ -27,11 +27,9 @@ set -e
case "$1" in
configure)
########################################################################
# Activate package triggers. These triggers are only set during the
# package installation.
# Activate trigger to rebuild workbench configuration files.
########################################################################
dpkg-trigger update-fixperms
dpkg-trigger update-locale
dpkg-trigger update-workbench
;;
abort-upgrade|abort-remove|abort-deconfigure)

View File

@ -29,8 +29,8 @@ case "$1" in
;;
remove)
# Activate trigger to purge cached files.
dpkg-trigger update-fixperms
# Activate trigger to rebuild workbench configuration files.
dpkg-trigger update-workbench
;;
upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)

View File

@ -9,8 +9,11 @@
"required": true
},
"devices": {
"type": "string",
"pattern": "^(.+[,;])*.+$",
"type": "array",
"items": {
"type": "string",
"format": "devicefile"
},
"required": true
}
}
@ -80,8 +83,11 @@
"required": true
},
"devices": {
"type": "string",
"pattern": "^(.+[,;])*.+$",
"type": "array",
"items": {
"type": "string",
"format": "devicefile"
},
"required": true
}
}
@ -98,8 +104,11 @@
"required": true
},
"devices": {
"type": "string",
"pattern": "^(.+[,;])*.+$",
"type": "array",
"items": {
"type": "string",
"format": "devicefile"
},
"required": true
}
}
@ -115,7 +124,9 @@
"required": true
},
"size": {
"type": "string",
"type": "integer",
"minimum": 1,
"maximum": 100,
"required": true
},
"vgname": {
@ -124,6 +135,19 @@
}
}
}
},{
"type": "rpc",
"id": "rpc.logicalvolumemgmt.getlogicalvolume",
"params": {
"type": "object",
"properties": {
"name": {
"type": "string",
"format": "devicefile",
"required": true
}
}
}
},{
"type": "rpc",
"id": "rpc.logicalvolumemgmt.renamelogicalvolume",
@ -143,7 +167,7 @@
}
},{
"type": "rpc",
"id": "rpc.logicalvolumemgmt.modifylogicalvolume",
"id": "rpc.logicalvolumemgmt.extendlogicalvolume",
"params": {
"type": "object",
"properties": {
@ -153,7 +177,28 @@
"required": true
},
"size": {
"type": "integer",
"minimum": 1,
"maximum": 100,
"required": true
}
}
}
},{
"type": "rpc",
"id": "rpc.logicalvolumemgmt.reducelogicalvolume",
"params": {
"type": "object",
"properties": {
"devicefile": {
"type": "string",
"format": "devicefile",
"required": true
},
"size": {
"type": "integer",
"minimum": 1,
"maximum": 100,
"required": true
}
}

View File

@ -51,9 +51,11 @@ class OMVRpcServiceLogicalVolumeMgmt extends \OMV\Rpc\ServiceAbstract {
$this->registerMethod("getLogicalVolumesList");
$this->registerMethod("getLogicalVolumeCandidates");
$this->registerMethod("createLogicalVolume");
$this->registerMethod("getLogicalVolume");
$this->registerMethod("renameLogicalVolume");
$this->registerMethod("deleteLogicalVolume");
$this->registerMethod("modifyLogicalVolume");
$this->registerMethod("extendLogicalVolume");
$this->registerMethod("reduceLogicalVolume");
$this->registerMethod("createLogicalVolumeSnapshot");
}
@ -376,25 +378,23 @@ class OMVRpcServiceLogicalVolumeMgmt extends \OMV\Rpc\ServiceAbstract {
]);
// Validate the parameters of the RPC service method.
$this->validateMethodParams($params,
"rpc.logicalvolumemgmt.createvolumegroup");
// Get the physical volumes to be used.
$devices = preg_split("/[,;]/", $params['devices']);
"rpc.logicalvolumemgmt.createvolumegroup");
// Create the volume group.
$vg = new \OMV\System\Storage\Lvm\VolumeGroup($params['name']);
$vg->create($devices);
$vg->create($params['devices']);
// Notify configuration changes.
$dispatcher = \OMV\Engine\Notify\Dispatcher::getInstance();
$dispatcher->notify(OMV_NOTIFY_CREATE,
"org.openmediavault.conf.system.storage.lvm.volumegroup", [
"name" => $params['name'],
"devices" => $devices
]);
"org.openmediavault.conf.system.storage.lvm.volumegroup", [
"name" => $params['name'],
"devices" => $params['devices']
]);
}
/**
* Get volume group details.
* @param params An array containing the following fields:
* \em uuid name The name of the volume group, e.g. vg0 or /dev/vg1.
* \em name The name of the volume group, e.g. vg0 or /dev/vg1.
* @param context The context of the caller.
* @return The volume group details containing the fields \em devicefile,
* \em uuid, \em name, \em free, \em size, \em pvname, \em lvname,
@ -534,23 +534,21 @@ class OMVRpcServiceLogicalVolumeMgmt extends \OMV\Rpc\ServiceAbstract {
]);
// Validate the parameters of the RPC service method.
$this->validateMethodParams($params,
"rpc.logicalvolumemgmt.extendvolumegroup");
"rpc.logicalvolumemgmt.extendvolumegroup");
// Check if the volume group exists.
$vg = new \OMV\System\Storage\Lvm\VolumeGroup($params['devicefile']);
$vg->assertExists();
// Get the physical volumes assigned to the volume group.
$pvs = $vg->getPVName();
// Get the new assigned physical volumes.
$extendPV = preg_split("/[,;]/", $params['devices']);
// Extend the volume group.
if (!empty($extendPV)) {
$vg->extend($extendPV);
if (!empty($params['devices'])) {
$vg->extend($params['devices']);
// Notify configuration changes.
$dispatcher = \OMV\Engine\Notify\Dispatcher::getInstance();
$dispatcher->notify(OMV_NOTIFY_MODIFY,
"org.openmediavault.conf.system.storage.lvm.volumegroup", [
"devicefile" => $params['devicefile'],
"devices" => array_merge($extendPV, $pvs)
"devices" => array_merge($params['devices'], $pvs)
]);
}
}
@ -568,23 +566,21 @@ class OMVRpcServiceLogicalVolumeMgmt extends \OMV\Rpc\ServiceAbstract {
]);
// Validate the parameters of the RPC service method.
$this->validateMethodParams($params,
"rpc.logicalvolumemgmt.reducevolumegroup");
"rpc.logicalvolumemgmt.reducevolumegroup");
// Check if the volume group exists.
$vg = new \OMV\System\Storage\Lvm\VolumeGroup($params['devicefile']);
$vg->assertExists();
// Get the physical volumes assigned to the volume group.
$pvs = $vg->getPVName();
// Get the removed physical volumes.
$reducePV = preg_split("/[,;]/", $params['devices']);
// Reduce the volume group.
if (!empty($reducePV)) {
$vg->reduce($reducePV);
if (!empty($params['devices'])) {
$vg->reduce($params['devices']);
// Notify configuration changes.
$dispatcher = \OMV\Engine\Notify\Dispatcher::getInstance();
$dispatcher->notify(OMV_NOTIFY_MODIFY,
"org.openmediavault.conf.system.storage.lvm.volumegroup", [
"devicefile" => $params['devicefile'],
"devices" => array_diff($pvs, $reducePV)
"devices" => array_diff($pvs, $params['devices'])
]);
}
}
@ -679,8 +675,7 @@ class OMVRpcServiceLogicalVolumeMgmt extends \OMV\Rpc\ServiceAbstract {
* Create a logical volume.
* @param params An array containing the following fields:
* \em name The name of the logical volume, e.g. lv0.
* \em size The size of the logical volume in bytes. This is a string to
* support volumes > 2GiB on 32bit systems.
* \em size The size of the logical volume in percent.
* \em vgname The name of the volume group, e.g. /dev/vg0.
* @param context The context of the caller.
* @return void
@ -693,8 +688,7 @@ class OMVRpcServiceLogicalVolumeMgmt extends \OMV\Rpc\ServiceAbstract {
// Validate the parameters of the RPC service method.
$this->validateMethodParams($params,
"rpc.logicalvolumemgmt.createlogicalvolume");
// Create the logical volume. Convert size to KiB to ensure it is
// a multiple of 512.
// Create the logical volume.
\OMV\System\Storage\Lvm\LogicalVolume::create(
$params['name'], $params['size'], $params['vgname']);
// Notify configuration changes.
@ -707,9 +701,43 @@ class OMVRpcServiceLogicalVolumeMgmt extends \OMV\Rpc\ServiceAbstract {
]);
}
/**
* Get logical volume details.
* @param params An array containing the following fields:
* \em devicefile The device file of the logical volume.
* @param context The context of the caller.
* @return The logical volume details containing the fields
* \em devicefile, \em uuid, \em name, \em size, \em vgname,
* \em attributes, \em vgattributes and \em isavailable.
*/
public function getLogicalVolume($params, $context) {
// Validate the RPC caller context.
$this->validateMethodContext($context, [
"role" => OMV_ROLE_ADMINISTRATOR
]);
// Validate the parameters of the RPC service method.
$this->validateMethodParams($params,
"rpc.logicalvolumemgmt.getlogicalvolume");
// Get the logical volume details.
$lv = new \OMV\System\Storage\Lvm\LogicalVolume($params['name']);
$lv->assertExists();
return [
"devicefile" => $lv->getPreferredDeviceFile(),
"uuid" => $lv->getUuid(),
"name" => $lv->getName(),
"size" => $lv->getSize(),
"vgname" => $lv->getVGName(),
"attributes" => $lv->getAttributes(),
"vgattributes" => $lv->getVGAttributes(),
"isavailable" => $lv->IsMediaAvailable()
];
}
/**
* Rename a logical volume.
* @param params The method parameters.
* @param params An array containing the following fields:
* \em devicefile The device file of the logical volume.
* \em name The new name of the logical volume.
* @param context The context of the caller.
* @return void
*/
@ -765,38 +793,54 @@ class OMVRpcServiceLogicalVolumeMgmt extends \OMV\Rpc\ServiceAbstract {
}
/**
* Modify a logical volume.
* Extend a logical volume.
* @param params An array containing the following fields:
* \em devicefile The device file of the logical volume to modify.
* \em size The new size of the logical volume in bytes. This is a string
* to support volumes > 2GiB on 32bit systems.
* \em size The percentage of the total space in the volume group.
* @param context The context of the caller.
* @return void
*/
public function modifyLogicalVolume($params, $context) {
public function extendLogicalVolume($params, $context) {
// Validate the RPC caller context.
$this->validateMethodContext($context, [
"role" => OMV_ROLE_ADMINISTRATOR
]);
// Validate the parameters of the RPC service method.
$this->validateMethodParams($params,
"rpc.logicalvolumemgmt.modifylogicalvolume");
"rpc.logicalvolumemgmt.extendlogicalvolume");
// Check if logical volume exists.
$lv = new \OMV\System\Storage\Lvm\LogicalVolume($params['devicefile']);
$lv->assertExists();
// Calculate the new size of the logical volume to decide
// whether it must be extended or reduced.
$vg = new \OMV\System\Storage\Lvm\VolumeGroup($lv->getVGName());
$vg->assertExists();
// Extend or reduce volume size?
switch (bccomp($lv->getSize(), $params['size'])) {
case -1: // Extend
$lv->extend($params['size']);
break;
case 1: // Reduce
$lv->reduce($params['size']);
break;
}
$lv->extend($params['size']);
// Notify configuration changes.
$dispatcher = \OMV\Engine\Notify\Dispatcher::getInstance();
$dispatcher->notify(OMV_NOTIFY_MODIFY,
"org.openmediavault.conf.system.storage.lvm.logicalvolume", [
"devicefile" => $params['devicefile'],
"size" => $params['size']
]);
}
/**
* Reduce a logical volume.
* @param params An array containing the following fields:
* \em devicefile The device file of the logical volume to modify.
* \em size The percentage of the total space in the volume group.
* @param context The context of the caller.
* @return void
*/
public function reduceLogicalVolume($params, $context) {
// Validate the RPC caller context.
$this->validateMethodContext($context, [
"role" => OMV_ROLE_ADMINISTRATOR
]);
// Validate the parameters of the RPC service method.
$this->validateMethodParams($params,
"rpc.logicalvolumemgmt.reducelogicalvolume");
// Check if logical volume exists.
$lv = new \OMV\System\Storage\Lvm\LogicalVolume($params['devicefile']);
$lv->assertExists();
$lv->reduce($params['size']);
// Notify configuration changes.
$dispatcher = \OMV\Engine\Notify\Dispatcher::getInstance();
$dispatcher->notify(OMV_NOTIFY_MODIFY,

View File

@ -0,0 +1,53 @@
version: "1.0"
type: component
data:
name: omv-storage-lvm-lv-create-form-page
type: formPage
config:
request:
service: LogicalVolumeMgmt
post:
method: createLogicalVolume
fields:
- type: textInput
name: name
label: _("Name")
value: ""
validators:
required: true
pattern:
pattern: "^[a-zA-Z0-9+_\\.\\-]+$"
errorData?: _("Invalid name")
- type: select
name: vgname
label: _("Volume group")
placeholder: _("Select a volume group ...")
valueField: name
textField: description
store:
proxy:
service: LogicalVolumeMgmt
get:
method: getLogicalVolumeCandidates
sorters:
- dir: asc
prop: name
validators:
required: true
- type: slider
name: size
label: _("Size")
hint: _("The percentage of the total space in the volume group to allocate for the new logical volume.")
value: 50,
validators:
min: 1
max: 100
buttons:
- template: submit
execute:
type: url
url: "/storage/lvm/lvs"
- template: cancel
execute:
type: url
url: "/storage/lvm/lvs"

View File

@ -0,0 +1,93 @@
version: "1.0"
type: component
data:
name: omv-storage-lvm-lv-datatable-page
type: datatablePage
config:
autoReload: false
stateId: 87081dac-a91b-4a5e-901e-e69290b533ee
sorters:
- dir: asc
prop: devicefile
store:
proxy:
service: LogicalVolumeMgmt
get:
method: getLogicalVolumesList
columns:
- name: _("Device")
prop: devicefile
flexGrow: 1
sortable: true
hidden: true
- name: _("Name")
prop: name
flexGrow: 1
sortable: true
- name: _("Capacity")
prop: size
flexGrow: 1
sortable: true
cellTemplateName: binaryUnit
- name: _("Volume Group")
prop: vgname
flexGrow: 1
sortable: true
- name: _("Active")
prop: isavailable
flexGrow: 1
sortable: true
cellTemplateName: checkIcon
actions:
- template: create
execute:
type: url
url: "/storage/lvm/lvs/create"
- template: edit
execute:
type: url
url: "/storage/lvm/lvs/edit/{{ devicefile }}"
- type: iconButton
icon: "mdi:camera"
tooltip: _("Snapshot")
enabledConstraints:
minSelected: 1
maxSelected: 1
constraint:
- operator: falsy
arg0:
prop: "attributes.snapshot"
execute:
type: request
request:
service: LogicalVolumeMgmt
method: createLogicalVolumeSnapshot
params:
devicefile: "{{ devicefile }}"
successNotification: _("Created snapshot of logical volume '{{ devicefile }}'.")
- type: iconButton
icon: expand
tooltip: _("Extend")
enabledConstraints:
minSelected: 1
maxSelected: 1
execute:
type: url
url: "/storage/lvm/lvs/extend/{{ _selected[0].devicefile }}"
- type: iconButton
icon: collapse
tooltip: _("Reduce")
enabledConstraints:
minSelected: 1
maxSelected: 1
execute:
type: url
url: "/storage/lvm/lvs/reduce/{{ _selected[0].devicefile }}"
- template: delete
execute:
type: request
request:
service: LogicalVolumeMgmt
method: deleteLogicalVolume
params:
devicefile: "{{ _selected[0].devicefile }}"

View File

@ -0,0 +1,35 @@
version: "1.0"
type: component
data:
name: omv-storage-lvm-lv-edit-form-page
type: formPage
config:
request:
service: LogicalVolumeMgmt
get:
method: getLogicalVolume
params:
name: "{{ _routeParams.devicefile }}"
post:
method: renameLogicalVolume
fields:
- type: hidden
name: devicefile
- type: textInput
name: name
label: _("Name")
value: ""
validators:
required: true
pattern:
pattern: "^[a-zA-Z0-9+_\\.\\-]+$"
errorData?: _("Invalid name")
buttons:
- template: submit
execute:
type: url
url: "/storage/lvm/lvs"
- template: cancel
execute:
type: url
url: "/storage/lvm/lvs"

View File

@ -0,0 +1,68 @@
version: "1.0"
type: component
data:
name: omv-storage-lvm-lv-extend-form-page
type: formPage
config:
request:
service: LogicalVolumeMgmt
get:
method: getLogicalVolume
params:
name: "{{ _routeParams.devicefile }}"
transform:
capacity: "{{ size | binaryunit }}"
filter:
mode: omit
props:
- size
post:
method: extendLogicalVolume
fields:
- type: hidden
name: devicefile
- type: textInput
name: name
label: _("Name")
value: ""
disabled: true
submitValue: false
- type: select
name: vgname
label: _("Volume group")
placeholder: _("Select a volume group ...")
valueField: name
textField: description
disabled: true
submitValue: false
store:
proxy:
service: LogicalVolumeMgmt
get:
method: getLogicalVolumeCandidates
sorters:
- dir: asc
prop: name
- type: textInput
name: capacity
label: _("Capacity")
value: ""
disabled: true
submitValue: false
- type: slider
name: size
label: _("Size")
hint: _("The percentage of the total space in the volume group to use by the logical volume.")
value: 100,
validators:
min: 1
max: 100
buttons:
- template: submit
execute:
type: url
url: "/storage/lvm/lvs"
- template: cancel
execute:
type: url
url: "/storage/lvm/lvs"

View File

@ -0,0 +1,10 @@
version: "1.0"
type: component
data:
name: omv-storage-lvm-lv-reduce-form-page
type: formPage
extends: omv-storage-lvm-lv-extend-form-page
config:
request:
post:
method: reduceLogicalVolume

View File

@ -0,0 +1,5 @@
version: "1.0"
type: component
data:
name: omv-storage-lvm-navigation-page
type: navigationPage

View File

@ -0,0 +1,39 @@
version: "1.0"
type: component
data:
name: omv-storage-lvm-pv-create-form-page
type: formPage
config:
request:
service: LogicalVolumeMgmt
post:
method: createPhysicalVolume
confirmationDialogConfig:
template: confirmation
message: _("Do you really want to create a physical volume on '{{ devicefile }}'?")
fields:
- type: select
name: devicefile
label: _("Device")
placeholder: _("Select a device ...")
valueField: devicefile
textField: description
store:
proxy:
service: LogicalVolumeMgmt
get:
method: getPhysicalVolumeCandidates
sorters:
- dir: asc
prop: devicefile
validators:
required: true
buttons:
- template: submit
execute:
type: url
url: "/storage/lvm/pvs"
- template: cancel
execute:
type: url
url: "/storage/lvm/pvs"

View File

@ -0,0 +1,69 @@
version: "1.0"
type: component
data:
name: omv-storage-lvm-pv-datatable-page
type: datatablePage
config:
autoReload: false
stateId: 4f7be743-777a-4547-9277-21a30ce0856b
sorters:
- dir: asc
prop: devicefile
store:
proxy:
service: LogicalVolumeMgmt
get:
method: getPhysicalVolumesList
columns:
- name: _("Device")
prop: devicefile
flexGrow: 1
sortable: true
- name: _("Available")
prop: size
flexGrow: 1
sortable: true
cellTemplateName: binaryUnit
- name: _("Used")
prop: used
flexGrow: 1
sortable: true
cellTemplateName: binaryUnit
- name: _("Volume Group")
prop: vgname
flexGrow: 2
sortable: true
actions:
- template: create
execute:
type: url
url: "/storage/lvm/pvs/create"
- type: iconButton
icon: "expand"
tooltip: _("Resize")
enabledConstraints:
minSelected: 1
maxSelected: 1
confirmationDialogConfig:
template: confirmation
message: _("Do you really want to resize the selected physical volume?")
execute:
type: request
request:
service: LogicalVolumeMgmt
method: resizePhysicalVolume
params:
devicefile: '{{ _selected[0].devicefile }}'
- template: delete
enabledConstraints:
constraint:
- operator: falsy
arg0:
prop: "_used"
execute:
type: request
request:
service: LogicalVolumeMgmt
method: deletePhysicalVolume
params:
devicefile: "{{ _selected[0].devicefile }}"

View File

@ -0,0 +1,46 @@
version: "1.0"
type: component
data:
name: omv-storage-lvm-vg-create-form-page
type: formPage
config:
request:
service: LogicalVolumeMgmt
post:
method: createVolumeGroup
fields:
- type: textInput
name: name
label: _("Name")
value: ""
validators:
required: true
pattern:
pattern: "^[a-zA-Z0-9+_\\.\\-]+$"
errorData?: _("Invalid name")
- type: select
name: devices
label: _("Devices")
placeholder: _("Select devices ...")
multiple: true
valueField: devicefile
textField: description
store:
proxy:
service: LogicalVolumeMgmt
get:
method: getVolumeGroupCandidates
sorters:
- dir: asc
prop: devicefile
validators:
required: true
buttons:
- template: submit
execute:
type: url
url: "/storage/lvm/vgs"
- template: cancel
execute:
type: url
url: "/storage/lvm/vgs"

View File

@ -0,0 +1,86 @@
version: "1.0"
type: component
data:
name: omv-storage-lvm-vg-datatable-page
type: datatablePage
config:
autoReload: false
stateId: af0712c4-9f60-493a-9be4-c9658f958f99
sorters:
- dir: asc
prop: devicefile
store:
proxy:
service: LogicalVolumeMgmt
get:
method: getVolumeGroupsList
columns:
- name: _("Device")
prop: devicefile
flexGrow: 1
sortable: true
hidden: true
- name: _("Name")
prop: name
flexGrow: 1
sortable: true
- name: _("Available")
prop: size
flexGrow: 1
sortable: true
cellTemplateName: binaryUnit
- name: _("Free")
prop: free
flexGrow: 1
sortable: true
cellTemplateName: binaryUnit
- name: _("Physical Volumes")
prop: pvname
flexGrow: 2
sortable: true
cellTemplateName: unsortedList
- name: _("Logical Volumes")
prop: lvname
flexGrow: 2
sortable: true
cellTemplateName: unsortedList
actions:
- template: create
execute:
type: url
url: "/storage/lvm/vgs/create"
- template: edit
execute:
type: url
url: "/storage/lvm/vgs/edit/{{ _selected[0].name }}"
- type: iconButton
icon: expand
tooltip: _("Extend")
enabledConstraints:
minSelected: 1
maxSelected: 1
execute:
type: url
url: "/storage/lvm/vgs/extend/{{ _selected[0].name }}"
- type: iconButton
icon: collapse
tooltip: _("Reduce")
enabledConstraints:
minSelected: 1
maxSelected: 1
execute:
type: url
url: "/storage/lvm/vgs/reduce/{{ _selected[0].name }}"
- template: delete
enabledConstraints:
constraint:
- operator: falsy
arg0:
prop: "_used"
execute:
type: request
request:
service: LogicalVolumeMgmt
method: deleteVolumeGroup
params:
name: "{{ _selected[0].name }}"

View File

@ -0,0 +1,35 @@
version: "1.0"
type: component
data:
name: omv-storage-lvm-vg-edit-form-page
type: formPage
config:
request:
service: LogicalVolumeMgmt
get:
method: getVolumeGroup
params:
name: "{{ _routeParams.name }}"
post:
method: renameVolumeGroup
fields:
- type: hidden
name: devicefile
- type: textInput
name: name
label: _("Name")
value: ""
validators:
required: true
pattern:
pattern: "^[a-zA-Z0-9+_\\.\\-]+$"
errorData?: _("Invalid name")
buttons:
- template: submit
execute:
type: url
url: "/storage/lvm/vgs"
- template: cancel
execute:
type: url
url: "/storage/lvm/vgs"

View File

@ -0,0 +1,54 @@
version: "1.0"
type: component
data:
name: omv-storage-lvm-vg-extend-form-page
type: formPage
config:
request:
service: LogicalVolumeMgmt
get:
method: getVolumeGroup
params:
name: "{{ _routeParams.name }}"
filter:
mode: pick
props:
- name
post:
method: extendVolumeGroup
fields:
- type: hidden
name: devicefile
- type: textInput
name: name
label: _("Name")
value: ""
disabled: true
submitValue: false
- type: select
name: devices
label: _("Devices")
placeholder: _("Select devices ...")
hint: _("Select the devices used to extend the volume group.")
multiple: true
valueField: devicefile
textField: description
store:
proxy:
service: LogicalVolumeMgmt
get:
method: getVolumeGroupCandidates
sorters:
- dir: asc
prop: devicefile
validators:
required: true
buttons:
- template: submit
execute:
type: url
url: "/storage/lvm/vgs"
- template: cancel
execute:
type: url
url: "/storage/lvm/vgs"

View File

@ -0,0 +1,60 @@
version: "1.0"
type: component
data:
name: omv-storage-lvm-vg-reduce-form-page
type: formPage
config:
request:
service: LogicalVolumeMgmt
get:
method: getVolumeGroup
params:
name: "{{ _routeParams.name }}"
filter:
mode: pick
props:
- name
post:
method: reduceVolumeGroup
fields:
- type: hidden
name: devicefile
- type: textInput
name: name
label: _("Name")
value: ""
disabled: true
submitValue: false
- type: select
name: devices
label: _("Devices")
placeholder: _("Select devices ...")
hint: _("Select the devices used to reduce from the volume group.")
multiple: true
valueField: devicefile
textField: description
store:
proxy:
service: LogicalVolumeMgmt
get:
method: getVolumeGroupPhysicalVolumes
params:
name: "{{ _routeParams.name }}"
sorters:
- dir: asc
prop: devicefile
filters:
- operator: falsy
arg0:
prop: "_used"
validators:
required: true
buttons:
- template: submit
execute:
type: url
url: "/storage/lvm/vgs"
- template: cancel
execute:
type: url
url: "/storage/lvm/vgs"

View File

@ -0,0 +1,8 @@
version: "1.0"
type: navigation-item
data:
path: "storage.lvm.lvs"
text: _("Logical Volumes")
icon: "mdi:database"
url: "/storage/lvm/lvs"
position: 30

View File

@ -0,0 +1,8 @@
version: "1.0"
type: navigation-item
data:
path: "storage.lvm.pvs"
text: _("Physical Volumes")
icon: "mdi:database"
url: "/storage/lvm/pvs"
position: 10

View File

@ -0,0 +1,8 @@
version: "1.0"
type: navigation-item
data:
path: "storage.lvm.vgs"
text: _("Volume Groups")
icon: "mdi:database"
url: "/storage/lvm/vgs"
position: 20

View File

@ -0,0 +1,7 @@
version: "1.0"
type: navigation-item
data:
path: "storage.lvm"
text: _("Logical Volume Management")
icon: "mdi:database"
url: "/storage/lvm"

View File

@ -0,0 +1,7 @@
version: "1.0"
type: route
data:
url: "/storage/lvm/lvs/create"
title: _("Create")
notificationTitle: _("Created logical volume '{{ name }}'.")
component: omv-storage-lvm-lv-create-form-page

View File

@ -0,0 +1,8 @@
version: "1.0"
type: route
data:
url: "/storage/lvm/lvs/edit/:devicefile"
title: _("Edit")
editing: true
notificationTitle: _("Updated logical volume '{{ devicefile }}'.")
component: omv-storage-lvm-lv-edit-form-page

View File

@ -0,0 +1,8 @@
version: "1.0"
type: route
data:
url: "/storage/lvm/lvs/extend/:devicefile"
title: _("Extend")
editing: true
notificationTitle: _("Extended logical volume '{{ devicefile }}'.")
component: omv-storage-lvm-lv-extend-form-page

View File

@ -0,0 +1,8 @@
version: "1.0"
type: route
data:
url: "/storage/lvm/lvs/reduce/:devicefile"
title: _("Reduce")
editing: true
notificationTitle: _("Extended logical volume '{{ devicefile }}'.")
component: omv-storage-lvm-lv-reduce-form-page

View File

@ -0,0 +1,6 @@
version: "1.0"
type: route
data:
url: "/storage/lvm/lvs"
title: _("Logical Volumes")
component: omv-storage-lvm-lv-datatable-page

View File

@ -0,0 +1,7 @@
version: "1.0"
type: route
data:
url: "/storage/lvm/pvs/create"
title: _("Create")
notificationTitle: _("Created physical volume {{ devicefile }}.")
component: omv-storage-lvm-pv-create-form-page

View File

@ -0,0 +1,6 @@
version: "1.0"
type: route
data:
url: "/storage/lvm/pvs"
title: _("Physical Volumes")
component: omv-storage-lvm-pv-datatable-page

View File

@ -0,0 +1,7 @@
version: "1.0"
type: route
data:
url: "/storage/lvm/vgs/create"
title: _("Create")
notificationTitle: _("Created volume group '{{ name }}'.")
component: omv-storage-lvm-vg-create-form-page

View File

@ -0,0 +1,8 @@
version: "1.0"
type: route
data:
url: "/storage/lvm/vgs/edit/:name"
title: _("Edit")
editing: true
notificationTitle: _("Updated volume group '{{ devicefile }}'.")
component: omv-storage-lvm-vg-edit-form-page

View File

@ -0,0 +1,8 @@
version: "1.0"
type: route
data:
url: "/storage/lvm/vgs/extend/:name"
title: _("Extend")
editing: true
notificationTitle: _("Extended volume group '{{ devicefile }}'.")
component: omv-storage-lvm-vg-extend-form-page

View File

@ -0,0 +1,8 @@
version: "1.0"
type: route
data:
url: "/storage/lvm/vgs/reduce/:name"
title: _("Reduce")
editing: true
notificationTitle: _("Reduced volume group '{{ devicefile }}'.")
component: omv-storage-lvm-vg-reduce-form-page

View File

@ -0,0 +1,6 @@
version: "1.0"
type: route
data:
url: "/storage/lvm/vgs"
title: _("Volume Groups")
component: omv-storage-lvm-vg-datatable-page

View File

@ -0,0 +1,6 @@
version: "1.0"
type: route
data:
url: "/storage/lvm"
title: _("Logical Volume Management")
component: omv-storage-lvm-navigation-page

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