many improvements from Vladyslav
This commit is contained in:
@@ -197,7 +197,7 @@ def select():
|
||||
_name='update_fields', _value=request.vars.update_fields
|
||||
or '')), TR(T('Delete:'), INPUT(_name='delete_check',
|
||||
_class='delete', _type='checkbox', value=False), ''),
|
||||
TR('', '', INPUT(_type='submit', _value='submit'))),
|
||||
TR('', '', INPUT(_type='submit', _value=T('submit')))),
|
||||
_action=URL(r=request,args=request.args))
|
||||
if request.vars.csvfile != None:
|
||||
try:
|
||||
|
||||
@@ -42,7 +42,7 @@ def commit():
|
||||
path = apath(app, r=request)
|
||||
repo = hg_repo(path)
|
||||
form = FORM('Comment:',INPUT(_name='comment',requires=IS_NOT_EMPTY()),
|
||||
INPUT(_type='submit',_value='Commit'))
|
||||
INPUT(_type='submit',_value=T('Commit')))
|
||||
if form.accepts(request.vars,session):
|
||||
oldid = repo[repo.lookup('.')]
|
||||
addremove(repo)
|
||||
@@ -69,7 +69,7 @@ def revision():
|
||||
repo = hg_repo(path)
|
||||
revision = request.args(1)
|
||||
ctx=repo.changectx(revision)
|
||||
form=FORM(INPUT(_type='submit',_value='revert'))
|
||||
form=FORM(INPUT(_type='submit',_value=T('Revert')))
|
||||
if form.accepts(request.vars):
|
||||
hg.update(repo, revision)
|
||||
session.flash = "reverted to revision %s" % ctx.rev()
|
||||
|
||||
@@ -3,15 +3,15 @@ from distutils import dir_util
|
||||
try:
|
||||
from git import *
|
||||
except ImportError:
|
||||
session.flash = 'requires python-git, but not installed'
|
||||
session.flash = T('requires python-git, but not installed')
|
||||
redirect(URL('default','site'))
|
||||
|
||||
def deploy():
|
||||
apps = sorted(file for file in os.listdir(apath(r=request)))
|
||||
form = SQLFORM.factory(
|
||||
Field('osrepo',default='/tmp',label='Path to local openshift repo root.',
|
||||
Field('osrepo',default='/tmp',label=T('Path to local openshift repo root.'),
|
||||
requires=EXISTS(error_message=T('directory not found'))),
|
||||
Field('osname',default='web2py',label='WSGI reference name'),
|
||||
Field('osname',default='web2py',label=T('WSGI reference name')),
|
||||
Field('applications','list:string',
|
||||
requires=IS_IN_SET(apps,multiple=True),
|
||||
label=T('web2py apps to deploy')))
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
<br/><br/><h3>{{=T("Import/Export")}}</h3><br/>
|
||||
[ <a href="{{=URL('csv',args=request.args[0],vars=dict(query=query))}}">{{=T("export as csv file")}}</a> ]
|
||||
{{if table:}}
|
||||
{{=FORM(str(T('or import from csv file'))+" ",INPUT(_type='file',_name='csvfile'),INPUT(_type='hidden',_value=table,_name='table'),INPUT(_type='submit',_value='import'))}}
|
||||
{{=FORM(str(T('or import from csv file'))+" ",INPUT(_type='file',_name='csvfile'),INPUT(_type='hidden',_value=table,_name='table'),INPUT(_type='submit',_value=T('import')))}}
|
||||
{{pass}}
|
||||
|
||||
|
||||
|
||||
@@ -12,20 +12,20 @@ $(document).ready(function() {
|
||||
});
|
||||
</script>
|
||||
|
||||
<h2>OpenShift Deployment Interface</h2>
|
||||
<h2>{{=T("OpenShift Deployment Interface")}}</h2>
|
||||
|
||||
<p class="help">{{=T("This page can commit your changes to an openshift app repo and push them to your cloud instance. This assumes that you've already created the application instance using the web2py skeleton and have that repo somewhere on a filesystem that this web2py instance can access. This functionality requires GitPython installed and on the python path of the runtime that web2py is operating in.")}}</p>
|
||||
|
||||
<p class="help">{{=T("Note: If you receive an error with github status code of 128, ensure the system and account you are deploying from has a cooresponding ssh key configured in the openshift account.")}}</p>
|
||||
|
||||
{{if command:}}
|
||||
<h3>Command</h3>
|
||||
<button onclick="$.get('{{=URL(r=request,f='kill')}}');">kill process</button>
|
||||
<h3>{{=T("Command")}}</h3>
|
||||
<button onclick="$.get('{{=URL(r=request,f='kill')}}');">{{=T("kill process")}}</button>
|
||||
{{=CODE(command)}}
|
||||
<h3>OpenShift Output</h3>
|
||||
<h3>{{=T("OpenShift Output")}}</h3>
|
||||
<pre id="target"></pre>
|
||||
{{else:}}
|
||||
<h3>Deployment form</h3>
|
||||
<h3>{{=T("Deployment form")}}</h3>
|
||||
<div class="deploy_form form">
|
||||
{{=form}}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user