|
385 | 385 | :width="isTauri ? '90%' : '60%'"
|
386 | 386 | center
|
387 | 387 | align-center
|
388 |
| - @closed="closeConfigDialog" |
| 388 | + :before-close="closeConfigDialog" |
389 | 389 | >
|
390 | 390 | <template #header="{ titleId, titleClass }">
|
391 | 391 | <div class="configHeader">
|
|
399 | 399 | </template>
|
400 | 400 | <TauriConfig ref="tauriConfigRef" :isJson="isJson" />
|
401 | 401 | </el-dialog>
|
402 |
| - <!-- code edit --> |
| 402 | + <!-- js code edit --> |
403 | 403 | <el-dialog
|
404 | 404 | v-model="codeDialogVisible"
|
405 | 405 | :width="isTauri ? '90%' : '60%'"
|
406 | 406 | center
|
407 | 407 | align-center
|
408 |
| - @closed="closeConfigDialog" |
| 408 | + @closed="closeJsCodeEditDialog" |
409 | 409 | >
|
410 | 410 | <template #header="{ titleId, titleClass }">
|
411 | 411 | <div class="configHeader">
|
@@ -610,10 +610,20 @@ const changeUrl = (value: string) => {
|
610 | 610 | }
|
611 | 611 |
|
612 | 612 | // close tauri config dialog
|
613 |
| -const closeConfigDialog = () => { |
614 |
| - configDialogVisible.value = false |
| 613 | +const closeConfigDialog = (done: any) => { |
| 614 | + console.log('closeConfigDialog', done) |
| 615 | + const isJson = tauriConfigRef.value?.checkJson() |
| 616 | + if (isJson) { |
| 617 | + configDialogVisible.value = false |
| 618 | + done() |
| 619 | + } else { |
| 620 | + ElMessage.error(t('jsonError')) |
| 621 | + } |
| 622 | +} |
| 623 | +
|
| 624 | +// close js code edit dialog |
| 625 | +const closeJsCodeEditDialog = () => { |
615 | 626 | codeDialogVisible.value = false
|
616 |
| - // console.log('closeConfigDialog', tauriConfig) |
617 | 627 | }
|
618 | 628 |
|
619 | 629 | // switch tauri config json or code
|
@@ -734,6 +744,9 @@ const uploadIcon = async () => {
|
734 | 744 |
|
735 | 745 | // update icon file content
|
736 | 746 | const updateIcon = async () => {
|
| 747 | + if (iconBase64.value === '') { |
| 748 | + return |
| 749 | + } |
737 | 750 | const iconContent = store.currentProject.iconRound
|
738 | 751 | ? roundIcon.value.split('base64,')[1]
|
739 | 752 | : iconBase64.value.split('base64,')[1]
|
@@ -1168,7 +1181,7 @@ const publishWeb = async () => {
|
1168 | 1181 | console.log('publish web')
|
1169 | 1182 | loadingText(t('syncConfig') + '...')
|
1170 | 1183 | // update app icon
|
1171 |
| - iconBase64.value && (await updateIcon()) |
| 1184 | + await updateIcon() |
1172 | 1185 | // update build.yml
|
1173 | 1186 | await updateBuildYml()
|
1174 | 1187 | // update Cargo.toml
|
@@ -1249,7 +1262,7 @@ const dispatchAction = async () => {
|
1249 | 1262 | console.log('dispatchRes---', dispatchRes)
|
1250 | 1263 | if (dispatchRes.status !== 204) {
|
1251 | 1264 | console.error('dispatch res error', dispatchRes)
|
1252 |
| - ElMessage.error('dispatch res error') |
| 1265 | + ElMessage.error(t('dispatchError') + ':' + dispatchRes.data.message) |
1253 | 1266 | buildLoading.value = false
|
1254 | 1267 | return
|
1255 | 1268 | } else {
|
@@ -1278,10 +1291,12 @@ const dispatchAction = async () => {
|
1278 | 1291 |
|
1279 | 1292 | // create issue
|
1280 | 1293 | const createIssue = async (url: string, label: string, title: string) => {
|
| 1294 | + console.log('createIssue', url, label, title) |
1281 | 1295 | const issueRes: any = await githubApi.createIssue({
|
1282 |
| - body: `name: ${store.currentProject.name}\n |
1283 |
| - build info: ${url}`, |
1284 |
| - labels: [label], |
| 1296 | + body: `build name: ${store.currentProject.name}\r |
| 1297 | + show name: ${store.currentProject.showName}\r |
| 1298 | + build state: ${label}\r |
| 1299 | + build action: ${url}`, |
1285 | 1300 | title: title,
|
1286 | 1301 | })
|
1287 | 1302 | console.log('issueRes---', issueRes)
|
|
0 commit comments