Appli complètement fonctionnelle !

This commit is contained in:
Michel Roux 2013-10-02 16:46:02 +02:00
parent 73f3b226d2
commit eb9381f89c
3 changed files with 11 additions and 10 deletions

View File

@ -22,9 +22,9 @@ if (!empty($_POST['action'])) {
echo ansi2html($session->exec('cd ' . $config['path'] . ' && ' . $gitstatus));
} else if ($_POST['action'] == 'push') {
$message = empty($_POST['message']) ? 'FTP' : $_POST['message'];
//echo $session->exec('cd ' . $config['path'] . ' && git add -A && git commit -m "' . $message . '" && git push && ' . $gitstatus);
echo ansi2html($session->exec('cd ' . $config['path'] . ' && git add -A && git commit -m "' . $message . '" && git push && ' . $gitstatus));
} else if ($_POST['action'] == 'pull') {
//echo $session->exec('cd ' . $config['path'] . ' && git pull && ' . $gitstatus);
echo ansi2html($session->exec('cd ' . $config['path'] . ' && git pull && ' . $gitstatus));
}
}
}

View File

@ -35,10 +35,16 @@ global $servers;
<section id="<?php echo $id; ?>">
<h3><?php echo $param['title']; ?> <span class="label"></span></h3>
<div class="btn-group">
<button class="btn" onclick="callRequest('status', '<?php echo $id; ?>');"><i class="icon-refresh"></i> Status</button>
<button class="btn" onclick="callRequest('pull', '<?php echo $id; ?>');"><i class="icon-arrow-down"></i> Pull</button>
<button class="btn" onclick="callRequest('status', '<?php echo $id; ?>');">
<i class="icon-refresh"></i> Status
</button>
<button class="btn" onclick="callRequest('pull', '<?php echo $id; ?>');">
<i class="icon-arrow-down"></i> Pull
</button>
<div class="input-prepend">
<button class="btn" type="button"><i class="icon-arrow-up"></i> Push</button>
<button class="btn" type="button" onclick="callRequest('push', '<?php echo $id; ?>', document.querySelector('#<?php echo $id; ?> input[name=message]').value);">
<i class="icon-arrow-up"></i> Push
</button>
<input type="text" name="message" placeholder="Commit message">
</div>
</div>

View File

@ -36,8 +36,3 @@ function callRequest(action, section, message) {
}
};
}
function push(section) {
//callRequest('push', section, document.getElementById('message').value);
return false;
}