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

Commit

Permalink
chore: template chunk filter
Browse files Browse the repository at this point in the history
  • Loading branch information
hibig committed Aug 14, 2023
1 parent e3125dc commit b37a35c
Show file tree
Hide file tree
Showing 19 changed files with 40 additions and 215 deletions.
2 changes: 1 addition & 1 deletion config/vite.config.dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default mergeConfig(
},
https: true,
port: 4000,
proxy: createProxyTable('https://192.168.50.92')
proxy: createProxyTable()
},
plugins: [
basicSsl(),
Expand Down
75 changes: 0 additions & 75 deletions src/components/form-create/config/test.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/components/form-create/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@
} from './config/interface';
import { json2Yaml, yaml2Json } from './config/yaml-parse';
import formComponents from './components';
import testData from './config/test';
import {
parseMapstring,
parseOptions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,6 @@
:ref="(el: refItem) => setRefMap(el, `schemaForm${index}`)"
:form-id="`schemaForm${index}`"
layout="vertical"
action="post"
api=""
:show-footer="false"
:submit="() => {}"
:attributes="variableAttributes"
Expand All @@ -203,8 +201,6 @@
ref="schemaForm"
form-id="schemaForm"
layout="vertical"
action="post"
api=""
:show-footer="false"
:submit="() => {}"
:model="variablesGroupForm[defaultGroupKey]?.attributes"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
</template>

<script lang="ts" setup>
import { PageAction } from '@/views/config';
import { Resources } from '@/permissions/config';
import { useUserStore } from '@/store';
import { PropType, watchEffect } from 'vue';
Expand Down Expand Up @@ -139,23 +140,16 @@
router.push({
name: 'EnvironmentDetail',
params: {
action: 'edit'
action: PageAction.EDIT
},
query: { id: row.id }
});
};
const handleView = (row) => {
// router.push({
// name: 'EnvironmentDetail',
// params: {
// action: 'view'
// },
// query: { id: row.id }
// });
router.push({
name: 'ProjectEnvDetail',
params: {
action: 'view',
action: PageAction.VIEW,
...route.params,
environmentId: row.id
}
Expand Down
3 changes: 1 addition & 2 deletions src/views/application-management/environments/pages/edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,7 @@
import {
createEnvironment,
updateEnvironment,
queryItemEnvironments,
cloneEnvironment
queryItemEnvironments
} from '../api';
const { getProjectList, setProjectList, initBreadValues, handleBreadChange } =
Expand Down
11 changes: 2 additions & 9 deletions src/views/application-management/environments/pages/list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@
const total = ref(0);
const showModal = ref(false);
const currentInfo = ref({});
const action = ref('edit');
const action = ref(PageAction.EDIT);
const queryParams = reactive({
query: '',
page: 1,
Expand All @@ -246,13 +246,11 @@
});
const handleCreate = () => {
// action.value = 'create';
// showModal.value = true;
router.push({
name: PROJECT.EnvEdit,
params: {
projectId: route.params.projectId,
action: 'edit'
action: PageAction.EDIT
}
});
};
Expand Down Expand Up @@ -313,11 +311,6 @@
});
};
const handleEdit = (row) => {
// currentInfo.value = row;
// action.value = 'edit';
// setTimeout(() => {
// showModal.value = true;
// }, 100);
router.push({
name: PROJECT.EnvEdit,
params: {
Expand Down
11 changes: 2 additions & 9 deletions src/views/application-management/services/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ interface ApplicationRevisionParams extends Pagination {
sort?: string[];
}

export const queryApplicationRevisions = (
export const queryServiceRevisions = (
params: ApplicationRevisionParams,
token?
) => {
Expand Down Expand Up @@ -281,7 +281,7 @@ export const queryRevisionChange = (params: {
);
};

export const rollbackInstance = (data: {
export const rollbackService = (data: {
revisionID: string;
serviceID: string;
}) => {
Expand All @@ -295,13 +295,6 @@ export const rollbackInstance = (data: {
);
};

export const rollbackApplication = (data: { id: string }) => {
return axios.post(
`${SERVICE_RESOURCE_API_PREFIX()}/revisions/${
data.id
}/rollback-applications?${qs.stringify(getPermissionRouteParams())}`
);
};
// ===========resource==========
export const queryServiceResource = (
params: ApplicationRevisionParams,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ export default function useFetchResource() {
const { data } = await queryServiceResource(params, fetchToken.token);
let list: any = _.filter(
data?.items || [],
(item) => item?.instance?.id === serviceId.value
(item) => item?.service?.id === serviceId.value
);
list = setDataList(list);
dataList.value = [].concat(list);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,6 @@
const handleOk = () => {
router.back();
};
const handleCancel = () => {
router.back();
};
onMounted(() => {
setInstanceTabList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,16 +178,15 @@
import serviceSpecDiff from '../service-spec-diff.vue';
import { setDurationValue, RevisionStatus } from '../../config';
import {
queryApplicationRevisions,
queryServiceRevisions,
deleteApplicationRevisions,
diffRevisionSpec,
rollbackInstance,
rollbackService,
queryRevisionChange,
SERVICE_RESOURCE_API_PREFIX
} from '../../api';
let axiosListInstance = createAxiosToken();
const permissionParams = usePermissionParams();
const userStore = useUserStore();
const { t, route } = useCallCommon();
const { setChunkRequest } = useSetChunkRequest();
Expand All @@ -205,7 +204,6 @@
const showDetailModal = ref(false);
const showDiffModal = ref(false);
const initialStatus = ref('');
const rollbackType = ref('');
const diffContent = ref({});
const rollbackData = ref<any>({});
const ids = ref<{ id: string }[]>([]);
Expand Down Expand Up @@ -234,9 +232,9 @@
}
};
const handleRollbackInstance = async () => {
const handleRollbackService = async () => {
try {
await rollbackInstance({
await rollbackService({
revisionID: rollbackData.value.id,
serviceID: serviceId.value
});
Expand All @@ -247,10 +245,9 @@
};
const handleConfirmDiff = async () => {
handleRollbackInstance();
handleRollbackService();
};
const handleViewHistoryChange = async (row) => {
rollbackType.value = 'instance';
rollbackData.value = row;
try {
const params = {
Expand All @@ -274,7 +271,7 @@
axiosListInstance = createAxiosToken();
try {
loading.value = true;
const { data } = await queryApplicationRevisions(
const { data } = await queryServiceRevisions(
{
...queryParams,
serviceID: serviceId.value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,10 @@
import EditPageFooter from '@/components/edit-page-footer/index.vue';
import { InstanceData, HistoryData } from '../config/interface';
import {
queryApplicationRevisions,
queryServiceRevisions,
diffRevisionSpec,
rollbackApplication,
rollbackInstance
rollbackService
} from '../api';
import { updateApplicationEmitter } from '../hooks/update-application-listener';
const props = defineProps({
show: {
Expand Down Expand Up @@ -163,18 +161,9 @@
id: ''
});
const handleRollbackApplication = async () => {
const handleRollbackService = async () => {
try {
await rollbackApplication({ id: formData.id });
execSucceed();
updateApplicationEmitter();
} catch (error) {
//
}
};
const handleRollbackInstance = async () => {
try {
await rollbackInstance({
await rollbackService({
revisionID: formData.id,
serviceID: formData.serviceID
});
Expand All @@ -192,7 +181,7 @@
serviceID: formData.serviceID,
projectID: props.projectID
};
const { data } = await queryApplicationRevisions(params);
const { data } = await queryServiceRevisions(params);
revisionList.value = data?.items || [];
loading.value = false;
} catch (error) {
Expand Down Expand Up @@ -223,16 +212,9 @@
clearDiffLines();
getRevisionDiff();
};
const handleInstanceChange = () => {
clearDiffLines();
getRevisionList();
};
const handleExecRollback = async () => {
if (!props.serviceId) {
await handleRollbackApplication();
} else {
await handleRollbackInstance();
}
await handleRollbackService();
emit('update:show', false);
};
const handleOk = async () => {
Expand Down
21 changes: 0 additions & 21 deletions src/views/application-management/services/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,12 @@ export const instanceTabs = [
requiredAuth: true,
permission: ['GET']
},
// {
// label: 'applications.instance.tab.log',
// value: 'logs',
// com: 'tabLogs',
// requiredAuth: true,
// permission: ['GET']
// },
{
label: 'applications.instance.tab.output',
value: 'outputs',
requiredAuth: false,
com: 'tabOutput'
}
// {
// label: 'applications.instance.tab.graph',
// value: 'graph',
// com: 'tabGraph',
// requiredAuth: true,
// permission: ['GET']
// },
// {
// label: 'applications.instance.tab.term',
// value: 'terminal',
// com: 'tabTerminal',
// requiredAuth: true,
// permission: ['GET']
// }
];

export const moduleActions = [
Expand Down
Loading

0 comments on commit b37a35c

Please sign in to comment.