Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
fix: deploy start stop update latest run
Browse files Browse the repository at this point in the history
  • Loading branch information
hibig committed Mar 5, 2024
1 parent 8f22705 commit bb39486
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 26 deletions.
9 changes: 0 additions & 9 deletions components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,32 +24,23 @@ declare module 'vue' {
AGrid: typeof import('@arco-design/web-vue')['Grid'];
AGridItem: typeof import('@arco-design/web-vue')['GridItem'];
AInput: typeof import('@arco-design/web-vue')['Input'];
AInputGroup: typeof import('@arco-design/web-vue')['InputGroup'];
AInputNumber: typeof import('@arco-design/web-vue')['InputNumber'];
AInputPassword: typeof import('@arco-design/web-vue')['InputPassword'];
AInputSearch: typeof import('@arco-design/web-vue')['InputSearch'];
ALayout: typeof import('@arco-design/web-vue')['Layout'];
ALayoutContent: typeof import('@arco-design/web-vue')['LayoutContent'];
ALayoutFooter: typeof import('@arco-design/web-vue')['LayoutFooter'];
ALayoutSider: typeof import('@arco-design/web-vue')['LayoutSider'];
ALink: typeof import('@arco-design/web-vue')['Link'];
AList: typeof import('@arco-design/web-vue')['List'];
AListItemMeta: typeof import('@arco-design/web-vue')['ListItemMeta'];
AMenu: typeof import('@arco-design/web-vue')['Menu'];
AMenuItem: typeof import('@arco-design/web-vue')['MenuItem'];
AModal: typeof import('@arco-design/web-vue')['Modal'];
AOption: typeof import('@arco-design/web-vue')['Option'];
APagination: typeof import('@arco-design/web-vue')['Pagination'];
APopconfirm: typeof import('@arco-design/web-vue')['Popconfirm'];
AProgress: typeof import('@arco-design/web-vue')['Progress'];
ARangePicker: typeof import('@arco-design/web-vue')['RangePicker'];
AResult: typeof import('@arco-design/web-vue')['Result'];
ASelect: typeof import('@arco-design/web-vue')['Select'];
ASpace: typeof import('@arco-design/web-vue')['Space'];
ASpin: typeof import('@arco-design/web-vue')['Spin'];
AStatistic: typeof import('@arco-design/web-vue')['Statistic'];
AStep: typeof import('@arco-design/web-vue')['Step'];
ASteps: typeof import('@arco-design/web-vue')['Steps'];
ASubMenu: typeof import('@arco-design/web-vue')['SubMenu'];
ASwitch: typeof import('@arco-design/web-vue')['Switch'];
ATable: typeof import('@arco-design/web-vue')['Table'];
Expand Down
4 changes: 3 additions & 1 deletion src/store/modules/app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import defaultSettings from '@/config/settings.json';
import { AppState } from './types';

const useAppStore = defineStore('app', {
persist: true,
persist: {
key: 'app'
},
state: (): AppState => ({ ...defaultSettings }),

getters: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export interface EnvironmentRow {

export interface EnvironFormData {
draft?: boolean;
preview?: boolean;
projectID?: string;
id?: string;
name: string;
Expand Down
17 changes: 10 additions & 7 deletions src/views/application-management/environments/pages/edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,8 @@
v-else
:loading="submitLoading"
:actions="SaveActions"
position="br"
trigger="hover"
@select="handleSelect"
>
</GroupButtonMenu>
Expand Down Expand Up @@ -562,16 +564,14 @@
return data;
};
const handleSubmit = async (draft?: boolean) => {
const handleSubmit = async () => {
const res = await formref.value?.validate();
validateTrigger.value = true;
scrollToView();
if (!res) {
try {
submitLoading.value = true;
if (draft) {
formData.value.draft = true;
}
const data = _.omit(formData.value, ['edges']);
if (isCloneAction) {
handleCloneEnvironment(data);
Expand Down Expand Up @@ -607,12 +607,15 @@
return false;
};
const handleSelect = (value) => {
if (value === 'deploy') {
handleSubmit();
_.omit(formData.value, ['preview', 'draft']);
if (value === 'preview') {
formData.value.preview = true;
}
if (value === 'draft') {
handleSubmit(true);
formData.value.draft = true;
}
handleSubmit();
};
const cancelCallback = () => {
if (route.name === PROJECT.EnvDetail) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,10 @@
return res;
});
const updateLatestRun = () => {
latestKey.value = Date.now();
};
const handleComfirmComment = async (comment: string) => {
try {
const params = {
Expand All @@ -280,12 +284,12 @@
};
await deployItemService(params);
execSucceed();
updateLatestRun();
} catch (error) {
// ignore
}
};
const handleUpgrade = () => {
// pageAction.value = PageAction.EDIT;
showCommentModal.value = true;
};
Expand Down Expand Up @@ -323,6 +327,7 @@
try {
await stopApplicationInstance({ id: route.query.id });
execSucceed();
updateLatestRun();
} catch (error) {
// ignore
}
Expand All @@ -331,6 +336,7 @@
try {
await startApplicationInstance({ id: route.query.id });
execSucceed();
updateLatestRun();
} catch (error) {
// ignore
}
Expand All @@ -357,7 +363,7 @@
const handleDelete = () => {
showDeleteModal.value = true;
};
const handleSelect = (value) => {
const handleSelect = async (value) => {
actionMap.get(value)?.();
};
Expand Down
7 changes: 1 addition & 6 deletions src/views/application-management/services/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,14 +240,9 @@ export const RevisionStatus = {
Succeeded: 'Succeeded',
Running: 'Running',
Failed: 'Failed',
Pending: 'Pending',
Plan: 'Plan',
Planned: 'Planned',
Planning: 'Planning',
Apply: 'Apply',
Applying: 'Applying',
Canceled: 'Canceled',
Canceling: 'Canceling'
Canceled: 'Canceled'
};

export const ApplicableStatus = [RevisionStatus.Planned];
Expand Down
2 changes: 1 addition & 1 deletion src/views/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ export const StatusColor = {
icon: 'icon-close-circle-fill'
},
warning: {
text: `rgba(var(${StatusColorValueMap.warningColor}))`, // color
text: `rgba(var(${StatusColorValueMap.warningColor}),1)`, // color
bg: `rgba(var(${StatusColorValueMap.warningBg}),0.3)`, // backgroundColor #f9cc45
icon: ''
},
Expand Down

0 comments on commit bb39486

Please sign in to comment.