Kaydet (Commit) c7f965f4 authored tarafından mertcelen's avatar mertcelen

Log Bug Fixed

Breadcrumb added to server pages.
üst 2c3debc7
......@@ -43,7 +43,11 @@ class ServerLog extends Eloquent
$scripts = \App\Script::all();
foreach ($logs as $log){
$log->username = $users->find($log->user_id)->first()->name;
$user = $users->where('_id', $log->user_id)->first();
if(!$user){
continue;
}
$log->username = $user->name;
if(strpos($log->command, "sudo /usr/bin/env python3 /tmp/") == 0){
if (preg_match('/\/tmp\/([a-zA-Z0-9_]*) /', $log->command, $script_id) == 1) {
$script = $scripts->find($script_id[1]);
......
......@@ -8,8 +8,8 @@
"php": "^7.1.3",
"ext-json": "*",
"ext-ldap": "*",
"ext-simplexml": "*",
"ext-zip": "*",
"ext-simplexml" : "*",
"barryvdh/laravel-ide-helper": "^2.5",
"fideloper/proxy": "^4.0",
"guzzlehttp/guzzle": "~6.0",
......@@ -17,6 +17,7 @@
"jeroennoten/laravel-adminlte": "^1.24",
"laravel/framework": "5.7.*",
"laravel/tinker": "^1.0",
"laravelcollective/remote": "^5.7",
"phpseclib/phpseclib": "^2.0",
"twig/twig": "^2.6"
},
......
......@@ -176,6 +176,7 @@ return [
App\Providers\RouteServiceProvider::class,
Jenssegers\Mongodb\MongodbServiceProvider::class,
Jenssegers\Mongodb\MongodbQueueServiceProvider::class,
Collective\Remote\RemoteServiceProvider::class,
],
/*
......@@ -224,7 +225,7 @@ return [
'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,
'SSH' => Collective\Remote\RemoteFacade::class,
],
];
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Remote Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify the default connection that will be used for SSH
| operations. This name should correspond to a connection name below
| in the server list. Each connection will be manually accessible.
|
*/
'default' => 'production',
/*
|--------------------------------------------------------------------------
| Remote Server Connections
|--------------------------------------------------------------------------
|
| These are the servers that will be accessible via the SSH task runner
| facilities of Laravel. This feature radically simplifies executing
| tasks on your servers, such as deploying out these applications.
|
*/
'connections' => [
'production' => [
'host' => '',
'username' => '',
'password' => '',
'key' => '',
'keytext' => '',
'keyphrase' => '',
'agent' => '',
'timeout' => 10,
],
],
/*
|--------------------------------------------------------------------------
| Remote Server Groups
|--------------------------------------------------------------------------
|
| Here you may list connections under a single group name, which allows
| you to easily access all of the servers at once using a short name
| that is extremely easy to remember, such as "web" or "database".
|
*/
'groups' => [
'web' => ['production'],
],
];
......@@ -19,11 +19,24 @@
<tr id="{{str_random(10)}}" @isset($onclick)onclick="{{$onclick}}(this)" @endisset>
@foreach($display as $item)
@if($item == "server_id" || $item == "extension_id" || $item == "script_id")
<td id="{{$item}}" hidden>{{$k->__get($item)}}</td>
@if(is_array($k))
<td id="{{$item}}" hidden>{{$k[$item]}}</td>
@else
<td id="{{$item}}" hidden>{{$k->__get($item)}}</td>
@endif
@elseif(count(explode(':',$item)) > 1)
<td id="{{explode(':',$item)[1]}}" hidden>{{$k->__get(explode(':',$item)[0])}}</td>
@if(is_array($k))
<td id="{{explode(':',$item)[1]}}" hidden>{{$k[explode(':',$item)[0]]}}</td>
@else
<td id="{{explode(':',$item)[1]}}" hidden>{{$k->__get(explode(':',$item)[0])}}</td>
@endif
@else
<td id="{{$item}}">{{$k->__get($item)}}</td>
@if(is_array($k))
<td id="{{$item}}">{{$k[$item]}}</td>
@else
<td id="{{$item}}">{{$k->__get($item)}}</td>
@endif
@endif
@endforeach
</tr>
......@@ -32,18 +45,24 @@
</table>
@if(isset($menu))
<script>
@isset($setCurrentVariable)
var {{$setCurrentVariable}};
@endisset
$.contextMenu({
selector: '#{{$rand}} tr',
callback: function (key, options) {
@isset($setCurrentVariable)
{{$setCurrentVariable}} = options.$trigger[0].getAttribute("id");
@endisset
let target = $("#" + key);
inputs =[];
$("#" + key + " input , #" + key + ' select').each(function (index, value) {
let element_value = $("#" + options.$trigger[0].getAttribute("id") + " #" + value.getAttribute('name')).html();
if(element_value){
inputs.push($("#" + options.$trigger[0].getAttribute("id") + " #" + value.getAttribute('name')));
$("#" + key + " select[name='" + value.getAttribute('name') + "']" + " , "
+ "#" + key + " input[name='" + value.getAttribute('name') + "']").val(element_value);
}
$("#" + key + " select[name='" + value.getAttribute('name') + "']" + " , "
+ "#" + key + " input[name='" + value.getAttribute('name') + "']").val(element_value);
});
target.modal('show');
},
......
@php($random = str_random(20))
<div id="{{$random}}"></div>
<script>
$('#{{$random}}').jstree({
"plugins": [
@isset($menu)
"contextmenu",
@endisset
"search",
"state"
],
'core': {
'data': [
@include("l.folder",["files" => $data])
],
"check_callback": true
},
@isset($menu)
'contextmenu': {
items: customMenu
}
@endisset
}).on('select_node.jstree', function (e, data) {
{{$click}}(uiGetParents(data));
});
function uiGetParents(loSelectedNode) {
try {
let lnLevel = loSelectedNode.node.parents.length;
let lsSelectedID = loSelectedNode.node.id;
let loParent = $("#" + lsSelectedID);
let lsParents = loSelectedNode.node.text + ',';
for (let ln = 0; ln <= lnLevel -1 ; ln++) {
loParent = loParent.parent().parent();
if (loParent.children()[1] !== undefined) {
lsParents += loParent.children()[1].text + ",";
}
}
if (lsParents.length > 0) {
lsParents = lsParents.substring(0, lsParents.length - 1);
}
return lsParents;
}
catch (err) {}
}
function searchTree() {
$('#{{$random}}').jstree(true).search($("#q").val());
}
@isset($menu)
function customMenu() {
return {
@foreach($menu as $key=>$item)
'{{random_int(1,100)}}': {
label: "{{__($key)}}",
action: {{$item}}
}
@endforeach
};
}
@endisset
</script>
\ No newline at end of file
@extends('layouts.app')
@section('content_header')
<h1>{{__("Tüm Sunucular")}}</h1>
@stop
@section('content')
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="{{route('home')}}">{{__("Ana Sayfa")}}</a></li>
<li class="breadcrumb-item active" aria-current="page">{{__("Sunucular")}}</li>
</ol>
</nav>
@include('l.modal-button',[
"class" => "btn-success",
"target_id" => "add_server",
......
@extends('layouts.app')
@section('content_header')
<h1>{{$server->name}}</h1>
@stop
@section('content')
<button class="btn btn-success" onclick="location.href = '/sunucular/';">{{__("Geri Dön")}}</button>
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="{{route('home')}}">Ana Sayfa</a></li>
<li class="breadcrumb-item"><a href="{{route('servers')}}">Sunucular</a></li>
<li class="breadcrumb-item active" aria-current="page">{{$server->name}}</li>
</ol>
</nav>
@include('l.modal-button',[
"class" => "btn-primary",
"target_id" => "edit",
"text" => "Düzenle"
])
@if(count($available_extensions))
@include('l.modal-button',[
"class" => "btn-secondary",
......
......@@ -66,5 +66,3 @@ Route::post('/talep', 'HomeController@request')->name('request_send');
Route::post('/arama/','SearchController@index')->name('search');
});
Route::get('/deneme','HomeController@deneme');
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment