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

Xzyaoi/feat/inspector #278

Merged
merged 3 commits into from Mar 11, 2019
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 8 additions & 14 deletions cli/Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions cli/Gopkg.toml
Expand Up @@ -108,15 +108,15 @@
[prune]
go-tests = true
unused-packages = true

[[constraint]]
name = "github.com/HouzuoGuo/tiedot"
version = "3.4.0"


[[constraint]]
branch = "master"
name = "github.com/fatihkahveci/gin-inspector"

[[constraint]]
name = "gopkg.in/appleboy/gin-status-api.v1"
version = "1.0.1"

[[constraint]]
branch = "master"
name = "github.com/cvpm-contrib/auth"
8 changes: 8 additions & 0 deletions cli/contrib.go
Expand Up @@ -6,6 +6,7 @@
package main

import (
"io"
"net/http"

dataset "github.com/cvpm-contrib/dataset"
Expand All @@ -32,3 +33,10 @@ func AddNewRegistry(c *gin.Context) {
"status": "Finished",
})
}

// StreamCamera GET /camera
func StreamCamera(c *gin.Context) {
c.Stream(func(w io.Writer) bool {
return true
})
}
7 changes: 5 additions & 2 deletions cli/daemon.go
Expand Up @@ -15,6 +15,7 @@ import (
"net/url"
"path/filepath"

auth "github.com/cvpm-contrib/auth"
"github.com/fatih/color"
raven "github.com/getsentry/raven-go"
"github.com/gin-contrib/static"
Expand Down Expand Up @@ -263,7 +264,7 @@ func runServer(port string) {
r.Use(BeforeResponse())
watchLogs(socketServer)
r.Use(static.Serve("/", static.LocalFile(webuiFolder, false)))
r.Use(InspectorStats())
r.Use(auth.InspectorStats())
r.Use(gin.Logger())
// Status Related Handlers
r.GET("/status", func(c *gin.Context) {
Expand All @@ -289,11 +290,13 @@ func runServer(port string) {
r.GET("/socket.io/", socketHandler)
r.POST("/socket.io/", socketHandler)
// Contrib Related Routes
// Datasets
r.GET("/contrib/datasets", GetAllDatasets)
r.POST("/contrib/datasets/registries", AddNewRegistry)
// Camera
// Plugin Related Routes
r.GET("/_inspector", func(c *gin.Context) {
c.JSON(200, GetPaginator())
c.JSON(200, auth.GetRequests())
})
r.GET("/_api/status", api.StatusHandler)
// Socket Related Routes
Expand Down
87 changes: 0 additions & 87 deletions cli/inspector.go

This file was deleted.

3 changes: 2 additions & 1 deletion cvpm/requirements.txt
@@ -1,3 +1,4 @@
gevent
flask
toml
toml
psutil
10 changes: 10 additions & 0 deletions cvpm/server.py
Expand Up @@ -7,6 +7,7 @@
from flask import Flask, request
from werkzeug.datastructures import ImmutableMultiDict
from werkzeug.utils import secure_filename
import psutil

# extensions

Expand Down Expand Up @@ -56,6 +57,15 @@ def help():
help_message = server.solver.help_message
return help_message

@server.route("/_status", methods=["GET"])
def status():
process = psutil.Process(os.getpid())
result = {
'memory': process.memory_info(),
'cpu_percent': process.cpu_percent(),
'id': process.pid
}
return json.dumps(result)

@server.route("/infer", methods=["GET", "POST"])
def infer():
Expand Down
1 change: 1 addition & 0 deletions dashboard/package.json
Expand Up @@ -15,6 +15,7 @@
"dependencies": {
"@vuetify/vuex-cognito-module": "0.4.0",
"axios": "0.18.0",
"dayjs": "^1.8.10",
"eslint-plugin-html": "5.0.3",
"flexsearch": "0.6.21",
"js-base64": "2.5.1",
Expand Down
31 changes: 25 additions & 6 deletions dashboard/src/components/CVPM-Repo-Meta.vue
Expand Up @@ -49,7 +49,26 @@ export default {
components: {
'vue-markdown': VueMarkdown
},
props: ['config', 'dependency', 'diskSize', 'readme']
props: {
config: {
type: Object,
default: function () {
return {}
}
},
dependency: {
type: String,
default: ''
},
diskSize: {
type: String,
default: ''
},
readme: {
type: String,
default: ''
}
}
}
</script>

Expand All @@ -58,14 +77,14 @@ export default {
padding: 2em;
}
pre {
word-wrap: break-word;
white-space: pre-wrap;
word-wrap: break-word;
white-space: pre-wrap;
}
.cvpm-repo-readme {
padding: 2em;
padding: 2em;
}
.cvpm-meta-detail {
margin-left: auto;
margin-right: auto;
margin-left: auto;
margin-right: auto;
}
</style>
19 changes: 18 additions & 1 deletion dashboard/src/components/CVPM-Table.vue
Expand Up @@ -42,7 +42,24 @@

<script>
export default {
props: ['items', 'headers', 'loading'],
props: {
config: {
type: Object,
default: function () {
return {}
}
},
headers: {
type: Array,
default: function () {
return []
}
},
loading: {
type: Boolean,
default: false
}
},
data () {
return {}
},
Expand Down
21 changes: 20 additions & 1 deletion dashboard/src/components/basic/CVPM-Parameter-Input.vue
Expand Up @@ -59,7 +59,26 @@
<script>
import { systemService } from '@/services/system'
export default {
props: ['file', 'vendor', 'packageName', 'solverName'],
props: {
file: {
type: Object,
default: function () {
return {}
}
},
vendor: {
type: String,
default: ''
},
packageName: {
type: String,
default: ''
},
solverName: {
type: String,
default: ''
}
},
data () {
return {
loading: false,
Expand Down
1 change: 0 additions & 1 deletion dashboard/src/main.js
Expand Up @@ -11,7 +11,6 @@ import TreeView from 'vue-json-tree-view'
import VueTour from 'vue-tour'
import colors from 'vuetify/es5/util/colors'
import { ConfigService } from '@/services/config'

import 'vuetify/dist/vuetify.min.css'
import '@/assets/styles/main.css'
import 'vue-tour/dist/vue-tour.css'
Expand Down