Skip to content

Commit

Permalink
Add headers
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoxhaa committed Aug 25, 2024
1 parent 397b96b commit c09e392
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 46 deletions.
3 changes: 3 additions & 0 deletions application/controllers/DaemonsetController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Icinga\Module\Kubernetes\Model\DaemonSet;
use Icinga\Module\Kubernetes\Web\Controller;
use Icinga\Module\Kubernetes\Web\DaemonSetDetail;
use Icinga\Module\Kubernetes\Web\DaemonSetList;
use ipl\Stdlib\Filter;
use Ramsey\Uuid\Uuid;

Expand All @@ -29,6 +30,8 @@ public function indexAction(): void
$this->httpNotFound($this->translate('Daemon Set not found'));
}

$this->addControl(new DaemonSetList([$daemonSet]));

$this->addContent(new DaemonSetDetail($daemonSet));
}
}
3 changes: 3 additions & 0 deletions application/controllers/DeploymentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Icinga\Module\Kubernetes\Model\Deployment;
use Icinga\Module\Kubernetes\Web\Controller;
use Icinga\Module\Kubernetes\Web\DeploymentDetail;
use Icinga\Module\Kubernetes\Web\DeploymentList;
use ipl\Stdlib\Filter;
use Ramsey\Uuid\Uuid;

Expand All @@ -29,6 +30,8 @@ public function indexAction(): void
$this->httpNotFound($this->translate('Deployment not found'));
}

$this->addControl(new DeploymentList([$deployment]));

$this->addContent(new DeploymentDetail($deployment));
}
}
3 changes: 3 additions & 0 deletions application/controllers/JobController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Icinga\Module\Kubernetes\Common\Database;
use Icinga\Module\Kubernetes\Model\Job;
use Icinga\Module\Kubernetes\Web\JobDetail;
use Icinga\Module\Kubernetes\Web\JobList;
use ipl\Stdlib\Filter;
use ipl\Web\Compat\CompatController;
use Ramsey\Uuid\Uuid;
Expand All @@ -29,6 +30,8 @@ public function indexAction(): void
$this->httpNotFound($this->translate('Job not found'));
}

$this->addControl(new JobList([$job]));

$this->addContent(new JobDetail($job));
}
}
48 changes: 2 additions & 46 deletions application/controllers/PodController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,13 @@

namespace Icinga\Module\Kubernetes\Controllers;

use Icinga\Module\Icingadb\Model\Behavior\ActionAndNoteUrl;
use Icinga\Module\Icingadb\Model\State;
use Icinga\Module\Kubernetes\Common\Database;
use Icinga\Module\Kubernetes\Model\Pod;
use Icinga\Module\Kubernetes\Web\EndpointTable;
use Icinga\Module\Kubernetes\Web\PodDetail;
use ipl\Html\Attributes;
use ipl\Html\HtmlElement;
use ipl\Html\Text;
use Icinga\Module\Kubernetes\Web\PodList;
use ipl\Stdlib\Filter;
use ipl\Web\Compat\CompatController;
use Ramsey\Uuid\Uuid;
use ipl\Web\Widget\HorizontalKeyValue;
use ipl\Web\Widget\StateBall;
use ipl\Web\Widget\TimeAgo;
use ipl\Web\Widget\TimeSince;

class PodController extends CompatController
{
Expand All @@ -39,42 +30,7 @@ public function indexAction(): void
$this->httpNotFound($this->translate('Pod not found'));
}

$this->addControl(
new HtmlElement('div', new Attributes(['class' => 'resource-list item-list']),
new HtmlElement('div', new Attributes(['class' => 'list-item']),
new HtmlElement('div', new Attributes(['class' => 'visual']),
new StateBall('critical', StateBall::SIZE_MEDIUM_LARGE)),
new HtmlElement('div', new Attributes(['class' => 'main']),
new HtmlElement('header', null,
new HtmlElement('div', new Attributes(['class' => 'title']),
new HtmlElement('span', new Attributes(['class' => 'subject']),
new HtmlElement('i', new Attributes(['class' => 'ikicon-kubernetes ikicon-kubernetes-pod'])),
new Text($pod->name)
),
new Text(' is '),
new HtmlElement('span', new Attributes(['class' => 'state-text']), new Text($pod->phase))
),
new TimeSince('1716284368')
),
new HtmlElement('section', new Attributes(['class' => 'caption']),
new HorizontalKeyValue('created', new Text('2024-12-23 12:24'))
),
/*
new HtmlElement('br'),
new Text($pod->uid),
new Text(' / '),
new Text($pod->resource_version),
*/
new HtmlElement('footer', null,
new HtmlElement('span', new Attributes(['class' => 'badge-namespace']),
new HtmlElement('i', new Attributes(['class' => 'ikicon-kubernetes ikicon-kubernetes-ns'])),
new Text($pod->namespace)
)
)
)
)
)
);
$this->addControl(new PodList([$pod]));

$this->addContent(new PodDetail($pod));
}
Expand Down
3 changes: 3 additions & 0 deletions application/controllers/ReplicasetController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Icinga\Module\Kubernetes\Model\ReplicaSet;
use Icinga\Module\Kubernetes\Web\Controller;
use Icinga\Module\Kubernetes\Web\ReplicaSetDetail;
use Icinga\Module\Kubernetes\Web\ReplicaSetList;
use ipl\Stdlib\Filter;
use Ramsey\Uuid\Uuid;

Expand All @@ -29,6 +30,8 @@ public function indexAction(): void
$this->httpNotFound($this->translate('Replica Set not found'));
}

$this->addControl(new ReplicaSetList([$replicaSet]));

$this->addContent(new ReplicaSetDetail($replicaSet));
}
}
3 changes: 3 additions & 0 deletions application/controllers/StatefulsetController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Icinga\Module\Kubernetes\Model\StatefulSet;
use Icinga\Module\Kubernetes\Web\Controller;
use Icinga\Module\Kubernetes\Web\StatefulSetDetail;
use Icinga\Module\Kubernetes\Web\StatefulSetList;
use ipl\Stdlib\Filter;
use Ramsey\Uuid\Uuid;

Expand All @@ -29,6 +30,8 @@ public function indexAction(): void
$this->httpNotFound($this->translate('Stateful Set not found'));
}

$this->addControl(new StatefulSetList([$statefulSet]));

$this->addContent(new StatefulSetDetail($statefulSet));
}
}

0 comments on commit c09e392

Please sign in to comment.