94 lines
4.2 KiB
PHP
94 lines
4.2 KiB
PHP
<?php
|
|
$templatePath = __DIR__ . '/template.json.tpl';
|
|
$deployDir = __DIR__;
|
|
|
|
include __DIR__ . '/../../include/include_header.php';
|
|
include __DIR__ . '/../../include/include_functions.php';
|
|
|
|
?>
|
|
|
|
<main class="container py-5">
|
|
|
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
|
<h1 class="h3 text-dark">Pomp flow</h1>
|
|
</div>
|
|
|
|
<?php if ($newVersionAlert) echo $newVersionAlert; ?>
|
|
<?php if ($successMessage) echo $successMessage; ?>
|
|
<?php if ($deployResponse) echo "<pre class='bg-light border p-2 rounded small'>".htmlspecialchars($deployResponse)."</pre>"; ?>
|
|
|
|
<div class="card shadow-sm mb-4">
|
|
<div class="card-body">
|
|
<h5 class="card-title mb-3">Parameters voor deploy</h5>
|
|
<form method="post">
|
|
<div class="mb-3">
|
|
<label for="assetId" class="form-label">Asset ID</label>
|
|
<input type="text" class="form-control" id="assetId" name="assetId" value="<?= htmlspecialchars($parameters['assetId']) ?>" required>
|
|
</div>
|
|
|
|
<div class="mb-3">
|
|
<label for="assetName" class="form-label">Asset Naam</label>
|
|
<input type="text" class="form-control" id="assetName" name="assetName" value="<?= htmlspecialchars($parameters['assetName']) ?>" required>
|
|
</div>
|
|
|
|
<div class="mb-3">
|
|
<label for="param1" class="form-label">Extra parameter 1</label>
|
|
<input type="text" class="form-control" id="param1" name="param1" value="<?= htmlspecialchars($parameters['param1']) ?>">
|
|
</div>
|
|
|
|
<div class="mb-3">
|
|
<label for="param2" class="form-label">Extra parameter 2</label>
|
|
<input type="text" class="form-control" id="param2" name="param2" value="<?= htmlspecialchars($parameters['param2']) ?>">
|
|
</div>
|
|
|
|
<div class="mb-3">
|
|
<label for="environment" class="form-label">Selecteer Node-RED omgeving</label>
|
|
<select class="form-select" id="environment" name="environment" required>
|
|
<option value="">-- Kies een omgeving --</option>
|
|
<?php foreach ($environments as $env): ?>
|
|
<option value="<?= htmlspecialchars($env['ip']) ?>" <?= $selectedEnv === $env['ip'] ? 'selected' : '' ?>>
|
|
<?= htmlspecialchars($env['name'] ?? 'Onbekend') ?> (<?= htmlspecialchars($env['ip']) ?>)
|
|
</option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</div>
|
|
|
|
<button type="submit" name="deploy" class="btn btn-primary">Nieuwe versie deployen</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card shadow-sm">
|
|
<div class="card-body">
|
|
<h5 class="card-title mb-3">Overzicht van deploys</h5>
|
|
<?php if (!empty($deploys)): ?>
|
|
<div class="table-responsive">
|
|
<table class="table table-hover table-bordered mb-0">
|
|
<thead class="table-light">
|
|
<tr>
|
|
<th>Bestand</th>
|
|
<th>Versie</th>
|
|
<th>Bekijk</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php foreach ($deploys as $d): ?>
|
|
<tr>
|
|
<td><?= htmlspecialchars($d['name']) ?></td>
|
|
<td><?= htmlspecialchars($d['version']) ?></td>
|
|
<td>
|
|
<a href="<?= htmlspecialchars($d['name']) ?>" target="_blank" class="btn btn-sm btn-outline-secondary">Bekijk</a>
|
|
</td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<?php else: ?>
|
|
<p class="text-muted mb-0">Geen deploys gevonden.</p>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
|
|
</main>
|