Skip to content

Commit

Permalink
FE api minor improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfboys committed Oct 15, 2023
1 parent e5b793d commit dfc72fa
Show file tree
Hide file tree
Showing 51 changed files with 74 additions and 74 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,15 @@ export function fetchCheckName(data: { id?: string; jobName: string }): Promise<
return defHttp.post({ url: APP_API.CHECK_NAME, data });
}

export function fetchMain(data) {
export function fetchMain(data):Promise<string> {
return defHttp.post({ url: APP_API.MAIN, data });
}
/**
* upload
* @param params
* @returns {String} file path
*/
export function fetchUpload(params) {
export function fetchUpload(params) :Promise<string> {
return defHttp.post<string>({
url: APP_API.UPLOAD,
params,
Expand Down Expand Up @@ -167,8 +167,8 @@ export function fetchDeleteOperationLog(id: string) {

/**
* forced stop
* @param params id:string
* @returns
* @param data
*/
export function fetchForcedStop(data: { id: string }): Promise<boolean> {
return defHttp.post({ url: APP_API.FORCED_STOP, data });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { HadoopConf } from './index.type';
import { HadoopConf } from './config.type';
import { defHttp } from '/@/utils/http/axios';

enum CONFIG_API {
Expand Down Expand Up @@ -47,8 +47,8 @@ export function fetchListVer(data) {
}
/**
* delete configuration
* @param {String}
* @returns {Promise<Boolean>}
* @param data
*/
export function fetchRemoveConf(data: { id: string }): Promise<boolean> {
return defHttp.post({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ enum BUILD_API {
DETAIL = '/flink/pipe/detail',
}

export function fetchBuild(data): Promise<AxiosResponse<any>> {
export function fetchBuild(data: { appId: string; forceBuild: boolean; }): Promise<AxiosResponse<any>> {
return defHttp.post({ url: BUILD_API.BUILD, data }, { isReturnNativeResponse: true });
}
/**
* Get build details
* @param params appId:string
* @returns
* @param data
*/
export function fetchBuildDetail(data: { appId: string }): Promise<{ pipeline: any; docker: any }> {
return defHttp.post({ url: BUILD_API.DETAIL, data });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ export function fetchFlinkCreate(data: FlinkCreate): Promise<AxiosResponse<Resul

/**
* update flink
* @param {FlinkCreate} params
* @returns {Promise<AxiosResponse<Result>>}
* @param data
*/
export function fetchFlinkUpdate(data: FlinkCreate): Promise<AxiosResponse<Result>> {
return defHttp.post<AxiosResponse<Result>>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import { useDrawer } from '/@/components/Drawer';
import Mergely from './components/Mergely.vue';
import { handleConfTemplate } from '/@/api/flink/config';
import { fetchAppConf, fetchCreate } from '/@/api/flink/app/app';
import { fetchAppConf, fetchCreate } from '/@/api/flink/app';
import options from './data/option';
import { useCreateSchema } from './hooks/useCreateSchema';
import { getAppConfType, handleSubmitParams } from './utils';
Expand All @@ -43,7 +43,7 @@
import VariableReview from './components/VariableReview.vue';
import PomTemplateTab from './components/PodTemplate/PomTemplateTab.vue';
import UseSysHadoopConf from './components/UseSysHadoopConf.vue';
import { CreateParams } from '/@/api/flink/app/app.type';
import { CreateParams } from '/@/api/flink/app.type';
import { decodeByBase64, encryptByBase64 } from '/@/utils/cipher';
import {
AppTypeEnum,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
import { Description, useDescription } from '/@/components/Description';
import { Icon } from '/@/components/Icon';
import { useRoute, useRouter } from 'vue-router';
import { fetchBackUps, fetchGet, fetchOptionLog, fetchYarn } from '/@/api/flink/app/app';
import { fetchBackUps, fetchGet, fetchOptionLog, fetchYarn } from '/@/api/flink/app';
import { onUnmounted, reactive, h, unref, ref, onMounted, computed } from 'vue';
import { useIntervalFn, useClipboard } from '@vueuse/core';
import { AppListRecord } from '/@/api/flink/app/app.type';
import { AppListRecord } from '/@/api/flink/app.type';
import { Tooltip, Divider, Space } from 'ant-design-vue';
import { handleView } from './utils';
import { Button } from '/@/components/Button';
Expand All @@ -41,7 +41,7 @@
import { useMessage } from '/@/hooks/web/useMessage';
import { baseUrl } from '/@/api';
import { fetchListVer } from '/@/api/flink/config';
import { fetchSavePonitHistory } from '/@/api/flink/app/savepoint';
import { fetchSavePonitHistory } from '/@/api/flink/savepoint';
import Mergely from './components/Mergely.vue';
import DetailTab from './components/AppDetail/DetailTab.vue';
import { createDetailProviderContext } from './hooks/useDetailContext';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import { BasicForm, useForm } from '/@/components/Form';
import { onMounted, reactive, ref, nextTick, unref } from 'vue';
import { Alert } from 'ant-design-vue';
import { fetchMain, fetchUpload, fetchUpdate } from '/@/api/flink/app/app';
import { fetchMain, fetchUpload, fetchUpdate } from '/@/api/flink/app';
import { handleSubmitParams } from './utils';
import PomTemplateTab from './components/PodTemplate/PomTemplateTab.vue';
import { fetchListJars } from '/@/api/resource/project';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
import { PageWrapper } from '/@/components/Page';
import { BasicForm, useForm } from '/@/components/Form';
import { onMounted, reactive, ref, nextTick, unref } from 'vue';
import { AppListRecord } from '/@/api/flink/app/app.type';
import { AppListRecord } from '/@/api/flink/app.type';
import configOptions from './data/option';
import { fetchMain, fetchUpload, fetchUpdate, fetchGet } from '/@/api/flink/app/app';
import { fetchMain, fetchUpload, fetchUpdate, fetchGet } from '/@/api/flink/app';
import { useRoute } from 'vue-router';
import { getAppConfType, handleSubmitParams, handleTeamResource } from './utils';
import { fetchFlinkHistory } from '/@/api/flink/app/flinkSql';
import { fetchFlinkHistory } from '/@/api/flink/flinkSql';
import { decodeByBase64, encryptByBase64 } from '/@/utils/cipher';
import PomTemplateTab from './components/PodTemplate/PomTemplateTab.vue';
import UploadJobJar from './components/UploadJobJar.vue';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
import { AppStateEnum, JobTypeEnum, OptionStateEnum, ReleaseStateEnum } from '/@/enums/flinkEnum';
import { useTimeoutFn } from '@vueuse/core';
import { Tooltip, Badge, Divider, Tag } from 'ant-design-vue';
import { fetchAppRecord } from '/@/api/flink/app/app';
import { fetchAppRecord } from '/@/api/flink/app';
import { useTable } from '/@/components/Table';
import { PageWrapper } from '/@/components/Page';
import { BasicTable, TableAction } from '/@/components/Table';
import { AppListRecord } from '/@/api/flink/app/app.type';
import { AppListRecord } from '/@/api/flink/app.type';
import { getAppColumns, releaseTitleMap } from './data';
import { handleView } from './utils';
import { useDrawer } from '/@/components/Drawer';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { decodeByBase64 } from '/@/utils/cipher';
import { fetchGetVer } from '/@/api/flink/config';

import { ApiTreeSelect } from '/@/components/Form';
import { fetchAppConf, fetchName } from '/@/api/flink/app/app';
import { fetchAppConf, fetchName } from '/@/api/flink/app';
import { SettingTwoTone } from '@ant-design/icons-vue';
import { fetchListConf } from '/@/api/resource/project';
import { UseStrategyEnum } from '/@/enums/flinkEnum';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@
import { getMonacoOptions } from '../../data';
import { useRoute } from 'vue-router';
import { fetchGetVer, fetchListVer, fetchRemoveConf } from '/@/api/flink/config';
import { fetchRemoveSavePoint, fetchSavePonitHistory } from '/@/api/flink/app/savepoint';
import { fetchRemoveSavePoint, fetchSavePonitHistory } from '/@/api/flink/savepoint';

import {
fetchBackUps,
fetchOptionLog,
fetchRemoveBackup,
fetchDeleteOperationLog,
fetchYarn,
} from '/@/api/flink/app/app';
} from '/@/api/flink/app';
import { decodeByBase64 } from '/@/utils/cipher';
import { useModal } from '/@/components/Modal';
import CompareModal from './CompareModal.vue';
Expand All @@ -61,7 +61,7 @@
JobTypeEnum,
SavePointEnum,
} from '/@/enums/flinkEnum';
import { fetchFlinkSql, fetchFlinkSqlList, fetchRemoveFlinkSql } from '/@/api/flink/app/flinkSql';
import { fetchFlinkSql, fetchFlinkSqlList, fetchRemoveFlinkSql } from '/@/api/flink/flinkSql';
import FlinkSqlReview from './FlinkSqlReview.vue';
import FlinkSqlCompareModal from './FlinkSqlCompareModal.vue';
import { OperationEnum } from '/@/enums/flinkEnum';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import { Select, Tag } from 'ant-design-vue';
import { Icon, SvgIcon } from '/@/components/Icon';
import { useDetailProviderContext } from '../../hooks/useDetailContext';
import { fetchFlinkSql, fetchFlinkSqlList } from '/@/api/flink/app/flinkSql';
import { fetchFlinkSql, fetchFlinkSqlList } from '/@/api/flink/flinkSql';
import { useDrawer } from '/@/components/Drawer';
import { BasicForm, useForm } from '/@/components/Form';
import { BasicModal, useModalInner } from '/@/components/Modal';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<script lang="ts" setup>
import { onMounted, reactive, ref } from 'vue';
import { fetchDashboard } from '/@/api/flink/app/app';
import { fetchDashboard } from '/@/api/flink/app';
import StatisticCard from './StatisticCard.vue';
import { Row, Col } from 'ant-design-vue';
import { useI18n } from '/@/hooks/web/useI18n';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
handleAppBuildStepText,
} from '../../utils';
import BuildLayer from './BuildLayer.vue';
import { AppListRecord } from '/@/api/flink/app/app.type';
import { AppListRecord } from '/@/api/flink/app.type';
import { useTimeoutFn } from '@vueuse/core';
import { fetchBuildDetail } from '/@/api/flink/app/flinkBuild';
import { fetchBuildDetail } from '/@/api/flink/flinkBuild';
import { useI18n } from '/@/hooks/web/useI18n';

const TimelineItem = Timeline.Item;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</script>
<script setup lang="ts" name="LogModal">
import { reactive, ref, unref } from 'vue';
import { fetchK8sStartLog } from '/@/api/flink/app/app';
import { fetchK8sStartLog } from '/@/api/flink/app';
import { BasicModal, useModalInner } from '/@/components/Modal';
import { Icon } from '/@/components/Icon';
import { formatToDateTime } from '/@/utils/dateUtil';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
import { BasicModal, useModalInner } from '/@/components/Modal';
import { useMessage } from '/@/hooks/web/useMessage';
import { useRouter } from 'vue-router';
import { fetchStart } from '/@/api/flink/app/app';
import { fetchStart } from '/@/api/flink/app';
import { RestoreModeEnum } from '/@/enums/flinkEnum';
import { fetchFlinkEnv } from '/@/api/flink/app/flinkEnv';
import { fetchFlinkEnv } from '/@/api/flink/flinkEnv';
import { renderFlinkAppRestoreMode } from '/@/views/flink/app/hooks/useFlinkRender';

const SelectOption = Select.Option;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
import { SvgIcon } from '/@/components/Icon';
import { BasicModal, useModalInner } from '/@/components/Modal';
import { useMessage } from '/@/hooks/web/useMessage';
import { fetchCancel, fetchCheckSavepointPath } from '/@/api/flink/app/app';
import { CancelParam } from '/@/api/flink/app/app.type';
import { fetchCancel, fetchCheckSavepointPath } from '/@/api/flink/app';
import { CancelParam } from '/@/api/flink/app.type';
import { h } from 'vue';
const emit = defineEmits(['register', 'updateOption']);
const app = reactive<Recordable>({});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
import { useMonaco } from '/@/hooks/web/useMonaco';
import { Select, Tabs, Alert, Tag, Space, Form } from 'ant-design-vue';
import { useMessage } from '/@/hooks/web/useMessage';
import { fetchUpload } from '/@/api/flink/app/app';
import { fetchUploadJars } from '/@/api/flink/app/flinkHistory';
import { fetchUpload } from '/@/api/flink/app';
import { fetchUploadJars } from '/@/api/flink/flinkHistory';
import UploadJobJar from './UploadJobJar.vue';

interface DependencyType {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import { Button } from 'ant-design-vue';
import { isEmpty } from '/@/utils/is';
import { useMessage } from '/@/hooks/web/useMessage';
import { fetchFlinkSqlVerify } from '/@/api/flink/app/flinkSql';
import { fetchFlinkSqlVerify } from '/@/api/flink/flinkSql';
import { format } from '../FlinkSqlFormatter';
import { useI18n } from '/@/hooks/web/useI18n';
import { useFullContent } from '/@/hooks/event/useFullscreen';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
fetchCompleteHostAliasToPodTemplate,
fetchPreviewHostAlias,
fetchSysHosts,
} from '/@/api/flink/app/flinkPodtmpl';
} from '/@/api/flink/flinkPodtmpl';

const SelectOption = Select.Option;
const emit = defineEmits(['complete', 'register']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
fetchExtractHostAliasFromPodTemplate,
fetchInitPodTemplate,
fetchPreviewHostAlias,
} from '/@/api/flink/app/flinkPodtmpl';
} from '/@/api/flink/flinkPodtmpl';
import {
fetchFlinkJmPodTemplates,
fetchFlinkPodTemplates,
fetchFlinkTmPodTemplates,
} from '/@/api/flink/app/flinkHistory';
} from '/@/api/flink/flinkHistory';
import HistoryDrawer from './HistoryDrawer.vue';
import HostAliasDrawer from './HostAliasDrawer.vue';
import TemplateButtonGroup from './TemplateButtonGroup.vue';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
import { Alert, Form, Input, Tag } from 'ant-design-vue';
import { h, onMounted, reactive, ref, unref, VNode } from 'vue';
import { handleAppBuildStatueText } from '../utils';
import { fetchCheckName, fetchCopy, fetchForcedStop, fetchMapping } from '/@/api/flink/app/app';
import { fetchBuild, fetchBuildDetail } from '/@/api/flink/app/flinkBuild';
import { fetchSavePonitHistory } from '/@/api/flink/app/savepoint';
import { fetchCheckName, fetchCopy, fetchForcedStop, fetchMapping } from '/@/api/flink/app';
import { fetchBuild, fetchBuildDetail } from '/@/api/flink/flinkBuild';
import { fetchSavePonitHistory } from '/@/api/flink/savepoint';
import { fetchAppOwners } from '/@/api/system/user';
import { SvgIcon } from '/@/components/Icon';
import { AppStateEnum, ExecModeEnum, OptionStateEnum } from '/@/enums/flinkEnum';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import { useRouter } from 'vue-router';
import { handleIsStart } from '../utils';
import { useFlinkAppStore } from '/@/store/modules/flinkApplication';
import { useFlinkApplication } from './useApp';
import { fetchAppRecord, fetchAppRemove } from '/@/api/flink/app/app';
import { AppListRecord } from '/@/api/flink/app/app.type';
import { fetchAppRecord, fetchAppRemove } from '/@/api/flink/app';
import { AppListRecord } from '/@/api/flink/app.type';
import { ActionItem, FormProps } from '/@/components/Table';
import { useMessage } from '/@/hooks/web/useMessage';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
renderYarnQueue,
} from './useFlinkRender';

import { fetchCheckName } from '/@/api/flink/app/app';
import { fetchCheckName } from '/@/api/flink/app';
import { RuleObject } from 'ant-design-vue/lib/form';
import { StoreValue } from 'ant-design-vue/lib/form/interface';
import { useDrawer } from '/@/components/Drawer';
Expand All @@ -42,14 +42,14 @@ import {
fetchFlinkBaseImages,
fetchK8sNamespaces,
fetchSessionClusterIds,
} from '/@/api/flink/app/flinkHistory';
} from '/@/api/flink/flinkHistory';
import { fetchSelect } from '/@/api/resource/project';
import { fetchAlertSetting } from '/@/api/setting/alert';
import { fetchFlinkCluster } from '/@/api/flink/app/flinkCluster';
import { fetchFlinkEnv, fetchListFlinkEnv } from '/@/api/flink/app/flinkEnv';
import { FlinkEnv } from '/@/api/flink/app/flinkEnv.type';
import { fetchFlinkCluster } from '/@/api/flink/flinkCluster';
import { fetchFlinkEnv, fetchListFlinkEnv } from '/@/api/flink/flinkEnv';
import { FlinkEnv } from '/@/api/flink/flinkEnv.type';
import { AlertSetting } from '/@/api/setting/types/alert.type';
import { FlinkCluster } from '/@/api/flink/app/flinkCluster.type';
import { FlinkCluster } from '/@/api/flink/flinkCluster.type';
import { AppTypeEnum, ClusterStateEnum, ExecModeEnum, JobTypeEnum } from '/@/enums/flinkEnum';
import { isK8sExecMode } from '../utils';
import { useI18n } from '/@/hooks/web/useI18n';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {

import { SvgIcon } from '/@/components/Icon';
import { useCreateAndEditSchema } from './useCreateAndEditSchema';
import { fetchMain, fetchName } from '/@/api/flink/app/app';
import { fetchMain, fetchName } from '/@/api/flink/app';
import { modules, fetchListConf, fetchListJars } from '/@/api/resource/project';
import { RuleObject } from 'ant-design-vue/lib/form';
import { StoreValue } from 'ant-design-vue/lib/form/interface';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { fetchRemoveSavePoint } from '/@/api/flink/app/savepoint';
import { fetchRemoveSavePoint } from '/@/api/flink/savepoint';
import { ActionItem } from '/@/components/Table';
import { useMessage } from '/@/hooks/web/useMessage';
import { useClipboard } from '@vueuse/core';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/
import { InjectionKey } from 'vue';
import { AppListRecord } from '/@/api/flink/app/app.type';
import { AppListRecord } from '/@/api/flink/app.type';
import { createContext, useContext } from '/@/hooks/core/useContext';

export interface DetailProviderContextProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import { reactive } from 'vue';
import { useRoute } from 'vue-router';
import { optionsValueMapping } from '../data/option';
import { fetchGet } from '/@/api/flink/app/app';
import { AppListRecord } from '/@/api/flink/app/app.type';
import { fetchGet } from '/@/api/flink/app';
import { AppListRecord } from '/@/api/flink/app.type';
import { isString } from '/@/utils/is';

export const useEdit = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { useCreateAndEditSchema } from './useCreateAndEditSchema';
import { getAlertSvgIcon } from './useFlinkRender';
import { Alert } from 'ant-design-vue';
import { useRoute } from 'vue-router';
import { fetchMain } from '/@/api/flink/app/app';
import { fetchMain } from '/@/api/flink/app';
import { ResourceFromEnum } from '/@/enums/flinkEnum';

export const useEditFlinkSchema = (jars: Ref) => {
Expand Down
Loading

0 comments on commit dfc72fa

Please sign in to comment.