Commit 9f6f9673 authored by Cédric de Saint Martin's avatar Cédric de Saint Martin

Merge branch 'slaprunner'

Conflicts:
	slapos/pubsub/notifier.py
parents 415e50cf fbeebb8b
...@@ -60,22 +60,22 @@ setup(name=name, ...@@ -60,22 +60,22 @@ setup(name=name,
'cloudmgr = slapos.cloudmgr.cloudmgr:main', 'cloudmgr = slapos.cloudmgr.cloudmgr:main',
'cloudstart = slapos.cloudmgr.start:main', 'cloudstart = slapos.cloudmgr.start:main',
'cloudstop = slapos.cloudmgr.stop:main', 'cloudstop = slapos.cloudmgr.stop:main',
'onetimeupload = slapos.onetimeupload:main', 'equeue = slapos.equeue:main',
'killpidfromfile = slapos.systool:killpidfromfile',
'lampconfigure = slapos.lamp:run [lampconfigure]',
'onetimedownload = slapos.onetimedownload:main', 'onetimedownload = slapos.onetimedownload:main',
'onetimeupload = slapos.onetimeupload:main',
'pubsubnotifier = slapos.pubsub.notifier:main',
'pubsubserver = slapos.pubsub:main',
'shacache = slapos.shacache:main', 'shacache = slapos.shacache:main',
'slapbuilder = slapos.builder:main', 'slapbuilder = slapos.builder:main',
'slapcontainer = slapos.container:main',
'slapmonitor = slapos.monitor:run_slapmonitor', 'slapmonitor = slapos.monitor:run_slapmonitor',
'slapmonitor-xml = slapos.monitor:run_slapmonitor_xml', 'slapmonitor-xml = slapos.monitor:run_slapmonitor_xml',
'slapreport = slapos.monitor:run_slapreport', 'slapreport = slapos.monitor:run_slapreport',
'slaprunner = slapos.runner:run', 'slaprunner = slapos.runner:run',
'killpidfromfile = slapos.systool:killpidfromfile',
'lampconfigure = slapos.lamp:run [lampconfigure]',
'equeue = slapos.equeue:main',
'pubsubserver = slapos.pubsub:main',
'pubsubnotifier = slapos.pubsub.notifier:main',
'slaprunnertest = slapos.runner.runnertest:main', 'slaprunnertest = slapos.runner.runnertest:main',
'zodbpack = slapos.zodbpack:run [zodbpack]', 'zodbpack = slapos.zodbpack:run [zodbpack]',
'slapcontainer = slapos.container:main',
] ]
}, },
) )
...@@ -152,19 +152,19 @@ def run(config): ...@@ -152,19 +152,19 @@ def run(config):
fdisk_output_path = "/tmp/a_generated_file" fdisk_output_path = "/tmp/a_generated_file"
try: try:
if not config.virtual: if not config.virtual:
offset = 0 offset = 0
fdisk_output_file = open(fdisk_output_path, 'w') fdisk_output_file = open(fdisk_output_path, 'w')
_call(['sfdisk', '-d', '-uS', config.system_path], stdout=fdisk_output_file) _call(['sfdisk', '-d', '-uS', config.system_path], stdout=fdisk_output_file)
fdisk_output_file.close() fdisk_output_file.close()
fdisk_output_file = open(fdisk_output_path, 'r') fdisk_output_file = open(fdisk_output_path, 'r')
for line in fdisk_output_file: for line in fdisk_output_file:
line = line.rstrip().replace(' ', '') line = line.rstrip().replace(' ', '')
if line.endswith("bootable"): if line.endswith("bootable"):
offset = int(line.split(':')[1].split(',')[0].split('=')[1]) offset = int(line.split(':')[1].split(',')[0].split('=')[1])
fdisk_output_file.close() fdisk_output_file.close()
offset = offset * 512 offset = offset * 512
_call(['mount', '-o', 'loop,offset=%i' % offset, config.system_path, _call(['mount', '-o', 'loop,offset=%i' % offset, config.system_path,
mount_dir_path], dry_run=dry_run) mount_dir_path], dry_run=dry_run)
# Call vmware-mount to mount Virtual disk image # Call vmware-mount to mount Virtual disk image
else: else:
print "Mount Virtual Image" print "Mount Virtual Image"
...@@ -191,7 +191,7 @@ def run(config): ...@@ -191,7 +191,7 @@ def run(config):
cert_file])) cert_file]))
for (src, dst) in [(config.key_file, key_file_dest), (config.cert_file, for (src, dst) in [(config.key_file, key_file_dest), (config.cert_file,
cert_file_dest)]: cert_file_dest)]:
print "Coping %r to %r, and setting minimum privileges" % (src, dst) print "Coping %r to %r, and setting minimal privileges" % (src, dst)
if not dry_run: if not dry_run:
shutil.copy(src, dst) shutil.copy(src, dst)
os.chmod(dst, 0600) os.chmod(dst, 0600)
...@@ -302,16 +302,16 @@ def run(config): ...@@ -302,16 +302,16 @@ def run(config):
# Adding slapos_firstboot in case of MultiDisk usage # Adding slapos_firstboot in case of MultiDisk usage
if not config.one_disk : if not config.one_disk :
for script in ['slapos_firstboot']: for script in ['slapos_firstboot']:
path = os.path.join(mount_dir_path, 'etc', 'init.d', script) path = os.path.join(mount_dir_path, 'etc', 'init.d', script)
print "Creating %r" % path print "Creating %r" % path
if not dry_run: if not dry_run:
open(path, 'w').write(pkg_resources.resource_stream(__name__, open(path, 'w').write(pkg_resources.resource_stream(__name__,
'script/%s' % script).read()) 'script/%s' % script).read())
os.chmod(path, 0755) os.chmod(path, 0755)
else: else:
for script in ['slapos_firstboot']: for script in ['slapos_firstboot']:
path = os.path.join(mount_dir_path, 'etc', 'init.d', script) path = os.path.join(mount_dir_path, 'etc', 'init.d', script)
if os.path.exists(path): if os.path.exists(path):
print "Removing %r" % path print "Removing %r" % path
os.remove(path) os.remove(path)
......
File mode changed from 100644 to 100755
from optparse import OptionParser, Option # -*- coding: utf-8 -*-
# vim: set et sts=2:
# pylint: disable-msg=W0311,C0301,C0103,C0111,R0904,R0903
import ConfigParser import ConfigParser
import datetime
import logging import logging
import logging.handlers import logging.handlers
from optparse import OptionParser, Option
import os import os
import slapos.runner.process
import sys import sys
import subprocess from slapos.runner.utils import runInstanceWithLock
from datetime import timedelta
class Parser(OptionParser): class Parser(OptionParser):
""" """
...@@ -13,7 +19,7 @@ class Parser(OptionParser): ...@@ -13,7 +19,7 @@ class Parser(OptionParser):
""" """
def __init__(self, usage=None, version=None): def __init__(self, usage=None, version=None):
""" """
Initialize all options possibles. Initialize all possible options.
""" """
OptionParser.__init__(self, usage=usage, version=version, OptionParser.__init__(self, usage=usage, version=version,
option_list=[ option_list=[
...@@ -45,6 +51,13 @@ class Parser(OptionParser): ...@@ -45,6 +51,13 @@ class Parser(OptionParser):
return options, args[0] return options, args[0]
class Config: class Config:
def __init__(self):
self.configuration_file_path = None
self.console = None
self.log_file = None
self.logger = None
self.verbose = None
def setConfig(self, option_dict, configuration_file_path): def setConfig(self, option_dict, configuration_file_path):
""" """
Set options given by parameters. Set options given by parameters.
...@@ -100,9 +113,13 @@ def run(): ...@@ -100,9 +113,13 @@ def run():
config = Config() config = Config()
config.setConfig(*Parser(usage=usage).check_args()) config.setConfig(*Parser(usage=usage).check_args())
if os.getuid() == 0:
# avoid mistakes (mainly in development mode)
raise Exception('Do not run SlapRunner as root.')
serve(config) serve(config)
return_code = 0 return_code = 0
except SystemExit, err: except SystemExit as err:
# Catch exception raise by optparse # Catch exception raise by optparse
return_code = err return_code = err
...@@ -121,11 +138,13 @@ def serve(config): ...@@ -121,11 +138,13 @@ def serve(config):
instance_profile='instance.cfg', instance_profile='instance.cfg',
software_profile='software.cfg', software_profile='software.cfg',
SECRET_KEY=os.urandom(24), SECRET_KEY=os.urandom(24),
PERMANENT_SESSION_LIFETIME=timedelta(days=31), PERMANENT_SESSION_LIFETIME=datetime.timedelta(days=31),
) )
if not os.path.exists(workdir): if not os.path.exists(workdir):
os.mkdir(workdir) os.mkdir(workdir)
if not os.path.exists(software_link): if not os.path.exists(software_link):
os.mkdir(software_link) os.mkdir(software_link)
slapos.runner.process.setHandler()
runInstanceWithLock(app.config)
app.run(host=config.runner_host, port=int(config.runner_port), app.run(host=config.runner_host, port=int(config.runner_port),
debug=config.debug, threaded=True) debug=config.debug, threaded=True)
# -*- coding: utf-8 -*-
# vim: set et sts=2:
#pylint: disable-all
import json
from flask import Response
def as_json(f):
def inner(*args, **kwargs):
return Response(json.dumps(f(*args, **kwargs)), mimetype='application/json')
return inner
This diff is collapsed.
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# vim: set et sts=2:
# pylint: disable-msg=W0311,C0301,C0103,C0111
import slapos.slap
import time
import subprocess
import os import os
import re import re
import urllib
from flask import jsonify
import shutil import shutil
import string
from git import *
class Popen(subprocess.Popen): from git import Repo
def __init__(self, *args, **kwargs): from flask import jsonify
kwargs['stdin'] = subprocess.PIPE
kwargs['stderr'] = subprocess.STDOUT
kwargs.setdefault('stdout', subprocess.PIPE)
kwargs.setdefault('close_fds', True)
subprocess.Popen.__init__(self, *args, **kwargs)
self.stdin.flush()
self.stdin.close()
self.stdin = None
def cloneRepo(data): def cloneRepo(data):
"""Clonne a repository """Clonne a repository
...@@ -49,7 +38,7 @@ def cloneRepo(data): ...@@ -49,7 +38,7 @@ def cloneRepo(data):
if data["email"] != "": if data["email"] != "":
config_writer.set_value("user", "email", data["email"]) config_writer.set_value("user", "email", data["email"])
code = 1 code = 1
except Exception, e: except Exception as e:
json = safeResult(str(e)) json = safeResult(str(e))
if os.path.exists(workDir): if os.path.exists(workDir):
shutil.rmtree(workDir) shutil.rmtree(workDir)
...@@ -70,7 +59,7 @@ def gitStatus(project): ...@@ -70,7 +59,7 @@ def gitStatus(project):
branch = git.branch().replace(' ', '').split('\n') branch = git.branch().replace(' ', '').split('\n')
isdirty = repo.is_dirty(untracked_files=True) isdirty = repo.is_dirty(untracked_files=True)
code = 1 code = 1
except Exception, e: except Exception as e:
json = safeResult(str(e)) json = safeResult(str(e))
return jsonify(code=code, result=json, branch=branch, dirty=isdirty) return jsonify(code=code, result=json, branch=branch, dirty=isdirty)
...@@ -85,7 +74,6 @@ def switchBranch(project, name): ...@@ -85,7 +74,6 @@ def switchBranch(project, name):
json = "" json = ""
try: try:
repo = Repo(project) repo = Repo(project)
branches = repo.branches
current_branch = repo.active_branch.name current_branch = repo.active_branch.name
if name == current_branch: if name == current_branch:
json = "This is already your active branch for this project" json = "This is already your active branch for this project"
...@@ -93,7 +81,7 @@ def switchBranch(project, name): ...@@ -93,7 +81,7 @@ def switchBranch(project, name):
git = repo.git git = repo.git
git.checkout(name) git.checkout(name)
code = 1 code = 1
except Exception, e: except Exception as e:
json = safeResult(str(e)) json = safeResult(str(e))
return jsonify(code=code, result=json) return jsonify(code=code, result=json)
...@@ -115,7 +103,7 @@ def addBranch(project, name, onlyCheckout=False): ...@@ -115,7 +103,7 @@ def addBranch(project, name, onlyCheckout=False):
else: else:
git.checkout(name) git.checkout(name)
code = 1 code = 1
except Exception, e: except Exception as e:
json = safeResult(str(e)) json = safeResult(str(e))
return jsonify(code=code, result=json) return jsonify(code=code, result=json)
...@@ -127,7 +115,7 @@ def getDiff(project): ...@@ -127,7 +115,7 @@ def getDiff(project):
git = repo.git git = repo.git
current_branch = repo.active_branch.name current_branch = repo.active_branch.name
result = git.diff(current_branch) result = git.diff(current_branch)
except Exception, e: except Exception as e:
result = safeResult(str(e)) result = safeResult(str(e))
return result return result
...@@ -157,7 +145,7 @@ def gitPush(project, msg): ...@@ -157,7 +145,7 @@ def gitPush(project, msg):
else: else:
json = "Nothing to be commited" json = "Nothing to be commited"
code = 1 code = 1
except Exception, e: except Exception as e:
if undo_commit: if undo_commit:
git.reset("HEAD~") #undo previous commit git.reset("HEAD~") #undo previous commit
json = safeResult(str(e)) json = safeResult(str(e))
...@@ -169,14 +157,13 @@ def gitPull(project): ...@@ -169,14 +157,13 @@ def gitPull(project):
try: try:
repo = Repo(project) repo = Repo(project)
git = repo.git git = repo.git
current_branch = repo.active_branch.name
git.pull() git.pull()
code = 1 code = 1
except Exception, e: except Exception as e:
result = safeResult(str(e)) result = safeResult(str(e))
return jsonify(code=code, result=result) return jsonify(code=code, result=result)
def safeResult(result): def safeResult(result):
"""Parse string and remove credential of the user""" """Parse string and remove credential of the user"""
regex=re.compile("(https:\/\/)([\w\d\._-]+:[\w\d\._-]+)\@([\S]+\s)", re.VERBOSE) regex = re.compile("(https:\/\/)([\w\d\._-]+:[\w\d\._-]+)\@([\S]+\s)", re.VERBOSE)
return regex.sub(r'\1\3', result) return regex.sub(r'\1\3', result)
\ No newline at end of file
import os
import psutil
import signal
import subprocess
import sys
SLAPRUNNER_PROCESS_LIST = []
class Popen(subprocess.Popen):
"""
Extension of Popen to launch and kill process in a clean way
"""
def __init__(self, *args, **kwargs):
"""
Launch process and add object to process list for handler
"""
self.name = kwargs.pop('name', None)
kwargs['stdin'] = subprocess.PIPE
kwargs['stderr'] = subprocess.STDOUT
kwargs.setdefault('stdout', subprocess.PIPE)
kwargs.setdefault('close_fds', True)
subprocess.Popen.__init__(self, *args, **kwargs)
SLAPRUNNER_PROCESS_LIST.append(self)
self.stdin.flush()
self.stdin.close()
self.stdin = None
def kill(self, sig=signal.SIGTERM, recursive=False):
"""
Kill process and all its descendant if recursive
"""
if self.poll() is None:
if recursive:
childs_pids = pidppid(self.pid)
for pid in childs_pids:
killNoFail(pid, sig)
killNoFail(self.pid, sig)
if self.poll() is not None:
SLAPRUNNER_PROCESS_LIST.remove(self)
def __del__(self):
"""
Del function, try to kill process group
and process if its group does not exist
"""
for pid in (-self.pid, self.pid):
try:
os.kill(-self.pid, 15)
except OSError:
pass
subprocess.Popen.__del__(self)
def pidppid(pid, recursive=True):
"""
Return a list of all children of pid
"""
return [p.pid for p in psutil.Process(pid).get_children(recursive=recursive)]
def killNoFail(pid, sig):
"""
function to kill without failing. Return True if kill do not fail
"""
try:
os.kill(pid, sig)
return True
except OSError:
return False
def isRunning(name):
"""
Return True if a process with this name is running
"""
for process in SLAPRUNNER_PROCESS_LIST:
if process.name == name:
if process.poll() is None:
return True
return False
def killRunningProcess(name, recursive=False):
"""
Kill all process with name
"""
for process in SLAPRUNNER_PROCESS_LIST:
if process.name == name:
process.kill(recursive=recursive)
def handler(sig, frame):
"""
Signal handler to kill all process
"""
pid = os.getpid()
os.kill(-pid, sig)
sys.exit()
def setHandler(sig_list=None):
if sig_list is None:
sig_list = [signal.SIGTERM]
for sig in sig_list:
signal.signal(sig, handler)
This diff is collapsed.
UL.jqueryFileTree { UL.jqueryFileTree {
font-family: Verdana, sans-serif; font-family: Verdana, sans-serif;
font-size: 12px; font-size: 12px;
line-height: 18px; line-height: 18px;
padding: 0px; padding: 0px;
...@@ -60,6 +60,7 @@ UL.jqueryFileTree A:hover { ...@@ -60,6 +60,7 @@ UL.jqueryFileTree A:hover {
background-color: white; background-color: white;
border: 1px solid #BBBBBB; border: 1px solid #BBBBBB;
} }
div.browser div.gs_dir_content_files{min-height:330px;}
#curDir { #curDir {
height: 30px; height: 30px;
...@@ -124,7 +125,7 @@ UL.jqueryFileTree A:hover { ...@@ -124,7 +125,7 @@ UL.jqueryFileTree A:hover {
font-weight: bold; font-weight: bold;
} }
.gs_head{padding: 10px 5px 10px 0;} .gs_head{padding: 10px 5px 10px 0;}
.gs_title{padding-left: 10px; margin:5px 5px 0 0; background: #e4e4e4;} .gs_title{padding-left: 10px; margin:5px 5px 0 0; background: #e4e4e4; height:30px;}
.rowSelected { .rowSelected {
color: #FFF; color: #FFF;
background-color: #c2c2c2; background-color: #c2c2c2;
...@@ -133,6 +134,7 @@ UL.jqueryFileTree A:hover { ...@@ -133,6 +134,7 @@ UL.jqueryFileTree A:hover {
.rowSelected a { .rowSelected a {
color: #FFF; color: #FFF;
} }
.pathlink {cursor: pointer; font-size: 13px; margin-right: 2px; margin-left: 2px;}
.gs_delimiter { .gs_delimiter {
height: 16px; height: 16px;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
background: #e4e4e4; background: #e4e4e4;
padding:3px; padding:3px;
/*position:relative;*/ /*position:relative;*/
width:757px; width:930px;
font-size: 14px; font-size: 14px;
border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0;
} }
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
#tabContaier textarea { #tabContaier textarea {
width:702px; width:702px;
} }
#tabContaier textarea.slap{white-space: pre-wrap;word-wrap: break-word;overflow: hidden;color: #6F6F6F;width:430px; max-height:120px; #tabContaier textarea.slap{white-space: pre-wrap;word-wrap: break-word;overflow: hidden;color: #6F6F6F;width:616px; max-height:120px;
resize: none; height:18px;padding:3px;min-height:18px;font-size: 13px;} resize: none; height:18px;padding:3px;min-height:18px;font-size: 13px;}
#tabContaier textarea.mb_style{width:560px;} #tabContaier textarea.mb_style{width:713px;}
#tabContaier > ul{ #tabContaier > ul{
overflow:hidden; overflow:hidden;
height:34px; height:34px;
......
...@@ -28,7 +28,7 @@ td{ ...@@ -28,7 +28,7 @@ td{
border-right: 1px solid #A8A8A8; border-right: 1px solid #A8A8A8;
} }
td.propertie{padding-left:10px; color:blue;width: 178px;} td.propertie{padding-left:10px; color:blue;width: 178px;}
.slapvalues{display:block;width: 375px;word-wrap: break-word} .slapvalues{display:block;width: 522px;word-wrap: break-word}
td.first{border-left: 1px solid #A8A8A8;} td.first{border-left: 1px solid #A8A8A8;}
th{ th{
background: #2281C1; background: #2281C1;
...@@ -39,7 +39,7 @@ th{ ...@@ -39,7 +39,7 @@ th{
} }
table.small th{padding: 4px;font-size: 16px;} table.small th{padding: 4px;font-size: 16px;}
textarea { textarea {
width:762px; width:932px;
font-family: 'Helvetica Neue',Tahoma,Helvetica,Arial,sans-serif; font-family: 'Helvetica Neue',Tahoma,Helvetica,Arial,sans-serif;
} }
...@@ -54,8 +54,8 @@ overflow-y: scroll; ...@@ -54,8 +54,8 @@ overflow-y: scroll;
#page #page
{ {
margin: 20px auto; margin: 10px auto;
width: 841px; width: 1014px;
} }
#logo{ #logo{
...@@ -64,8 +64,8 @@ overflow-y: scroll; ...@@ -64,8 +64,8 @@ overflow-y: scroll;
#header{ #header{
height: 78px; height: 78px;
padding-top: 15px; padding-top: 12px;
width: 847px; width: 1014px;
background: url(../images/head.png) no-repeat; background: url(../images/head.png) no-repeat;
} }
...@@ -86,7 +86,7 @@ overflow-y: scroll; ...@@ -86,7 +86,7 @@ overflow-y: scroll;
font-weight: normal; font-weight: normal;
padding-top: 3px; padding-top: 3px;
float: left; float: left;
width: 656px; width: 820px;
height: 22px; height: 22px;
text-align: center; text-align: center;
color: #4c6172; color: #4c6172;
...@@ -114,16 +114,12 @@ overflow-y: scroll; ...@@ -114,16 +114,12 @@ overflow-y: scroll;
} }
.wmenu{ .wmenu{
margin: 1px 0 1px 20px;
} }
.wmenu ul{ .wmenu ul{
list-style:none; height: 34px;
margin:0; overflow:hidden;
margin-top:1px;
padding:0;
margin-left:20px;
height: 36px;
} }
.space{ .space{
...@@ -132,7 +128,6 @@ overflow-y: scroll; ...@@ -132,7 +128,6 @@ overflow-y: scroll;
.wmenu li{ .wmenu li{
float:left; float:left;
background: url(../images/sep.png) left center no-repeat;
} }
.wmenu li .title_software{ .wmenu li .title_software{
...@@ -146,7 +141,7 @@ overflow-y: scroll; ...@@ -146,7 +141,7 @@ overflow-y: scroll;
padding-left: 20px; padding-left: 20px;
padding-right: 5px; padding-right: 5px;
margin-left:4px; margin-left:4px;
height: 20px; height: 18px;
text-shadow:1px 1px 0 #E6EDF2; text-shadow:1px 1px 0 #E6EDF2;
} }
...@@ -165,20 +160,23 @@ overflow-y: scroll; ...@@ -165,20 +160,23 @@ overflow-y: scroll;
text-shadow:1px 1px 0 #E6EDF2; text-shadow:1px 1px 0 #E6EDF2;
} }
.wmenu ul li.sep{border-right: 1px solid #c2c2c2; min-width:20px; height:34px}
.wmenu ul li a{ .wmenu ul li a{
display:block; display:block;
height: 20px; height: 20px;
Color:#000; Color:#275777;
font-size:14px; /*background: url(../images/sep.png) right center no-repeat;*/
border-right: 1px solid #c2c2c2;
/*font-weight:bold;*/
font-size:15px;
text-decoration:none; text-decoration:none;
padding:8px; padding:7px 10px 7px 10px;
padding-left: 6px;
} }
.wmenu ul li:last-child a {border: none}
.wmenu ul li a:hover, .wmenu ul li a.active{ .wmenu ul li a:hover, .wmenu ul li a.active{
color:#0271BF; color: #000;/*#0271BF;*/
background:url(../images/menu_hover.png) bottom repeat-x; background:#c2c2c2;
} }
#main #main
...@@ -191,7 +189,7 @@ overflow-y: scroll; ...@@ -191,7 +189,7 @@ overflow-y: scroll;
.main_content{ .main_content{
position:relative; position:relative;
width: 100%; width: 99.6%;
height: 430px; height: 430px;
margin-top:10px; margin-top:10px;
border:1px solid #4c6172; border:1px solid #4c6172;
...@@ -201,12 +199,12 @@ overflow-y: scroll; ...@@ -201,12 +199,12 @@ overflow-y: scroll;
.main_head{ .main_head{
height: 15px; height: 15px;
background: url(../images/main_top.png) no-repeat; background: url(../images/main_top.png) no-repeat;
width: 794px; width: 966px;
} }
.content{ .content{
background: url(../images/content.png) repeat-y; background: url(../images/content.png) repeat-y;
width: 764px; width: 936px;
padding: 15px; padding: 15px;
padding-top:0; padding-top:0;
padding-bottom:0; padding-bottom:0;
...@@ -229,16 +227,16 @@ overflow-y: scroll; ...@@ -229,16 +227,16 @@ overflow-y: scroll;
.main_foot{ .main_foot{
height: 15px; height: 15px;
background: url(../images/main_bottom.png) no-repeat; background: url(../images/main_bottom.png) no-repeat;
width: 794px; width: 966px;
} }
#footer{ #footer{
height: 35px; height: 35px;
width: 767px; width: 934px;
background: url(../images/footer_bg.png) no-repeat; background: url(../images/footer_bg.png) no-repeat;
padding-left: 40px; padding-left: 40px;
padding-right: 40px; padding-right: 40px;
padding-top: 5px; padding-top: 4px;
text-align: center; text-align: center;
color: #4c6172; color: #4c6172;
text-shadow: 0px 1px 1px #fff; text-shadow: 0px 1px 1px #fff;
...@@ -319,7 +317,8 @@ input[type="radio"], input[type="checkbox"]{ ...@@ -319,7 +317,8 @@ input[type="radio"], input[type="checkbox"]{
border: 2px solid #87B0D4; border: 2px solid #87B0D4;
padding: 0; padding: 0;
color: #4c6172; color: #4c6172;
margin: 15px 59px 15px 59px; margin: 20px auto;
width: 641px;
} }
#home_box a{ #home_box a{
...@@ -369,14 +368,14 @@ input[type="radio"], input[type="checkbox"]{ ...@@ -369,14 +368,14 @@ input[type="radio"], input[type="checkbox"]{
.lmenu{ .lmenu{
display: block; display: block;
height: 80px; height: 80px;
margin: 10px 45px 10px 45px; margin: 10px 0 10px 45px;
padding: 10px; padding: 10px;
padding-bottom:15px; padding-bottom:15px;
width: 530px; width: 530px;
border: 1px solid #678dad; border: 1px solid #678dad;
} }
.smaller{margin-left:10px; width: 350px; float:right} .smaller{margin-left:10px; width: 350px; float:left}
.smaller p{width: 280px;} .smaller p{width: 280px;}
.umenu{display: block;margin: 10px 0 10px 45px; width: 147px; float:left;border: 1px solid #678dad; .umenu{display: block;margin: 10px 0 10px 45px; width: 147px; float:left;border: 1px solid #678dad;
padding: 10px;height: 80px;padding-bottom:15px;} padding: 10px;height: 80px;padding-bottom:15px;}
...@@ -398,7 +397,6 @@ padding: 10px;height: 80px;padding-bottom:15px;} ...@@ -398,7 +397,6 @@ padding: 10px;height: 80px;padding-bottom:15px;}
.sright_menu{ .sright_menu{
display: block; display: block;
height: 80px; height: 80px;
margin: 0 45px 0 0;
padding: 10px; padding: 10px;
padding-bottom:15px; padding-bottom:15px;
border: #678dad; border: #678dad;
...@@ -415,7 +413,7 @@ padding: 10px;height: 80px;padding-bottom:15px;} ...@@ -415,7 +413,7 @@ padding: 10px;height: 80px;padding-bottom:15px;}
} }
.file_tree { .file_tree {
width: 752px; width: 923px;
height: 300px; height: 300px;
border: solid 1px #678dad; border: solid 1px #678dad;
background: #fff; background: #fff;
...@@ -433,28 +431,30 @@ padding: 10px;height: 80px;padding-bottom:15px;} ...@@ -433,28 +431,30 @@ padding: 10px;height: 80px;padding-bottom:15px;}
} }
.file_tree_short{ .file_tree_short{
width: 352px; width: 228px;
height: 170px; height: 379px;
border: solid 1px #678dad; border: solid 1px #678dad;
background: #fff; background: #fff;
overflow: auto; overflow: auto;
padding: 5px; padding: 5px;
float:left;
} }
.box_software{ .box_software{
width: 362px; width: 240px;
height: 100px;
background: #fff; background: #fff;
padding: 5px;
float:right;
} }
.software_details{float: left;}
#details_box{ #details_box{
display:none; display:block;
margin-top:10px;
} }
#code{
float: right;
width: 692px;
}
#details_head{margin-bottom: 10px;}
#contentInfo{ #contentInfo{
width: 756px; width: 926px;
border: solid 1px #678dad; border: solid 1px #678dad;
background: #fff; background: #fff;
overflow: auto; overflow: auto;
...@@ -490,10 +490,6 @@ h2.hight:hover{ ...@@ -490,10 +490,6 @@ h2.hight:hover{
cursor: pointer; cursor: pointer;
} }
.software_details{
padding: 10px;
}
.log_content{ .log_content{
border: solid 1px #4c6172; border: solid 1px #4c6172;
padding: 2px; padding: 2px;
...@@ -503,13 +499,17 @@ h2.hight:hover{ ...@@ -503,13 +499,17 @@ h2.hight:hover{
border: none; border: none;
background: #f6f7f8; background: #f6f7f8;
color: #000; color: #000;
width: 754px; width: 926px;
padding: 2px; padding: 2px;
height: 450px; height: 450px;
font-size: 13px; font-size: 13px;
overflow-y: auto;
white-space: pre-wrap;
} }
.log_btn{border: 1px solid #678dad; border-top:none; height: 22px; width: 654px; margin: 0 40px 10px 40px; .log_btn{border: 1px solid #678dad; border-top:none; height: 22px; width: 654px; margin: 0 40px 10px 40px;
padding:4px 10px 4px 10px; font-size: 16px; color: #4c6172;} padding:4px 10px 4px 10px; font-size: 16px; color: #4c6172;}
.log p{white-space: pre-wrap; width:100%}
.log p.info{white-space: pre-wrap; width:98%; font-size: 15px; margin: 5px; color:red;}
.waitting{ .waitting{
margin-left: 10px; margin-left: 10px;
...@@ -557,7 +557,11 @@ h2.hight:hover{ ...@@ -557,7 +557,11 @@ h2.hight:hover{
margin: 10px; margin: 10px;
margin-top: 20px; margin-top: 20px;
} }
label.header {
color: #4C6172;
font-size: 18px;
font-weight: normal;
}
select { select {
-webkit-appearance: button; -webkit-appearance: button;
-webkit-border-radius: 2px; -webkit-border-radius: 2px;
...@@ -655,7 +659,8 @@ a.lshare img{ ...@@ -655,7 +659,8 @@ a.lshare img{
.form input[type=text] ,.form input[type=password] {float:left; width:190px;margin:5px;} .form input[type=text] ,.form input[type=password] {float:left; width:190px;margin:5px;}
.hiddendiv {display: none;white-space: pre-wrap;min-height: 18px;font-size: 13px; .hiddendiv {display: none;white-space: pre-wrap;min-height: 18px;font-size: 13px;
padding:3px;word-wrap: break-word;width:430px; max-height:120px;font-family: 'Helvetica Neue',Tahoma,Helvetica,Arial,sans-serif;} padding:3px;word-wrap: break-word;width:430px; max-height:120px;font-family: 'Helvetica Neue',Tahoma,Helvetica,Arial,sans-serif;}
.list{background: url(../images/menu_dropdown.png) left center no-repeat; padding-left:10px;} .list{display: block;padding: 5px;background: #E7E7E7; margin-bottom:7px;}
div.sep{display:block; height:7px;}
.slidebox{padding:10px; } .slidebox{padding:10px; }
.alert_message{ background: url(../images/alert.png) center no-repeat; height: 26px;} .alert_message{ background: url(../images/alert.png) center no-repeat; height: 26px;}
.error_message{ background: url(../images/exit.png) center no-repeat; height: 26px;} .error_message{ background: url(../images/exit.png) center no-repeat; height: 26px;}
...@@ -665,10 +670,10 @@ a.lshare img{ ...@@ -665,10 +670,10 @@ a.lshare img{
#pClose, .close{background:url(../images/close.png) no-repeat 0px 0px; display:block; width:22px; height:22px; cursor:pointer} #pClose, .close{background:url(../images/close.png) no-repeat 0px 0px; display:block; width:22px; height:22px; cursor:pointer}
#pClose:hover, .close:hover{background:url(../images/close_hover.png) no-repeat 0px 0px;} #pClose:hover, .close:hover{background:url(../images/close_hover.png) no-repeat 0px 0px;}
.md5sum {margin:10px; font-size:15px;} .md5sum {margin:10px; font-size:15px;}
.title{background: #e4e4e4; width: 100%; height: 25px; padding-top:2px; text-indent: 5px; color: #737373; text-shadow: 0px 1px #FFF;} .title{background: #e4e4e4; width: 100%; height: 26px; padding-top:2px; text-indent: 5px; color: #737373; text-shadow: 0px 1px #FFF;}
.menu-box-left{float:left; width: 120px; font-size:14px; background: #e4e4e4; padding:5px 0 5px 5px; margin-top:10px; .menu-box-left{float:left; width: 135px; font-size:14px; background: #e4e4e4; padding:5px 0 5px 5px; margin-top:10px;
font-size:14px; border-radius: 4px 0 0 4px;} font-size:14px; border-radius: 4px 0 0 4px;}
.menu-box-right{background: #e4e4e4; padding: 5px; float:right; width: 634px; margin-left: -5px; .menu-box-right{background: #e4e4e4; padding: 5px; float:right; width: 745px; margin-left: -5px;
margin-top:10px; box-shadow: 1px 1px 1px #888888;} margin-top:10px; box-shadow: 1px 1px 1px #888888;}
.menu-box-left ul{margin:0px; list-style:none;} .menu-box-left ul{margin:0px; list-style:none;}
.menu-box-left li{padding: 2px; padding-left:10px; padding-right:10px; text-shadow: 0px 1px #fff;border-bottom:1px solid #fff;} .menu-box-left li{padding: 2px; padding-left:10px; padding-right:10px; text-shadow: 0px 1px #fff;border-bottom:1px solid #fff;}
...@@ -690,10 +695,14 @@ a.lshare img{ ...@@ -690,10 +695,14 @@ a.lshare img{
.popup td.top img { display: block; } .popup td.top img { display: block; }
.popup td#bottomright { background-image: url(../images/bubble-1.png); } .popup td#bottomright { background-image: url(../images/bubble-1.png); }
.popup-contents {background: #fff; color: #666666;} .popup-contents {background: #fff; color: #666666;}
.popup a{display: block; font-weight:bold; color: #4DA0C6;} .popup a{display: block; font-weight:bold; color: #4DA0C6; padding-left: 5px; padding-bottom: 5px;}
.popup a:hover{color: #666666;} .popup a:hover{color: #666666;}
.popup ul{margin:0; padding:0; list-style:none;} .popup ul{margin:0; margin-bottom:10px; padding:0; list-style:none;}
.popup li{border-bottom: 1px dashed #666666; padding:5px; padding-top:5px;} .popup li{border-bottom: 1px dashed #666666; padding:0;}
.popup ul li:last-child{border-bottom:none}
.popup ul li a{padding-bottom:0}
ul.menu li {padding-top:5px; padding-bottom:5px;}
ul.menu{margin-bottom:0;}
.popup-value{display:none;} .popup-value{display:none;}
textarea.parameter {border: solid 1px #678dad; color: #666666; height:110px;} textarea.parameter {border: solid 1px #678dad; color: #666666; height:110px;}
.link{color:#fff; font-weight:bold; text-decoration:none} .link{color:#fff; font-weight:bold; text-decoration:none}
......
slapos/runner/static/images/content.png

192 Bytes | W: | H:

slapos/runner/static/images/content.png

195 Bytes | W: | H:

slapos/runner/static/images/content.png
slapos/runner/static/images/content.png
slapos/runner/static/images/content.png
slapos/runner/static/images/content.png
  • 2-up
  • Swipe
  • Onion skin
slapos/runner/static/images/footer_bg.png

984 Bytes | W: | H:

slapos/runner/static/images/footer_bg.png

1.08 KB | W: | H:

slapos/runner/static/images/footer_bg.png
slapos/runner/static/images/footer_bg.png
slapos/runner/static/images/footer_bg.png
slapos/runner/static/images/footer_bg.png
  • 2-up
  • Swipe
  • Onion skin
slapos/runner/static/images/head.png

1.27 KB | W: | H:

slapos/runner/static/images/head.png

1.4 KB | W: | H:

slapos/runner/static/images/head.png
slapos/runner/static/images/head.png
slapos/runner/static/images/head.png
slapos/runner/static/images/head.png
  • 2-up
  • Swipe
  • Onion skin
slapos/runner/static/images/main_bg_all.png

236 Bytes | W: | H:

slapos/runner/static/images/main_bg_all.png

215 Bytes | W: | H:

slapos/runner/static/images/main_bg_all.png
slapos/runner/static/images/main_bg_all.png
slapos/runner/static/images/main_bg_all.png
slapos/runner/static/images/main_bg_all.png
  • 2-up
  • Swipe
  • Onion skin
slapos/runner/static/images/main_bottom.png

413 Bytes | W: | H:

slapos/runner/static/images/main_bottom.png

421 Bytes | W: | H:

slapos/runner/static/images/main_bottom.png
slapos/runner/static/images/main_bottom.png
slapos/runner/static/images/main_bottom.png
slapos/runner/static/images/main_bottom.png
  • 2-up
  • Swipe
  • Onion skin
slapos/runner/static/images/main_top.png

374 Bytes | W: | H:

slapos/runner/static/images/main_top.png

379 Bytes | W: | H:

slapos/runner/static/images/main_top.png
slapos/runner/static/images/main_top.png
slapos/runner/static/images/main_top.png
slapos/runner/static/images/main_top.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -465,7 +465,7 @@ if (jQuery) (function(jQuery){ ...@@ -465,7 +465,7 @@ if (jQuery) (function(jQuery){
var fileshtml = ''; var fileshtml = '';
var gs_lastparent = jQuery('#' + jQuery("#curDir").attr('rel')).parent().parent().parent().children('a'); var gs_lastparent = jQuery('#' + jQuery("#curDir").attr('rel')).parent().parent().parent().children('a');
if (gs_lastparent.length > 0) { if (gs_lastparent.length > 0) {
fileshtml += "<tr><td class='first'><div class='directory directory_info gsItem' rel=\'up\'><a href='javascript:void(0)' onclick=\"jQuery('#" + jQuery("#curDir").attr('rel')+ "').parent().parent().parent().children('a').trigger('click'); return false\"> parent...</a></div></td align='center'><td align='center'>Folder</td><td align='center'>-</td><td align='center'>-</td></tr>"; fileshtml += "<tr><td class='first'><div class='directory directory_info gsItem' rel=\'up\'><a href='javascript:void(0)' onclick=\"jQuery('#" + jQuery("#curDir").attr('rel')+ "').parent().parent().parent().children('a').trigger('click'); return false\"> ..</a></div></td align='center'><td align='center'>Folder</td><td align='center'>-</td><td align='center'>-</td></tr>";
} }
if (gsfiless.length > 0) { if (gsfiless.length > 0) {
for (var numf in gsfiless) { for (var numf in gsfiless) {
...@@ -525,6 +525,21 @@ if (jQuery) (function(jQuery){ ...@@ -525,6 +525,21 @@ if (jQuery) (function(jQuery){
} }
function splitPath(path) {
var list = path.split('/'),
html = "";
for (var i=0; i<list.length; i++){
var subList = new Array();
if (list[i] !== '') {
for (var j=0; j<=i; j++){
subList.push(list[j]);
}
html += "<a class='pathlink' rel='"+subList.join('/')+"/'>"+list[i]+"</a>/";
}
}
return html;
}
function showTree(c, t) { function showTree(c, t) {
var cObject = jQuery(c); var cObject = jQuery(c);
cObject.addClass('wait'); cObject.addClass('wait');
...@@ -541,7 +556,8 @@ if (jQuery) (function(jQuery){ ...@@ -541,7 +556,8 @@ if (jQuery) (function(jQuery){
success: function(data) { success: function(data) {
//remember current dir id //remember current dir id
jQuery("#curDir").html(unescape(t)); jQuery("#curDir").html(splitPath(unescape(t)));
jQuery("#curDir").attr('val', unescape(t));
jQuery("#curDir").attr('rel', jQuery('a', cObject).attr('id')); jQuery("#curDir").attr('rel', jQuery('a', cObject).attr('id'));
gs_cur_items = new Array(); gs_cur_items = new Array();
...@@ -587,6 +603,9 @@ if (jQuery) (function(jQuery){ ...@@ -587,6 +603,9 @@ if (jQuery) (function(jQuery){
jQuery(t).find('LI > A').bind('click', function () { jQuery(t).find('LI > A').bind('click', function () {
showTree (jQuery(this).parent(), encodeURIComponent(jQuery(this).attr('rel').match( /.*\// ))); showTree (jQuery(this).parent(), encodeURIComponent(jQuery(this).attr('rel').match( /.*\// )));
}); });
jQuery('a.pathlink').bind('click', function () {
showTree( jQuery('#gs_dir_list'), jQuery(this).attr('rel'));
});
} }
function showRoot(){ function showRoot(){
...@@ -630,7 +649,7 @@ if (jQuery) (function(jQuery){ ...@@ -630,7 +649,7 @@ if (jQuery) (function(jQuery){
}); });
return false; return false;
} }
var curDir = jQuery("#curDir").html(); var curDir = jQuery("#curDir").attr('val');
var dataForSend = null; var dataForSend = null;
var gsitem = gs_get_cur_item(jQuery(this).attr('rel')); var gsitem = gs_get_cur_item(jQuery(this).attr('rel'));
......
This diff is collapsed.
$(document).ready(function(){ $(document).ready(function(){
$(".tabContents").hide(); // Hide all tab content divs by default $(".tabContents").hide(); // Hide all tab content divs by default
var hashes = window.location.href.split('#'); var hashes = window.location.href.split('#');
var fromheight = 0; var fromheight = 0;
var previoustab = null; var previoustab = null;
...@@ -18,17 +18,17 @@ $(document).ready(function(){ ...@@ -18,17 +18,17 @@ $(document).ready(function(){
}); });
} }
else{$(".tabContents:first").show(); previoustab = ".tabContents:first";} // Show the first div of tab content by default else{$(".tabContents:first").show(); previoustab = ".tabContents:first";} // Show the first div of tab content by default
$("#tabContaier ul li a").click(function(){ //Fire the click event $("#tabContaier ul li a").click(function(){ //Fire the click event
if($(this).hasClass('active')){ if($(this).hasClass('active')){
return false; return false;
} }
fromheight = $(previoustab).height(); fromheight = $(previoustab).height();
var activeTab = $(this).attr("href"); // Catch the click link var activeTab = $(this).attr("href"); // Catch the click link
$("#tabContaier .tabDetails").css("height", $("#tabContaier .tabDetails").height()); $("#tabContaier .tabDetails").css("height", $("#tabContaier .tabDetails").height());
$("#tabContaier ul li a").removeClass("active"); // Remove pre-highlighted link $("#tabContaier ul li a").removeClass("active"); // Remove pre-highlighted link
$(this).addClass("active"); // set clicked link to highlight state $(this).addClass("active"); // set clicked link to highlight state
$(".tabContents").hide(); // hide currently visible tab content div $(".tabContents").hide(); // hide currently visible tab content div
$(activeTab).fadeIn(); // show the target tab content div by matching clicked link. $(activeTab).fadeIn(); // show the target tab content div by matching clicked link.
var diff = fromheight - $(activeTab).height(); var diff = fromheight - $(activeTab).height();
if (diff > 0){$("#tabContaier .tabDetails").animate({height: '-=' + diff + 'px'}, 850, 'swing', function() { if (diff > 0){$("#tabContaier .tabDetails").animate({height: '-=' + diff + 'px'}, 850, 'swing', function() {
$("#tabContaier .tabDetails").css("height", ""); $("#tabContaier .tabDetails").css("height", "");
...@@ -39,5 +39,5 @@ $(document).ready(function(){ ...@@ -39,5 +39,5 @@ $(document).ready(function(){
previoustab = activeTab; previoustab = activeTab;
$("#tabContaier .tabDetails").css("height", $("#tabContaier .tabDetails").height()); $("#tabContaier .tabDetails").css("height", $("#tabContaier .tabDetails").height());
return false;//this reinitialize tab index when reload page return false;//this reinitialize tab index when reload page
}); });
}); });
\ No newline at end of file
...@@ -45,7 +45,7 @@ $(function () { ...@@ -45,7 +45,7 @@ $(function () {
$('.popup').css('display', 'none'); $('.popup').css('display', 'none');
shown = false; shown = false;
}); });
}, hideDelay) }, hideDelay);
return false; return false;
}); });
}); });
\ No newline at end of file
...@@ -8,11 +8,11 @@ ...@@ -8,11 +8,11 @@
$.extend($.fn, { $.extend($.fn, {
Popup: function(msg, option) { Popup: function(msg, option) {
var h; var h;
if (option.type == undefined) option.type = "info"; if (option.type === undefined) option.type = "info";
if (option.closebtn == undefined) option.closebtn = false; if (option.closebtn === undefined) option.closebtn = false;
if (option.duration == undefined) option.duration = 0; if (option.duration === undefined) option.duration = 0;
if (option.load == undefined) option.load = false; if (option.load === undefined) option.load = false;
$box = $(this); var $box = $(this);
if(showDelayTimer){clearTimeout(showDelayTimer);} if(showDelayTimer){clearTimeout(showDelayTimer);}
if(isShow){ if(isShow){
$box.fadeOut('normal', function() { $box.fadeOut('normal', function() {
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
} }
else{setupBox();} else{setupBox();}
function setupBox(){ function setupBox(){
if (msg == undefined){ if (msg === undefined){
msg = "Cannot execute your request. Please make sure you are logged in!!" msg = "Cannot execute your request. Please make sure you are logged in!!";
option.type = "error"; option.type = "error";
} }
$box.empty(); $box.empty();
...@@ -30,43 +30,43 @@ ...@@ -30,43 +30,43 @@
$box.show(); $box.show();
$box.append('<div><table id="bcontent"><tr>' + $box.append('<div><table id="bcontent"><tr>' +
'<td valign="middle" class="logo ' + option.type + '_message"></td>' + '<td valign="middle" class="logo ' + option.type + '_message"></td>' +
'<td valign="middle"><p>' + msg + '</p></td>' + '<td valign="middle"><p>' + msg + '</p></td>' +
'<td valign="middle" class="b_close"><span id="pClose"></span></td></tr></table></div>'); '<td valign="middle" class="b_close"><span id="pClose"></span></td></tr></table></div>');
$(window).scroll(function(){ $(window).scroll(function(){
$box.animate({top:$(window).scrollTop()+"px" },{queue: false, duration: 350}); $box.animate({top:$(window).scrollTop()+"px" },{queue: false, duration: 350});
}); });
h = $("#bcontent").height()+5; h = $("#bcontent").height()+5;
$("#pClose").bind("click", function() { $("#pClose").bind("click", function() {
close(); close();
}); });
showBox(); showBox();
if(option.duration != 0){ if(option.duration !== 0){
showDelayTimer = setTimeout(function(){ showDelayTimer = setTimeout(function(){
showDelayTimer = null; showDelayTimer = null;
close(); close();
}, option.duration); }, option.duration);
} }
} }
function showBox(){ function showBox(){
if(option.load){ if(option.load){
$(window).load(function(){ $(window).load(function(){
$box.css('top', + ($(window).scrollTop() - h) +'px'); $box.css('top', + ($(window).scrollTop() - h) +'px');
$box.animate({ top:"+=" + h + "px" }, "slow"); $box.animate({ top:"+=" + h + "px" }, "slow");
isShow = true; isShow = true;
}); });
} }
else{ else{
$box.css('top', + ($(window).scrollTop() - h) +'px'); $box.css('top', + ($(window).scrollTop() - h) +'px');
$box.animate({ top:"+=" + h + "px" }, "slow"); $box.animate({ top:"+=" + h + "px" }, "slow");
isShow = true; isShow = true;
} }
} }
function close(){ function close(){
$box.animate({ top:"-=" + h + "px" }, "slow", function(){ $box.animate({ top:"-=" + h + "px" }, "slow", function(){
$box.fadeOut("normal", function() { $box.fadeOut("normal", function() {
isShow = false; isShow = false;
}); });
}); });
} }
} }
}); });
......
$(document).ready( function() { /*jslint undef: true */
var send = false; /*global $, document, window, $SCRIPT_ROOT */
$("#update").click(function(){ /* vim: set et sts=4: */
var haspwd = false;
var hasAccount = !($("input#hasAccount").val() === ""); $(document).ready(function () {
if($("input#username").val() === "" || !$("input#username").val().match(/^[\w\d\._-]+$/)){ "use strict";
$("#error").Popup("Invalid user name. Please check it!", {type:'alert', duration:3000}); var send = false;
return false; $("#update").click(function () {
} var haspwd = false,
else if ($("input#username").val().length <6){ hasAccount = ($("input#hasAccount").val() !== "");
$("#error").Popup("Username must have at least 6 characters", {type:'alert', duration:3000}); if ($("input#username").val() === "" || !$("input#username").val().match(/^[\w\d\._\-]+$/)) {
return false; $("#error").Popup("Invalid user name. Please check it!", {type: 'alert', duration: 3000});
} return false;
if($("input#name").val() === ""){
$("#error").Popup("Please enter your name and surname!", {type:'alert', duration:3000});
return false;
}
if(!$("input#email").val().match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/)){
$("#error").Popup("Please enter a valid email adress!", {type:'alert', duration:3000});
return false;
}
if(!hasAccount && !$("input#password").val().match(/^[\w\d\._-]+$/)){
$("#error").Popup("Please enter your new password!", {type:'alert', duration:3000});
return false;
}
if ($("input#password").val() !== "" && $("input#password").val().length <6){
$("#error").Popup("The password must have at least 6 characters", {type:'alert', duration:3000});
return false;
}
if($("input#password").val() !== ""){
if($("input#password").val() === "" || !$("input#password").val().match(/^[\w\d\._-]+$/)){
$("#error").Popup("Please enter your new password!", {type:'alert', duration:3000});
return false;
}
if($("input#password").val() !== $("input#cpassword").val()){
$("#error").Popup("your password does not match!", {type:'alert', duration:3000});
return false;
}
haspwd = true;
}
if(!$("input#rcode").val().match(/^[\w\d]+$/)){
$("#error").Popup("Please enter your password recovery code.", {type:'alert', duration:3000});
return false;
}
if(send) return false;
send = true;
$.ajax({
type: "POST",
url: $SCRIPT_ROOT + ((hasAccount)? '/updateAccount':'/configAccount'),
data: {name: $("input#name").val(), username:$("input#username").val(), email:$("input#email").val(),
password:((haspwd) ? $("input#password").val():""), rcode:$("input#rcode").val()},
success: function(data){
if(data.code ==1){
location.href = $SCRIPT_ROOT+"/"
} }
else{ if ($("input#username").val().length < 6) {
$("#error").Popup(data.result, {type:'error', duration:5000}); $("#error").Popup("Username must have at least 6 characters", {type: 'alert', duration: 3000});
return false;
} }
send = false; if ($("input#name").val() === "") {
}, $("#error").Popup("Please enter your name and surname!", {type: 'alert', duration: 3000});
error:function(){send = false;} return false;
}
if (!$("input#email").val().match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/)) {
$("#error").Popup("Please enter a valid email adress!", {type: 'alert', duration: 3000});
return false;
}
if (!hasAccount && !$("input#password").val()) {
$("#error").Popup("Please enter your new password!", {type: 'alert', duration: 3000});
return false;
}
if ($("input#password").val() !== "" && $("input#password").val().length < 6) {
$("#error").Popup("The password must have at least 6 characters", {type: 'alert', duration: 3000});
return false;
}
if ($("input#password").val() !== "") {
if ($("input#password").val() === "" || !$("input#password").val()) {
$("#error").Popup("Please enter your new password!", {type: 'alert', duration: 3000});
return false;
}
if ($("input#password").val() !== $("input#cpassword").val()) {
$("#error").Popup("your password does not match!", {type: 'alert', duration: 3000});
return false;
}
haspwd = true;
}
if (!$("input#rcode").val().match(/^[\w\d]+$/)) {
$("#error").Popup("Please enter your password recovery code.", {type: 'alert', duration: 3000});
return false;
}
if (send) {
return false;
}
send = true;
$.ajax({
type: "POST",
url: $SCRIPT_ROOT + ((hasAccount) ? '/updateAccount' : '/configAccount'),
data: {
name: $("input#name").val(),
username: $("input#username").val(),
email: $("input#email").val(),
password: ((haspwd) ? $("input#password").val() : ""),
rcode: $("input#rcode").val()
},
success: function (data) {
if (data.code === 1) {
window.location.href = $SCRIPT_ROOT + "/";
} else {
$("#error").Popup(data.result, {type: 'error', duration: 5000});
}
send = false;
},
error: function () { send = false; }
});
return false;
}); });
return false; });
});
});
\ No newline at end of file
/*jslint undef: true */
/*global $, window, $SCRIPT_ROOT */
/* vim: set et sts=4: */
/*Common javascript function*/ /*Common javascript function*/
String.prototype.toHtmlChar = function(){ String.prototype.toHtmlChar = function () {
var c = {'<':'&lt;', '>':'&gt;', '&':'&amp;', '"':'&quot;', "'":'&#039;', "use strict";
'#':'&#035;' }; var c = {
return this.replace( /[<&>'"#]/g, function(s) { return c[s]; } ); '<': '&lt;',
'>': '&gt;',
'&': '&amp;',
'"': '&quot;',
"'": '&#039;',
'#': '&#035;'
};
return this.replace(/[<&>'"#]/g, function (s) { return c[s]; });
}; };
String.prototype.trim = function () { String.prototype.trim = function () {
"use strict";
return this.replace(/^\s*/, "").replace(/\s*$/, ""); return this.replace(/^\s*/, "").replace(/\s*$/, "");
}; };
/****************************************/ /****************************************/
function setInput($elt) { function setInput($elt) {
if(!$elt){$elt = $('input[type="text"], input[type="password"]');} "use strict";
$elt.addClass("idleField"); if (!$elt) {
$elt.focus(function() { $elt = $('input[type="text"], input[type="password"]');
$(this).removeClass("idleField").addClass("focusField"); }
if (this.value == this.defaultValue){ $elt.addClass("idleField");
this.value = ''; $elt.focus(function () {
} $(this).removeClass("idleField").addClass("focusField");
if(this.value != this.defaultValue){ if (this.value === this.defaultValue) {
this.select(); this.value = '';
} }
}); if (this.value !== this.defaultValue) {
$elt.blur(function() { this.select();
$(this).removeClass("focusField").addClass("idleField"); }
if ($.trim(this.value) === ''){ });
this.value = (this.defaultValue ? this.defaultValue : ''); $elt.blur(function () {
} $(this).removeClass("focusField").addClass("idleField");
}); if ($.trim(this.value) === '') {
this.value = (this.defaultValue || '');
}
});
} }
/*******************Bind remove all button*******************/ /*******************Bind remove all button*******************/
function bindRemove(){ function bindRemove() {
$("a#removeSr").click(function(){ "use strict";
if(!window.confirm("Do you really want to remove all software release?")){ $("a#removeSr").click(function () {
return false; if (!window.confirm("Do you really want to remove all software release?")) {
} return false;
location.href = $SCRIPT_ROOT + '/removeSoftware'; }
}); window.location.href = $SCRIPT_ROOT + '/removeSoftware';
$("a#removeIst").click(function(){ });
if(!window.confirm("Do you really want to remove all computer partition?")){ $("a#removeIst").click(function () {
return false; if (!window.confirm("Do you really want to remove all computer partition?")) {
} return false;
location.href = $SCRIPT_ROOT + '/removeInstance'; }
}); window.location.href = $SCRIPT_ROOT + '/removeInstance';
});
} }
/**************************/ /**************************/
(function ($, document, window) { (function ($, document, window) {
"use strict";
$.extend($.fn, { $.extend($.fn, {
slideBox: function(state) { slideBox: function (state) {
if (!state) state = "hide"; if (!state) {
var header = $("#"+$(this).attr('id')+">h2"); state = "hide";
var box = $("#"+$(this).attr('id')+">div"); }
header.addClass(state); var header = $("#" + $(this).attr('id') + ">h2"),
if(state=="hide"){box.css('display', 'none');} box = $("#" + $(this).attr('id') + ">div");
header.click(function(){ header.addClass(state);
var state = box.css("display"); if (state === "hide") {
if (state == "none"){ box.css('display', 'none');
box.slideDown("normal"); }
header.removeClass("hide"); header.click(function () {
header.addClass("show"); var state = box.css("display");
} if (state === "none") {
else{ box.slideDown("normal");
box.slideUp("normal"); header.removeClass("hide");
header.removeClass("show"); header.addClass("show");
header.addClass("hide"); } else {
} box.slideUp("normal");
}); header.removeClass("show");
} header.addClass("hide");
}
});
}
}); });
}(jQuery, document, this)); }(jQuery, document, this));
\ No newline at end of file
/*jslint undef: true */
/*global document, escape, unescape */
/* vim: set et sts=4: */
/*Cookies Management*/ /*Cookies Management*/
function setCookie(name,value,expires,path,domain,secure){ function getCookie(name) {
if (!expires){ "use strict";
var today = new Date(); var i,
expires = new Date(today.getTime() + 365 * 24 * 60 * 60 * 1000); x,
} y,
document.cookie = name + "=" + escape(value) + result,
"; expires=" + expires.toGMTString() + ARRcookies = document.cookie.split(";");
((path) ? "; path=" + path : "/") + for (i = 0; i < ARRcookies.length; i += 1) {
((domain) ? "; domain=" + domain : "") + x = ARRcookies[i].substr(0, ARRcookies[i].indexOf("="));
((secure) ? "; secure" : ""); y = ARRcookies[i].substr(ARRcookies[i].indexOf("=") + 1);
x = x.replace(/^\s+|\s+$/g, "");
if (x === name) {
result = unescape(y);
if (result !== "" && result !== null) {
return result;
}
return null;
}
}
return null;
} }
function deleteCookie(name,path,domain) {
if (getCookie(name)) { function deleteCookie(name, path, domain) {
document.cookie = name + "=" + "use strict";
((path) ? "; path=" + path : "/") + if (getCookie(name)) {
((domain) ? "; domain=" + domain : "") + document.cookie = name + "=" +
"; expires=Thu, 01-Jan-70 00:00:01 GMT"; (path ? "; path=" + path : "/") +
} (domain ? "; domain=" + domain : "") +
"; expires=Thu, 01-Jan-70 00:00:01 GMT";
}
} }
function getCookie(name) {
var i,x,y,ARRcookies=document.cookie.split(";"); function setCookie(name, value, expires, path, domain, secure) {
for (i=0;i<ARRcookies.length;i++){ "use strict";
x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("=")); if (getCookie(name) !== null){
y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1); deleteCookie(name);
x=x.replace(/^\s+|\s+$/g,""); }
if (x==name){ if (!expires) {
var result = unescape(y); var today = new Date();
if (result != "" && result != null){ expires = new Date(today.getTime() + 365 * 24 * 60 * 60 * 1000);
return result;
}
return null;
} }
} document.cookie = name + "=" + escape(value) +
return null; "; expires=" + expires.toGMTString() +
((path) ? "; path=" + path : "/") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "");
} }
/**************************/ /**************************/
$(document).ready( function() { /*jslint undef: true */
var editor = ace.edit("editor"); /*global $, document, ace, $SCRIPT_ROOT */
editor.setTheme("ace/theme/crimson_editor"); /* vim: set et sts=4: */
var CurentMode = require("ace/mode/buildout").Mode;
editor.getSession().setMode(new CurentMode());
editor.getSession().setTabSize(2);
editor.getSession().setUseSoftTabs(true);
editor.renderer.setHScrollBarAlwaysVisible(false);
var file = $("input#profile").val(); $(document).ready(function () {
var workdir = $("input#workdir").val(); "use strict";
var edit = false;
var send = false;
selectFile(file);
$("#save").click(function(){ var editor, CurrentMode, file, workdir, edit, send;
if(!edit){
$("#error").Popup("Can not load your file, please make sure that you have selected a Software Release", {type:'alert', duration:5000});
return false;
}
if (send) return;
send =true
$.ajax({
type: "POST",
url: $SCRIPT_ROOT + '/saveFileContent',
data: {file: file, content: editor.getSession().getValue()},
success: function(data){
if(data.code == 1){
$("#error").Popup("File Saved!", {type:'confirm', duration:2000});
}
else{
$("#error").Popup(data.result, {type:'error', duration:5000});
}
send = false;
}
});
return false;
});
$("#getmd5").click(function(){
getmd5sum();
return false;
});
$("#adddevelop").click(function(){
var developList = new Array();
var i=0;
$("#plist li").each(function(index){
var elt = $(this).find("input:checkbox");
if (elt.is(":checked")){
developList[i] = workdir+"/"+elt.val();
i++;
elt.attr("checked", false);
}
});
if (developList.length > 0){setDevelop(developList);}
return false;
});
function selectFile(file){ function selectFile(file) {
edit = false; edit = false;
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: $SCRIPT_ROOT + '/getFileContent', url: $SCRIPT_ROOT + '/getFileContent',
data: "file=" + file, data: "file=" + file,
success: function(data){ success: function (data) {
if(data.code == 1){ if (data.code === 1) {
editor.getSession().setValue(data.result); editor.getSession().setValue(data.result);
edit = true; edit = true;
} } else {
else{ $("#error").Popup("Can not load your file, please make sure that you have selected a Software Release",
$("#error").Popup("Can not load your file, please make sure that you have selected a Software Release", {type:'alert', duration:5000}); {type: 'alert', duration: 5000});
} }
} }
}); });
return; return;
} }
function getmd5sum(){ function getmd5sum() {
if (send) return; if (send) {
send =true return;
$.ajax({ }
type: "POST", send = true;
url: $SCRIPT_ROOT + '/getmd5sum', $.ajax({
data: {file: file}, type: "POST",
success: function(data){ url: $SCRIPT_ROOT + '/getmd5sum',
if(data.code == 1){ data: {file: file},
$("#md5sum").empty(); success: function (data) {
$("#md5sum").append('md5sum : <span>' + data.result + '</span>'); if (data.code === 1) {
} $("#md5sum").empty();
else{ $("#md5sum").append('md5sum : <span>' + data.result + '</span>');
$("#error").Popup(data.result, {type:'error', duration:5000}); } else {
} $("#error").Popup(data.result, {type: 'error', duration: 5000});
send = false; }
} send = false;
}); }
} });
function setDevelop(developList){ }
if (developList==null || developList.length <= 0) return;
editor.navigateFileStart(); function setDevelop(developList) {
editor.find('buildout',{caseSensitive: true,wholeWord: true}); if (developList === null || developList.length <= 0) {
if(!editor.getSelectionRange().isEmpty()){ return;
//editor.find("",{caseSensitive: true,wholeWord: true,regExp: true}); }
//if(!editor.getSelectionRange().isEmpty()){ editor.navigateFileStart();
//alert("found"); editor.find('buildout', {caseSensitive: true, wholeWord: true});
//} if (editor.getSelectionRange().isEmpty()) {
//else{alert("no found"); $("#error").Popup("Can not found part [buildout]! Please make sure that you have a cfg file",
//} {type: 'alert', duration: 3000});
} return;
else{ }
$("#error").Popup("Can not found part [buildout]! Please make sure that you have a cfg file", {type:'alert', duration:3000}); //else {
return; // //editor.find("",{caseSensitive: true,wholeWord: true,regExp: true});
} // //if (!editor.getSelectionRange().isEmpty()) {
editor.navigateLineEnd(); // //alert("found");
$.post($SCRIPT_ROOT+"/getPath", {file:developList.join("#")}, function(data) { // //}
if(data.code==1){ // //else{alert("no found");
var result = data.result.split('#'); // //}
editor.insert("\ndevelop =\n\t" + result[0] + "\n"); //}
for(var i=1; i<result.length; i++) editor.navigateLineEnd();
editor.insert("\t" + result[i] + "\n"); $.post($SCRIPT_ROOT + "/getPath", {file: developList.join("#")}, function (data) {
} if (data.code === 1) {
}) var i,
.error(function() { }) result = data.result.split('#');
.complete(function(){}); editor.insert("\ndevelop =\n\t" + result[0] + "\n");
editor.insert("\n"); for (i = 1; i < result.length; i += 1) {
} editor.insert("\t" + result[i] + "\n");
}); }
\ No newline at end of file }
})
.error(function () { })
.complete(function () {});
editor.insert("\n");
}
editor = ace.edit("editor");
CurrentMode = require("ace/mode/buildout").Mode;
file = $("input#profile").val();
workdir = $("input#workdir").val();
edit = false;
send = false;
editor.setTheme("ace/theme/crimson_editor");
editor.getSession().setMode(new CurrentMode());
editor.getSession().setTabSize(2);
editor.getSession().setUseSoftTabs(true);
editor.renderer.setHScrollBarAlwaysVisible(false);
selectFile(file);
$("#save").click(function () {
if (!edit) {
$("#error").Popup("Can not load your file, please make sure that you have selected a Software Release",
{type: 'alert', duration: 5000});
return false;
}
if (send) {
return;
}
send = true;
$.ajax({
type: "POST",
url: $SCRIPT_ROOT + '/saveFileContent',
data: {file: file, content: editor.getSession().getValue()},
success: function (data) {
if (data.code === 1) {
$("#error").Popup("File Saved!", {type: 'confirm', duration: 2000});
} else {
$("#error").Popup(data.result, {type: 'error', duration: 5000});
}
send = false;
}
});
return false;
});
$("#getmd5").click(function () {
getmd5sum();
return false;
});
$("#adddevelop").click(function () {
var developList = [],
i = 0;
$("#plist li").each(function (index) {
var elt = $(this).find("input:checkbox");
if (elt.is(":checked")) {
developList[i] = workdir + "/" + elt.val();
i += 1;
elt.attr("checked", false);
}
});
if (developList.length > 0) {
setDevelop(developList);
}
return false;
});
});
$(document).ready( function() { /*jslint undef: true */
var send = false; /*global $, document, $SCRIPT_ROOT */
var cloneRequest; /* vim: set et sts=4: */
$('#fileNavigator').gsFileManager({ script: $SCRIPT_ROOT+"/fileBrowser", root: "workspace/"});
configRadio();
$("input#nothing").change(function(){ $(document).ready(function () {
configRadio(); "use strict";
});
$("input#ssh").change(function(){ function configRadio() {
configRadio(); $("#modelist li").each(function (index) {
}); var boxselector = "#box" + index;
$("input#https").change(function(){ if ($(this).hasClass('checked')) {
configRadio(); $(this).removeClass('checked');
}); $(boxselector).slideUp("normal");
$("#clone").click(function(){ }
if(send){ if ($(this).find("input:radio").is(':checked')) {
cloneRequest.abort(); $(this).addClass('checked');
$("#imgwaitting").fadeOut('normal'); //change content here
$("#clone").empty(); $(boxselector).slideDown("normal");
$("#clone").append("Clone"); }
send = false; if (index !== 2) {
return; $("input#password").val("");
} $("input#cpassword").val("");
var repo_url = $("input#repo").val(); }
var email = ""; });
var name = ""; }
/* /^(ht|f)tps?:\/\/[a-z0-9-\.]+\.[a-z]{2,4}\/?([^\s<>\#%"\,\{\}\\|\\\^\[\]`]+)?$/ */
if($("input#repo").val() === '' || !repo_url.match(/^[\w\d\.\/:~@_-]+$/)){ var send = false,
$("#error").Popup("Invalid url for the repository", {type:'alert', duration:3000}); cloneRequest;
return false;
} $('#fileNavigator').gsFileManager({ script: $SCRIPT_ROOT + "/fileBrowser", root: "workspace/"});
if($("input#name").val() === '' || !$("input#name").val().match(/^[\w\d\._-]+$/)){ configRadio();
$("#error").Popup("Invalid project name", {type:'alert', duration:3000}); $("input#nothing").change(function () {
return false; configRadio();
} });
if($("input#user").val() !== ""){ $("input#ssh").change(function () {
name = $("input#user").val(); configRadio();
} });
if($("input#email").val() !== '' && $("input#email").val() !== "Enter your email adress..."){ $("input#https").change(function () {
if(!$("input#email").val().match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/)){ configRadio();
$("#error").Popup("Please enter a valid email adress!", {type:'alert', duration:3000}); });
return false; $("#clone").click(function () {
} if (send) {
email = $("input#email").val(); cloneRequest.abort();
} $("#imgwaitting").fadeOut('normal');
if($("input#https").is(':checked')){ $("#clone").empty();
if($("input#username").val() == "" || !$("input#username").val().match(/^[\w\d\._-]+$/)){ $("#clone").append("Clone");
$("#error").Popup("Please enter a correct username", {type:'alert', duration:3000}); send = false;
return false; return;
} }
if($("input#password").val() != ""){ var repo_url = $("input#repo").val(),
if(repo_url.indexOf("https://") != -1){ email = "",
repo_url = "https://" + $("input#username").val() + name = "";
":" + $("input#password").val() +
"@" + repo_url.substring(8); /* /^(ht|f)tps?:\/\/[a-z0-9-\.]+\.[a-z]{2,4}\/?([^\s<>\#%"\,\{\}\\|\\\^\[\]`]+)?$/ */
} if ($("input#repo").val() === '' || !repo_url.match(/^[\w\d\.\/:~@_\-]+$/)) {
else{ $("#error").Popup("Invalid url for the repository", {type: 'alert', duration: 3000});
$("#error").Popup("The URL of your repository should start with 'https://'", {type:'alert', duration:3000}); return false;
return false; }
} if ($("input#name").val() === '' || !$("input#name").val().match(/^[\w\d\._\-]+$/)) {
} $("#error").Popup("Invalid project name", {type: 'alert', duration: 3000});
else{ return false;
$("#error").Popup("Please enter your password", {type:'alert', duration:3000}); }
return false; if ($("input#user").val() !== "") {
} name = $("input#user").val();
} }
else if(repo_url.indexOf("https://") != -1){ if ($("input#email").val() !== '' && $("input#email").val() !== "Enter your email adress...") {
$("#error").Popup("Please select HTTPS Security Mode for this repository", {type:'alert', duration:3000}); if (!$("input#email").val().match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/)) {
return false; $("#error").Popup("Please enter a valid email adress!", {type: 'alert', duration: 3000});
} return false;
$("#imgwaitting").fadeIn('normal'); }
$("#clone").empty(); email = $("input#email").val();
$("#clone").append("Stop"); }
send = true; if ($("input#https").is(':checked')) {
cloneRequest = $.ajax({ if ($("input#username").val() === "" || !$("input#username").val().match(/^[\w\d\._\-]+$/)) {
type: "POST", $("#error").Popup("Please enter a correct username", {type: 'alert', duration: 3000});
url: $SCRIPT_ROOT + '/cloneRepository', return false;
data: {repo: repo_url, name: ($("input#workdir").val() + "/" + }
$("input#name").val()), email:email, if ($("input#password").val() !== "") {
user:name}, if (repo_url.indexOf("https://") !== -1) {
success: function(data){ repo_url = "https://" + $("input#username").val() +
if(data.code == 1){ ":" + $("input#password").val() +
$("#file_navigation").fadeIn('normal'); "@" + repo_url.substring(8);
$("#error").Popup("Your repository is cloned!", {type:'confirm', duration:3000}); } else {
$("input#repo").val("Enter the url of your repository..."); $("#error").Popup("The URL of your repository should start with 'https://'", {type: 'alert', duration: 3000});
$("input#name").val("Enter the project name..."); return false;
$('#fileNavigator').gsFileManager({ script: $SCRIPT_ROOT+"/fileBrowser", root: "workspace"}); }
} } else {
else{ $("#error").Popup("Please enter your password", {type: 'alert', duration: 3000});
$("#error").Popup(data.result, {type:'error'}); return false;
} }
$("#imgwaitting").hide(); } else if (repo_url.indexOf("https://") !== -1) {
$("#clone").empty(); $("#error").Popup("Please select HTTPS Security Mode for this repository", {type: 'alert', duration: 3000});
$("#clone").append("Clone"); return false;
send = false; }
}, $("#imgwaitting").fadeIn('normal');
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").empty();
$("#clone").append("Clone"); $("#clone").append("Stop");
} send = true;
}); cloneRequest = $.ajax({
return false; type: "POST",
}); url: $SCRIPT_ROOT + '/cloneRepository',
function configRadio(){ data: {
$("#modelist li").each(function(index) { repo: repo_url,
var boxselector = "#box" + index; name: $("input#workdir").val() + "/" + $("input#name").val(),
if($(this).hasClass('checked')){ email: email,
$(this).removeClass('checked'); user: name
$(boxselector).slideUp("normal"); },
} success: function (data) {
if($(this).find("input:radio").is(':checked')){ if (data.code === 1) {
$(this).addClass('checked'); $("#file_navigation").fadeIn('normal');
//change content here $("#error").Popup("Your repository is cloned!", {type: 'confirm', duration: 3000});
$(boxselector).slideDown("normal"); $("input#repo").val("Enter the url of your repository...");
} $("input#name").val("Enter the project name...");
if(index != 2){ $('#fileNavigator').gsFileManager({ script: $SCRIPT_ROOT + "/fileBrowser", root: "workspace/"});
$("input#password").val(""); } else {
$("input#cpassword").val(""); $("#error").Popup(data.result, {type: 'error'});
} }
}); $("#imgwaitting").hide();
} $("#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;
});
function selectFile(file){ function selectFile(file) {
//nothing //nothing
return; return;
} }
}); });
\ No newline at end of file
$(document).ready( function() { /*jslint undef: true */
var editor; /*global $, document, window, $SCRIPT_ROOT, ace */
var send = false; /* vim: set et sts=4: */
var runnerDir = $("input#runnerdir").val();
$("#reloadfiles").click(function(){
fillContent();
});
fillContent();
function fillContent(){
$('#fileNavigator').gsFileManager({ script: $SCRIPT_ROOT+"/fileBrowser", root: runnerDir});
}
$("#open").click(function(){ $(document).ready(function () {
var elt = $("option:selected", $("#softwarelist")); "use strict";
if(elt.val() === "No Software Release found"){
$("#error").Popup("Please select your Software Release", {type:'alert', duration:5000}); var editor,
return false; send = false,
runnerDir = $("input#runnerdir").val();
function fillContent() {
$('#fileNavigator').gsFileManager({script: $SCRIPT_ROOT + "/fileBrowser", root: runnerDir});
} }
$.ajax({
type: "POST",
url: $SCRIPT_ROOT + '/setCurrentProject',
data: "path=" + elt.attr('rel'),
success: function(data){
if(data.code == 1){
location.href = $SCRIPT_ROOT + '/editSoftwareProfile'
}
else{
$("#error").Popup(data.result, {type:'error', duration:5000});
}
}
});
return false;
});
$("#delete").click(function(){ $("#reloadfiles").click(function () {
if($("#softwarelist").val() === "No Software Release found"){ fillContent();
$("#error").Popup("Please select your Software Release", {type:'alert', duration:5000}); });
fillContent();
$("#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',
data: "path=" + elt.attr('rel'),
success: function (data) {
if (data.code === 1) {
window.location.href = $SCRIPT_ROOT + '/editSoftwareProfile';
} else {
$("#error").Popup(data.result, {type: 'error', duration: 5000});
}
}
});
return false; return false;
} });
if(send) return;
if(!window.confirm("Do you really want to delete this software release?")){
return;
}
send = false;
var elt = $("option:selected", $("#softwarelist"));
$.ajax({
type: "POST",
url: $SCRIPT_ROOT + '/removeSoftwareDir',
data: {md5:$("#softwarelist").val(), title:elt.attr('title')},
success: function(data){
if(data.code == 1){
$("#softwarelist").empty();
for(var i=0; i<data.result.length; i++){
$("#softwarelist").append('<option value="' + data.result[i]['md5'] +
'" 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();
}
fillContent();
$("#error").Popup("Operation complete, Selected Software Release has been delete!", {type:'confirm', duration:5000});
}
else{
$("#error").Popup(data.result, {type:'error'});
}
send = false;
}
});
return false;
});
function setupEditor(){ $("#delete").click(function () {
editor = ace.edit("editor"); if ($("#softwarelist").val() === "No Software Release found") {
editor.setTheme("ace/theme/crimson_editor"); $("#error").Popup("Please select your Software Release", {type: 'alert', duration: 5000});
return false;
}
if (send) {
return;
}
if (!window.confirm("Do you really want to delete this software release?")) {
return;
}
send = false;
var elt = $("option:selected", $("#softwarelist"));
$.ajax({
type: "POST",
url: $SCRIPT_ROOT + '/removeSoftwareDir',
data: {
md5: $("#softwarelist").val(),
title: elt.attr('title')
},
success: function (data) {
var i;
if (data.code === 1) {
$("#softwarelist").empty();
for (i = 0; i < data.result.length; i += 1) {
$("#softwarelist").append('<option value="' + data.result[i].md5 +
'" 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();
}
fillContent();
$("#error").Popup("Operation complete, Selected Software Release has been delete!",
{type: 'confirm', duration: 5000});
} else {
$("#error").Popup(data.result, {type: 'error'});
}
send = false;
}
});
return false;
});
var CurentMode = require("ace/mode/text").Mode; function setupEditor() {
editor.getSession().setMode(new CurentMode()); editor = ace.edit("editor");
editor.getSession().setTabSize(2); editor.setTheme("ace/theme/crimson_editor");
editor.getSession().setUseSoftTabs(true);
editor.renderer.setHScrollBarAlwaysVisible(false); var CurentMode = require("ace/mode/text").Mode;
editor.setReadOnly(true); editor.getSession().setMode(new CurentMode());
} editor.getSession().setTabSize(2);
}); editor.getSession().setUseSoftTabs(true);
\ No newline at end of file editor.renderer.setHScrollBarAlwaysVisible(false);
editor.setReadOnly(true);
}
});
$(document).ready( function() { /*jslint undef: true */
var send = false; /*global $, document, window, $SCRIPT_ROOT */
//change background /* vim: set et sts=4: */
$("body").css("background", "#9C9C9C");
$("#login").click(function(){ $(document).ready(function () {
if (send) return false; "use strict";
if($("input#clogin").val() === "" || !$("input#clogin").val().match(/^[\w\d\.-]+$/)){
$("#error").Popup("Please enter a valid user name", {type:'alert', duration:3000}); var send = false;
return false; //change background
} $("body").css("background", "#9C9C9C");
if($("input#cpwd").val() === "" || $("input#cpwd").val() ==="******"){ $("#login").click(function () {
$("#error").Popup("Please enter your password", {type:'alert', duration:3000}); if (send) {
return false; return false;
} }
send = true; if ($("input#clogin").val() === "" || !$("input#clogin").val().match(/^[\w\d\.\-]+$/)) {
var param = {clogin:$("input#clogin").val(), cpwd:$("input#cpwd").val()}; $("#error").Popup("Please enter a valid user name", {type: 'alert', duration: 3000});
var url = $SCRIPT_ROOT + "/doLogin"; return false;
$("#login").removeClass("button").addClass("dsblebutton"); }
$.post(url, param, function(data) { if ($("input#cpwd").val() === "" || $("input#cpwd").val() === "******") {
if (data.code==1){ $("#error").Popup("Please enter your password", {type: 'alert', duration: 3000});
location.href = $SCRIPT_ROOT + '/'; return false;
} }
else{ send = true;
$("#error").Popup(data.result, {type:'alert', duration:3000}); var param = { clogin: $("input#clogin").val(), cpwd: $("input#cpwd").val() },
} url = $SCRIPT_ROOT + "/doLogin";
})
.error(function() { $("#login").removeClass("button").addClass("dsblebutton");
$("#error").Popup("Cannot send your account identifier please try again!!", $.post(url, param, function (data) {
{type:'alert', duration:3000});}) if (data.code === 1) {
.complete(function() { window.location.href = $SCRIPT_ROOT + '/';
$("#login").removeClass('dsblebutton').addClass('button'); } else {
send = false; $("#error").Popup(data.result, {type: 'alert', duration: 3000});
}
})
.error(function () {
$("#error").Popup("Cannot send your account identifier please try again!!",
{type: 'alert', duration: 3000});
})
.complete(function () {
$("#login").removeClass('dsblebutton').addClass('button');
send = false;
});
return false;
}); });
return false; });
});
});
\ No newline at end of file
This diff is collapsed.
$(document).ready( function() { /*jslint undef: true */
var method = $("input#method").val(); /*global $, document, window, $SCRIPT_ROOT */
var workdir = $("input#workdir").val(); /* vim: set et sts=4: */
if (method != "file"){
script = "/openFolder"; $(document).ready(function () {
$('#fileTree').fileTree({ root: workdir, script: $SCRIPT_ROOT + script, folderEvent: 'click', expandSpeed: 750, collapseSpeed: 750, multiFolder: false, selectFolder: true }, function(file) { "use strict";
selectFile(file);
}); var method = $("input#method").val(),
} workdir = $("input#workdir").val();
$("input#subfolder").val("");
$("#create").click(function(){ function checkFolder(path) {
repo_url = $("input#software").val(); $.ajax({
if($("input#software").val() == "" || !$("input#software").val().match(/^[\w\d._-]+$/)){ type: "POST",
$("#error").Popup("Invalid Software name", {type:'alert', duration:3000}) url: $SCRIPT_ROOT + '/checkFolder',
return false; data: "path=" + path,
} success: function (data) {
if($("input#subfolder").val() == ""){ var path = data.result;
$("#error").Popup("Select the parent folder of your software!", {type:'alert', duration:3000}) $("input#path").val(path);
return false; if (path !== "") {
} $("#check").fadeIn('normal');
$.ajax({ } else {
type: "POST", $("#check").hide();
url: $SCRIPT_ROOT + '/createSoftware', }
data: "folder=" + $("input#subfolder").val() + $("input#software").val(), }
success: function(data){ });
if(data.code == 1){ return "";
location.href = $SCRIPT_ROOT + '/editSoftwareProfile' }
}
else{ function selectFile(file) {
$("#error").Popup(data.result, {type:'error', duration:5000}) $("#info").empty();
$("input#subfolder").val(file);
} if (method === "open") {
} $("#info").append("Selection: " + file);
}); checkFolder(file);
return false; } else {
}); if ($("input#software").val() !== "" && $("input#software").val().match(/^[\w\d._\-]+$/)) {
$("#info").append("New Software in: " + file + $("input#software").val());
$("#open").click(function(){ } else {
$("#flash").fadeOut('normal'); $("#info").append("Selection: " + file);
$("#flash").empty(); }
$("#flash").fadeIn('normal'); }
if($("input#path").val() == ""){ return;
$("#error").Popup("Select a valid Software Release folder!", {type:'alert', duration:3000}) }
return false;
} if (method !== "file") {
$.ajax({ $('#fileTree').fileTree({root: workdir, script: $SCRIPT_ROOT + '/openFolder', folderEvent: 'click', expandSpeed: 750, collapseSpeed: 750, multiFolder: false, selectFolder: true }, function (file) {
type: "POST", selectFile(file);
url: $SCRIPT_ROOT + '/setCurrentProject', });
data: "path=" + $("input#path").val(), }
success: function(data){ $("input#subfolder").val("");
if(data.code == 1){ $("#create").click(function () {
location.href = $SCRIPT_ROOT + '/editSoftwareProfile' if ($("input#software").val() === "" || !$("input#software").val().match(/^[\w\d._\-]+$/)) {
} $("#error").Popup("Invalid Software name", {type: 'alert', duration: 3000});
else{ return false;
$("#error").Popup(data.result, {type:'error', duration:5000}) }
} if ($("input#subfolder").val() === "") {
} $("#error").Popup("Select the parent folder of your software!", {type: 'alert', duration: 3000});
}); return false;
return false; }
}); $.ajax({
type: "POST",
function selectFile(file){ url: $SCRIPT_ROOT + '/createSoftware',
$("#info").empty(); data: "folder=" + $("input#subfolder").val() + $("input#software").val(),
$("input#subfolder").val(file); success: function (data) {
path = ""; if (data.code === 1) {
if(method == "open"){ window.location.href = $SCRIPT_ROOT + '/editSoftwareProfile';
$("#info").append("Selection: " + file); } else {
checkFolder(file); $("#error").Popup(data.result, {type: 'error', duration: 5000});
} }
else{ }
if($("input#software").val() != "" && $("input#software").val().match(/^[\w\d._-]+$/)){ });
$("#info").append("New Software in: " + file + $("input#software").val()); return false;
} });
else{
$("#info").append("Selection: " + file); $("#open").click(function () {
} $("#flash").fadeOut('normal');
} $("#flash").empty();
return; $("#flash").fadeIn('normal');
} if ($("input#path").val() === "") {
$("#error").Popup("Select a valid Software Release folder!", {type: 'alert', duration: 3000});
function checkFolder(path){ return false;
$.ajax({ }
type: "POST", $.ajax({
url: $SCRIPT_ROOT + '/checkFolder', type: "POST",
data: "path=" + path, url: $SCRIPT_ROOT + '/setCurrentProject',
success: function(data){ data: "path=" + $("input#path").val(),
var path = data.result; success: function (data) {
$("input#path").val(path); if (data.code === 1) {
if (path != ""){ window.location.href = $SCRIPT_ROOT + '/editSoftwareProfile';
$("#check").fadeIn('normal'); } else {
} $("#error").Popup(data.result, {type: 'error', duration: 5000});
else{ }
$("#check").hide(); }
} });
} return false;
}); });
return ""; });
}
});
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
/*jslint undef: true */
/*global $, document, window, $SCRIPT_ROOT, ace */
/* vim: set et sts=4: */
$(document).ready(function () {
"use strict";
$('#fileNavigator').gsFileManager({script: $SCRIPT_ROOT + "/fileBrowser", root:'workspace/'});
});
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
</div> </div>
<br/> <br/>
<h2>Set your Security Mode</h2> <h2>Set your Security Mode</h2>
<div class="menu-box-right" style="width: 592px;"> <div class="menu-box-right">
<div style="background:#fff; padding:10px; min-height:100px; font-size:14px;"> <div style="background:#fff; padding:10px; min-height:100px; font-size:14px;">
<div id="box0"> <div id="box0">
<h2>Clone Repository without using HTTPS and SSH</h2><br/> <h2>Clone Repository without using HTTPS and SSH</h2><br/>
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
</div> </div>
<div id="box2" style="display:none;"> <div id="box2" style="display:none;">
<h2>Enter your username and password for https authentication access</h2><br/> <h2>Enter your username and password for https authentication access</h2><br/>
<div style="margin-left:80px; margin-bottom:20px;"> <div style="margin-left:140px; margin-bottom:20px;">
<label for='username'>Your username:&nbsp;&nbsp;</label> <label for='username'>Your username:&nbsp;&nbsp;</label>
<input type="text" name="username" id="username" size='20' value="Enter your username..." /><br/><br/> <input type="text" name="username" id="username" size='20' value="Enter your username..." /><br/><br/>
<label for='password'>Your password: &nbsp;&nbsp;</label> <label for='password'>Your password: &nbsp;&nbsp;</label>
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="menu-box-left" style="width: 115px;"> <div class="menu-box-left">
<ul id="modelist"> <ul id="modelist">
<li class="checked"><input type="radio" name="security" id="nothing" value="nothing" /><label for="nothing">ReadOnly</label></li> <li class="checked"><input type="radio" name="security" id="nothing" value="nothing" /><label for="nothing">ReadOnly</label></li>
<li><input type="radio" name="security" id="ssh" value="SSH" checked /><label for="ssh">SSH Mode</label></li> <li><input type="radio" name="security" id="ssh" value="SSH" checked /><label for="ssh">SSH Mode</label></li>
......
...@@ -24,17 +24,15 @@ ...@@ -24,17 +24,15 @@
</form> </form>
<div id="tooltip-editOption" style="display:none"> <div id="tooltip-editOption" style="display:none">
<span class="list">MD5 SUM for the current file</span> <span class="list">MD5 SUM for the current file</span>
<div style="margin-top:3px; margin-bottom:5px;border-bottom: 1px dashed #666666; heigth:1px"></div>
<a id='getmd5' href="#">Get or Update md5sum</a> <a id='getmd5' href="#">Get or Update md5sum</a>
<br/><span class="list">Add Project to Develop</span><br/> <div class="sep"></div>
<div style="margin-top:3px;border-bottom: 1px dashed #666666; heigth:1px"></div> <span class="list">Add Project to Develop</span>
<ul id="plist"> <ul id="plist">
{% for name in projectList%} {% for name in projectList%}
<li><input type="checkbox" name="develop" value="{{name}}" id="{{name}}"> <li><input type="checkbox" name="develop" value="{{name}}" id="{{name}}">
<label>{{name}}</label></li> <label>{{name}}</label></li>
{% endfor %} {% endfor %}
</ul> </ul>
<br/>
<a href="#" id="adddevelop" class="lshare">Add to profile</a> <a href="#" id="adddevelop" class="lshare">Add to profile</a>
</div> </div>
{% endblock %} {% endblock %}
......
...@@ -23,6 +23,11 @@ ...@@ -23,6 +23,11 @@
<img src="{{ url_for('static', filename='images/manage_repo.png') }}" /> <img src="{{ url_for('static', filename='images/manage_repo.png') }}" />
</div> </div>
<div class="clear"></div> <div class="clear"></div>
<div class="umenu">
<h2><a href="{{ url_for('myAccount')}}">Your Account</a></h2>
<p>Update your account informations</p>
<img src="{{ url_for('static', filename='images/user_card.png') }}" />
</div>
<div class="lmenu smaller"> <div class="lmenu smaller">
<h2><a href="{{ url_for('openProject', method='new')}}">Create your Software Release</a></h2> <h2><a href="{{ url_for('openProject', method='new')}}">Create your Software Release</a></h2>
<p>To create a new Software Release, choose the project directory in which you want to create your software.<!-- You will then be able to edit and <p>To create a new Software Release, choose the project directory in which you want to create your software.<!-- You will then be able to edit and
...@@ -31,11 +36,6 @@ ...@@ -31,11 +36,6 @@
<img src="{{ url_for('static', filename='images/folder_blue.png') }}" /> <img src="{{ url_for('static', filename='images/folder_blue.png') }}" />
<div class="clear"></div> <div class="clear"></div>
</div> </div>
<div class="umenu">
<h2><a href="{{ url_for('myAccount')}}">Your Account</a></h2>
<p>Update your account informations</p>
<img src="{{ url_for('static', filename='images/user_card.png') }}" />
</div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
</div> </div>
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<ul> <ul>
<li><a href="#tab1" class="active">Slapgrid Supervisor</a></li> <li><a href="#tab1" class="active">Slapgrid Supervisor</a></li>
<li><a href="#tab2">SLAP Response</a></li> <li><a href="#tab2">SLAP Response</a></li>
<li><a href="#tab3" id="parameterTab">Parameters</a></li> <li><a href="#tab3" id="parameterTab">SLAP Parameters</a></li>
<li><a href="#tab4" id="instancetabfiles">Partitions Content</a></li> <li><a href="#tab4" id="instancetabfiles">Partitions Content</a></li>
</ul><!-- //Tab buttons --> </ul><!-- //Tab buttons -->
<div class="tabDetails"> <div class="tabDetails">
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<div id="tab2" class="tabContents"> <div id="tab2" class="tabContents">
{% if slap_status %} {% if slap_status %}
<p>Uses parameters below to run your application</p> <p>Uses parameters below to run your application</p>
<div class="menu-box-right" style="width: 597px;"> <div class="menu-box-right">
<div style="background:#fff; padding:10px;"> <div style="background:#fff; padding:10px;">
{% for item in slap_status %} {% for item in slap_status %}
<div id="box{{item[0]}}" style="display:none;"> <div id="box{{item[0]}}" style="display:none;">
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
</h2> </h2>
<div class="clear"></div><br/> <div class="clear"></div><br/>
<div id="bcontent{{item[0]}}"> <div id="bcontent{{item[0]}}">
<table cellpadding="0" cellspacing="0" width="577"> <table cellpadding="0" cellspacing="0" width="100%">
<tr> <tr>
<th>Parameter Name</th><th>Parameter Value</th> <th>Parameter Name</th><th>Parameter Value</th>
</tr> </tr>
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
{% endfor %} {% endfor %}
</div> </div>
</div> </div>
<div class="menu-box-left" style="width: 110px;"> <div class="menu-box-left">
<ul id="slappart"> <ul id="slappart">
{% for item in slap_status %} {% for item in slap_status %}
<li><input type="radio" name="slapresponse" id="{{item[0]}}" value="{{item[0]}}" /> <li><input type="radio" name="slapresponse" id="{{item[0]}}" value="{{item[0]}}" />
...@@ -143,6 +143,5 @@ ...@@ -143,6 +143,5 @@
</div> </div>
</div> </div>
{{instance}}
{% endblock %} {% endblock %}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -18,6 +18,6 @@ ...@@ -18,6 +18,6 @@
<label for="slow">From time to time</label> <label for="slow">From time to time</label>
</div> </div>
<br/> <br/>
<div class="log_content"><textarea class="log" readonly id="salpgridLog"></textarea> <div class="log_content"><div class="log" id="salpgridLog"></div>
<textarea class="log" readonly id="manualLog" style="display:none">{{result}}</textarea></div> <textarea class="log" readonly id="manualLog" style="display:none">{{result}}</textarea></div>
{% endblock %} {% endblock %}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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