Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update sidebar navigation menu #99

Merged
merged 5 commits into from Feb 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 3 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ without the use of FFmpeg or GStreamer!
- [Installation](#installation)
- [Configuration](#configuration)
- [Command-line](#command-line)
- [Web UI](#web-ui)
- [API documentation](#api-documentation)
- [Limitations](#Limitations)
- [Performance](#Performance)
Expand Down Expand Up @@ -75,7 +74,7 @@ name - channel name
url - channel rtsp url
on_demand - stream mode static (run any time) or ondemand (run only has viewers)
debug - enable debug output (RTSP client)
audio - enable audio
audio - enable audio
status - default stream status
```

Expand Down Expand Up @@ -129,15 +128,15 @@ file.php need response json
"name": "ch1",
"url": "rtsp://admin:admin@YOU_CAMERA_IP/uri",
"on_demand": true,
"debug": false,
"debug": false,
"audio": true,
"status": 0
},
"1": {
"name": "ch2",
"url": "rtsp://admin:admin@YOU_CAMERA_IP/uri",
"on_demand": true,
"debug": false,
"debug": false,
"audio": true,
"status": 0
}
Expand Down Expand Up @@ -184,28 +183,6 @@ Usage of ./RTSPtoWeb:
set debug mode (default true)
```

## Web UI

The web UI is available at http://127.0.0.1:8083/.

### Parameters for full-page multiview

#### Grid size

```
http://localhost:8083/pages/multiview/full?grid=5
```

#### Show additional options

* Video protocol (MSE, WebRTC, or HLS)
* Grid size
* Background image

```
http://localhost:8083/pages/multiview/full?controls
```

## API documentation

See the [API docs](/docs/api.md)
Expand Down
9 changes: 0 additions & 9 deletions apiHTTPRouter.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ func HTTPAPIServer() {
public.GET("/pages/multiview", HTTPAPIMultiview)
public.Any("/pages/multiview/full", HTTPAPIFullScreenMultiView)
public.GET("/pages/documentation", HTTPAPIServerDocumentation)
public.GET("/pages/login", HTTPAPIPageLogin)
public.GET("/pages/player/all/:uuid/:channel", HTTPAPIPlayAll)
}

Expand Down Expand Up @@ -187,14 +186,6 @@ func HTTPAPIStreamList(c *gin.Context) {
"page": "stream_list",
})
}
func HTTPAPIPageLogin(c *gin.Context) {
c.HTML(http.StatusOK, "login.tmpl", gin.H{
"port": Storage.ServerHTTPPort(),
"streams": Storage.Streams,
"version": time.Now().String(),
"page": "login",
})
}

func HTTPAPIPlayHls(c *gin.Context) {
c.HTML(http.StatusOK, "play_hls.tmpl", gin.H{
Expand Down
9 changes: 8 additions & 1 deletion web/templates/documentation.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@
<div class="content">
<div class="container-fluid">
<div class="row">

<div class="col-12">
<p>
<a href="https://github.com/deepch/RTSPtoWeb/tree/master/docs/api.md">API documentation</a> is available in the GitHub repository.
</p>
<p>
See the project <a href="https://github.com/deepch/RTSPtoWeb#readme">README</a> for installation and configuration instructions.
</p>
</div>
</div>
</div>
</div>
Expand Down
3 changes: 1 addition & 2 deletions web/templates/fullscreenmulti.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

<div class="collapse navbar-collapse order-3" id="navbarCollapse">
<ul class="order-1 order-md-3 navbar-nav navbar-no-expand ml-auto">
<input type="hidden" id="defaultPlayer" value="mse" />
{{ if .query.controls}}
<li class="nav-item dropdown">
<a href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" class="nav-link dropdown-toggle"><i class="fas fa-photo-video"></i></a>
Expand Down Expand Up @@ -89,7 +88,7 @@
</ul>
</li>
<li class="nav-item">
<a class="nav-link" href="/pages/login" role="button"><i class="fas fa-sign-out-alt"></i> Exit</a>
<a class="nav-link" href="/" role="button"><i class="fas fa-times"></i> Close</a>
</li>
{{end}}
</ul>
Expand Down
68 changes: 14 additions & 54 deletions web/templates/head.tmpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
<!DOCTYPE html>
<!--
This is a starter template page. Use this page to start your new project from
scratch. This page gets rid of all links and provides the needed markup only.
-->
<html lang="en">

<head>
Expand Down Expand Up @@ -36,15 +32,6 @@ scratch. This page gets rid of all links and provides the needed markup only.
<li class="nav-item">
<a class="nav-link" href="/pages/stream/add" role="button"><i class="fas fa-plus-square"></i> Add stream</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/pages/login" role="button"><i class="fas fa-sign-out-alt"></i> Sign out</a>
</li>
<!-- <li class="nav-item">
<a class="nav-link" data-widget="control-sidebar" data-slide="true" href="#" role="button"><i class="fas fa-cogs"></i></a>
</li> -->
<!-- <li class="nav-item">
<a class="nav-link" data-widget="control-sidebar" data-slide="true" href="#" role="button"><i class="fas fa-th-large"></i></a>
</li> -->
</ul>
</nav>

Expand Down Expand Up @@ -72,46 +59,25 @@ scratch. This page gets rid of all links and provides the needed markup only.
</a>
</li>
<li class="nav-header">NAVIGATION</li>

<li class="nav-item has-treeview {{ if or (eq .page "add_stream") (eq .page "stream_list") }}
menu-open
{{end}}
">
<a href="#" class="nav-link {{ if or (eq .page "add_stream") (eq .page "stream_list") }}
<li class="nav-item ">
<a href="/pages/stream/list" class="nav-link {{ if (eq .page "stream_list") }}
active
{{end}}
">
<i class="nav-icon fas fa-clipboard-list"></i>
<p>
Streams
<i class="right fas fa-angle-left"></i>
<span class="badge badge-info right" id="stream-counter">{{ len .streams}}</span>
</p>

{{end}}">
<i class="fas fa-list-alt nav-icon"></i>
<p>Streams list</p>
</a>
</li>
<li class="nav-item">
<a href="/pages/stream/add" class="nav-link {{ if (eq .page "add_stream") }}
active
{{end}}">
<i class="fas fa-plus-square nav-icon"></i>
<p>Add stream</p>
</a>
<ul class="nav nav-treeview">
<li class="nav-item ">
<a href="/pages/stream/list" class="nav-link {{ if (eq .page "stream_list") }}
active
{{end}}">
<i class="fas fa-list-alt nav-icon"></i>
<p>Streams list</p>
</a>
</li>

<li class="nav-item">
<a href="/pages/stream/add" class="nav-link {{ if (eq .page "add_stream") }}
active
{{end}}">
<i class="fas fa-plus-square nav-icon"></i>
<p>Add stream</p>
</a>
</li>
</ul>
</li>

<li class="nav-item ">
<a href="/pages/multiview/full" class="nav-link {{ if (eq .page "fullscreenmulti") }}
<a href="/pages/multiview/full?controls" class="nav-link {{ if (eq .page "fullscreenmulti") }}
active
{{end}}">
<i class="fas fa-th-large nav-icon"></i>
Expand All @@ -128,12 +94,6 @@ scratch. This page gets rid of all links and provides the needed markup only.
<p>Documentation</p>
</a>
</li>
<li class="nav-item">
<a href="/pages/login" class="nav-link">
<i class="nav-icon fas fa-sign-out-alt"></i>
<p>Sign out</p>
</a>
</li>
</ul>
</nav>
<!-- /.sidebar-menu -->
Expand Down
90 changes: 2 additions & 88 deletions web/templates/index.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,95 +17,9 @@
<!-- Main content -->
<div class="content">
<div class="container-fluid">
<h5 class="mt-4 mb-2">System information</h5>
<div class="row">
<div class="col-12 col-sm-6 col-md-3">
<div class="info-box">
<span class="info-box-icon bg-info elevation-1"><i class="fas fa-cog"></i></span>

<div class="info-box-content">
<span class="info-box-text">CPU</span>
<span class="info-box-number">
<label>0</label>
<small>%</small>
</span>
</div>
<!-- /.info-box-content -->
</div>
<!-- /.info-box -->
</div>
<!-- /.col -->
<div class="col-12 col-sm-6 col-md-3">
<div class="info-box mb-3">
<span class="info-box-icon bg-danger elevation-1"><i class="fas fa-chart-line"></i></span>

<div class="info-box-content">
<span class="info-box-text">Bitrate</span>
<span class="info-box-number">
<label>0</label>
<small>kbps</small>
</span>
</div>
<!-- /.info-box-content -->
</div>
<!-- /.info-box -->
</div>
<!-- /.col -->

<!-- fix for small devices only -->
<div class="clearfix hidden-md-up"></div>

<div class="col-12 col-sm-6 col-md-3">
<div class="info-box mb-3">
<span class="info-box-icon bg-success elevation-1"><i class="fas fa-photo-video"></i></span>

<div class="info-box-content">
<span class="info-box-text">Streams</span>
<span class="info-box-number">
<label>{{ len .streams}}</label>
<small>st.</small>
</span>
</div>
<!-- /.info-box-content -->
</div>
<!-- /.info-box -->
</div>
<!-- /.col -->
<div class="col-12 col-sm-6 col-md-3">
<div class="info-box mb-3">
<span class="info-box-icon bg-warning elevation-1"><i class="fas fa-users"></i></span>

<div class="info-box-content">
<span class="info-box-text">Viewers</span>
<span class="info-box-number">
<label>0</label>
<small>man</small>
</span>
</div>
<!-- /.info-box-content -->
</div>
<!-- /.info-box -->
</div>
<!-- /.col -->
</div>


<div class="row">
<div class="col-6">
<h5 class="mt-4 mb-2">Streams</h5>
</div>
<div class="col-6">

<div class="input-group-prepend float-right mt-3">
<a class="btn" data-toggle="dropdown" style="padding-right: 0;">
<i class="fas fa-lg fa-sort"></i>
</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="#">Name <i class="fas fa-sort-alpha-down float-right"></i> </a>
<a class="dropdown-item" href="#">Name <i class="fas fa-sort-alpha-up float-right"></i></a>
</div>
</div>

<div class="col-12">
<h5 class="mt-4 mb-2">Streams ({{ len .streams}})</h5>
</div>
</div>

Expand Down
Loading