Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
monitoring
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cylab
monitoring
Commits
db5576ed
Commit
db5576ed
authored
6 years ago
by
Tibo
Browse files
Options
Downloads
Patches
Plain Diff
Basic server view
parent
4e98ff9d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
web/app/Server.php
+16
-0
16 additions, 0 deletions
web/app/Server.php
web/resources/views/server/show.blade.php
+32
-20
32 additions, 20 deletions
web/resources/views/server/show.blade.php
with
48 additions
and
20 deletions
web/app/Server.php
+
16
−
0
View file @
db5576ed
...
...
@@ -2,6 +2,7 @@
namespace
App
;
use
MongoDB\Client
as
Mongo
;
use
Illuminate\Database\Eloquent\Model
;
class
Server
extends
Model
...
...
@@ -17,4 +18,19 @@ class Server extends Model
public
function
organization
()
{
return
$this
->
belongsTo
(
"App\Organization"
);
}
public
function
lastRecord
()
{
$collection
=
(
new
Mongo
)
->
monitoring
->
records
;
return
$collection
->
findOne
(
[
"server_id"
=>
$this
->
id
],
[
"sort"
=>
[
"_id"
=>
-
1
]]);
}
public
function
lastRecordTime
()
{
return
$this
->
lastRecord
()
->
time
;
}
public
function
clientVersion
()
{
return
$this
->
lastRecord
()
->
version
;
}
}
This diff is collapsed.
Click to expand it.
web/resources/views/server/show.blade.php
+
32
−
20
View file @
db5576ed
...
...
@@ -2,33 +2,45 @@
@
section
(
'content'
)
<
div
class
=
"container"
>
<
div
class
=
"row
justify-content-center
"
>
<
div
class
=
"col-md-
8
"
>
<
div
class
=
"row"
>
<
div
class
=
"col-md-
4
"
>
<
div
class
=
"card"
>
<
div
class
=
"card-header"
>
{{
$server
->
name
}}
</
div
>
<
div
class
=
"card-body"
>
<
p
>
Name
:
{{
$server
->
name
}}
</
p
>
<
p
>
Last
heartbeet
:<
br
>
{{
Carbon\Carbon
::
createFromTimestamp
(
$server
->
lastRecordTime
())
->
toDateTimeString
()
}}
</
p
>
<
div
>
<
a
class
=
"btn btn-primary"
href
=
"{{ action('ServerController@edit', ['Server' =>
$server
]) }}"
>
<
i
class
=
"fa fa-pencil"
aria
-
hidden
=
"true"
></
i
>
Edit
</
a
>
<
p
>
Client
version
:
{{
$server
->
clientVersion
()
}}
</
p
>
</
div
>
</
div
>
<
form
method
=
"POST"
action
=
"{{ action('ServerController@destroy', ['Server' =>
$server
]) }}"
style
=
"display: inline-block"
>
{{
csrf_field
()
}}
{{
method_field
(
"DELETE"
)
}}
<
button
class
=
"btn btn-danger"
>
<
i
class
=
"fa fa-times-circle"
aria
-
hidden
=
"true"
></
i
>
Delete
</
button
>
</
form
>
</
div
>
<
div
class
=
"card"
>
<
div
class
=
"card-header"
>
<
h4
>
Danger
zone
</
h4
>
</
div
>
<
div
class
=
"card-body"
>
<
a
class
=
"btn btn-primary"
href
=
"{{ action('ServerController@edit', ['Server' =>
$server
]) }}"
>
<
i
class
=
"fa fa-pencil"
aria
-
hidden
=
"true"
></
i
>
Edit
</
a
>
<
form
method
=
"POST"
action
=
"{{ action('ServerController@destroy', ['Server' =>
$server
]) }}"
style
=
"display: inline-block"
>
{{
csrf_field
()
}}
{{
method_field
(
"DELETE"
)
}}
<
button
class
=
"btn btn-danger"
>
<
i
class
=
"fa fa-times-circle"
aria
-
hidden
=
"true"
></
i
>
Delete
</
button
>
</
form
>
</
div
>
</
div
>
</
div
>
<
div
class
=
"col-md-8"
>
<
h1
>
{{
$server
->
name
}}
</
h1
>
</
div
>
</
div
>
</
div
>
@
endsection
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment