Commit b677f7d4 authored by Alain Takoudjou's avatar Alain Takoudjou

Update some features at javascript and UI

parent decbd4b3
......@@ -70,7 +70,7 @@ overflow-y: scroll;
.block_header{
text-align: left;
padding-left: 25px;
padding-left: 20px;
height: 30px;
}
......@@ -84,7 +84,7 @@ overflow-y: scroll;
font-weight: normal;
padding-top: 3px;
float: left;
width: 690px;
width: 656px;
height: 22px;
text-align: center;
color: #4c6172;
......@@ -260,11 +260,8 @@ overflow-y: scroll;
box-shadow: 1px 1px 1px #888888;
}
.button:active {
background-position: 0 top;
position: relative;
top: 1px;
padding: 6px 10px 4px;
box-shadow: 1px 1px 1px #888888;
background: #eee;
color: #000;
}
.focusField{
......@@ -644,6 +641,7 @@ a.lshare img{
width: 30px;
height:22px;
}
#error p{white-space: pre-wrap; word-wrap: break-word; width: 430px; padding-bottom: 5px;}
.noscroll {
overflow: hidden;
}
......
......@@ -97,6 +97,12 @@ $(document).ready( function() {
$("#clone").empty();
$("#clone").append("Clone");
send = false;
},
error: function(request,error) {
$("#error").Popup("unable to clone your project, please check your internet connection", {type:'error', duration:3000});
$("#imgwaitting").hide();
$("#clone").empty();
$("#clone").append("Clone");
}
});
return false;
......
......@@ -20,16 +20,22 @@ $(document).ready( function() {
function fillContent(){
var folder = $("#softwarelist").val();
var elt = $("option:selected", $("#softwarelist"));
if(elt.val() !== "No Software Release found"){
$('#fileTree').fileTree({ root: runnerDir + "/" + folder, script: $SCRIPT_ROOT + '/readFolder',
folderEvent: 'click', expandSpeed: 750, collapseSpeed: 750, multiFolder: false, selectFolder: true }, function(file) {
selectFile(file);
}, function(file){ viewFile(file)});
$("#softcontent").empty();
$("#softcontent").append("File content: " + elt.attr('title'));
}
}
$("#open").click(function(){
var elt = $("option:selected", $("#softwarelist"));
if(elt.val() === "No Software Release found"){
$("#error").Popup("Please select your Software Release", {type:'alert', duration:5000});
return false;
}
$.ajax({
type: "POST",
url: $SCRIPT_ROOT + '/setCurrentProject',
......@@ -39,7 +45,7 @@ $(document).ready( function() {
location.href = $SCRIPT_ROOT + '/editSoftwareProfile'
}
else{
$("#error").Popup(data.result, {type:'error'});
$("#error").Popup(data.result, {type:'error', duration:5000});
}
}
});
......@@ -47,6 +53,10 @@ $(document).ready( function() {
});
$("#delete").click(function(){
if($("#softwarelist").val() === "No Software Release found"){
$("#error").Popup("Please select your Software Release", {type:'alert', duration:5000});
return false;
}
if(send) return;
send = false;
$.ajax({
......@@ -56,11 +66,6 @@ $(document).ready( function() {
success: function(data){
if(data.code == 1){
var folder = $("#softwarelist").val();
$('#fileTree').fileTree({ root: runnerDir + "/" + folder, script: $SCRIPT_ROOT + '/readFolder', folderEvent: 'click', expandSpeed: 750,
collapseSpeed: 750, multiFolder: false, selectFolder: true }, function(file) {
selectFile(file);
setupFileTree(runnerDir);
}, function(file){ viewFile(file)});
$("input#file").val("");
$("#info").empty();
$("#info").append("Please select your file or folder into the box...");
......@@ -70,6 +75,17 @@ $(document).ready( function() {
'" title="' + data.result[i]["title"] +'" rel="' +
data.result[i]["path"] +'">' + data.result[i]["title"] + '</option>');
}
if(data.result.length < 1){
$("#softwarelist").append('<option>No Software Release found</option>');
$('#fileTree').empty();
}
else{
folder = $("#softwarelist").val();
$('#fileTree').fileTree({ root: runnerDir + "/" + folder, script: $SCRIPT_ROOT + '/readFolder', folderEvent: 'click', expandSpeed: 750,
collapseSpeed: 750, multiFolder: false, selectFolder: true }, function(file) {
selectFile(file);
}, function(file){ viewFile(file)});
}
$("#error").Popup("Operation complete, Selected Software Release has been delete!", {type:'confirm', duration:5000});
}
else{
......
$(document).ready( function() {
var send = false;
//change background
$("body").css("background", "#9C9C9C");
$("#login").click(function(){
if (send) return false;
if($("input#clogin").val() === "" || !$("input#clogin").val().match(/^[\w\d\.-]+$/)){
......
......@@ -106,7 +106,7 @@ function setRunningState(data){
$current.css("color", "#000");
$current = undefined;
currentState = false;
$("#error").Popup("Successfully run " + processType + " Profile", {type:'info', duration:3000});
$("#error").Popup("Slapgrid completely finish running your " + processType + " Profile", {type:'info', duration:3000});
}
}
currentState = data.result;
......
{% extends "layout.html" %}
{% block title %}SlapOs buildout web based runner {% endblock %}
{% block title %}SlapOS buildout web based runner {% endblock %}
{% block body %}
<div id="home_box">
<div class="inner_box">
......@@ -33,7 +33,7 @@
</div>
<div class="umenu">
<h2><a href="{{ url_for('myAccount')}}">Your Account</a></h2>
<p>Click here to Manage your account</p>
<p>Update your account informations</p>
<img src="{{ url_for('static', filename='images/user_card.png') }}" />
</div>
<div class="clear"></div>
......
......@@ -53,6 +53,8 @@
<a href="{{ url_for('home') }}" style="float:left;" id="home" {% if request.path != '/' %}rel="tooltip"{% endif %} title="Home"><img alt="" src="{{ url_for('static', filename='images/home.png') }}" /></a>
<div class="line"></div>
<a href="{{ url_for('editCurrentProject') }}" style="float:left" title="Edit your current project"><img alt="" src="{{ url_for('static', filename='images/project.png') }}" /></a>
<div class="line"></div>
<a href="{{ url_for('logout') }}" style="float:left" title="Close your session"><img alt="" src="{{ url_for('static', filename='images/logout.png') }}" /></a>
<div class="line"></div>
<h2 class="info">{% block title %}{% endblock %} - {{session.title}}</h2>
<div class="run"><span id="running" style="display:none"><img alt="" src="{{ url_for('static', filename='images/ajax_roller.gif') }}"
......@@ -121,9 +123,9 @@
<div style="margin-top:3px;border-bottom: 1px dashed #666666; heigth:1px"></div>
<ul>
<li><a href="{{ url_for('manageProject')}}">Manage Repositories</a></li>
<li><a href="{{ url_for('configRepo')}}" >Clone your repository</a></li>
<li><a href="{{ url_for('openProject', method='open')}}">Open Software Release</a></li>
<li><a href="{{ url_for('openProject', method='new')}}">Create Software Release</a></li>
<li><a href="{{ url_for('logout')}}" >Close your session</a></li>
</ul>
</div>
</body>
......
......@@ -16,6 +16,7 @@
<input type="hidden" name="runnerdir" id="runnerdir" value="{{softwareRoot}}" />
<label for='softwarelist'>Select software: </label>
<select name="softwarelist" id="softwarelist">
{%if not softwares %}<option >No Software Release found</option>{% endif %}
{%for soft in softwares %}
<option value="{{soft['md5']}}" title="{{soft['title']}}" rel="{{soft['path']}}">{{soft['title']}}</option>
{%endfor%}
......@@ -23,7 +24,7 @@
&nbsp;&nbsp;<button id ="delete" class="button" title="Remove this software">Remove</button>
&nbsp;&nbsp;<button id ="open" class="button" title="Set this software as current software release">Open</button>
<br/><br/>
<h2 id="softcontent">No content to displays</h2>
<h2 id="softcontent">No file or folder to display</h2>
<div id="fileTree" class="file_tree" style='height:200px;' title="Double click to open file"></div>
<div id="file_info" class="file_info">
<span id="info">Please select your file or folder into the box...</span></div>
......
......@@ -51,6 +51,7 @@ def checkLogin(config, login, pwd):
Returns:
a list of user informations or False if authentication fail.
list=[username, password, email, complete_name]
"""
user = getSession(config)
salt = "runner81" #to be changed
......@@ -162,8 +163,6 @@ def updateProxy(config):
xml_result = readParameters(param_path)
partition_parameter_kw = None
if type(xml_result) != type('') and xml_result.has_key('instance'):
for item in xml_result['instance'].keys():
xml_result['instance'][item] = xml_result['instance'][item].decode('utf-8')
partition_parameter_kw = xml_result['instance']
computer.updateConfiguration(xml_marshaller.dumps(slap_config))
sr_request = slap.registerOpenOrder().request(profile, partition_reference=getSoftwareReleaseName(config),
......@@ -582,6 +581,9 @@ def configNewSR(config, projectpath):
removeProxyDb(config)
startProxy(config)
removeInstanceRoot(config)
param_path = os.path.join(config['runner_workdir'], ".parameter.xml")
if os.path.exists(param_path):
os.remove(param_path)
open(os.path.join(config['runner_workdir'], ".project"), 'w').write(projectpath)
return True
else:
......
......@@ -25,8 +25,6 @@ def before_request():
# general views
@app.route('/')
def home():
if not os.path.exists(app.config['workspace']) or len(os.listdir(app.config['workspace'])) == 0:
return redirect(url_for('configRepo'))
return render_template('index.html')
@app.route("/login")
......@@ -154,6 +152,9 @@ def removeInstance():
removeProxyDb(app.config)
startProxy(app.config)
removeInstanceRoot(app.config)
param_path = os.path.join(app.config['runner_workdir'], ".parameter.xml")
if os.path.exists(param_path):
os.remove(param_path)
flash('Instance removed')
return redirect(url_for('inspectInstance'))
......
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 to comment