Skip to content

Commit

Permalink
Merge pull request #202 from lbr38/devel
Browse files Browse the repository at this point in the history
4.11.0
  • Loading branch information
lbr38 authored Sep 28, 2024
2 parents 2402b6d + 38d977a commit 25abe82
Show file tree
Hide file tree
Showing 38 changed files with 265 additions and 271 deletions.
36 changes: 0 additions & 36 deletions www/controllers/App/Cache.php

This file was deleted.

4 changes: 0 additions & 4 deletions www/controllers/App/Config/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ public static function get()
if (!defined('HOSTS_DB')) {
define('HOSTS_DB', DB_DIR . "/repomanager-hosts.db");
}
// Cache dir
if (!defined('WWW_CACHE')) {
define('WWW_CACHE', DATA_DIR . "/cache");
}
// GnuPG home
if (!defined('GPGHOME')) {
define('GPGHOME', DATA_DIR . "/.gnupg");
Expand Down
1 change: 0 additions & 1 deletion www/controllers/App/Structure/Directory.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public static function create()
PID_DIR,
TEMP_DIR,
HOSTS_DIR,
WWW_CACHE,
DB_UPDATE_DONE_DIR,
DATA_DIR . '/ssl'
);
Expand Down
10 changes: 0 additions & 10 deletions www/controllers/Environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ public function delete(string $name)
* Delete env from database
*/
$this->model->delete($name);

/**
* Clean repos list cache
*/
\Controllers\App\Cache::clear();
}

/**
Expand Down Expand Up @@ -69,11 +64,6 @@ public function edit(array $envs)
$this->model->new($env);
}
}

/**
* Clean repos list cache
*/
\Controllers\App\Cache::clear();
}
}

Expand Down
6 changes: 0 additions & 6 deletions www/controllers/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,6 @@ public function new(string $name)

$myhistory = new \Controllers\History();
$myhistory->set($_SESSION['username'], 'Create a new group <span class="label-white">' . $name . '</span> (type: ' . $this->type . ')', 'success');

\Controllers\App\Cache::clear();
}

/**
Expand Down Expand Up @@ -179,8 +177,6 @@ public function edit(int $id, string $name, array $data)

$myhistory = new \Controllers\History();
$myhistory->set($_SESSION['username'], 'Group <span class="label-white">' . $name . '</span> (type: ' . $this->type . ') edited', 'success');

\Controllers\App\Cache::clear();
}

/**
Expand Down Expand Up @@ -208,8 +204,6 @@ public function delete(int $id)

$myhistory = new \Controllers\History();
$myhistory->set($_SESSION['username'], 'Delete group <span class="label-white">' . $name . '</span> (type: '. $this->type . ')', 'success');

\Controllers\App\Cache::clear();
}

/**
Expand Down
8 changes: 0 additions & 8 deletions www/controllers/Repo/Repo.php
Original file line number Diff line number Diff line change
Expand Up @@ -540,8 +540,6 @@ public function addReposIdToGroup(array $reposId = null, int $groupId)
$this->model->removeFromGroup($actualRepoId, $groupId);
}
}

\Controllers\App\Cache::clear();
}

/**
Expand Down Expand Up @@ -588,8 +586,6 @@ public function getEnvIdBySnapId(string $snapId)
public function envSetDescription(string $envId, string $description)
{
$this->model->envSetDescription($envId, $description);

\Controllers\App\Cache::clear();
}

/**
Expand Down Expand Up @@ -716,8 +712,6 @@ public function cleanSnapshots()
}
}

\Controllers\App\Cache::clear();

return $returnOutput;
}

Expand Down Expand Up @@ -745,8 +739,6 @@ public function cleanGroups()
$this->model->removeFromGroup($id);
}
}

\Controllers\App\Cache::clear();
}

/**
Expand Down
5 changes: 0 additions & 5 deletions www/controllers/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,5 @@ public function apply(array $sendSettings)
* Write settings to database
*/
$this->model->apply($settingsToApply);

/**
* Clean repos list cache
*/
\Controllers\App\Cache::clear();
}
}
2 changes: 1 addition & 1 deletion www/controllers/Task/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ public function steplogDuration(string $stepId, string $duration)
*/
public function steplogLoading(string $stepId)
{
echo '<span class="' . $stepId . '-loading-' . $this->taskId . ' op-step-loading">Running<img src="/assets/images/loading.gif" class="icon" /></span>';
echo '<span class="' . $stepId . '-loading-' . $this->taskId . ' op-step-loading">Running<img src="/assets/icons/loading.svg" class="icon" /></span>';
$this->steplogWrite();
}

Expand Down
15 changes: 0 additions & 15 deletions www/controllers/Task/Task.php
Original file line number Diff line number Diff line change
Expand Up @@ -509,11 +509,6 @@ public function start()
*/
$this->updateStatus($this->id, 'running');

/**
* Clear cache
*/
\Controllers\App\Cache::clear();

