Fixes
This commit is contained in:
14
README.ru.md
14
README.ru.md
@@ -72,4 +72,16 @@ sudo dnf install _packages/ispmanager-plugin-nginx_mod_rewrite_plugin-0.0.1-1.el
|
|||||||
|
|
||||||
Если вдруг установка провалилась, лог установки можно изучить здесь - `/usr/local/mgr5/var/nginx-mod-rewrite-plugin.log`
|
Если вдруг установка провалилась, лог установки можно изучить здесь - `/usr/local/mgr5/var/nginx-mod-rewrite-plugin.log`
|
||||||
|
|
||||||
Если все прошло успешно, то необходимо перейти
|
Если все прошло успешно, то необходимо перейти в раздел "Модули":
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Найти модуль с названием "Модуль nginx mod_rewrite" и нажать на значек настройки модуля. На изображении выше обведены синим контуром.
|
||||||
|
|
||||||
|
Далее откроется окно сборки модуля:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Для отмены сборки, нажмите кнопку "Отменить сборку". Для сборки и установки хука пересборки при обновлении nginx необходимо нажать "Собать модуль и установить хук на пересборку".
|
||||||
|
|
||||||
|
Процесс сборки можно будет изучить в логе: `/usr/local/mgr5/var/nginx-mod-rewrite-plugin.log.
|
||||||
|
|||||||
BIN
img/isp_mod_rewrite1.png
Normal file
BIN
img/isp_mod_rewrite1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
BIN
img/isp_mod_rewrite2.png
Normal file
BIN
img/isp_mod_rewrite2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 28 KiB |
@@ -68,6 +68,10 @@ def Handle(root):
|
|||||||
result = True
|
result = True
|
||||||
result_error = CheckModuleExists()
|
result_error = CheckModuleExists()
|
||||||
if result_error is None:
|
if result_error is None:
|
||||||
|
for parent in root.iter():
|
||||||
|
for child in list(parent):
|
||||||
|
if child.tag == 'textdata' and child.get('name') == 'nginx_mod_rewrite_plugin_msg_info':
|
||||||
|
parent.remove(child)
|
||||||
result_error = InstallModule()
|
result_error = InstallModule()
|
||||||
result = result_error is None
|
result = result_error is None
|
||||||
|
|
||||||
@@ -84,6 +88,22 @@ def Handle(root):
|
|||||||
param = etree.SubElement(error, 'param')
|
param = etree.SubElement(error, 'param')
|
||||||
param.set('name', 'value')
|
param.set('name', 'value')
|
||||||
param.text = result_error
|
param.text = result_error
|
||||||
|
else:
|
||||||
|
# Add <ok/> element to root
|
||||||
|
etree.SubElement(root, 'ok')
|
||||||
|
else:
|
||||||
|
# Remove textdata element with name="nginx_mod_rewrite_plugin_msg"
|
||||||
|
for parent in root.iter():
|
||||||
|
for child in list(parent):
|
||||||
|
if child.tag == 'textdata' and child.get('name') == 'nginx_mod_rewrite_plugin_msg':
|
||||||
|
parent.remove(child)
|
||||||
|
# Find the messages element with name "nginx_mod_rewrite_plugin.settings"
|
||||||
|
messages_elem = root.find(".//messages[@name='nginx_mod_rewrite_plugin.settings']")
|
||||||
|
if messages_elem is not None:
|
||||||
|
# Find the msg element with name "msg_create" and change its text
|
||||||
|
msg_create_elem = messages_elem.find(".//msg[@name='msg_create']")
|
||||||
|
if msg_create_elem is not None:
|
||||||
|
msg_create_elem.text = 'Ничего не делать'
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
@@ -100,6 +120,28 @@ if __name__ == "__main__":
|
|||||||
if correct_function:
|
if correct_function:
|
||||||
if os.getenv("PARAM_clicked_button") == "ok":
|
if os.getenv("PARAM_clicked_button") == "ok":
|
||||||
Handle(root)
|
Handle(root)
|
||||||
|
else:
|
||||||
|
result_error = CheckModuleExists()
|
||||||
|
if result_error is None:
|
||||||
|
for parent in root.iter():
|
||||||
|
for child in list(parent):
|
||||||
|
if child.tag == 'textdata' and child.get('name') == 'nginx_mod_rewrite_plugin_msg_info':
|
||||||
|
parent.remove(child)
|
||||||
|
else:
|
||||||
|
# Remove textdata element with name="nginx_mod_rewrite_plugin_msg"
|
||||||
|
for parent in root.iter():
|
||||||
|
for child in list(parent):
|
||||||
|
if child.tag == 'textdata' and child.get('name') == 'nginx_mod_rewrite_plugin_msg':
|
||||||
|
parent.remove(child)
|
||||||
|
|
||||||
|
# Find the messages element with name "nginx_mod_rewrite_plugin.settings"
|
||||||
|
messages_elem = root.find(".//messages[@name='nginx_mod_rewrite_plugin.settings']")
|
||||||
|
if messages_elem is not None:
|
||||||
|
# Find the msg element with name "msg_create" and change its text
|
||||||
|
msg_create_elem = messages_elem.find(".//msg[@name='msg_create']")
|
||||||
|
if msg_create_elem is not None:
|
||||||
|
msg_create_elem.text = 'Ничего не делать'
|
||||||
|
|
||||||
|
|
||||||
etree.dump(root)
|
etree.dump(root)
|
||||||
quit(0)
|
quit(0)
|
||||||
|
|||||||
@@ -11,7 +11,8 @@
|
|||||||
<metadata name="nginx_mod_rewrite_plugin.settings" type="form" mgr="ispmgr">
|
<metadata name="nginx_mod_rewrite_plugin.settings" type="form" mgr="ispmgr">
|
||||||
<form>
|
<form>
|
||||||
<field name="nginx_mod_rewrite_plugin_field" noname="yes" fullwidth="yes">
|
<field name="nginx_mod_rewrite_plugin_field" noname="yes" fullwidth="yes">
|
||||||
<textdata name="nginx_mod_rewrite_plugin_msg" type="msg" />
|
<textdata name="nginx_mod_rewrite_plugin_msg" type="banner" status="warning"/>
|
||||||
|
<textdata name="nginx_mod_rewrite_plugin_msg_info" type="banner" status="info"/>
|
||||||
</field>
|
</field>
|
||||||
</form>
|
</form>
|
||||||
<buttons>
|
<buttons>
|
||||||
@@ -66,6 +67,7 @@
|
|||||||
<messages name="nginx_mod_rewrite_plugin.settings">
|
<messages name="nginx_mod_rewrite_plugin.settings">
|
||||||
<msg name="title">Установка модуля для nginx</msg>
|
<msg name="title">Установка модуля для nginx</msg>
|
||||||
<msg name="nginx_mod_rewrite_plugin_msg">Данный плагин установит ряд пакетов для сборки модуля nginx</msg>
|
<msg name="nginx_mod_rewrite_plugin_msg">Данный плагин установит ряд пакетов для сборки модуля nginx</msg>
|
||||||
|
<msg name="nginx_mod_rewrite_plugin_msg_info">Модуль уже установлен</msg>
|
||||||
<msg name="msg_create">Собрать модуль и установить хук на пересборку</msg>
|
<msg name="msg_create">Собрать модуль и установить хук на пересборку</msg>
|
||||||
<msg name="msg_back"><< Отменить сборку</msg>
|
<msg name="msg_back"><< Отменить сборку</msg>
|
||||||
</messages>
|
</messages>
|
||||||
|
|||||||
Reference in New Issue
Block a user