diff --git a/ajax.php b/ajax.php index 92bc984..bf5674b 100644 --- a/ajax.php +++ b/ajax.php @@ -41,11 +41,18 @@ if (!empty($_POST['action'])) { if ($_POST['action'] == 'status') { echo ansi2html($session->exec('bash -c \'cd ' . $config['path'] . ' && ' . $gitstatus . "'")); exit; - } else if ($_POST['action'] == 'push') { - $message = empty($_POST['message']) ? 'FTP' : str_replace(array('"', "'"), ' ', stripslashes($_POST['message'])); - echo ansi2html($session->exec('bash -c \'cd ' . $config['path'] . ' && git add -A && git commit -m "' . $message . '" && git push && git push && ' . $gitstatus . "'")); - if (!empty($config['after_push'])) { - echo ansi2html($session->exec('bash -c \'cd ' . $config['path'] . ' && ' . $config['after_push'] . "'")); + } else if (strpos($_POST['action'], 'push') !== false) { + if (strpos($_POST['action'], 'force') !== false) { + echo ansi2html($session->exec('bash -c \'cd ' . $config['path'] . ' && git push && ' . $gitstatus . "'")); + if (!empty($config['after_push'])) { + echo ansi2html($session->exec('bash -c \'cd ' . $config['path'] . ' && ' . $config['after_push'] . "'")); + } + } else { + $message = empty($_POST['message']) ? 'FTP' : str_replace(array('"', "'"), ' ', stripslashes($_POST['message'])); + echo ansi2html($session->exec('bash -c \'cd ' . $config['path'] . ' && git add -A && git commit -m "' . $message . '" && git push && ' . $gitstatus . "'")); + if (!empty($config['after_push'])) { + echo ansi2html($session->exec('bash -c \'cd ' . $config['path'] . ' && ' . $config['after_push'] . "'")); + } } exit; } else if ($_POST['action'] == 'pull') { diff --git a/css/styles.css b/css/styles.css index 7dc34d7..2b51480 100644 --- a/css/styles.css +++ b/css/styles.css @@ -9,35 +9,43 @@ } .toolbar-top.btn-group .btn { - border-bottom: 0; - border-bottom-left-radius: 0 !important; - border-bottom-right-radius: 0 !important; + border-bottom: 0; + border-bottom-left-radius: 0 !important; + border-bottom-right-radius: 0 !important; } pre { - border-top-left-radius: 0; - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; - margin: 0; -} - -.toolbar-bottom { - margin-top: -1px; + border-top-left-radius: 0; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + margin: 0; } .toolbar-bottom { + margin-top: -1px; display: block; padding-right: 79px; + margin-right: 25px; } .toolbar-bottom .input-block-level { - border-top-left-radius: 0; + border-top-left-radius: 0; width: 100% !important; } .toolbar-bottom .btn { width: 80px; - border-top-right-radius: 0 !important; + border-top-right-radius: 0 !important; +} + +.toolbar-bottom .btn:last-child i:last-child { + position: relative; + right: 9px; + margin-right: -9px; +} + +.toolbar-bottom .btn:last-child { + width: 20px; } .span9 { diff --git a/index.php b/index.php index 0db787e..353520b 100644 --- a/index.php +++ b/index.php @@ -5,61 +5,65 @@ require_once 'utils.php'; global $servers; ?> - - - - - - - Git Control Center - - -
-
-
- -
-
- $ssh): ?> -

- $param): ?> -
-

-
-
- - -
-

-								
- - -
-
- -
+ + + + + + + Git Control Center + + +
+
+
+
-
+ +
+
+ $ssh): ?> +

+ $param): ?> +
+

-
- - - -
- +
+
+ + +
+

+						
+ + + +
+
+ +
+ +
+
+
+ + + diff --git a/js/app.js b/js/app.js index cd305d2..169b0c1 100644 --- a/js/app.js +++ b/js/app.js @@ -1,6 +1,6 @@ "use strict"; -window.addEventListener('load', function() { +window.addEventListener('load', function () { var sections = document.querySelectorAll('section'); for (var i = 0; i < sections.length; i++) { callRequest('status', sections[i].id); @@ -26,7 +26,7 @@ function callRequest(action, section, message) { xhr.open('POST', 'ajax.php'); xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xhr.send('action=' + action + '§ion=' + section + '&message=' + message); - xhr.onreadystatechange = function() { + xhr.onreadystatechange = function () { if (xhr.readyState === 4 && (xhr.status === 200 || xhr.status === 0)) { pre.innerHTML = xhr.responseText; diff --git a/utils.php b/utils.php index e5b7058..79714ba 100644 --- a/utils.php +++ b/utils.php @@ -9,7 +9,8 @@ if (defined('ONGITLAB') && ONGITLAB) { } } -function ansi2html($string) { +function ansi2html($string) +{ $dictionary = array( '[30m' => '', '[31m' => '',