From 11bab4d60b28fac6464b222d1eb49a2b7c4c9692 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xe=CC=81fir=20Destiny?= Date: Wed, 2 Oct 2013 15:22:31 +0200 Subject: [PATCH] Les couleurs fonctionnent --- ajax.php | 11 ++++++----- config/color.php | 17 +++++++++++++++++ css/styles.css | 2 +- 3 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 config/color.php diff --git a/ajax.php b/ajax.php index 64e1d64..a82417d 100644 --- a/ajax.php +++ b/ajax.php @@ -1,7 +1,8 @@ login($config['user'], $config['pass'])) { + if ($session->login($config['user'], $config['pass'])) { if ($_POST['action'] == 'status') { - echo $ssh->exec('cd ' . $config['path'] . ' && git fetch && git status'); + echo ansi2html($session->exec('cd ' . $config['path'] . ' && git fetch && git status')); } else if ($_POST['action'] == 'push') { $message = empty($_POST['message']) ? 'FTP' : $_POST['message']; - //echo $ssh->exec('cd ' . $config['path'] . ' && git add -A && git commit -m "' . $message . '" && git push'); + //echo $session->exec('cd ' . $config['path'] . ' && git add -A && git commit -m "' . $message . '" && git push'); } else if ($_POST['action'] == 'pull') { - //echo $ssh->exec('cd ' . $config['path'] . ' && git pull'); + //echo $session->exec('cd ' . $config['path'] . ' && git pull'); } } } diff --git a/config/color.php b/config/color.php new file mode 100644 index 0000000..d5bec67 --- /dev/null +++ b/config/color.php @@ -0,0 +1,17 @@ + '', + '[31m' => '', + '[32m' => '', + '[33m' => '', + '[34m' => '', + '[35m' => '', + '[36m' => '', + '[37m' => '', + '[m' => '', + ); + + return str_replace(array_keys($dictionary), $dictionary, $string); +} diff --git a/css/styles.css b/css/styles.css index 292fd5c..528ad42 100644 --- a/css/styles.css +++ b/css/styles.css @@ -20,7 +20,7 @@ pre { } .container { - margin-top: 20px; + margin: 20px auto; } .nav {