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
013af013
Unverified
Kaydet (Commit)
013af013
authored
Ock 29, 2021
tarafından
Ali Orhun Akkirman
Kaydeden (comit)
GitHub
Ock 29, 2021
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge pull request #129 from aliorhun/master
added number of services and processes
üst
bcfbdb5d
91cc46a8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
0 deletions
+60
-0
OneController.php
app/Http/Controllers/Server/OneController.php
+3
-0
Server.php
app/Models/Server.php
+45
-0
details.blade.php
resources/views/server/one/general/details.blade.php
+12
-0
No files found.
app/Http/Controllers/Server/OneController.php
Dosyayı görüntüle @
013af013
...
...
@@ -29,6 +29,9 @@ class OneController extends Controller
$outputs
=
[
"hostname"
=>
$server
->
getHostname
(),
"version"
=>
$server
->
getVersion
(),
"nofservices"
=>
$server
->
getNoOfServices
(),
"nofprocesses"
=>
$server
->
getNoOfProcesses
(),
"uptime"
=>
$server
->
getUptime
(),
];
$input_extensions
=
[];
...
...
app/Models/Server.php
Dosyayı görüntüle @
013af013
...
...
@@ -218,6 +218,51 @@ class Server extends Model
)[
0
];
}
public
function
getUptime
()
{
if
(
!
$this
->
canRunCommand
())
{
return
""
;
}
if
(
$this
->
isLinux
())
{
return
$this
->
run
(
"uptime -s"
);
}
return
explode
(
"|"
,
$this
->
run
(
"wmic path Win32_OperatingSystem get LastBootUpTime"
)
)[
0
];
}
public
function
getNoOfServices
()
{
if
(
!
$this
->
canRunCommand
())
{
return
""
;
}
if
(
$this
->
isLinux
())
{
return
$this
->
run
(
"systemctl list-units --type=service --state=active | wc -l"
);
}
return
explode
(
"|"
,
$this
->
run
(
"wmic service get name | find
\"\"
/v /c"
)
)[
0
];
}
public
function
getNoOfProcesses
()
{
if
(
!
$this
->
canRunCommand
())
{
return
""
;
}
if
(
$this
->
isLinux
())
{
return
$this
->
run
(
"ps -aux | wc -l"
);
}
return
explode
(
"|"
,
$this
->
run
(
"(Get-Process).Count"
)
)[
0
];
}
public
function
getHostname
()
{
if
(
!
$this
->
canRunCommand
())
{
...
...
resources/views/server/one/general/details.blade.php
Dosyayı görüntüle @
013af013
...
...
@@ -38,6 +38,17 @@
@endif
</p>
<hr>
@if(server()->canRunCommand())
<strong>
{{ __('Açık Kalma') }}
</strong>
<p
class=
"text-muted"
>
{{$outputs["uptime"]}}
</p>
<hr>
<strong>
{{ __('Servis Sayısı') }}
</strong>
<p
class=
"text-muted"
>
{{$outputs["nofservices"]}}
</p>
<hr>
<strong>
{{ __('İşlem Sayısı') }}
</strong>
<p
class=
"text-muted"
>
{{$outputs["nofprocesses"]}}
</p>
<hr>
@endif
</div>
</div>
</div>
\ 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