generated from spatie/package-skeleton-laravel
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from xbugster/config-publish-ability
Release candidate 1.0.0
- Loading branch information
Showing
12 changed files
with
415 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
|
||
<div class="container" id="container" ng-app="RemotisanApp" ng-controller="RemotisanController"> | ||
<h2>Commands</h2> | ||
<form class="form-inline" ng-submit="execute()" ng-init='init("{{ config('remotisan.url') }}")'> | ||
<label class="my-1 mr-2" for="inlineFormCustomSelectPref">Preference</label> | ||
<select required class="custom-select my-1 mr-sm-2" ng-model="command" name="command" | ||
ng-options='c.name as (c.name + " - " + c.description) for c in commands' ng-change="onChangeDropdownValue()"> | ||
</select> | ||
|
||
<textarea placeholder="input options & arguments (if required)..." name="command_arguments" ng-model="command_arguments" style="width:70%"></textarea> | ||
|
||
<input type="button" class="btn btn-primary" ng-click="execute()" value="Execute" /> | ||
|
||
<hr style="opacity:0; display:block; width:100%;"/> | ||
|
||
<div id="command_details_wrapper" ng-show="command !== null" ng-model="command_details"> | ||
<div class="abc" style="background-color: #f9fdf0"> | ||
<div><strong>Command name:</strong> @{{command_details.name}}</div> | ||
<div><strong>Description:</strong> @{{command_details.description}}</div> | ||
<div><strong>Help:</strong> @{{command_details.help}}</div> | ||
<div><strong>Arguments:</strong></div> | ||
<div style="margin-left:20px;" ng-repeat="(field_name, field_details) in command_details['definition']['args']"> | ||
<div><strong>@{{field_name}}:</strong> @{{field_details}}</div> | ||
</div> | ||
<div><strong>Options:</strong></div> | ||
<div style="margin-left:20px;" ng-repeat="(field_name, field_details) in command_details['definition']['ops']"> | ||
<div><strong>@{{field_name}}:</strong> @{{field_details}}</div> | ||
</div> | ||
</div> | ||
</div> | ||
</form> | ||
|
||
<h2>Logger</h2> | ||
<pre style="width: 90%; background-color: black; color: darkcyan;font-family: 'Space Mono', sans-serif;">@{{ log.content }}</pre> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
@if(!($ngApp ?? null)) | ||
var RemotisanApp = angular.module('RemotisanApp', []); | ||
@endif | ||
|
||
{{ $ngApp ?? "RemotisanApp" }}.controller('RemotisanController', ["$scope", "$http", "$timeout", "$sce", "$location", function($scope, $http, $timeout, $sce, $location) { | ||
$scope.baseUrl = ''; | ||
$scope.commands = []; | ||
$scope.command = null; | ||
$scope.command_arguments = null; | ||
$scope.command_details = []; | ||
$scope.params = null; | ||
$scope.$location = {}; | ||
$scope.log = { | ||
uuid: null, | ||
content: "", | ||
} | ||
$scope.init = function(baseUrl) { | ||
$scope.baseUrl = baseUrl; | ||
$scope.fetchCommands(); | ||
if($location.path() != '') { | ||
$scope.uuid = $location.path().replace('/', ''); | ||
$scope.readLog(); | ||
} | ||
} | ||
|
||
$scope.locationPath = function (newPath) | ||
{ | ||
return $location.path(newPath); | ||
} | ||
|
||
$scope.onChangeDropdownValue = function () { | ||
$scope.command_arguments = ''; | ||
$scope.command_details = $scope.commands[$scope.command]; | ||
} | ||
|
||
$scope.execute = function () { | ||
$http.post($scope.baseUrl + "/execute", { | ||
command: $scope.command, | ||
command_arguments: $scope.command_arguments, | ||
params: $scope.params | ||
}).then(function (response) { | ||
$scope.uuid = response.data.id; | ||
|
||
$timeout( function(){ $scope.readLog(); }, 5000); | ||
}, function (response) { | ||
console.log(response); | ||
}); | ||
} | ||
|
||
$scope.fetchCommands = function () { | ||
$http.get($scope.baseUrl + "/commands") | ||
.then(function (response) { | ||
$scope.commands = response.data.commands; | ||
}, function (response) { | ||
console.log(response); | ||
}); | ||
} | ||
|
||
$scope.readLog = function () { | ||
$http.get($scope.baseUrl + "/execute/" + $scope.uuid) | ||
.then(function (response) { | ||
$scope.locationPath($scope.uuid); | ||
console.log(response.data); | ||
$scope.log.content = response.data.content.join("\n"); | ||
if (!response.data.isEnded) { | ||
$timeout( function(){ $scope.readLog(); }, 1000); | ||
} | ||
}, function (response) { | ||
console.log(response); | ||
}); | ||
} | ||
}]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.