Skip to content
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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

NavidSassan
Copy link

Re-implementation of #294.

@cla-bot
Copy link

cla-bot bot commented Sep 29, 2022

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

  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Please contact us if you think this is the case.

  • If you signed the CLA as a corporation, your GitHub username may not have been submitted to us. Please reach out to the responsible person in your organization.

@NavidSassan
Copy link
Author

Corporation CLA signed

@bobapple
Copy link
Member

@cla-bot check

@cla-bot cla-bot bot added the cla/signed label Sep 29, 2022
@nilmerg nilmerg added this to the 2.5.0 milestone Jul 11, 2023
Copy link
Contributor

@sukhwinder33445 sukhwinder33445 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the mockup below to style the full screen view:

fullSreen

I have not yet reviewed BpDashboardFullscreenTile.php, because it will change when you add changes according to the mockup.

application/controllers/IndexController.php Outdated Show resolved Hide resolved
application/controllers/IndexController.php Outdated Show resolved Hide resolved
/** @var string */
protected $tag = 'div';

protected $defaultAttributes = array(
Copy link
Contributor

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.

Copy link
Author

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?

Copy link
Contributor

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.

library/Businessprocess/Web/Controller.php Outdated Show resolved Hide resolved
public/css/module.less Outdated Show resolved Hide resolved
public/css/module.less Outdated Show resolved Hide resolved
library/Businessprocess/Web/Controller.php Outdated Show resolved Hide resolved
@slalomsk8er
Copy link

@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.

@sukhwinder33445
Copy link
Contributor

sukhwinder33445 commented Aug 1, 2023

Hi @slalomsk8er,
The request is also about the content and the information that should be displayed.

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.
localhost_icingaweb2_businessprocess_showFullscreen=1 view=compact

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.

@slalomsk8er
Copy link

@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:

Screenshot_20230801_123022

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.

@nilmerg nilmerg removed this from the 2.5.0 milestone Aug 9, 2023
Copy link
Member

@nilmerg nilmerg left a 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.

module.info Outdated Show resolved Hide resolved
public/css/module.less Show resolved Hide resolved
@nilmerg
Copy link
Member

nilmerg commented Jul 25, 2024

And please rebase with main, otherwise the checks will not run.

@lippserd lippserd added the dev-call Issues and Pull Requests to be discussed at the Dev Call. label Aug 3, 2024
@lippserd
Copy link
Member

@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.

@lippserd lippserd self-requested a review October 25, 2024 12:02
@NavidSassan
Copy link
Author

Oh sorry, wasn't aware of that. Thanks for the update 👍

@lippserd
Copy link
Member

Oh sorry, wasn't aware of that. Thanks for the update 👍

No worries!

Copy link
Member

@lippserd lippserd left a 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;
Copy link
Member

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');
Copy link
Member

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.

@@ -49,7 +49,6 @@ public function init()
$this->view->showFullscreen
= $this->showFullscreen
= (bool) $this->_helper->layout()->showFullscreen;

Copy link
Member

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'];
Copy link
Member

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 */
Copy link
Member

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(
Copy link
Member

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(
Copy link
Member

@lippserd lippserd Nov 7, 2024

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)
Copy link
Member

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(),
Copy link
Member

@lippserd lippserd Nov 7, 2024

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()]),
Copy link
Member

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(...);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla/signed dev-call Issues and Pull Requests to be discussed at the Dev Call.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants