Skip to content

Commit fbbd3e9

Browse files
committed
Added templates folder to support app.py for rendering UI
1 parent 9e0b283 commit fbbd3e9

2 files changed

Lines changed: 149 additions & 0 deletions

File tree

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<!-- Copyright 2026 Google LLC
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License. -->
14+
15+
<!-- [START alm_ui_sample] -->
16+
<!DOCTYPE html>
17+
<html lang="en">
18+
<head>
19+
<meta charset="UTF-8">
20+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
21+
<title>Generate API</title>
22+
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap" rel="stylesheet">
23+
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
24+
</head>
25+
<body>
26+
27+
<div class="gcp-header">
28+
<h1>Market Place Integration</h1>
29+
</div>
30+
31+
<div class="card" style="max-width: 550px;">
32+
<h2>Step 1: Generate API</h2>
33+
34+
<form method="POST" action="/">
35+
36+
<div class="form-group">
37+
<label for="apigee_org">Apigee Organization (APIGEE_ORG)</label>
38+
<input type="text" name="apigee_org" id="apigee_org" value="PROJECT_ID" required>
39+
</div>
40+
41+
<div class="form-group">
42+
<label for="service_account">Service Account (For gcloud Impersonation)</label>
43+
<input type="text" name="service_account" id="service_account" value="SERVICE_ACCOUNT" required>
44+
</div>
45+
46+
<button type="submit">Generate API</button>
47+
</form>
48+
49+
{% if action_result %}
50+
<div class="result-alert">
51+
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z"/></svg>
52+
<span><strong>{{ action_result }}</strong></span>
53+
</div>
54+
{% endif %}
55+
56+
{% if error %}
57+
<div class="result-alert" style="background-color: #fce8e6; color: #c5221f;">
58+
<span><strong>Deployment Failed:</strong> {{ error }}</span>
59+
</div>
60+
{% endif %}
61+
62+
<hr style="margin: 30px 0 20px 0; border: 0; border-top: 1px solid #dadce0;">
63+
64+
<a href="{{ url_for('deploy_page') }}" class="secondary-btn">Next Page &rarr;</a>
65+
</div>
66+
67+
</body>
68+
</html>
69+
<!-- [END alm_ui_sample] -->
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<!-- Copyright 2026 Google LLC
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License. -->
14+
15+
<!-- [START alm_ui_sample] -->
16+
17+
<!DOCTYPE html>
18+
<html lang="en">
19+
<head>
20+
<meta charset="UTF-8">
21+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
22+
<title>GCP Region Selector</title>
23+
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap" rel="stylesheet">
24+
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
25+
<style>
26+
.button-group {
27+
display: flex;
28+
gap: 10px;
29+
margin-top: 15px;
30+
}
31+
.back-btn { display: inline-block; margin-bottom: 20px; color: #1a73e8; text-decoration: none;}
32+
</style>
33+
</head>
34+
<body>
35+
36+
<div class="gcp-header">
37+
<h1>Market Place Integration</h1>
38+
</div>
39+
40+
<div class="card">
41+
<a href="{{ url_for('generate_api') }}" class="back-btn">&larr; Back to Step 1</a>
42+
<h2>Apigee to ALM</h2>
43+
44+
<form method="POST" action="/deploy">
45+
<div class="form-group">
46+
<label for="region">Location</label>
47+
<select name="region" id="region" required>
48+
<option value="" disabled selected>Select a region...</option>
49+
{% for region in regions %}
50+
<option value="{{ region }}" {% if selected_region == region %}selected{% endif %}>
51+
{{ region }}
52+
</option>
53+
{% endfor %}
54+
</select>
55+
</div>
56+
57+
<div class="button-group">
58+
<button type="submit" name="action" value="deploy">Deploy to Region</button>
59+
<button type="submit" name="action" value="status">Get Status</button>
60+
</div>
61+
</form>
62+
63+
{% if api_response and not api_response.error %}
64+
<div class="result-alert">
65+
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z"/></svg>
66+
<span>Successfully configured for <strong>{{ selected_region }}</strong></span>
67+
</div>
68+
{% endif %}
69+
70+
{% if operation_state %}
71+
<div class="result-alert" style="margin-top: 15px; background-color: #f0f4f8;">
72+
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z"/></svg>
73+
<span>State: <strong>{{ operation_state }}</strong></span>
74+
</div>
75+
{% endif %}
76+
</div>
77+
78+
</body>
79+
</html>
80+
<!-- [END alm_ui_sample] -->

0 commit comments

Comments
 (0)