Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
L
Liman MYS - Çekirdek
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
liman
Liman MYS - Çekirdek
Commits
e08a8e47
Kaydet (Commit)
e08a8e47
authored
Nis 30, 2020
tarafından
Baran Sekin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge branch 'master' of github.com:mertcelen/liman
üst
e612f84c
c8dc67d0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
55 additions
and
112 deletions
+55
-112
Certificate.php
app/Certificate.php
+3
-0
OneController.php
app/Http/Controllers/Server/OneController.php
+11
-5
Server.php
app/Server.php
+39
-1
ejs.blade.php
resources/views/ejs.blade.php
+0
-24
index.blade.php
resources/views/scripts/index.blade.php
+0
-77
one.blade.php
resources/views/server/one.blade.php
+0
-0
web.php
routes/web.php
+2
-5
No files found.
app/Certificate.php
Dosyayı görüntüle @
e08a8e47
...
...
@@ -4,6 +4,9 @@ namespace App;
use
Illuminate\Database\Eloquent\Model
;
/**
* @method static where(string $string, array|\Illuminate\Contracts\Foundation\Application|\Illuminate\Http\Request|string $request)
*/
class
Certificate
extends
Model
{
use
UsesUuid
;
...
...
app/Http/Controllers/Server/OneController.php
Dosyayı görüntüle @
e08a8e47
...
...
@@ -22,14 +22,20 @@ class OneController extends Controller
{
public
function
one
()
{
if
(
!
\server
())
{
$server
=
server
();
if
(
!
$server
)
{
abort
(
504
,
"Sunucu Bulunamadı."
);
}
if
(
server
()
->
type
==
"linux_ssh"
||
server
()
->
type
==
"linux_certificate"
||
server
()
->
type
==
"windows_powershell"
)
{
View
::
share
(
'hostname'
,
server
()
->
run
(
"hostname"
));
}
$outputs
=
[
"hostname"
=>
$server
->
run
(
"hostname"
),
"version"
=>
$server
->
getVersion
()
];
return
view
(
'server.one'
,
[
"server"
=>
server
(),
"server"
=>
$server
,
"favorite"
=>
$server
->
isFavorite
(),
"outputs"
=>
$outputs
,
"installed_extensions"
=>
$this
->
installedExtensions
(),
"available_extensions"
=>
$this
->
availableExtensions
(),
]);
...
...
app/Server.php
Dosyayı görüntüle @
e08a8e47
...
...
@@ -2,12 +2,14 @@
namespace
App
;
use
App\Classes\Connector\Connector
;
use
App\Classes\Connector\SSHConnector
;
use
App\Classes\Connector\SSHCertificateConnector
;
use
App\Classes\Connector\WinRMConnector
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Database\Eloquent\Collection
;
use
Illuminate\Database\Query\Builder
;
use
App\UserFavorites
;
/**
* Class Server
...
...
@@ -29,7 +31,7 @@ class Server extends Model
public
$key
;
/**
* @return
SSHConnector|WinRM
Connector
* @return Connector
*/
private
function
connector
()
{
...
...
@@ -51,6 +53,10 @@ class Server extends Model
*/
public
function
run
(
$command
,
$log
=
true
)
{
if
(
!
$this
->
canRunCommand
()){
return
false
;
}
// Execute and return outputs.
return
$this
->
connector
()
->
execute
(
$command
,
$log
);
}
...
...
@@ -138,4 +144,36 @@ class Server extends Model
});
}
public
function
isFavorite
()
{
return
UserFavorites
::
where
([
"user_id"
=>
user
()
->
id
,
"server_id"
=>
server
()
->
id
])
->
exists
();
}
public
function
canRunCommand
()
{
return
$this
->
type
==
"linux_ssh"
||
$this
->
type
==
"linux_certificate"
||
$this
->
type
==
"windows_powershell"
;
}
public
function
isLinux
()
{
return
$this
->
type
==
"linux_ssh"
||
$this
->
type
==
"linux_certificate"
||
$this
->
type
==
"linux"
;
}
public
function
isWindows
()
{
return
$this
->
type
==
"windows"
||
$this
->
type
==
"windows_powershell"
;
}
public
function
getVersion
()
{
if
(
!
$this
->
canRunCommand
()){
return
false
;
}
if
(
$this
->
isLinux
()){
return
$this
->
run
(
"lsb_release -ds"
);
}
return
explode
(
"|"
,(
$this
->
run
(
"(Get-WmiObject Win32_OperatingSystem).name"
))[
0
]);
}
}
resources/views/ejs.blade.php
deleted
100644 → 0
Dosyayı görüntüle @
e612f84c
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<title>
Document
</title>
<script
src=
"https://cdn.jsdelivr.net/npm/ejs@3.0.1/ejs.min.js"
integrity=
"sha256-UBBPCOEPxc2jDuQMgYvzemO9GqrRd0UkYHVwl78VbqI="
crossorigin=
"anonymous"
></script>
</head>
<script>
function
renderEjs
(){
let
people
=
[
'geddy'
,
'neil'
,
'alex'
],
html
=
ejs
.
render
(
'<%= people.join(", "); %>'
,
{
people
:
people
});
document
.
getElementById
(
'mainData'
).
innerHTML
=
html
}
</script>
<body>
<button
onclick=
"renderEjs()"
>
Render
</button>
<pre
id=
"mainData"
>
</pre>
</body>
</html>
\ No newline at end of file
resources/views/scripts/index.blade.php
deleted
100644 → 0
Dosyayı görüntüle @
e612f84c
@
extends
(
'layouts.app'
)
@
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
">
{
{__("Betikler")}
}
</li>
</ol>
</nav>
@include('modal-button',[
"
class
"
=>
"
btn
-
primary
",
"
target_id
" => "
scriptUpload
",
"
text
" => "
Yükle
"
])<br><br>
@include('errors')
@include('modal',[
"
id
"=>"
scriptUpload
",
"
title
" => "
Betik
Yükle
",
"
url
" => route('script_upload'),
"
next
" => "
reload
",
"
inputs
" => [
"
Lütfen
Betik
Dosyasını
(
.
lmns
)
Seçiniz
" => "
script
:
file
",
],
"
submit_text
" => "
Yükle
"
])
@include('modal',[
"
id
"=>"
scriptExport
",
"
onsubmit
" => "
downloadFile
",
"
title
" => "
Betik
İndir
",
"
next
" => "",
"
inputs
" => [
"
Betik
Secin
:
script_id
" => objectToArray(
$scripts
,"
name
", "
id
")
],
"
submit_text
" => "
İndir
"
])
@include('table',[
"
value
" =>
$scripts
,
"
title
" => [
"
Betik
Adı
" , "
Açıklama
" , "
Tipi
" , "
Kodu
", "
*
hidden
*
", "
Son
Güncelleme
"
],
"
display
" => [
"
name
" , "
description
", "
extensions
" , "
unique_code
", "
id
:
script_id
" , "
updated_at
"
],
"
menu
" => [
"
İndir
" => [
"
target
" => "
scriptExport
",
"
icon
" => "
fa
-
download
"
],
"
Sil
" => [
"
target
" => "
delete
",
"
icon
" => "
context
-
menu
-
icon
-
delete
"
]
]
])
@include('modal',[
"
id
"=>"
delete
",
"
title
" =>"
Betiği
Sil
",
"
url
" => route('script_delete'),
"
text
" => "
Betiği
silmek
istediğinize
emin
misiniz
?
Bu
işlem
geri
alınamayacaktır
.
",
"
next
" => "
reload
",
"
inputs
" => [
"
Betik
Id
:
'null'
" => "
script_id
:
hidden
"
],
"
submit_text
" => "
Betiği
Sil
"
])
<script>
function downloadFile(form) {
window.location.assign('/indir/betik/' + form.getElementsByTagName('select')[0].value);
return false;
}
</script>
@endsection
\ No newline at end of file
resources/views/server/one.blade.php
Dosyayı görüntüle @
e08a8e47
This diff is collapsed.
Click to expand it.
routes/web.php
Dosyayı görüntüle @
e08a8e47
...
...
@@ -154,8 +154,4 @@ Route::post('/upload_info', function () {
shell_exec
(
"sudo chmod 770 "
.
$info
[
'file_path'
]);
}
return
$info
;
})
->
middleware
([
'auth'
,
'permissions'
]);
Route
::
get
(
'/ejs'
,
function
()
{
$certificate
=
Spatie\SslCertificate\SslCertificate
::
createForHostName
();
});
})
->
middleware
([
'auth'
,
'permissions'
]);
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment