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

Commit

Permalink
fix: update lates run when rollback
Browse files Browse the repository at this point in the history
  • Loading branch information
hibig committed Mar 5, 2024
1 parent 7885278 commit 909e453
Show file tree
Hide file tree
Showing 13 changed files with 125 additions and 59 deletions.
4 changes: 4 additions & 0 deletions src/assets/style/custom.less
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,10 @@ div#driver-highlighted-element-stage {
}
}

.arco-spin-tip {
font-size: var(--font-size-small);
}

.arco-btn-size-medium {
font-weight: var(--font-weight-medium);
font-size: var(--font-size-normal) !important;
Expand Down
2 changes: 1 addition & 1 deletion src/assets/style/global.less
Original file line number Diff line number Diff line change
Expand Up @@ -531,4 +531,4 @@ html[arco-theme='dark'] {
@import url('./arco-descriptions.less');
@import url('./flex.less');
@import url('./margin.less');
@import url('//at.alicdn.com/t/c/font_3892962_bkkd0hcjfbl.css');
@import url('//at.alicdn.com/t/c/font_3892962_vbgcoshnb3s.css');
4 changes: 2 additions & 2 deletions src/assets/style/variable.less
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ body {
--color-control-bg: var(--color-neutral-3);

// result view color
--color-result-tip: rgb(var(--primary-6));
--color-result-tip-bg: var(--color-primary-light-1);
--color-result-tip: var(--color-text-2);
--color-result-tip-bg: var(--color-fill-1);

// avatar icon color
--color-avatar-icon: rgb(var(--arcoblue-5));
Expand Down
1 change: 1 addition & 0 deletions src/components/dynamic-form/components/boolean-field.vue
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@
>
<SealViewItemWrap label={props.schema.title} style="width: 100%">
<a-checkbox
disabled={true}
modelValue={_.get(props.uiFormData, props.fieldPath)}
size="small"
></a-checkbox>
Expand Down
127 changes: 85 additions & 42 deletions src/components/header-info/index.vue
Original file line number Diff line number Diff line change
@@ -1,47 +1,75 @@
<template>
<div>
<div class="header-info" :class="{ 'top-gap': topGap }">
<div class="left">
<div class="img">
<slot name="icon"></slot>
<span v-if="showImgIcon" class="custom-icon">
<slot name="img"></slot>
</span>
</div>
</div>
<div class="right">
<slot name="title" class="title">
<div class="title">{{ info?.name }}</div>
</slot>
<slot name="status"></slot>
<slot name="description" class="desc"></slot>
</div>
<div class="extra">
<slot name="extra"></slot>
</div>
</div>
</div>
</template>

<script lang="ts" setup>
defineProps({
topGap: {
type: Boolean,
default() {
return false;
}
},
info: {
type: Object,
default() {
return {};
<script lang="tsx">
import { defineComponent } from 'vue';
export default defineComponent({
props: {
topGap: {
type: Boolean,
default() {
return false;
}
},
info: {
type: Object,
default() {
return {};
}
},
iconType: {
type: String,
default() {
return '';
}
},
showImgIcon: {
type: Boolean,
default() {
return false;
}
}
},
showImgIcon: {
type: Boolean,
default() {
return false;
}
setup(props, { slots }) {
const renderIcon = () => {
if (props.iconType === 'line') {
return <span class="line-icon">{slots.icon?.()}</span>;
}
if (slots.icon) {
return slots.icon();
}
return null;
};
const renderImgIcon = () => {
if (props.showImgIcon) {
return <span class="custom-icon">{slots.img?.()}</span>;
}
return null;
};
const renderTitle = () => {
if (slots.title) {
return <div class="title">{slots.title()}</div>;
}
return <div class="title">{props.info?.name}</div>;
};
return () => (
<div>
<div class={['header-info', { 'top-gap': props.topGap }]}>
<div class="left">
<div class="img">
{renderIcon()}
{renderImgIcon()}
</div>
</div>
<div class="right">
{renderTitle()}
{slots.status?.()}
{slots.description?.()}
</div>
<div class="extra">{slots.extra?.()}</div>
</div>
</div>
);
}
});
</script>
Expand Down Expand Up @@ -79,6 +107,21 @@
border-radius: 50%;
}
.line-icon {
display: flex;
align-items: center;
justify-content: center;
width: 42px;
height: 42px;
background-color: rgb(var(--arcoblue-5));
border-radius: 50%;
:deep(.iconfont) {
color: var(--color-white-2);
font-size: 22px;
}
}
.custom-icon {
display: flex;
align-items: center;
Expand Down
2 changes: 1 addition & 1 deletion src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import ResultView from './result-view/index.vue';
import SealSpin from './seal-spin/index.vue';

const IconFont = Icon.addFromIconFontCn({
src: '//at.alicdn.com/t/c/font_3892962_bkkd0hcjfbl.js'
src: '//at.alicdn.com/t/c/font_3892962_vbgcoshnb3s.js'
});
// Manually introduce ECharts modules to reduce packing size

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
></Breadcrumb>
</BreadWrapper>
<ComCard padding="0">
<HeaderInfo :info="currentInfo">
<HeaderInfo :info="currentInfo" icon-type="line">
<template #icon>
<i class="iconfont icon-rongqiyunfuwu"></i>
<i class="iconfont icon-server"></i>
</template>
<template #title>
<div class="title">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
>
<LatestRun
ref="latestRunRef"
:key="latestKey"
:service-info="currentInfo"
></LatestRun>
</a-grid-item>
Expand Down Expand Up @@ -98,7 +99,9 @@
:key="ResourceDetailTabs.REVISIONS"
:title="$t('applications.applications.instance.history')"
>
<serviceRevisions></serviceRevisions>
<serviceRevisions
@rollback="handleRollbackSuccess"
></serviceRevisions>
</a-tab-pane>
<a-tab-pane
:key="ResourceDetailTabs.SETTINGS"
Expand Down Expand Up @@ -211,6 +214,7 @@
});
// 1: create 2: update 3: delete
const settingKey = ref(Date.now());
const latestKey = ref(Date.now());
const actionMap = new Map();
const latestRunRef = ref();
const showCommentModal = ref(false);
Expand Down Expand Up @@ -294,8 +298,9 @@
}
};
const handleBasicCollapse = async (val) => {
isCollapsed.value = val;
const handleRollbackSuccess = () => {
latestKey.value = Date.now();
settingKey.value = Date.now();
};
const handleExportYaml = () => {
Expand Down Expand Up @@ -407,6 +412,7 @@
await getServiceItemInfo();
settingKey.value = Date.now();
latestKey.value = Date.now();
setPageTabActive(ResourceDetailTabs.OVERVIEW);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@
SERVICE_RESOURCE_API_PREFIX
} from '../../api';
const emit = defineEmits(['rollback']);
let timer: any = null;
let axiosListInstance = createAxiosToken();
const userStore = useUserStore();
Expand Down Expand Up @@ -363,6 +364,7 @@
preview: data.preview
});
execSucceed();
emit('rollback');
} catch (error) {
//
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
<a-spin
v-if="basicData.status?.summaryStatus === RevisionStatus.Planning"
dot
style="padding-top: 20px"
:tip="$t('resource.revisons.components.planning')"
/>
<runComponents
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@
const serviceDetail = computed(() => {
return {
...serviceInfo.value,
attributes: props.runData.attributes
attributes: {
...props.runData.attributes
}
};
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
});
const { route } = useCallCommon();
const serviceInfo = ref(props.detailInfo);
const schema = ref<any>({});
const loaded = ref(false);
const templateList = ref<any[]>([]);
Expand All @@ -62,6 +61,10 @@
provide(InjectSchemaFormStatusKey, ref(PageAction.VIEW));
const serviceInfo = computed(() => {
return props.detailInfo;
});
// template options
const getTemplates = async () => {
try {
Expand Down Expand Up @@ -184,8 +187,7 @@
watch(
() => serviceInfo.value.id,
() => {
if (serviceInfo.value.id && requestFlag.value) {
requestFlag.value = false;
if (serviceInfo.value.id) {
init();
}
},
Expand Down
13 changes: 9 additions & 4 deletions src/views/application-management/services/pages/clone.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,10 @@
<EditPageFooter>
<template #save>
<GroupButtonMenu
trigger="hover"
position="br"
:loading="submitLoading"
:actions="SaveActions"
:actions="actionList"
@select="handleSelect"
>
</GroupButtonMenu>
Expand All @@ -117,7 +119,7 @@
import { Resources, Actions } from '@/permissions/config';
import EditPageFooter from '@/components/edit-page-footer/index.vue';
import { PROJECT } from '@/router/config';
import { InputWidth, SaveActions } from '@/views/config';
import { InputWidth, SaveActions, ResourceSaveAction } from '@/views/config';
import { ref, computed, reactive } from 'vue';
import { useUserStore } from '@/store';
import { onBeforeRouteLeave } from 'vue-router';
Expand Down Expand Up @@ -177,9 +179,12 @@
environmentIDs: [],
items: []
});
const { labelList, handleAddLabel, handleDeleteLabel } =
useLabelsActions(formData);
const actionList = computed(() => {
return _.filter(SaveActions, (item) => {
return item.value !== ResourceSaveAction.Preview;
});
});
const selectedEnvList = computed(() => {
return _.filter(environments.value, (item) =>
_.includes(formData.environmentIDs, item.id)
Expand Down

0 comments on commit 909e453

Please sign in to comment.