Skip to content

Commit

Permalink
Merge pull request #100 from kuafuai/ui
Browse files Browse the repository at this point in the history
bug fix
  • Loading branch information
booboosui committed Sep 3, 2023
2 parents c0d15f9 + c7f38a9 commit 478a2eb
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 13 deletions.
4 changes: 2 additions & 2 deletions backend/app/controllers/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ def create():
def gitpush():
_ = getI18n("controllers")
username = session['username']
commitMsg = session[username]['memory']['originalPrompt']
requirementID = request.json.get('task_id')
serviceName = request.json.get('service_name')
fatureBranch = session[username]['memory']['task_info']['feature_branch']
wsPath = get_ws_path(requirementID)
req = Requirement.get_requirement_by_id(requirementID)
commitMsg = req["requirement_name"]
fatureBranch = req["default_target_branch"]
gitPath, success = getServiceGitPath(req["app_id"], serviceName)
tenantID = session['tenant_id']
username = session['username']
Expand Down
4 changes: 2 additions & 2 deletions backend/app/models/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def get_all_application(tenant_id, appID):
applications = Application.query.order_by(Application.app_id.desc()).all()
if appID:
applications = Application.query.filter_by(app_id=appID).all()
if tenant_id:
else:
applications = Application.query.filter_by(tenant_id=tenant_id).all()

application_list = []
Expand Down Expand Up @@ -84,4 +84,4 @@ def update_application(app_id, **kwargs):
setattr(app, key, value)
db.session.commit()
return app
return None
return None
10 changes: 5 additions & 5 deletions backend/app/models/application_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ApplicationService(db.Model):
role = db.Column(db.Text)
language = db.Column(db.String(50))
framework = db.Column(db.String(50))
database = db.Column(db.String(50))
database_type = db.Column(db.String(50))
api_type = db.Column(db.String(50))
api_location = db.Column(db.String(255))
struct_cache = db.Column(db.Text)
Expand All @@ -29,7 +29,7 @@ class ApplicationService(db.Model):

LANGUAGE_JAVA = "Java"

def create_service(app_id, name, git_path, git_workflow, role, language, framework, database, api_type, api_location,
def create_service(app_id, name, git_path, git_workflow, role, language, framework, database_type, api_type, api_location,
cd_container_name, cd_container_group, cd_region, cd_public_ip, cd_security_group, cd_subnet, struct_cache):
service = ApplicationService(
app_id=app_id,
Expand All @@ -40,7 +40,7 @@ def create_service(app_id, name, git_path, git_workflow, role, language, framewo
role=role,
language=language,
framework=framework,
database=database,
database_type=database_type,
api_type=api_type,
api_location=api_location,
cd_container_name=cd_container_name,
Expand Down Expand Up @@ -79,7 +79,7 @@ def get_service_by_name(appID, service_name):
'role': service.role,
'language': service.language,
'framework': service.framework,
'database': service.database,
'database_type': service.database_type,
'api_type': service.api_type,
'api_location': service.api_location,
'cd_container_name': service.cd_container_name,
Expand Down Expand Up @@ -137,7 +137,7 @@ def get_services_by_app_id(cls, app_id):
'role': service.role,
'language': service.language,
'framework': service.framework,
'database': service.database,
'database_type': service.database_type,
'api_type': service.api_type,
'api_location': service.api_location,
'cd_container_name': service.cd_container_name,
Expand Down
2 changes: 1 addition & 1 deletion frontend/static/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ function showApp(appID) {
</div>
<div class="field">
<label>`+globalFrontendText["service_database"]+`</label>
<input type="text" id="service_database_`+idx+`" value="`+service.database+`">
<input type="text" id="service_database_`+idx+`" value="`+service.database_type+`">
</div>
<div class="field">
<label>`+globalFrontendText["service_code_struct"]+`</label>
Expand Down
9 changes: 7 additions & 2 deletions frontend/static/js/coder.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
var globalTenantID = 0
var globalContext = []
var globalMemory = {}
var globalTasks = []
Expand Down Expand Up @@ -465,6 +466,7 @@ function logincheck() {
successCallback = function(data) {
var username = data.data.username
var tenant = data.data.tenant_name
globalTenantID = data.data.tenant_id
$("#current-username").html(username)
$("#current-tenant").html(tenant)
$("#watermark-username").html(username)
Expand All @@ -484,7 +486,7 @@ function logincheck() {
}
}

sendAjaxRequest('/requirement/clear_up', 'GET', info, successCallback, errorCallback, true, false)
sendAjaxRequest('/requirement/clear_up', 'GET', info, successCallback, errorCallback, false, false)
}

function logout() {
Expand Down Expand Up @@ -1525,5 +1527,8 @@ function getTenantID() {
var queryString = window.location.search;
var params = new URLSearchParams(queryString);
var tenant_id = params.get('tenant_id');
if (!tenant_id) {
tenant_id = globalTenantID
}
return tenant_id
}
}
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ python-gitlab
openai==0.27.8
aliyun-python-sdk-core
aliyun-python-sdk-eci
alembic
alembic
mysqlclient

0 comments on commit 478a2eb

Please sign in to comment.