Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 47 additions & 8 deletions .github/workflows/build-frontend.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,65 @@
name: Build Frontend on PR

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout 🛎️
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 16
cache: "npm"

- name: Install dependencies 🔧
run: npm ci --force

- name: Lint
run: npm run lint

unit-test:
runs-on: ubuntu-latest

steps:
- name: Checkout 🛎️
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 16
cache: 'npm'

- name: Install dependencies 🔧
run: npm ci --force

- name: Test
run: npm run test:unit

build:
runs-on: ubuntu-latest

needs: [lint, unit-test]

steps:
- uses: actions/checkout@v3
- name: Checkout 🛎️
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 16
cache: 'npm'

- name: Install dependencies
- name: Install dependencies 🔧
run: npm ci --force

- name: Build
run: yarn build
- name: Build 🏗️
run: npm run build
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"lodash": "^4.17.21",
"normalize.css": "^8.0.1",
"pinia": "^2.1.7",
"vee-validate": "^4.11.8",
"vee-validate": "^4.12.0",
"vue": "^3.3.8",
"vue-i18n": "9.7.1",
"vue-router": "^4.2.5",
Expand Down
763 changes: 0 additions & 763 deletions src/api/te.json

This file was deleted.

97 changes: 0 additions & 97 deletions src/api/te.yaml

This file was deleted.

21 changes: 21 additions & 0 deletions src/plugins/vee-validate/lib.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unused-vars */
import { Flags } from 'yup';

type MapperFunction = (item: any) => any;

declare module 'yup' {
// Ensure that the type parameters match the original ArraySchema declaration
interface ArraySchema<
TIn extends any[] | null | undefined = any[],
TContext = Record<string, any>,
TDefault = undefined,
TFlags extends Flags = ''
> {
unique(mapper: MapperFunction, label?: string): ArraySchema;
}

interface StringSchema {
s3(): StringSchema;
}
}
23 changes: 2 additions & 21 deletions src/plugins/vee-validate/rules.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,10 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/no-explicit-any */
import { findDuplicateIndices } from '@/utils/findDuplicate';
import { useI18n } from 'vue-i18n';
import {
addMethod, array, string, Flags,
} from 'yup'; // Import the ArraySchema type
import { addMethod, array, string } from 'yup';

// eslint-disable-next-line @typescript-eslint/no-explicit-any
type MapperFunction = (item: any) => any;

declare module 'yup' {
// Ensure that the type parameters match the original ArraySchema declaration
interface ArraySchema<
TIn extends any[] | null | undefined = any[],
TContext = Record<string, any>,
TDefault = undefined,
TFlags extends Flags = ''
> {
unique(mapper: MapperFunction, label?: string): ArraySchema;
}

interface StringSchema {
s3(): StringSchema;
}
}

addMethod(array, 'unique', function unique(mapper: MapperFunction, label: string) {
const { t } = useI18n();

Expand Down
3 changes: 2 additions & 1 deletion src/stores/namespace.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { nError } from '@/utils/useNoty';
import { NAMESPACE } from '@/utils/constant';
import { Namespace } from 'kubernetes-types/core/v1';
import { defineStore } from 'pinia';
Expand All @@ -22,7 +23,7 @@ export const useNamespaceStore = defineStore('namespace', {
this.setNamespace(firstNamespace.metadata?.name || '');
}
} catch (error) {
console.error('接口请求失败:', error);
nError('接口请求失败:', error);
}
},
setNamespace(val: string) {
Expand Down
8 changes: 4 additions & 4 deletions src/views/dataset/DatasetCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,13 @@ const {
handleSubmit,
resetForm,
setFieldError,
defineComponentBinds,
defineField,
} = useForm<DatasetForRender>({
initialValues: dataset,
initialValues: dataset.value,
validationSchema: schema,
});

const parameters = defineComponentBinds('spec.datasetMetadata.plugin.parameters', {
const [parameters] = defineField('spec.datasetMetadata.plugin.parameters', {
validateOnModelUpdate: false,
});

Expand Down Expand Up @@ -476,8 +476,8 @@ const onSubmit = handleSubmit(async (values) => {
<dao-form-item :label="$t('views.Dataset.pluginParameters')">
<key-value-form
ref="componentRef"
v-model="parameters"
name="spec.datasetMetadata.plugin.parameters"
v-bind="parameters"
/>
</dao-form-item>
</template>
Expand Down
6 changes: 3 additions & 3 deletions src/views/finetune-experiment/FinetuneExperimentCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ const validationSchema = markRaw(
);

const {
validate, errorBag, values, defineComponentBinds,
validate, errorBag, values, defineField,
} = useForm<FinetuneExperimentForRender>({
initialValues: finetuneExperiment,
initialValues: finetuneExperiment.value,
validationSchema,
});

const parameters = defineComponentBinds('spec.scoringConfig.parameters', {
const [parameters] = defineField('spec.scoringConfig.parameters', {
validateOnModelUpdate: false,
});

Expand Down
2 changes: 1 addition & 1 deletion src/views/hyperparameter/HyperparameterCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const {
handleSubmit,
resetForm,
} = useForm<Hyperparameter>({
initialValues: hyperparameter,
initialValues: hyperparameter.value,
validationSchema: schema,
});

Expand Down