Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from gsanchietti/server-manager-ui
Add basic UI NethServer/dev#5448
- Loading branch information
Showing
6 changed files
with
156 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
none |
8 changes: 8 additions & 0 deletions
8
root/usr/share/nethesis/NethServer/Language/en/NethServer_Module_Mattermost.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
$L['Mattermost_Description'] = 'Mattermost Team Edition'; | ||
$L['Mattermost_Tags'] = 'mattermost chat team edition'; | ||
$L['Mattermost_Title'] = 'Team chat'; | ||
$L['status_label'] = 'Enable Mattermost Team Edition'; | ||
$L['info_label'] = 'Mattermost is accessible only using a dedicated host name (eg. mattermost.yourdomain.org). If you\'re using Let\'s Encrypt certificate, remember to add the hostname below to the "${1}" field inside the "${1}" page'; | ||
$L['VirtualHost_label'] = 'Virtual host name'; |
43 changes: 43 additions & 0 deletions
43
root/usr/share/nethesis/NethServer/Module/Dashboard/Applications/Mattermost.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
namespace NethServer\Module\Dashboard\Applications; | ||
|
||
/* | ||
* Copyright (C) 2018 Nethesis S.r.l. | ||
* | ||
* This script is part of NethServer. | ||
* | ||
* NethServer 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 | ||
* (at your option) any later version. | ||
* | ||
* NethServer 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 NethServer. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
/** | ||
* WebTop | ||
* | ||
* @author Giacomo Sanchietti | ||
*/ | ||
class Mattermost extends \Nethgui\Module\AbstractModule implements \NethServer\Module\Dashboard\Interfaces\ApplicationInterface | ||
{ | ||
|
||
public function getName() | ||
{ | ||
return "Mattermost"; | ||
} | ||
|
||
public function getInfo() | ||
{ | ||
$host = $this->getPlatform()->getDatabase('configuration')->getProp('mattermost', 'VirtualHost'); | ||
return array( | ||
'url' => "https://".$host | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?php | ||
|
||
namespace NethServer\Module; | ||
|
||
/* | ||
* Copyright (C) 2018 Nethesis S.r.l. | ||
* | ||
* This script is part of NethServer. | ||
* | ||
* NethServer 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 | ||
* (at your option) any later version. | ||
* | ||
* NethServer 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 NethServer. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
use Nethgui\System\PlatformInterface as Validate; | ||
|
||
/** | ||
* Configure Mattermost | ||
* | ||
* @author Giacomo Sanchietti<giacomo.sanchietti@nethesis.it> | ||
*/ | ||
class Mattermost extends \Nethgui\Controller\AbstractController | ||
{ | ||
|
||
protected function initializeAttributes(\Nethgui\Module\ModuleAttributesInterface $base) | ||
{ | ||
return new \NethServer\Tool\CustomModuleAttributesProvider($base, array( | ||
'languageCatalog' => array('NethServer_Module_Mattermost','NethServer_Module_Pki'), | ||
'category' => 'Configuration') | ||
); | ||
} | ||
|
||
public function initialize() | ||
{ | ||
parent::initialize(); | ||
$this->declareParameter('VirtualHost', Validate::HOSTNAME_FQDN, array('configuration', 'mattermost', 'VirtualHost')); | ||
$this->declareParameter('status', Validate::SERVICESTATUS, array('configuration', 'mattermost', 'status')); | ||
} | ||
|
||
public function prepareView(\Nethgui\View\ViewInterface $view) | ||
{ | ||
$domain = $this->getPlatform()->getDatabase('configuration')->getType("DomainName"); | ||
$view['DefaultUrl'] = "mattermost.$domain"; | ||
} | ||
|
||
protected function onParametersSaved($changes) | ||
{ | ||
$this->getPlatform()->signalEvent('nethserver-mattermost-save'); | ||
} | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
root/usr/share/nethesis/NethServer/Template/Mattermost.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
echo $view->header()->setAttribute('template', $T('Mattermost_Title')); | ||
|
||
$url = $view->getModuleUrl('/Pki'); | ||
$info = "<div class='mattermost-info'><p><span class='fa fa-info-circle'></span>".$T('info_label', array($T('LetsEncryptDomains_label'),$T('Pki_Title')))."</p></div>"; | ||
|
||
echo $view->panel() | ||
->insert($view->fieldsetSwitch('status', 'enabled', $view::FIELDSETSWITCH_CHECKBOX | $view::FIELDSETSWITCH_EXPANDABLE)->setAttribute('uncheckedValue', 'disabled') | ||
->insert($view->panel()->insert($view->literal($info))) | ||
->insert($view->textInput('VirtualHost')->setAttribute('placeholder',$view['DefaultUrl'])) | ||
); | ||
|
||
echo $view->buttonList($view::BUTTON_SUBMIT); | ||
|
||
$view->includeCss(" | ||
.mattermost-info { padding: 10px; margin: 10px; border: 1px solid #c2c2c2; width: 50%; background-color: #eee } | ||
.mattermost-info .fa { padding-right: 5px } | ||
"); | ||
|