Commit 93a6e237 by Sulyok Gábor

Removed unneccesary file, added relation & attribute checks for

deployment in setty
parent f9aa89de
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('setty', '0021_element_real_type'),
]
\ No newline at end of file
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('setty', '0023_drop_parameters_from_elementconnection'),
]
operations = [
migrations.CreateModel(
name='ApacheNode',
fields=[
('webservernode_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='setty.WebServerNode')),
],
options={
'abstract': False,
},
bases=('setty.webservernode',),
),
migrations.CreateModel(
name='WordpressNode',
fields=[
('servicenode_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='setty.ServiceNode')),
('databaseListeningPort', models.PositiveIntegerField()),
('databaseHost', models.TextField()),
('databaseUser', models.TextField()),
('databasePass', models.TextField()),
('adminUsername', models.TextField()),
('adminPassword', models.TextField()),
('adminEmail', models.TextField()),
('siteTitle', models.TextField()),
('siteUrl', models.TextField()),
],
options={
'abstract': False,
},
bases=('setty.servicenode',),
),
migrations.RemoveField(
model_name='machine',
name='config_file',
),
]

9.07 KB | W: | H:

9.07 KB | W: | H:

circle/setty/static/setty/mysql.jpg
circle/setty/static/setty/mysql.jpg
circle/setty/static/setty/mysql.jpg
circle/setty/static/setty/mysql.jpg
  • 2-up
  • Swipe
  • Onion skin

84.4 KB | W: | H:

84.4 KB | W: | H:

circle/setty/static/setty/postgresql.png
circle/setty/static/setty/postgresql.png
circle/setty/static/setty/postgresql.png
circle/setty/static/setty/postgresql.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -803,7 +803,17 @@ jsPlumb.ready(function() {
/* Registering events concerning persistence. */
$('body').on('click', '#saveService',function() {
$.post("", {
event: "deploy",
}, function(result) {
if ( result.status == 'error' )
alert( result.errors );
else
alert("Deploying....");
});
})
$('body').on('click', '#saveService', function() {
serviceName = $("#serviceName").text();
connectionSet = [];
......
......@@ -33,7 +33,7 @@
<button class="btn btn-success btn-xs btn-block hidden-xs hidden-sm hidden-md" id="showAddMachineDialog">{% trans 'Machines' %}</button>
<button class="btn btn-success btn-xs hidden-lg" id="showAddMachineDialog" ><i class="fa fa-plus-circle"></i></button>
</div>
<div class="col-xs-4 text-center">
<div class="col-xs-3 text-center">
<h3 class="no-margin" id="serviceName"></h3>
<input class="form-control form-control-sm initHidden" id="serviceNameEdit" type="text" style="margin-top: -4px !important; margin-bottom: -4px !important; width: 80%;" />
<button class="btn btn-success btn-xs initHidden" id="serviceNameSave">{% trans 'OK' %}</button>
......@@ -47,6 +47,10 @@
<button class="btn btn-success btn-xs hidden-lg" id="saveService"><i class="fa fa-floppy-o"></i></button>
</div>
<div class="col-xs-1 col-xs-push-1 text-right">
<button class="btn btn-success btn-xs btn-block hidden-xs hidden-sm hidden-md" id="saveService">{% trans 'Deploy' %}</button>
<button class="btn btn-success btn-xs hidden-lg" id="deployService"><i class="fa fa-floppy-o"></i></button>
</div>
<div class="col-xs-1 col-xs-push-1 text-right">
<button class="btn btn-danger btn-xs btn-block hidden-xs hidden-sm hidden-md" id="deleteService" data-toggle="modal" data-target="#deleteServiceDialog">{% trans 'Delete' %}</button>
<button class="btn btn-danger btn-xs hidden-lg" id="deleteService" data-toggle="modal" data-target="#deleteServiceDialog"><i class="fa fa-trash-o"></i></button>
</div>
......
......@@ -54,7 +54,7 @@ class DetailView(LoginRequiredMixin, TemplateView):
else:
raise PermissionDenied
#def get(self, request, *args, **kwargs):
# def get(self, request, *args, **kwargs):
# # service = Service.objects.get(id=kwargs['pk'])
# # if self.request.user != service.user or not self.request.user.is_superuser:
# # raise PermissionDenied
......@@ -65,21 +65,20 @@ class DetailView(LoginRequiredMixin, TemplateView):
# # result = SettyController.getPictureName( data["elementTemplateId"] )
#
# return JsonResponse(result)
def post(self, request, *args, **kwargs):
service = Service.objects.get(id=kwargs['pk'])
if self.request.user != service.user or not self.request.user.is_superuser:
raise PermissionDenied
result = {}
eventName = self.request.POST.get('event')
serviceId = kwargs['pk']
if eventName == 'loadService':
result = SettyController.loadService(serviceId)
elif eventName == "deploy":
result = SettyController.deploy(serviceId)
result = SettyController.deploy(serviceId)
else:
data = json.loads(self.request.POST.get('data'))
if eventName == "saveService":
......@@ -87,7 +86,7 @@ class DetailView(LoginRequiredMixin, TemplateView):
'serviceNodes'], data['machines'], data['elementConnections'])
elif eventName == "getMachineAvailableList":
result = SettyController.getMachineAvailableList(
serviceId, data["usedHostnames"])
serviceId, data["usedHostnames"], self.request.user )
elif eventName == "addServiceNode":
result = SettyController.addServiceNode(
data["elementTemplateId"])
......@@ -95,7 +94,7 @@ class DetailView(LoginRequiredMixin, TemplateView):
result = SettyController.addMachine(data["hostname"])
elif eventName == "getInformation":
templateId = ""
hostname = ""
hostname = ""
if "elementTemplateId" in data.keys():
templateId = data['elementTemplateId']
......@@ -103,8 +102,10 @@ class DetailView(LoginRequiredMixin, TemplateView):
hostname = data['hostname']
result = SettyController.getInformation(
templateId, hostname )
templateId, hostname)
print '------------'
print result
print '------------'
return JsonResponse(result)
......@@ -124,6 +125,7 @@ class DeleteView(LoginRequiredMixin, DeleteView):
class CreateView(LoginRequiredMixin, TemplateView):
def get_template_names(self):
if self.request.is_ajax():
return ['dashboard/_modal.html']
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment