Browse Source

feat: 编辑运行环境增加提示 (#1896)

pull/1897/head
zhengkunwang 1 year ago committed by GitHub
parent
commit
bb7102d543
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      frontend/src/api/interface/runtime.ts
  2. 25
      frontend/src/views/website/runtime/create/index.vue
  3. 3
      frontend/src/views/website/runtime/index.vue

1
frontend/src/api/interface/runtime.ts

@ -12,6 +12,7 @@ export namespace Runtime {
type: string;
resource: string;
version: string;
status: string;
}
export interface RuntimeReq extends ReqPage {

25
frontend/src/views/website/runtime/create/index.vue

@ -87,7 +87,6 @@
<span>{{ $t('runtime.extendHelper') }}</span>
<span v-html="$t('runtime.phpPluginHelper')"></span>
<br />
<span v-if="mode == 'edit'">{{ $t('runtime.rebuildHelper') }}</span>
</el-alert>
</el-form-item>
</div>
@ -246,8 +245,8 @@ const submit = async (formEl: FormInstance | undefined) => {
if (!valid) {
return;
}
loading.value = true;
if (mode.value == 'create') {
loading.value = true;
CreateRuntime(runtime.value)
.then(() => {
MsgSuccess(i18n.global.t('commons.msg.createSuccess'));
@ -257,14 +256,20 @@ const submit = async (formEl: FormInstance | undefined) => {
loading.value = false;
});
} else {
UpdateRuntime(runtime.value)
.then(() => {
MsgSuccess(i18n.global.t('commons.msg.updateSuccess'));
handleClose();
})
.finally(() => {
loading.value = false;
});
ElMessageBox.confirm(i18n.global.t('runtime.rebuildHelper'), i18n.global.t('commons.msg.infoTitle'), {
confirmButtonText: i18n.global.t('commons.button.confirm'),
cancelButtonText: i18n.global.t('commons.button.cancel'),
}).then(async () => {
loading.value = true;
UpdateRuntime(runtime.value)
.then(() => {
MsgSuccess(i18n.global.t('commons.msg.updateSuccess'));
handleClose();
})
.finally(() => {
loading.value = false;
});
});
}
});
};

3
frontend/src/views/website/runtime/index.vue

@ -97,6 +97,9 @@ const buttons = [
click: function (row: Runtime.Runtime) {
openDetail(row);
},
disabled: function (row: Runtime.Runtime) {
return row.status === 'building';
},
},
{
label: i18n.global.t('commons.button.delete'),

Loading…
Cancel
Save