Skip to content

Commit

Permalink
Merge pull request #28 from PayMeService/xterm-support
Browse files Browse the repository at this point in the history
xterm support
  • Loading branch information
o-kima authored May 8, 2024
2 parents 1e16ba3 + 50b0b4b commit 6e75e06
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
7 changes: 6 additions & 1 deletion resources/views/html.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,10 @@
</div>

<h2>Logger</h2>
<pre style="width: 90%; background-color: black; color: darkcyan;font-family: 'Space Mono', sans-serif;">@{{ log.content }}</pre>

<div id="terminal"></div>
<script>
var term = new Terminal({cols: 182});
term.open(document.getElementById('terminal'));
</script>
</div>
2 changes: 2 additions & 0 deletions resources/views/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular.min.js"></script>
<link rel="stylesheet" href="https://xtermjs.org/css/xterm.css">
<script src="https://xtermjs.org/js/xterm.js"></script>
</head>
<body data-ng-app="RemotisanApp">
@include("remotisan::html")
Expand Down
3 changes: 2 additions & 1 deletion resources/views/scripts.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@
.then(function (response) {
$scope.locationPath($scope.log.uuid);
console.log(response.data);
$scope.log.content = response.data.content.join("\n");
term.clear();
term.write(response.data.content.join("\n"));
if (!response.data.isEnded) {
$timeout( function(){ $scope.readLog(); }, 1000);
}
Expand Down

0 comments on commit 6e75e06

Please sign in to comment.