songjianet
3 years ago
committed by
GitHub
27 changed files with 765 additions and 0 deletions
@ -0,0 +1,18 @@
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more |
||||
# contributor license agreements. See the NOTICE file distributed with |
||||
# this work for additional information regarding copyright ownership. |
||||
# The ASF licenses this file to You under the Apache License, Version 2.0 |
||||
# (the "License"); you may not use this file except in compliance with |
||||
# the License. You may obtain a copy of the License at |
||||
# |
||||
# http://www.apache.org/licenses/LICENSE-2.0 |
||||
# |
||||
# Unless required by applicable law or agreed to in writing, software |
||||
# distributed under the License is distributed on an "AS IS" BASIS, |
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
# See the License for the specific language governing permissions and |
||||
# limitations under the License. |
||||
|
||||
NODE_ENV = development |
||||
|
||||
VITE_APP_WEB_URL = '' |
@ -0,0 +1,18 @@
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more |
||||
# contributor license agreements. See the NOTICE file distributed with |
||||
# this work for additional information regarding copyright ownership. |
||||
# The ASF licenses this file to You under the Apache License, Version 2.0 |
||||
# (the "License"); you may not use this file except in compliance with |
||||
# the License. You may obtain a copy of the License at |
||||
# |
||||
# http://www.apache.org/licenses/LICENSE-2.0 |
||||
# |
||||
# Unless required by applicable law or agreed to in writing, software |
||||
# distributed under the License is distributed on an "AS IS" BASIS, |
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
# See the License for the specific language governing permissions and |
||||
# limitations under the License. |
||||
|
||||
NODE_ENV = production |
||||
|
||||
VITE_APP_WEB_URL = '' |
@ -0,0 +1,17 @@
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more |
||||
# contributor license agreements. See the NOTICE file distributed with |
||||
# this work for additional information regarding copyright ownership. |
||||
# The ASF licenses this file to You under the Apache License, Version 2.0 |
||||
# (the "License"); you may not use this file except in compliance with |
||||
# the License. You may obtain a copy of the License at |
||||
# |
||||
# http://www.apache.org/licenses/LICENSE-2.0 |
||||
# |
||||
# Unless required by applicable law or agreed to in writing, software |
||||
# distributed under the License is distributed on an "AS IS" BASIS, |
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
# See the License for the specific language governing permissions and |
||||
# limitations under the License. |
||||
|
||||
node_modules |
||||
dist |
@ -0,0 +1,66 @@
|
||||
/* |
||||
* Licensed to the Apache Software Foundation (ASF) under one or more |
||||
* contributor license agreements. See the NOTICE file distributed with |
||||
* this work for additional information regarding copyright ownership. |
||||
* The ASF licenses this file to You under the Apache License, Version 2.0 |
||||
* (the "License"); you may not use this file except in compliance with |
||||
* the License. You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
module.exports = { |
||||
parser: 'vue-eslint-parser', |
||||
parserOptions: { |
||||
parser: '@typescript-eslint/parser', |
||||
ecmaVersion: 2021, |
||||
sourceType: 'module', |
||||
ecmaFeatures: { |
||||
jsx: true |
||||
} |
||||
}, |
||||
extends: [ |
||||
'plugin:vue/vue3-recommended', |
||||
'plugin:@typescript-eslint/recommended', |
||||
'plugin:prettier/recommended', |
||||
'prettier' |
||||
], |
||||
rules: { |
||||
'@typescript-eslint/ban-ts-ignore': 'off', |
||||
'@typescript-eslint/explicit-function-return-type': 'off', |
||||
'@typescript-eslint/no-explicit-any': 'off', |
||||
'@typescript-eslint/no-var-requires': 'off', |
||||
'@typescript-eslint/no-empty-function': 'off', |
||||
'@typescript-eslint/no-empty-interface': 'off', |
||||
'vue/custom-event-name-casing': 'off', |
||||
'no-use-before-define': 'off', |
||||
'@typescript-eslint/no-use-before-define': 'off', |
||||
'@typescript-eslint/ban-ts-comment': 'off', |
||||
'@typescript-eslint/ban-types': 'off', |
||||
'@typescript-eslint/no-non-null-assertion': 'off', |
||||
'@typescript-eslint/explicit-module-boundary-types': 'off', |
||||
'@typescript-eslint/no-unused-vars': [ |
||||
'error', |
||||
{ |
||||
argsIgnorePattern: '^h$', |
||||
varsIgnorePattern: '^h$' |
||||
} |
||||
], |
||||
'no-unused-vars': [ |
||||
'error', |
||||
{ |
||||
argsIgnorePattern: '^h$', |
||||
varsIgnorePattern: '^h$' |
||||
} |
||||
], |
||||
'space-before-function-paren': 'off', |
||||
quotes: ['error', 'single'], |
||||
'comma-dangle': ['error', 'never'] |
||||
} |
||||
} |
@ -0,0 +1,30 @@
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more |
||||
# contributor license agreements. See the NOTICE file distributed with |
||||
# this work for additional information regarding copyright ownership. |
||||
# The ASF licenses this file to You under the Apache License, Version 2.0 |
||||
# (the "License"); you may not use this file except in compliance with |
||||
# the License. You may obtain a copy of the License at |
||||
# |
||||
# http://www.apache.org/licenses/LICENSE-2.0 |
||||
# |
||||
# Unless required by applicable law or agreed to in writing, software |
||||
# distributed under the License is distributed on an "AS IS" BASIS, |
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
# See the License for the specific language governing permissions and |
||||
# limitations under the License. |
||||
|
||||
.vscode |
||||
.idea |
||||
.DS_Store |
||||
|
||||
*.local |
||||
*.swp |
||||
*.tgz |
||||
*.tsbuildinfo |
||||
|
||||
node_modules |
||||
dist |
||||
dist-ssr |
||||
|
||||
pnpm-lock.yaml |
||||
.pnpm-debug.log |
@ -0,0 +1,29 @@
|
||||
/* |
||||
* Licensed to the Apache Software Foundation (ASF) under one or more |
||||
* contributor license agreements. See the NOTICE file distributed with |
||||
* this work for additional information regarding copyright ownership. |
||||
* The ASF licenses this file to You under the Apache License, Version 2.0 |
||||
* (the "License"); you may not use this file except in compliance with |
||||
* the License. You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
module.exports = { |
||||
"useTabs": false, |
||||
"semi": false, |
||||
"vueIndentScriptAndStyle": true, |
||||
"singleQuote": true, |
||||
"quoteProps": "as-needed", |
||||
"jsxBracketSameLine": false, |
||||
"jsxSingleQuote": true, |
||||
"arrowParens": "always", |
||||
"htmlWhitespaceSensitivity": "strict", |
||||
"endOfLine": "lf" |
||||
}; |
@ -0,0 +1,17 @@
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more |
||||
# contributor license agreements. See the NOTICE file distributed with |
||||
# this work for additional information regarding copyright ownership. |
||||
# The ASF licenses this file to You under the Apache License, Version 2.0 |
||||
# (the "License"); you may not use this file except in compliance with |
||||
# the License. You may obtain a copy of the License at |
||||
# |
||||
# http://www.apache.org/licenses/LICENSE-2.0 |
||||
# |
||||
# Unless required by applicable law or agreed to in writing, software |
||||
# distributed under the License is distributed on an "AS IS" BASIS, |
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
# See the License for the specific language governing permissions and |
||||
# limitations under the License. |
||||
|
||||
node_modules |
||||
dist |
@ -0,0 +1,5 @@
|
||||
### Dolphin Scheduler UI Next |
||||
|
||||
#### start |
||||
|
||||
Please make sure you use `node 16+` and `pnpm` to manage the dependencies of the project. |
@ -0,0 +1,31 @@
|
||||
<!-- |
||||
* Licensed to the Apache Software Foundation (ASF) under one |
||||
* or more contributor license agreements. See the NOTICE file |
||||
* distributed with this work for additional information |
||||
* regarding copyright ownership. The ASF licenses this file |
||||
* to you under the Apache License, Version 2.0 (the |
||||
* "License"); you may not use this file except in compliance |
||||
* with the License. You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
--> |
||||
|
||||
<!DOCTYPE html> |
||||
<html lang="en"> |
||||
<head> |
||||
<meta charset="UTF-8" /> |
||||
<link rel="icon" href="/favicon.ico" /> |
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
||||
<title>Dolphin Scheduler Admin</title> |
||||
</head> |
||||
<body> |
||||
<div id="app"></div> |
||||
<script type="module" src="/src/main.ts"></script> |
||||
</body> |
||||
</html> |
@ -0,0 +1,43 @@
|
||||
{ |
||||
"name": "dolphinscheduler-ui-next", |
||||
"version": "0.0.0", |
||||
"scripts": { |
||||
"dev": "vite", |
||||
"build:dev": "vue-tsc --noEmit && vite build --mode development", |
||||
"build:prod": "vue-tsc --noEmit && vite build --mode production", |
||||
"preview": "vite preview", |
||||
"lint": "eslint src --fix --ext .ts,.tsx,.vue", |
||||
"prettier": "prettier --config .prettier.js --write src/**/*.{vue,ts,tsx}" |
||||
}, |
||||
"dependencies": { |
||||
"@vueuse/core": "^7.2.2", |
||||
"axios": "^0.24.0", |
||||
"date-fns": "^2.27.0", |
||||
"naive-ui": "^2.21.5", |
||||
"nprogress": "^0.2.0", |
||||
"pinia": "^2.0.0-rc.10", |
||||
"vfonts": "^0.1.0", |
||||
"vue": "^3.2.23", |
||||
"vue-i18n": "^9.2.0-beta.23", |
||||
"vue-router": "^4.0.12" |
||||
}, |
||||
"devDependencies": { |
||||
"@types/nprogress": "^0.2.0", |
||||
"@typescript-eslint/eslint-plugin": "^5.6.0", |
||||
"@typescript-eslint/parser": "^5.6.0", |
||||
"@vitejs/plugin-vue": "^1.10.2", |
||||
"@vitejs/plugin-vue-jsx": "^1.3.1", |
||||
"dart-sass": "^1.25.0", |
||||
"eslint": "^8.4.1", |
||||
"eslint-config-prettier": "^8.3.0", |
||||
"eslint-plugin-prettier": "^4.0.0", |
||||
"eslint-plugin-vue": "^8.2.0", |
||||
"prettier": "^2.5.1", |
||||
"sass": "^1.44.0", |
||||
"sass-loader": "^12.4.0", |
||||
"typescript": "^4.4.4", |
||||
"vite": "^2.7.0", |
||||
"vite-plugin-compression": "^0.3.6", |
||||
"vue-tsc": "^0.28.10" |
||||
} |
||||
} |
@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!-- |
||||
~ Licensed to the Apache Software Foundation (ASF) under one or more |
||||
~ contributor license agreements. See the NOTICE file distributed with |
||||
~ this work for additional information regarding copyright ownership. |
||||
~ The ASF licenses this file to You under the Apache License, Version 2.0 |
||||
~ (the "License"); you may not use this file except in compliance with |
||||
~ the License. You may obtain a copy of the License at |
||||
~ |
||||
~ http://www.apache.org/licenses/LICENSE-2.0 |
||||
~ |
||||
~ Unless required by applicable law or agreed to in writing, software |
||||
~ distributed under the License is distributed on an "AS IS" BASIS, |
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
~ See the License for the specific language governing permissions and |
||||
~ limitations under the License. |
||||
--> |
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||
<parent> |
||||
<artifactId>dolphinscheduler</artifactId> |
||||
<groupId>org.apache.dolphinscheduler</groupId> |
||||
<version>2.0.0-SNAPSHOT</version> |
||||
</parent> |
||||
<modelVersion>4.0.0</modelVersion> |
||||
|
||||
<artifactId>dolphinscheduler-ui-next</artifactId> |
||||
|
||||
<name>${project.artifactId}</name> |
||||
|
||||
<properties> |
||||
<node.version>v16.13.1</node.version> |
||||
<npm.version>8.1.2</npm.version> |
||||
<sonar.sources>src</sonar.sources> |
||||
</properties> |
||||
</project> |
After Width: | Height: | Size: 4.2 KiB |
@ -0,0 +1,48 @@
|
||||
/* |
||||
* Licensed to the Apache Software Foundation (ASF) under one or more |
||||
* contributor license agreements. See the NOTICE file distributed with |
||||
* this work for additional information regarding copyright ownership. |
||||
* The ASF licenses this file to You under the Apache License, Version 2.0 |
||||
* (the "License"); you may not use this file except in compliance with |
||||
* the License. You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
import { defineComponent, computed } from 'vue' |
||||
import { NConfigProvider, darkTheme } from 'naive-ui' |
||||
import { useThemeStore } from '@/store/theme' |
||||
|
||||
const App = defineComponent({ |
||||
name: 'App', |
||||
setup() { |
||||
const themeStore = useThemeStore() |
||||
console.log(themeStore.dartTheme) |
||||
const currentTheme = computed(() => |
||||
themeStore.dartTheme ? darkTheme : undefined |
||||
) |
||||
console.log(currentTheme.value) |
||||
|
||||
return { |
||||
currentTheme, |
||||
} |
||||
}, |
||||
render() { |
||||
return ( |
||||
<NConfigProvider |
||||
theme={this.currentTheme} |
||||
style={{ width: '100%', height: '100vh' }} |
||||
> |
||||
<router-view /> |
||||
</NConfigProvider> |
||||
) |
||||
}, |
||||
}) |
||||
|
||||
export default App |
@ -0,0 +1,25 @@
|
||||
/* |
||||
* Licensed to the Apache Software Foundation (ASF) under one or more |
||||
* contributor license agreements. See the NOTICE file distributed with |
||||
* this work for additional information regarding copyright ownership. |
||||
* The ASF licenses this file to You under the Apache License, Version 2.0 |
||||
* (the "License"); you may not use this file except in compliance with |
||||
* the License. You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0 |
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
* { |
||||
outline: 0; |
||||
} |
||||
|
||||
html, body, p, dl, dd, dt { |
||||
margin: 0; |
||||
padding: 0; |
||||
} |
@ -0,0 +1,32 @@
|
||||
/* |
||||
* Licensed to the Apache Software Foundation (ASF) under one or more |
||||
* contributor license agreements. See the NOTICE file distributed with |
||||
* this work for additional information regarding copyright ownership. |
||||
* The ASF licenses this file to You under the Apache License, Version 2.0 |
||||
* (the "License"); you may not use this file except in compliance with |
||||
* the License. You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
declare module '*.vue' { |
||||
import { DefineComponent } from 'vue' |
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
|
||||
const component: DefineComponent<{}, {}, any> |
||||
export default component |
||||
} |
||||
|
||||
declare module '*.scss' { |
||||
const classes: { readonly [key: string]: string } |
||||
export default classes |
||||
} |
||||
|
||||
declare module '*.png' |
||||
declare module '*.jpg' |
||||
declare module '*.jpeg' |
@ -0,0 +1,31 @@
|
||||
/* |
||||
* Licensed to the Apache Software Foundation (ASF) under one or more |
||||
* contributor license agreements. See the NOTICE file distributed with |
||||
* this work for additional information regarding copyright ownership. |
||||
* The ASF licenses this file to You under the Apache License, Version 2.0 |
||||
* (the "License"); you may not use this file except in compliance with |
||||
* the License. You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
import { createI18n } from 'vue-i18n' |
||||
import zh_CN from './modules/zh_CN' |
||||
import en_US from './modules/en_US' |
||||
|
||||
const i18n = createI18n({ |
||||
globalInjection: true, |
||||
locale: 'zh_CN', |
||||
messages: { |
||||
zh_CN, |
||||
en_US, |
||||
}, |
||||
}) |
||||
|
||||
export default i18n |
@ -0,0 +1,24 @@
|
||||
/* |
||||
* Licensed to the Apache Software Foundation (ASF) under one or more |
||||
* contributor license agreements. See the NOTICE file distributed with |
||||
* this work for additional information regarding copyright ownership. |
||||
* The ASF licenses this file to You under the Apache License, Version 2.0 |
||||
* (the "License"); you may not use this file except in compliance with |
||||
* the License. You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
const login = { |
||||
test: 'Test', |
||||
} |
||||
|
||||
export default { |
||||
login, |
||||
} |
@ -0,0 +1,24 @@
|
||||
/* |
||||
* Licensed to the Apache Software Foundation (ASF) under one or more |
||||
* contributor license agreements. See the NOTICE file distributed with |
||||
* this work for additional information regarding copyright ownership. |
||||
* The ASF licenses this file to You under the Apache License, Version 2.0 |
||||
* (the "License"); you may not use this file except in compliance with |
||||
* the License. You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
const login = { |
||||
test: '测试', |
||||
} |
||||
|
||||
export default { |
||||
login, |
||||
} |
@ -0,0 +1,29 @@
|
||||
/* |
||||
* Licensed to the Apache Software Foundation (ASF) under one or more |
||||
* contributor license agreements. See the NOTICE file distributed with |
||||
* this work for additional information regarding copyright ownership. |
||||
* The ASF licenses this file to You under the Apache License, Version 2.0 |
||||
* (the "License"); you may not use this file except in compliance with |
||||
* the License. You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
import { createApp } from 'vue' |
||||
import App from './App' |
||||
import router from './router' |
||||
import { createPinia } from 'pinia' |
||||
import i18n from '@/locales' |
||||
import './assets/styles/default.scss' |
||||
|
||||
const app = createApp(App) |
||||
app.use(router) |
||||
app.use(createPinia()) |
||||
app.use(i18n) |
||||
app.mount('#app') |
@ -0,0 +1,33 @@
|
||||
/* |
||||
* Licensed to the Apache Software Foundation (ASF) under one or more |
||||
* contributor license agreements. See the NOTICE file distributed with |
||||
* this work for additional information regarding copyright ownership. |
||||
* The ASF licenses this file to You under the Apache License, Version 2.0 |
||||
* (the "License"); you may not use this file except in compliance with |
||||
* the License. You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router' |
||||
|
||||
const routes: RouteRecordRaw[] = [ |
||||
{ |
||||
path: '/login', |
||||
name: 'Login', |
||||
component: () => import('@/views/login/Login'), |
||||
}, |
||||
] |
||||
|
||||
const index = createRouter({ |
||||
history: createWebHistory(), |
||||
routes, |
||||
}) |
||||
|
||||
export default index |
@ -0,0 +1,39 @@
|
||||
/* |
||||
* Licensed to the Apache Software Foundation (ASF) under one or more |
||||
* contributor license agreements. See the NOTICE file distributed with |
||||
* this work for additional information regarding copyright ownership. |
||||
* The ASF licenses this file to You under the Apache License, Version 2.0 |
||||
* (the "License"); you may not use this file except in compliance with |
||||
* the License. You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
import axios, { AxiosRequestConfig, AxiosResponse, AxiosError } from 'axios' |
||||
|
||||
const baseRequestConfig: AxiosRequestConfig = { |
||||
baseURL: '/', |
||||
timeout: 10000, |
||||
} |
||||
|
||||
const service = axios.create(baseRequestConfig) |
||||
|
||||
const err = (error: AxiosError): Promise<AxiosError> => { |
||||
return Promise.reject(error) |
||||
} |
||||
|
||||
service.interceptors.request.use((config: AxiosRequestConfig<any>) => { |
||||
return config |
||||
}, err) |
||||
|
||||
service.interceptors.response.use((res: AxiosResponse) => { |
||||
return res.data |
||||
}, err) |
||||
|
||||
export { service as axios } |
@ -0,0 +1,31 @@
|
||||
/* |
||||
* Licensed to the Apache Software Foundation (ASF) under one or more |
||||
* contributor license agreements. See the NOTICE file distributed with |
||||
* this work for additional information regarding copyright ownership. |
||||
* The ASF licenses this file to You under the Apache License, Version 2.0 |
||||
* (the "License"); you may not use this file except in compliance with |
||||
* the License. You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
import { defineStore } from 'pinia' |
||||
|
||||
export const useThemeStore = defineStore({ |
||||
id: 'theme', |
||||
state: () => ({ |
||||
dartTheme: true, |
||||
}), |
||||
getters: { |
||||
getTheme(): boolean { |
||||
return this.dartTheme |
||||
}, |
||||
}, |
||||
actions: {}, |
||||
}) |
@ -0,0 +1,42 @@
|
||||
/* |
||||
* Licensed to the Apache Software Foundation (ASF) under one or more |
||||
* contributor license agreements. See the NOTICE file distributed with |
||||
* this work for additional information regarding copyright ownership. |
||||
* The ASF licenses this file to You under the Apache License, Version 2.0 |
||||
* (the "License"); you may not use this file except in compliance with |
||||
* the License. You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
import { defineComponent } from 'vue' |
||||
import styles from './login.module.scss' |
||||
import { useI18n } from 'vue-i18n' |
||||
import { NButton } from 'naive-ui' |
||||
|
||||
const Login = defineComponent({ |
||||
name: 'Login', |
||||
setup() { |
||||
const { t, locale } = useI18n() |
||||
return { t, locale } |
||||
}, |
||||
render() { |
||||
return ( |
||||
<div class={styles['login-container']}> |
||||
<NButton type='error'>{this.t('login.test')}</NButton> |
||||
<select v-model={this.locale}> |
||||
<option value='en_US'>en_US</option> |
||||
<option value='zh_CN'>zh_CN</option> |
||||
</select> |
||||
</div> |
||||
) |
||||
}, |
||||
}) |
||||
|
||||
export default Login |
@ -0,0 +1,29 @@
|
||||
/* |
||||
* Licensed to the Apache Software Foundation (ASF) under one or more |
||||
* contributor license agreements. See the NOTICE file distributed with |
||||
* this work for additional information regarding copyright ownership. |
||||
* The ASF licenses this file to You under the Apache License, Version 2.0 |
||||
* (the "License"); you may not use this file except in compliance with |
||||
* the License. You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0 |
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
.login-container { |
||||
width: 100%; |
||||
height: 100vh; |
||||
display: flex; |
||||
justify-content: center; |
||||
align-items: center; |
||||
|
||||
> .form-box { |
||||
width: 400px; |
||||
min-height: 260px; |
||||
} |
||||
} |
@ -0,0 +1,18 @@
|
||||
{ |
||||
"compilerOptions": { |
||||
"target": "esnext", |
||||
"module": "esnext", |
||||
"moduleResolution": "node", |
||||
"strict": true, |
||||
"jsx": "preserve", |
||||
"sourceMap": true, |
||||
"resolveJsonModule": true, |
||||
"esModuleInterop": true, |
||||
"lib": ["esnext", "dom"], |
||||
"baseUrl": ".", |
||||
"paths": { |
||||
"@/*": ["src/*"] |
||||
} |
||||
}, |
||||
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"] |
||||
} |
@ -0,0 +1,49 @@
|
||||
/* |
||||
* Licensed to the Apache Software Foundation (ASF) under one or more |
||||
* contributor license agreements. See the NOTICE file distributed with |
||||
* this work for additional information regarding copyright ownership. |
||||
* The ASF licenses this file to You under the Apache License, Version 2.0 |
||||
* (the "License"); you may not use this file except in compliance with |
||||
* the License. You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
import { defineConfig } from 'vite' |
||||
import vue from '@vitejs/plugin-vue' |
||||
import vueJsx from '@vitejs/plugin-vue-jsx' |
||||
import viteCompression from 'vite-plugin-compression' |
||||
import path from 'path' |
||||
|
||||
export default defineConfig({ |
||||
plugins: [ |
||||
vue(), |
||||
vueJsx(), |
||||
viteCompression({ |
||||
verbose: true, |
||||
disable: false, |
||||
threshold: 10240, |
||||
algorithm: 'gzip', |
||||
ext: '.gz' |
||||
}) |
||||
], |
||||
build: { |
||||
terserOptions: { |
||||
compress: { |
||||
drop_console: true, |
||||
drop_debugger: true |
||||
} |
||||
} |
||||
}, |
||||
resolve: { |
||||
alias: { |
||||
'@': path.resolve(__dirname, 'src') |
||||
} |
||||
} |
||||
}) |
Loading…
Reference in new issue