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 {