-
Notifications
You must be signed in to change notification settings - Fork 71
/
Copy pathapp.htm
290 lines (281 loc) · 13.6 KB
/
app.htm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>PromptAppGPT: A rapid prompt app development framework based on GPT</title>
<link rel="icon" type="image/x-icon" href="./images/idea.png">
<link rel="stylesheet" href="./css/codemirror.css">
<link rel="stylesheet" href="./css/codemirror-blackboard-m.css">
<link rel="stylesheet" href="./css/halfmoon-variables.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body class="with-custom-webkit-scrollbars with-custom-css-scrollbars">
<div id="main_app">
<!-- Page wrapper with .with-navbar class -->
<div class="page-wrapper with-navbar">
<!-- Navbar (immediate child of the page wrapper) -->
<div class="sticky-alerts">
<div class="alert alert-danger filled-dm alert-block position-sticky" role="alert" v-if="alert !== null">
<button class="close" @click="closeAlert()" type="button" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h4 class="alert-heading">{{alert.title}}</h4>
{{alert.content}}.
</div>
</div>
<nav class="navbar">
<!-- Navbar brand -->
<a href="#" class="navbar-brand">
<!--<img src="..." alt="...">-->
<span class="mr-5 text-success"><i class="fa fa-rocket fa-3x" aria-hidden="true"></i></span>
<span class="font-weight-bold font-italic">{{theUiText.PromptAppGPT}}</span>
</a>
<!-- Navbar nav -->
<ul class="navbar-nav d-none d-md-flex"> <!-- d-none = display: none, d-md-flex = display: flex on medium screens and up (width > 768px) -->
<li class="nav-item">
<a href="http://PromptAppGPT.wangzhishi.net" class="nav-link">{{theUiText.Home}}</a>
</li>
<li class="nav-item">
<a href="#license" class="nav-link">{{theUiText.License}}</a>
</li>
<li class="nav-item">
<a href="https://github.com/mleoking/PromptAppGPT" class="nav-link"><i class="fa fa-github" aria-hidden="true"></i></a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">{{theUiText.SelectApp}}:</span>
</div>
<select class="form-control" v-model="appCodeSelected" @change="onAppCodeSelectedChange()">
<option v-for="option in appOptions" :value="option.code">
{{ option.name }}
</option>
</select>
</div>
</a>
</li>
</ul>
<div class="ml-auto">
<ul class="navbar-nav d-none d-md-flex">
<li class="nav-item">
<a href="#" class="nav-link" @click="changEditMode()">
<i class="fa fa-pencil" aria-hidden="true"></i>
</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link" @click="changUiMode()">
<!--<div class="custom-switch">
<input type="checkbox" id="switch_dark" value="" checked="checked" @click="changUiMode()">
<label for="switch_dark">Dark</label>
</div>
-->
<i class="fa fa-moon-o" aria-hidden="true"></i>
</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link" @click="changUiText()">
<i class="fa fa-language" aria-hidden="true"></i>
</a>
</li>
<li class="nav-item">
<a href="#settings" class="nav-link">
<i class="fa fa-cog" aria-hidden="true"></i>
</a>
</li>
<!---<li class="nav-item">
<a href="#" class="nav-link" @click="doTest()">
doTest
</a>
</li>--->
</ul>
</div>
</nav>
<!-- Content wrapper -->
<div class="content-wrapper">
<div class="modal" id="license" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<h5 class="modal-title">License</h5>
<span>MIT License
Copyright (c) 2023-present, Changwang ZHANG.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
</span>
<div class="text-right mt-20"> <!-- text-right = text-align: right, mt-20 = margin-top: 2rem (20px) -->
<a href="#" class="btn btn-primary" role="button"><i class="fa fa-times mr-5" aria-hidden="true"></i>{{theUiText.Close}}</a>
</div>
</div>
</div>
</div>
<div class="modal" id="settings" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<h5 class="modal-title">{{theUiText.Settings}}</h5>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">{{theUiText.OpenAIKey}}:</span>
</div>
<input type="text" class="form-control" placeholder="Input" v-model="openaiApiKey">
</div>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">{{theUiText.OpenAIApiProxy}}:</span>
</div>
<input type="text" class="form-control" placeholder="Input" v-model="openaiApiProxy">
</div>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">{{theUiText.OpenAIGptModel}}:</span>
</div>
<input type="text" class="form-control" placeholder="Input" v-model="openaiGptModel">
</div>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">{{theUiText.CorsProxy}}:</span>
</div>
<input type="text" class="form-control" placeholder="Input" v-model="corsProxy">
</div>
<div class="text-right mt-20"> <!-- text-right = text-align: right, mt-20 = margin-top: 2rem (20px) -->
<a href="#" class="btn btn-primary" role="button"><i class="fa fa-times mr-5" aria-hidden="true"></i>{{theUiText.Close}}</a>
</div>
</div>
</div>
</div>
<div class="modal" id="websecurity" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<h5 class="modal-title">{{theUiText.WebSecurityErrorTitle}}</h5>
<div><span>{{theUiText.WebSecurityErrorGuideWin}}</span></div>
<div>-------------</div>
<div><span>{{theUiText.WebSecurityErrorGuideMac}}</span></div>
<div class="text-right mt-20"> <!-- text-right = text-align: right, mt-20 = margin-top: 2rem (20px) -->
<a href="#" class="btn btn-primary" role="button"><i class="fa fa-times mr-5" aria-hidden="true"></i>{{theUiText.Close}}</a>
</div>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row">
<!-- First column -->
<div :class="enableAppEdit ? 'col-sm-6' : 'col-sm-6 d-none'"> <!--class="col-sm d-none" -->
<div class="card">
<h2 class="card-title ">
<p class="text-center">{{ appCodeSelected }} </p>
</h2>
<p>
<textarea id="app-code" class="form-control form-control-lg" v-model="appCode"></textarea>
</p>
<div class="text-center">
<button class="btn btn-primary" type="button" @click="compile()">
<i class="fa fa-play-circle-o mr-5" aria-hidden="true"></i>
{{theUiText.Compile}}
</button>
</div>
</div>
</div>
<!-- Second column -->
<div class="col-sm">
<div class="card">
<h2 class="card-title">
<p class="text-center"> {{ appName }} <i class="fa fa-lightbulb-o" aria-hidden="true"></i> {{ uiAppAuthor() }}</p>
</h2>
<div class="content">
<p class="text-center">{{ uiAppDescription() }}</p>
</div>
<div class="content text-center">
<h2 class="content-title">
<i class="fa fa-user-circle fa-3x text-secondary" aria-hidden="true"></i>
</h2>
<div v-for="input in appUiInputs">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">{{ input.label }}</span>
</div>
<select class="form-control" v-if="input.type === 'select'" v-model="input.value">
<option v-for="option in input.options" :value="option">
{{ option }}
</option>
</select>
<input type="text" class="form-control" v-if="input.type === 'input'" v-model="input.value">
<textarea class="form-control form-control-sm" v-if="input.type === 'textarea'" v-model="input.value"></textarea>
</div>
</div>
</div>
<div class="text-center">
<button class="btn btn-primary" type="button" @click="appRun()">
<i class="fa fa-bolt mr-5" aria-hidden="true"></i>
{{theUiText.Run}}
</button>
<button class="btn ml-10" type="button" @click="appReset()">
<i class="fa fa-leaf mr-5" aria-hidden="true"></i>
{{theUiText.Reset}}
</button>
</div>
<!--<div class="d-flex">
<div class="m-auto">
<ul class="navbar-nav d-none d-md-flex">
<li class="nav-item">
<a href="#" class="nav-link">
<i class="fa fa-bolt fa-2x" aria-hidden="true"></i>
</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">
<i class="fa fa-leaf fa-2x" aria-hidden="true"></i>
</a>
</li>
</ul>
</div>
</div>
-->
<div class="content text-center">
<h2 class="content-title">
<i class="fa fa-grav fa-3x text-secondary" aria-hidden="true"></i>
</h2>
<div class="border" v-for="output in uiOutput()">
<span v-for="option in output.options">
<img v-if="option.type === 'img'" :src="option.value" class="img-fluid" :alt="option.label">
<a v-if="option.type === 'a'" :href="option.value">{{ option.label }}</a>
<span v-if="option.type === 'span'">{{ option.value }}</span>
</span>
</div>
<!--
<div v-for="output in appTaskOutputs">
{{ output }}
</div>
-->
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="./js/js-yaml.min.js"></script>
<script src="./js/vue.global.prod.min.js"></script>
<!--<script src="./js/vue-router.global.js"></script>-->
<script src="./js/halfmoon.min.js"></script>
<script src="./js/codemirror.js"></script>
<script src="./js/codemirror-yaml.js"></script>
<script src="./js/codemirror-active-line.js"></script>
<script src="./js/codemirror-matchbrackets.js"></script>
<script src="./js/prompt-app-gpt-app-uitext.js"></script>
<script src="./js/prompt-app-gpt-app-executor.js"></script>
<script src="./js/prompt-app-gpt-app.js"></script>
</body>
</html>