diff --git a/plugins/gae/index.html b/plugins/gae/index.html index 67d4a11bb..c03a47aca 100755 --- a/plugins/gae/index.html +++ b/plugins/gae/index.html @@ -20,8 +20,8 @@ function readme(){ var html = '
开发文档:https://cloud.google.com/sdk/docs/
'; html += '* 注意:本插件通过Google JSON 格式赋权免交互式
'; html += '* 注意:添加:gcloud auth activate-service-account --key-file [KEY_FILE] << y
'; - html += '* 注意:设置后,一般同步项目命令:gcloud app deploy << y
'; + html += '* 注意:可以查看命令,把命令加入到脚本中...自动更新。
'; $('.bt-w-main .soft-man-con').html(html); } \ No newline at end of file diff --git a/plugins/gae/index.py b/plugins/gae/index.py index d992aa390..3fd9be603 100755 --- a/plugins/gae/index.py +++ b/plugins/gae/index.py @@ -115,7 +115,7 @@ def projectListAsync(): file = getServerDir() + '/' + args['name'] + '.json' if not os.path.exists(file): - return 'file not exists!' + return 'not configured file!' content = public.readFile(file) contentObj = json.loads(content) @@ -132,6 +132,42 @@ def projectListAsync(): return 'ok' +def projectListCmd(): + args = getArgs() + if not 'name' in args: + return 'missing name!' + + file = getServerDir() + '/' + args['name'] + '.json' + if not os.path.exists(file): + return 'not configured file!' + + content = public.readFile(file) + contentObj = json.loads(content) + asyncUser = contentObj['client_email'] + cmd = getServerDir() + '/google-cloud-sdk/bin/' + projectDir = public.getWwwDir() + '/' + args['name'] + asyncCmd = 'cd ' + projectDir + ' && ' + cmd + 'gcloud app deploy << y' + return asyncCmd + + +def projectListUrl(): + args = getArgs() + if not 'name' in args: + return 'missing name!' + + file = getServerDir() + '/' + args['name'] + '.json' + if not os.path.exists(file): + return 'not configured file!' + + content = public.readFile(file) + contentObj = json.loads(content) + asyncUser = contentObj['client_email'] + plist = asyncUser.split('@') + + url = 'https://' + plist[0] + '.appspot.com' + return url + + def projectList(): args = getArgs() @@ -172,5 +208,9 @@ if __name__ == "__main__": print projectListDel() elif func == 'project_list_async': print projectListAsync() + elif func == 'project_list_cmd': + print projectListCmd() + elif func == 'project_list_url': + print projectListUrl() else: print 'error' diff --git a/plugins/gae/js/gae.js b/plugins/gae/js/gae.js index bf1a3d1e3..859a945e6 100755 --- a/plugins/gae/js/gae.js +++ b/plugins/gae/js/gae.js @@ -55,7 +55,8 @@ function projectList(page, search){ '