-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add showFullscreen and showCompact for dashboard #356
base: main
Are you sure you want to change the base?
Conversation
Thank you for your pull request. Before we can look at it, you'll need to sign a Contributor License Agreement (CLA). Please follow instructions at https://icinga.com/company/contributor-agreement to sign the CLA. After that, please reply here with a comment and we'll verify. Contributors that have not signed yet: @NavidSassan
|
Corporation CLA signed |
@cla-bot check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/** @var string */ | ||
protected $tag = 'div'; | ||
|
||
protected $defaultAttributes = array( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use short array syntax and fix align.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied that from the library/Businessprocess/Web/Component/Dashboard.php
file. Should I change both files, just the DashboardFullscreen.php
or leave it as it is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please only change in this class, as it is a new class. Leave the old code as it is.
@sukhwinder33445, is your request about the cosmetics and not about the content and information shown? Please confirm. If not, I fear, that your request goes directly against our needs and why we sponsor this code! Our requirement is to be able to see the process titles inside of the configs. In our use case, It's quite useless to know, on a big wall mounted sign, that X business critical processes inside a department, clinic, branch or team are kaput because the next question in mind is which one and there isn't a mouse or any other input available to find out without, then and there. Please, have a look at the original pull request Add a nice dashboard for kiosk mode for a explanation and a mock-up. |
Hi @slalomsk8er, The main reason why we should not show the titles of the nodes in each configuration is that we would then have problems with scalability. A large environment can have multiple configurations with multiple (hundreds) of nodes. In this case, only a few configurations with their node titles and states can be displayed on the dashboard page. In the following screenshot, you can see the current state of the full screen view with multiple nodes. As you can see, there is already less space available. The nodes can also have titles of different lengths, which can make the state badges unequal in length. The configuration containers have unequal height and width. This is one of the reasons why we remove the titles of the nodes in the mockup. The small status badges can still contain a link to the node and have a tooltip that shows the name of the node. A display that hangs on the wall and provides a full screen view can show you the current status of the nodes in all given configurations. To get more information, the user can open this view on a local device and perform further investigation. |
@sukhwinder33445 then we have a problem as showing the titles of the business processes is the whole point of this sponsored feature! This is what it actually looks in production: It maybe not perfect but works well for us and as far as I know, we're currently the only users so please don't let the perfect be the enemy of the good. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once both review requests are resolved, we will merge this.
library/Businessprocess/Web/Component/BpDashboardFullscreenTile.php
Outdated
Show resolved
Hide resolved
And please rebase with |
97f0522
to
0feceaf
Compare
@NavidSassan PR will be reviewed next week. Next time, please re-request review or leave a comment and don't resolve conversations. We do not receive notifications of code changes and it is the responsibility of who started the conversation to actually resolve it. |
Oh sorry, wasn't aware of that. Thanks for the update 👍 |
No worries! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NavidSassan if you need help with the changes requested, please let me know.
$this->setAutorefreshInterval(15); | ||
|
||
/** View */ | ||
$view = $this->view; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not introduce an extra local variable. Just call $this->view->...
twice.
if ($view->showFullscreen) { | ||
$this->content()->add(DashboardFullscreen::create($this->Auth(), $this->storage())); | ||
$this->setAutorefreshInterval(120); | ||
$this->controls()->getAttributes()->add('class', 'want-fullscreen'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not required and could be a leftover from previous changes. At least I can't find any CSS introduced by this PR that requires this class to be set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
without want-fullscreen
the icingaweb2 menu bar on the left is displayed - not sure where I got this from though
@@ -49,7 +49,6 @@ public function init() | |||
$this->view->showFullscreen | |||
= $this->showFullscreen | |||
= (bool) $this->_helper->layout()->showFullscreen; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please drop that change.
{ | ||
protected $tag = 'div'; | ||
|
||
protected $defaultAttributes = ['class' => 'dashboard-tile dashboard-tile-fullscreen']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no CSS for the dashboard-tile-fullscreen
class, so I think it can be safely removed.
|
||
class DashboardFullscreen extends BaseHtmlElement | ||
{ | ||
/** @var string */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove that comment. It is not needed.
$attributes['href'] = Url::fromPath($url, $urlParams ?: []); | ||
} | ||
|
||
$this->add(Html::tag( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The whole part should be moved to assemble()
. Necessary properties should be set here then.
MonitoringState::apply($bp); | ||
} | ||
|
||
$this->add(new BpDashboardFullscreenTile( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would adjust the arguments to BpDashboardFullscreenTile
as follows:
new BpDashboardFullscreenTile(
$bp,
$title,
$meta->get('Description')
)
$this->add(Html::tag( | ||
'div', | ||
['class' => 'bp-link', 'data-base-target' => '_main'], | ||
Html::tag('a', $attributes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using $attributes
set it directly, i.e.
$baseUrl = Url::fromPath('businessprocess/process/show', ['config' => $bp->getName()]);
...
['href' => $baseUrl]
$bp = $storage->loadProcess($name); | ||
} catch (Exception $e) { | ||
$this->add(new BpDashboardTile( | ||
new BpConfig(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use (new BpConfig())->setName($name)
so that it works with the requested changes from above and adjust the arguments, i.e.
new BpDashboardFullscreenTile(
(new BpConfig())->setName($name),
$title,
sprintf(mt('businessprocess', 'File %s has faulty config'), $name . '.conf')
)
Also note the t
/mt
change.
$tiles->add(Html::tag( | ||
'a', | ||
[ | ||
'href' => Url::fromPath($url, $urlParams ?: [])->with(['node' => $node->getName()]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the requested changes from above you can use $baseUrl->with(...)
;
Re-implementation of #294.