From 33ad8f4149b84394c3bdf7e35fb22863f9515406 Mon Sep 17 00:00:00 2001
From: Florian Schaal <florian@schaal-24.de>
Date: Thu, 22 Oct 2015 06:34:47 -0400
Subject: [PATCH] add bootorder to openvz
---
interface/web/vm/templates/openvz_vm_edit.htm | 5 ++
interface/web/vm/lib/lang/fr_openvz_vm.lng | 2 +
interface/web/vm/lib/lang/ja_openvz_vm.lng | 2 +
interface/web/vm/lib/lang/nl_openvz_vm.lng | 2 +
interface/web/vm/lib/lang/hu_openvz_vm.lng | 2 +
install/sql/ispconfig3.sql | 1
install/sql/incremental/upd_dev_collection.sql | 4 +
interface/web/vm/lib/lang/pt_openvz_vm.lng | 2 +
interface/web/vm/lib/lang/ro_openvz_vm.lng | 2 +
interface/web/vm/lib/lang/el_openvz_vm.lng | 2 +
interface/web/vm/lib/lang/sk_openvz_vm.lng | 2 +
interface/lib/plugins/vm_openvz_plugin.inc.php | 3 -
interface/web/vm/lib/lang/es_openvz_vm.lng | 2 +
interface/web/vm/lib/lang/tr_openvz_vm.lng | 2 +
interface/web/vm/lib/lang/de_openvz_vm.lng | 2 +
interface/web/vm/lib/lang/hr_openvz_vm.lng | 2 +
interface/web/vm/lib/lang/id_openvz_vm.lng | 2 +
interface/web/vm/lib/lang/pl_openvz_vm.lng | 2 +
interface/web/vm/form/openvz_vm.tform.php | 11 +++++
interface/web/vm/lib/lang/ru_openvz_vm.lng | 2 +
interface/web/vm/lib/lang/en_openvz_vm.lng | 2 +
interface/web/vm/lib/lang/br_openvz_vm.lng | 2 +
interface/web/vm/lib/lang/fi_openvz_vm.lng | 2 +
interface/web/vm/lib/lang/bg_openvz_vm.lng | 2 +
interface/web/vm/lib/lang/it_openvz_vm.lng | 2 +
interface/web/vm/lib/lang/se_openvz_vm.lng | 2 +
interface/web/vm/templates/openvz.conf.tpl | 1
interface/web/vm/lib/lang/cz_openvz_vm.lng | 2 +
interface/web/vm/lib/lang/ar_openvz_vm.lng | 2 +
29 files changed, 67 insertions(+), 4 deletions(-)
diff --git a/install/sql/incremental/upd_dev_collection.sql b/install/sql/incremental/upd_dev_collection.sql
index f034486..b68fa90 100644
--- a/install/sql/incremental/upd_dev_collection.sql
+++ b/install/sql/incremental/upd_dev_collection.sql
@@ -170,5 +170,7 @@
ALTER TABLE openvz_ip ADD COLUMN `additional` VARCHAR(255) NOT NULL DEFAULT 'n';
ALTER TABLE openvz_template ADD COLUMN `custom` text;
-ALTER TABLE openvz_vm ADD COLUMN `custom` text;
+ALTER TABLE openvz_vm
+ ADD COLUMN `bootorder` INT(11) NOT NULL DEFAULT '1' AFTER `start_boot`,
+ ADD COLUMN `custom` text;
diff --git a/install/sql/ispconfig3.sql b/install/sql/ispconfig3.sql
index ece5558..6aee695 100644
--- a/install/sql/ispconfig3.sql
+++ b/install/sql/ispconfig3.sql
@@ -1142,6 +1142,7 @@
`hostname` varchar(255) DEFAULT NULL,
`vm_password` varchar(255) DEFAULT NULL,
`start_boot` varchar(255) NOT NULL DEFAULT 'y',
+ `bootorder` int(11) NOT NULL DEFAULT '1',
`active` varchar(255) NOT NULL DEFAULT 'y',
`active_until_date` date NOT NULL DEFAULT '0000-00-00',
`description` text,
diff --git a/interface/lib/plugins/vm_openvz_plugin.inc.php b/interface/lib/plugins/vm_openvz_plugin.inc.php
index aae645c..3249793 100644
--- a/interface/lib/plugins/vm_openvz_plugin.inc.php
+++ b/interface/lib/plugins/vm_openvz_plugin.inc.php
@@ -134,8 +134,6 @@
foreach ($tmp_rec as $tmp) {
$app->db->datalogUpdate('openvz_ip', array('vm_id' => 0), 'ip_address_id', $tmp['ip_address_id']);
}
- unset($tmp);
- unset($tmp_rec);
}
private function applyTemplate() {
@@ -177,6 +175,7 @@
$onboot = ($vm['start_boot'] == 'y')?'yes':'no';
$tpl->setVar('onboot', $onboot);
+ $tpl->setVar('bootorder', $vm['bootorder']);
$tpl->setVar('kmemsize', $vm_template['kmemsize']);
$tpl->setVar('lockedpages', $vm_template['lockedpages']);
$tpl->setVar('privvmpages', $burst_ram.':'.$burst_ram);
diff --git a/interface/web/vm/form/openvz_vm.tform.php b/interface/web/vm/form/openvz_vm.tform.php
index 37bf869..d638442 100644
--- a/interface/web/vm/form/openvz_vm.tform.php
+++ b/interface/web/vm/form/openvz_vm.tform.php
@@ -150,6 +150,17 @@
'default' => 'y',
'value' => array(0 => 'n', 1 => 'y')
),
+ 'bootorder' => array (
+ 'datatype' => 'INTEGER',
+ 'formtype' => 'TEXT',
+ 'default' => '0',
+ 'value' => '',
+ 'width' => '3',
+ 'maxlength' => '3',
+ 'validators' => array ( 0 => array ( 'type' => 'ISPOSITIVE',
+ 'errmsg'=> 'limit_client_error_notint'),
+ ),
+ ),
'active' => array (
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX',
diff --git a/interface/web/vm/lib/lang/ar_openvz_vm.lng b/interface/web/vm/lib/lang/ar_openvz_vm.lng
index bbf388a..2029d96 100644
--- a/interface/web/vm/lib/lang/ar_openvz_vm.lng
+++ b/interface/web/vm/lib/lang/ar_openvz_vm.lng
@@ -40,4 +40,6 @@
$wb['features_txt'] = 'Features';
$wb["iptables_txt"] = "IP Tables";
$wb["custom_txt"] = "Custom settings";
+$wb["bootorder_txt"] = "Boot order priority";
+$wb["bootorder_error_notpositive"] = "Only positive integers are allowed for Boot order priority";
?>
diff --git a/interface/web/vm/lib/lang/bg_openvz_vm.lng b/interface/web/vm/lib/lang/bg_openvz_vm.lng
index bbf388a..2029d96 100644
--- a/interface/web/vm/lib/lang/bg_openvz_vm.lng
+++ b/interface/web/vm/lib/lang/bg_openvz_vm.lng
@@ -40,4 +40,6 @@
$wb['features_txt'] = 'Features';
$wb["iptables_txt"] = "IP Tables";
$wb["custom_txt"] = "Custom settings";
+$wb["bootorder_txt"] = "Boot order priority";
+$wb["bootorder_error_notpositive"] = "Only positive integers are allowed for Boot order priority";
?>
diff --git a/interface/web/vm/lib/lang/br_openvz_vm.lng b/interface/web/vm/lib/lang/br_openvz_vm.lng
index bbf388a..2029d96 100644
--- a/interface/web/vm/lib/lang/br_openvz_vm.lng
+++ b/interface/web/vm/lib/lang/br_openvz_vm.lng
@@ -40,4 +40,6 @@
$wb['features_txt'] = 'Features';
$wb["iptables_txt"] = "IP Tables";
$wb["custom_txt"] = "Custom settings";
+$wb["bootorder_txt"] = "Boot order priority";
+$wb["bootorder_error_notpositive"] = "Only positive integers are allowed for Boot order priority";
?>
diff --git a/interface/web/vm/lib/lang/cz_openvz_vm.lng b/interface/web/vm/lib/lang/cz_openvz_vm.lng
index 9d20c9b..0fd8a9c 100644
--- a/interface/web/vm/lib/lang/cz_openvz_vm.lng
+++ b/interface/web/vm/lib/lang/cz_openvz_vm.lng
@@ -40,5 +40,7 @@
$wb['features_txt'] = 'Features';
$wb["iptables_txt"] = "IP Tables";
$wb["custom_txt"] = "Custom settings";
+$wb["bootorder_txt"] = "Boot order priority";
+$wb["bootorder_error_notpositive"] = "Only positive integers are allowed for Boot order priority";
?>
diff --git a/interface/web/vm/lib/lang/de_openvz_vm.lng b/interface/web/vm/lib/lang/de_openvz_vm.lng
index 467af85..52daf3f 100644
--- a/interface/web/vm/lib/lang/de_openvz_vm.lng
+++ b/interface/web/vm/lib/lang/de_openvz_vm.lng
@@ -39,4 +39,6 @@
$wb['Advanced'] = 'Erweitert';
$wb["iptables_txt"] = "IP Tables";
$wb["custom_txt"] = "Custom settings";
+$wb["bootorder_txt"] = "Boot order priority";
+$wb["bootorder_error_notpositive"] = "Only positive integers are allowed for Boot order priority";
?>
diff --git a/interface/web/vm/lib/lang/el_openvz_vm.lng b/interface/web/vm/lib/lang/el_openvz_vm.lng
index 24b6e26..d221245 100644
--- a/interface/web/vm/lib/lang/el_openvz_vm.lng
+++ b/interface/web/vm/lib/lang/el_openvz_vm.lng
@@ -40,4 +40,6 @@
$wb['features_txt'] = 'Features';
$wb["iptables_txt"] = "IP Tables";
$wb["custom_txt"] = "Custom settings";
+$wb["bootorder_txt"] = "Boot order priority";
+$wb["bootorder_error_notpositive"] = "Only positive integers are allowed for Boot order priority";
?>
diff --git a/interface/web/vm/lib/lang/en_openvz_vm.lng b/interface/web/vm/lib/lang/en_openvz_vm.lng
index 213e3ad..f3562cb 100644
--- a/interface/web/vm/lib/lang/en_openvz_vm.lng
+++ b/interface/web/vm/lib/lang/en_openvz_vm.lng
@@ -40,4 +40,6 @@
$wb['features_txt'] = 'Features';
$wb["iptables_txt"] = "IP Tables";
$wb["custom_txt"] = "Custom settings";
+$wb["bootorder_txt"] = "Boot order priority";
+$wb["bootorder_error_notpositive"] = "Only positive integers are allowed for Boot order priority";
?>
diff --git a/interface/web/vm/lib/lang/es_openvz_vm.lng b/interface/web/vm/lib/lang/es_openvz_vm.lng
index 2982a9a..720e206 100644
--- a/interface/web/vm/lib/lang/es_openvz_vm.lng
+++ b/interface/web/vm/lib/lang/es_openvz_vm.lng
@@ -40,4 +40,6 @@
$wb['features_txt'] = 'Features';
$wb["iptables_txt"] = "IP Tables";
$wb["custom_txt"] = "Custom settings";
+$wb["bootorder_txt"] = "Boot order priority";
+$wb["bootorder_error_notpositive"] = "Only positive integers are allowed for Boot order priority";
?>
diff --git a/interface/web/vm/lib/lang/fi_openvz_vm.lng b/interface/web/vm/lib/lang/fi_openvz_vm.lng
index bbf388a..2029d96 100644
--- a/interface/web/vm/lib/lang/fi_openvz_vm.lng
+++ b/interface/web/vm/lib/lang/fi_openvz_vm.lng
@@ -40,4 +40,6 @@
$wb['features_txt'] = 'Features';
$wb["iptables_txt"] = "IP Tables";
$wb["custom_txt"] = "Custom settings";
+$wb["bootorder_txt"] = "Boot order priority";
+$wb["bootorder_error_notpositive"] = "Only positive integers are allowed for Boot order priority";
?>
diff --git a/interface/web/vm/lib/lang/fr_openvz_vm.lng b/interface/web/vm/lib/lang/fr_openvz_vm.lng
index d01f624..cfcf250 100644
--- a/interface/web/vm/lib/lang/fr_openvz_vm.lng
+++ b/interface/web/vm/lib/lang/fr_openvz_vm.lng
@@ -40,4 +40,6 @@
$wb['features_txt'] = 'Features';
$wb["iptables_txt"] = "IP Tables";
$wb["custom_txt"] = "Custom settings";
+$wb["bootorder_txt"] = "Boot order priority";
+$wb["bootorder_error_notpositive"] = "Only positive integers are allowed for Boot order priority";
?>
diff --git a/interface/web/vm/lib/lang/hr_openvz_vm.lng b/interface/web/vm/lib/lang/hr_openvz_vm.lng
index 5169eb9..c614b2b 100644
--- a/interface/web/vm/lib/lang/hr_openvz_vm.lng
+++ b/interface/web/vm/lib/lang/hr_openvz_vm.lng
@@ -40,6 +40,8 @@
$wb['features_txt'] = 'Features';
$wb["iptables_txt"] = "IP Tables";
$wb["custom_txt"] = "Custom settings";
+$wb["bootorder_txt"] = "Boot order priority";
+$wb["bootorder_error_notpositive"] = "Only positive integers are allowed for Boot order priority";
?>
diff --git a/interface/web/vm/lib/lang/hu_openvz_vm.lng b/interface/web/vm/lib/lang/hu_openvz_vm.lng
index bbf388a..2029d96 100644
--- a/interface/web/vm/lib/lang/hu_openvz_vm.lng
+++ b/interface/web/vm/lib/lang/hu_openvz_vm.lng
@@ -40,4 +40,6 @@
$wb['features_txt'] = 'Features';
$wb["iptables_txt"] = "IP Tables";
$wb["custom_txt"] = "Custom settings";
+$wb["bootorder_txt"] = "Boot order priority";
+$wb["bootorder_error_notpositive"] = "Only positive integers are allowed for Boot order priority";
?>
diff --git a/interface/web/vm/lib/lang/id_openvz_vm.lng b/interface/web/vm/lib/lang/id_openvz_vm.lng
index bbf388a..2029d96 100644
--- a/interface/web/vm/lib/lang/id_openvz_vm.lng
+++ b/interface/web/vm/lib/lang/id_openvz_vm.lng
@@ -40,4 +40,6 @@
$wb['features_txt'] = 'Features';
$wb["iptables_txt"] = "IP Tables";
$wb["custom_txt"] = "Custom settings";
+$wb["bootorder_txt"] = "Boot order priority";
+$wb["bootorder_error_notpositive"] = "Only positive integers are allowed for Boot order priority";
?>
diff --git a/interface/web/vm/lib/lang/it_openvz_vm.lng b/interface/web/vm/lib/lang/it_openvz_vm.lng
index bbf388a..2029d96 100644
--- a/interface/web/vm/lib/lang/it_openvz_vm.lng
+++ b/interface/web/vm/lib/lang/it_openvz_vm.lng
@@ -40,4 +40,6 @@
$wb['features_txt'] = 'Features';
$wb["iptables_txt"] = "IP Tables";
$wb["custom_txt"] = "Custom settings";
+$wb["bootorder_txt"] = "Boot order priority";
+$wb["bootorder_error_notpositive"] = "Only positive integers are allowed for Boot order priority";
?>
diff --git a/interface/web/vm/lib/lang/ja_openvz_vm.lng b/interface/web/vm/lib/lang/ja_openvz_vm.lng
index bbf388a..2029d96 100644
--- a/interface/web/vm/lib/lang/ja_openvz_vm.lng
+++ b/interface/web/vm/lib/lang/ja_openvz_vm.lng
@@ -40,4 +40,6 @@
$wb['features_txt'] = 'Features';
$wb["iptables_txt"] = "IP Tables";
$wb["custom_txt"] = "Custom settings";
+$wb["bootorder_txt"] = "Boot order priority";
+$wb["bootorder_error_notpositive"] = "Only positive integers are allowed for Boot order priority";
?>
diff --git a/interface/web/vm/lib/lang/nl_openvz_vm.lng b/interface/web/vm/lib/lang/nl_openvz_vm.lng
index bbf388a..2029d96 100644
--- a/interface/web/vm/lib/lang/nl_openvz_vm.lng
+++ b/interface/web/vm/lib/lang/nl_openvz_vm.lng
@@ -40,4 +40,6 @@
$wb['features_txt'] = 'Features';
$wb["iptables_txt"] = "IP Tables";
$wb["custom_txt"] = "Custom settings";
+$wb["bootorder_txt"] = "Boot order priority";
+$wb["bootorder_error_notpositive"] = "Only positive integers are allowed for Boot order priority";
?>
diff --git a/interface/web/vm/lib/lang/pl_openvz_vm.lng b/interface/web/vm/lib/lang/pl_openvz_vm.lng
index bbf388a..2029d96 100644
--- a/interface/web/vm/lib/lang/pl_openvz_vm.lng
+++ b/interface/web/vm/lib/lang/pl_openvz_vm.lng
@@ -40,4 +40,6 @@
$wb['features_txt'] = 'Features';
$wb["iptables_txt"] = "IP Tables";
$wb["custom_txt"] = "Custom settings";
+$wb["bootorder_txt"] = "Boot order priority";
+$wb["bootorder_error_notpositive"] = "Only positive integers are allowed for Boot order priority";
?>
diff --git a/interface/web/vm/lib/lang/pt_openvz_vm.lng b/interface/web/vm/lib/lang/pt_openvz_vm.lng
index bbf388a..2029d96 100644
--- a/interface/web/vm/lib/lang/pt_openvz_vm.lng
+++ b/interface/web/vm/lib/lang/pt_openvz_vm.lng
@@ -40,4 +40,6 @@
$wb['features_txt'] = 'Features';
$wb["iptables_txt"] = "IP Tables";
$wb["custom_txt"] = "Custom settings";
+$wb["bootorder_txt"] = "Boot order priority";
+$wb["bootorder_error_notpositive"] = "Only positive integers are allowed for Boot order priority";
?>
diff --git a/interface/web/vm/lib/lang/ro_openvz_vm.lng b/interface/web/vm/lib/lang/ro_openvz_vm.lng
index bbf388a..2029d96 100644
--- a/interface/web/vm/lib/lang/ro_openvz_vm.lng
+++ b/interface/web/vm/lib/lang/ro_openvz_vm.lng
@@ -40,4 +40,6 @@
$wb['features_txt'] = 'Features';
$wb["iptables_txt"] = "IP Tables";
$wb["custom_txt"] = "Custom settings";
+$wb["bootorder_txt"] = "Boot order priority";
+$wb["bootorder_error_notpositive"] = "Only positive integers are allowed for Boot order priority";
?>
diff --git a/interface/web/vm/lib/lang/ru_openvz_vm.lng b/interface/web/vm/lib/lang/ru_openvz_vm.lng
index bbf388a..2029d96 100644
--- a/interface/web/vm/lib/lang/ru_openvz_vm.lng
+++ b/interface/web/vm/lib/lang/ru_openvz_vm.lng
@@ -40,4 +40,6 @@
$wb['features_txt'] = 'Features';
$wb["iptables_txt"] = "IP Tables";
$wb["custom_txt"] = "Custom settings";
+$wb["bootorder_txt"] = "Boot order priority";
+$wb["bootorder_error_notpositive"] = "Only positive integers are allowed for Boot order priority";
?>
diff --git a/interface/web/vm/lib/lang/se_openvz_vm.lng b/interface/web/vm/lib/lang/se_openvz_vm.lng
index bbf388a..2029d96 100644
--- a/interface/web/vm/lib/lang/se_openvz_vm.lng
+++ b/interface/web/vm/lib/lang/se_openvz_vm.lng
@@ -40,4 +40,6 @@
$wb['features_txt'] = 'Features';
$wb["iptables_txt"] = "IP Tables";
$wb["custom_txt"] = "Custom settings";
+$wb["bootorder_txt"] = "Boot order priority";
+$wb["bootorder_error_notpositive"] = "Only positive integers are allowed for Boot order priority";
?>
diff --git a/interface/web/vm/lib/lang/sk_openvz_vm.lng b/interface/web/vm/lib/lang/sk_openvz_vm.lng
index bbf388a..2029d96 100644
--- a/interface/web/vm/lib/lang/sk_openvz_vm.lng
+++ b/interface/web/vm/lib/lang/sk_openvz_vm.lng
@@ -40,4 +40,6 @@
$wb['features_txt'] = 'Features';
$wb["iptables_txt"] = "IP Tables";
$wb["custom_txt"] = "Custom settings";
+$wb["bootorder_txt"] = "Boot order priority";
+$wb["bootorder_error_notpositive"] = "Only positive integers are allowed for Boot order priority";
?>
diff --git a/interface/web/vm/lib/lang/tr_openvz_vm.lng b/interface/web/vm/lib/lang/tr_openvz_vm.lng
index bbf388a..2029d96 100644
--- a/interface/web/vm/lib/lang/tr_openvz_vm.lng
+++ b/interface/web/vm/lib/lang/tr_openvz_vm.lng
@@ -40,4 +40,6 @@
$wb['features_txt'] = 'Features';
$wb["iptables_txt"] = "IP Tables";
$wb["custom_txt"] = "Custom settings";
+$wb["bootorder_txt"] = "Boot order priority";
+$wb["bootorder_error_notpositive"] = "Only positive integers are allowed for Boot order priority";
?>
diff --git a/interface/web/vm/templates/openvz.conf.tpl b/interface/web/vm/templates/openvz.conf.tpl
index a2b061a..ed4943f 100644
--- a/interface/web/vm/templates/openvz.conf.tpl
+++ b/interface/web/vm/templates/openvz.conf.tpl
@@ -4,6 +4,7 @@
# Parameters
ONBOOT="{tmpl_var name='onboot'}"
+BOOTORDER="{tmpl_var name='bootorder'}"
KMEMSIZE="{tmpl_var name='kmemsize'}"
LOCKEDPAGES="{tmpl_var name='lockedpages'}"
PRIVVMPAGES="{tmpl_var name='privvmpages'}"
diff --git a/interface/web/vm/templates/openvz_vm_edit.htm b/interface/web/vm/templates/openvz_vm_edit.htm
index c2e0cb6..a045012 100644
--- a/interface/web/vm/templates/openvz_vm_edit.htm
+++ b/interface/web/vm/templates/openvz_vm_edit.htm
@@ -75,6 +75,9 @@
{tmpl_var name='start_boot'}
</div>
</div>
+ <div class="form-group">
+ <label for="bootorder" class="col-sm-3 control-label">{tmpl_var name='bootorder_txt'}</label>
+ <div class="col-sm-9"><input type="text" name="bootorder" id="bootorder" value="{tmpl_var name='bootorder'}" class="form-control" /></div></div>
<div class="form-group">
<label class="col-sm-3 control-label">{tmpl_var name='active_txt'}</label>
<div class="col-sm-9">
@@ -95,4 +98,4 @@
<div class="clear"><div class="right">
<button class="btn btn-default formbutton-success" type="button" value="{tmpl_var name='btn_save_txt'}" data-submit-form="pageForm" data-form-action="vm/openvz_vm_edit.php">{tmpl_var name='btn_save_txt'}</button>
<button class="btn btn-default formbutton-default" type="button" value="{tmpl_var name='btn_cancel_txt'}" data-load-content="vm/openvz_vm_list.php">{tmpl_var name='btn_cancel_txt'}</button>
- </div></div>
\ No newline at end of file
+ </div></div>
--
Gitblit v1.9.1