/**
* Update layout containers states
*/
Expand Down Expand Up @@ -614,11 +609,6 @@ public function end()
*/
$this->profileController->cleanProfiles();

/**
* Clear cache
*/
\Controllers\App\Cache::clear();

/**
* Update layout containers states
*/
Expand Down Expand Up @@ -753,11 +743,6 @@ public function kill(string $pid)
);
}

/**
* Clear cache
*/
\Controllers\App\Cache::clear();

/**
* Update layout containers states
*/
Expand Down
34 changes: 34 additions & 0 deletions www/controllers/Websocket/Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,40 @@ public function responseFromRequestId($conn, $message)
*/
$this->hostController->updateWsRequest($requestId, $status, $info, $responseJson);

/**
* Send a message to the client to inform that the response was received
* Tell the client what kind of data was received (summary, log...), to avoid it to send them again
*/
$confirmMessage = array(
'info' => 'Request response received',
'request-id' => $requestId,
// Tell the client what kind of data was received
'data' => array(
'status'
)
);
// If there was an info message, add it to the data array, to inform the client that it was received
if (!empty($message['response-to-request']['info'])) {
$confirmMessage['data'][] = 'info';
}
// If there was an error message, add it to the data array, to inform the client that it was received
if (!empty($message['response-to-request']['error'])) {
$confirmMessage['data'][] = 'error';
}
// If there was a summary, add it to the data array, to inform the client that it was received
if (!empty($message['response-to-request']['summary'])) {
$confirmMessage['data'][] = 'summary';
}
// If there was a log, add it to the data array, to inform the client that it was received
if (!empty($message['response-to-request']['log'])) {
$confirmMessage['data'][] = 'log';
}

/**
* Send the confirmation message to the client
*/
$conn->send(json_encode($confirmMessage));

$this->layoutContainerStateController->update('hosts/overview');
$this->layoutContainerStateController->update('hosts/list');
$this->layoutContainerStateController->update('host/summary');
Expand Down
24 changes: 24 additions & 0 deletions www/controllers/ajax/repo.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,28 @@
response(HTTP_OK, "Description has been saved");
}

/**
* Get repo size
*/
if ($_POST['action'] == 'getRepoSize' and !empty($_POST['path'])) {
try {
/**
* Check if specified repo path exists
*/
if (!is_dir(REPOS_DIR . '/' . $_POST['path'])) {
throw new \Exception('Could not retrieve size of repository ' . $_POST['path']);
}

/**
* Calculate repo size
*/
$size = \Controllers\Filesystem\Directory::getSize(REPOS_DIR . '/' . $_POST['path']);
$size = \Controllers\Common::sizeFormat($size);
} catch (\Exception $e) {
response(HTTP_BAD_REQUEST, $e->getMessage());
}

response(HTTP_OK, $size);
}

response(HTTP_BAD_REQUEST, 'Invalid action');
2 changes: 1 addition & 1 deletion www/libs/vendor/composer/autoload_psr4.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
'React\\Cache\\' => array($vendorDir . '/react/cache/src'),
'Ratchet\\RFC6455\\' => array($vendorDir . '/ratchet/rfc6455/src'),
'Ratchet\\' => array($vendorDir . '/cboden/ratchet/src/Ratchet'),
'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src', $vendorDir . '/psr/http-factory/src'),
'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'),
'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'),
'Evenement\\' => array($vendorDir . '/evenement/evenement/src'),
);
4 changes: 2 additions & 2 deletions www/libs/vendor/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ class ComposerStaticInitce559b9fbd0e097bccee77e6c3cc8be1
),
'Psr\\Http\\Message\\' =>
array (
0 => __DIR__ . '/..' . '/psr/http-message/src',
1 => __DIR__ . '/..' . '/psr/http-factory/src',
0 => __DIR__ . '/..' . '/psr/http-factory/src',
1 => __DIR__ . '/..' . '/psr/http-message/src',
),
'GuzzleHttp\\Psr7\\' =>
array (
Expand Down
12 changes: 6 additions & 6 deletions www/libs/vendor/composer/installed.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<?php return array(
'root' => array(
'name' => '__root__',
'pretty_version' => 'dev-websocket',
'version' => 'dev-websocket',
'reference' => 'f0dcc692a201d420eae29099943975721290af1b',
'pretty_version' => 'dev-devel',
'version' => 'dev-devel',
'reference' => '2402b6d04782d67429bcc53989fb50b41fcd0904',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'dev' => true,
),
'versions' => array(
'__root__' => array(
'pretty_version' => 'dev-websocket',
'version' => 'dev-websocket',
'reference' => 'f0dcc692a201d420eae29099943975721290af1b',
'pretty_version' => 'dev-devel',
'version' => 'dev-devel',
'reference' => '2402b6d04782d67429bcc53989fb50b41fcd0904',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand Down
Loading

0 comments on commit 25abe82

Please sign in to comment.