Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
foris-netmetr-plugin
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Turris
Foris
foris-netmetr-plugin
Commits
0045cff0
Verified
Commit
0045cff0
authored
Sep 20, 2018
by
Štěpán Henek
🐻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reflect menu api updates + rename 'netmetr_plugin' to 'netmetr'
parent
5d03ad2b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
11 deletions
+12
-11
foris_plugins/netmetr/__init__.py
foris_plugins/netmetr/__init__.py
+8
-7
foris_plugins/netmetr/static/sass/netmetr.sass
foris_plugins/netmetr/static/sass/netmetr.sass
+0
-0
foris_plugins/netmetr/templates/javascript/netmetr/netmetr.js.j2
...lugins/netmetr/templates/javascript/netmetr/netmetr.js.j2
+3
-3
foris_plugins/netmetr/templates/netmetr/netmetr.html.j2
foris_plugins/netmetr/templates/netmetr/netmetr.html.j2
+1
-1
No files found.
foris_plugins/netmetr/__init__.py
View file @
0045cff0
...
...
@@ -68,8 +68,9 @@ class NetmetrPluginConfigHandler(BaseConfigHandler):
class
NetmetrPluginPage
(
ConfigPageMixin
,
NetmetrPluginConfigHandler
):
slug
=
"netmetr"
menu_order
=
80
template
=
"netmetr/netmetr
_plugin
"
template
=
"netmetr/netmetr"
template_type
=
"jinja2"
userfriendly_title
=
gettext
(
"Netmetr"
)
...
...
@@ -118,16 +119,16 @@ class NetmetrPluginPage(ConfigPageMixin, NetmetrPluginConfigHandler):
def
_action_download_data
(
self
):
current_state
.
backend
.
perform
(
"netmetr"
,
"download_data"
)
bottle
.
redirect
(
reverse
(
"config_page"
,
page_name
=
"netmetr
_plugin
"
))
bottle
.
redirect
(
reverse
(
"config_page"
,
page_name
=
"netmetr"
))
def
_action_measure_and_download_data
(
self
):
current_state
.
backend
.
perform
(
"netmetr"
,
"measure_and_download_data"
)
bottle
.
redirect
(
reverse
(
"config_page"
,
page_name
=
"netmetr
_plugin
"
))
bottle
.
redirect
(
reverse
(
"config_page"
,
page_name
=
"netmetr"
))
def
call_action
(
self
,
action
):
if
bottle
.
request
.
method
!=
'POST'
:
messages
.
error
(
"Wrong HTTP method."
)
bottle
.
redirect
(
reverse
(
"config_page"
,
page_name
=
"netmetr
_plugin
"
))
bottle
.
redirect
(
reverse
(
"config_page"
,
page_name
=
"netmetr"
))
if
action
==
"redownload"
:
self
.
_action_download_data
()
...
...
@@ -142,14 +143,14 @@ class NetmetrPlugin(ForisPlugin):
DIRNAME
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
PLUGIN_STYLES
=
[
"css/netmetr
_plugin
.css"
"css/netmetr.css"
]
PLUGIN_STATIC_SCRIPTS
=
[
]
PLUGIN_DYNAMIC_SCRIPTS
=
[
"netmetr
_plugin
.js"
"netmetr.js"
]
def
__init__
(
self
,
app
):
super
(
NetmetrPlugin
,
self
).
__init__
(
app
)
add_config_page
(
"netmetr_plugin"
,
NetmetrPluginPage
,
top_level
=
Tru
e
)
add_config_page
(
NetmetrPluginPag
e
)
foris_plugins/netmetr/static/sass/netmetr
_plugin
.sass
→
foris_plugins/netmetr/static/sass/netmetr.sass
View file @
0045cff0
File moved
foris_plugins/netmetr/templates/javascript/netmetr/netmetr
_plugin
.js.j2
→
foris_plugins/netmetr/templates/javascript/netmetr/netmetr.js.j2
View file @
0045cff0
...
...
@@ -2,7 +2,7 @@ Foris.watched_process = null;
Foris.update_data = function(newItem) {
const NEW_ITEM_CLASSNAME = "new-item";
document.getElementById('netmetr-results').classList.remove(NEW_ITEM_CLASSNAME);
$.get('{{ url("config_ajax", page_name="netmetr
_plugin
") }}', {action: "get_data"})
$.get('{{ url("config_ajax", page_name="netmetr") }}', {action: "get_data"})
.done(function(response, status, xhr) {
if (xhr.status == 200) {
$("#netmetr-results").replaceWith(response); // replace the table
...
...
@@ -53,7 +53,7 @@ Foris.WS["netmetr"] = function(msg) {
$(document).ready(function() {
$("#redownload-trigger").click(function(e) {
e.preventDefault();
$.get('{{ url("config_ajax", page_name="netmetr
_plugin
") }}', {action: "redownload"})
$.get('{{ url("config_ajax", page_name="netmetr") }}', {action: "redownload"})
.done(function(response) {
Foris.watched_process = response["async_id"];
$("#start-trigger").hide()
...
...
@@ -63,7 +63,7 @@ $(document).ready(function() {
});
$("#start-trigger").click(function(e) {
e.preventDefault();
$.get('{{ url("config_ajax", page_name="netmetr
_plugin
") }}', {action: "start"})
$.get('{{ url("config_ajax", page_name="netmetr") }}', {action: "start"})
.done(function(response) {
Foris.watched_process = response["async_id"];
$("#start-trigger").hide()
...
...
foris_plugins/netmetr/templates/netmetr/netmetr
_plugin
.html.j2
→
foris_plugins/netmetr/templates/netmetr/netmetr.html.j2
View file @
0045cff0
...
...
@@ -37,7 +37,7 @@
<h3>{% trans %}Controls{% endtrans %}</h3>
<p id="netmetr-control-status"></p>
<progress id="netmetr-control-progress" max="100" value="0" hidden></progress>
<form action="{{ url("config_action", page_name="netmetr
_plugin
", action="perform") }}" class="config-form" id="netmetr-controls" method="post">
<form action="{{ url("config_action", page_name="netmetr", action="perform") }}" class="config-form" id="netmetr-controls" method="post">
<input type="hidden" name="csrf_token" value="{{ get_csrf_token() }}">
<button type="submit" name="action" id="redownload-trigger" value="redownload" class="button">{% trans %}Redownload data{% endtrans %}</button>
<button type="submit" name="action" id="start-trigger" value="start" class="button">{% trans %}Start test{% endtrans %}</button>
...
...
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