kopia lustrzana https://github.com/OpenDroneMap/WebODM
Misc UI improvements, fixed #91
rodzic
ab4020e519
commit
abbcf8f111
25
app/boot.py
25
app/boot.py
|
@ -1,11 +1,16 @@
|
|||
from django.contrib.contenttypes.models import ContentType
|
||||
import logging
|
||||
|
||||
from django.contrib.auth.models import Permission
|
||||
from django.contrib.auth.models import User, Group
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
from django.db.utils import ProgrammingError
|
||||
from . import signals, scheduler
|
||||
import logging, os
|
||||
from .models import Task
|
||||
from guardian.shortcuts import assign_perm
|
||||
|
||||
from nodeodm.models import ProcessingNode
|
||||
from webodm import settings
|
||||
from . import scheduler
|
||||
from .models import Task
|
||||
|
||||
|
||||
def boot():
|
||||
logger = logging.getLogger('app.logger')
|
||||
|
@ -16,6 +21,15 @@ def boot():
|
|||
if created:
|
||||
logger.info("Created default group")
|
||||
|
||||
# Assign viewprocessing node object permission to default processing node (if present)
|
||||
# Otherwise non-root users will not be able to process
|
||||
try:
|
||||
pnode = ProcessingNode.objects.get(hostname="node-odm-1")
|
||||
assign_perm('view_processingnode', default_group, pnode)
|
||||
logger.info("Added view_processingnode permissions to default group")
|
||||
except ObjectDoesNotExist:
|
||||
pass
|
||||
|
||||
# Add default permissions (view_project, change_project, delete_project, etc.)
|
||||
for permission in ('_project', '_task'):
|
||||
default_group.permissions.add(
|
||||
|
@ -32,7 +46,8 @@ def boot():
|
|||
|
||||
# Unlock any Task that might have been locked
|
||||
Task.objects.filter(processing_lock=True).update(processing_lock=False)
|
||||
|
||||
|
||||
|
||||
if not settings.TESTING:
|
||||
# Setup and start scheduler
|
||||
scheduler.setup()
|
||||
|
|
|
@ -32,10 +32,8 @@ class MapView extends React.Component {
|
|||
|
||||
return (<div className="map-view">
|
||||
<Map tiles={this.props.tiles} showBackground={true} opacity={opacity}/>
|
||||
<div className="row controls">
|
||||
<div className="col-md-12 text-right">
|
||||
Orthophotos opacity: <input type="range" step="1" value={opacity} onChange={this.updateOpacity} />
|
||||
</div>
|
||||
<div className="opacity-slider">
|
||||
Opacity: <input type="range" step="1" value={opacity} onChange={this.updateOpacity} />
|
||||
</div>
|
||||
</div>);
|
||||
}
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
|
||||
.map-view{
|
||||
height: 80%;
|
||||
position: relative;
|
||||
|
||||
input[type="range"]{
|
||||
margin-left: 4px;
|
||||
display: inline-block;
|
||||
|
@ -12,7 +14,15 @@
|
|||
top: 6px;
|
||||
}
|
||||
|
||||
.controls{
|
||||
margin-top: 8px;
|
||||
.opacity-slider{
|
||||
text-align: center;
|
||||
width: 220px;
|
||||
position: absolute;
|
||||
bottom: 12px;
|
||||
left: 50%;
|
||||
margin-left: -100px;
|
||||
z-index: 400;
|
||||
padding-bottom: 6px;
|
||||
background-color: white;
|
||||
}
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
{% load i18n %}
|
||||
|
||||
{% block content %}
|
||||
<h3>{{title}}</h3>
|
||||
<h3><i class="fa fa-cube"></i> {{title}}</h3>
|
||||
|
||||
<div data-modelview
|
||||
{% for key, value in params %}
|
||||
|
|
|
@ -4,12 +4,7 @@
|
|||
|
||||
{% block content %}
|
||||
{% if no_processingnodes %}
|
||||
<h3>{% trans 'Welcome!' %}</h3>
|
||||
{% else %}
|
||||
<h3>{% trans 'Dashboard' %}</h3>
|
||||
{% endif %}
|
||||
|
||||
{% if no_processingnodes %}
|
||||
<h3>{% trans 'Welcome! ☺' %}</h3>
|
||||
{% trans 'Add a Processing Node' as add_processing_node %}
|
||||
{% with nodeodm_link='<a href="https://github.com/pierotofy/node-OpenDroneMap" target="_blank">node-OpenDroneMap</a>' api_link='<a href="https://github.com/pierotofy/node-OpenDroneMap/blob/master/docs/index.adoc" target="_blank">API</a>' %}
|
||||
<p>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{% load i18n %}
|
||||
|
||||
{% block content %}
|
||||
<h3>{{title}}</h3>
|
||||
<h3><i class="fa fa-globe"></i> {{title}}</h3>
|
||||
|
||||
<div data-mapview
|
||||
{% for key, value in params %}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{% load i18n tz %}
|
||||
|
||||
{% block content %}
|
||||
<h3>Processing Node</h3>
|
||||
|
||||
<table class="table table-bordered table-striped table-first-col-bold processing-node-info">
|
||||
<tr>
|
||||
<td>{% trans "Hostname" %}</td>
|
||||
|
|
Ładowanie…
Reference in New Issue