update deployment

This commit is contained in:
AceDataCloud committed 2023-12-18 02:38:24 +08:00
1 parent 6119d2d9c3
commit ded672001b
17 files changed
+40 -81

No files matched your search

-1
View File
@@ -4,7 +4,6 @@ WORKDIR /app
COPY package.json yarn.lock ./ COPY package.json yarn.lock ./
RUN yarn RUN yarn
COPY . . COPY . .
RUN yarn run init:https
RUN yarn build RUN yarn build
# production stage # production stage
+6 -6
View File
@@ -2,23 +2,23 @@ apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
labels: labels:
app: chat-frontend app: hub-frontend
name: chat-frontend name: hub-frontend
namespace: zhishuyun namespace: zhishuyun
spec: spec:
replicas: 2 replicas: 2
revisionHistoryLimit: 5 revisionHistoryLimit: 5
selector: selector:
matchLabels: matchLabels:
app: chat-frontend app: hub-frontend
template: template:
metadata: metadata:
labels: labels:
app: chat-frontend app: hub-frontend
spec: spec:
containers: containers:
- image: ghcr.io/zhishuyun/chat-frontend:${TAG} - image: ghcr.io/zhishuyun/hub-frontend:${TAG}
name: chat-frontend name: hub-frontend
ports: ports:
- containerPort: 80 - containerPort: 80
livenessProbe: livenessProbe:
+4 -4
View File
@@ -1,7 +1,7 @@
apiVersion: networking.k8s.io/v1beta1 apiVersion: networking.k8s.io/v1beta1
kind: Ingress kind: Ingress
metadata: metadata:
name: chat-frontend name: hub-frontend
namespace: zhishuyun namespace: zhishuyun
annotations: annotations:
kubernetes.io/ingress.class: 'nginx' kubernetes.io/ingress.class: 'nginx'
@@ -10,13 +10,13 @@ metadata:
spec: spec:
tls: tls:
- hosts: - hosts:
- chat.zhishuyun.com - hub.zhishuyun.com
secretName: tls-wildcard-zhishuyun-com secretName: tls-wildcard-zhishuyun-com
rules: rules:
- host: chat.zhishuyun.com - host: hub.zhishuyun.com
http: http:
paths: paths:
- backend: - backend:
serviceName: chat-frontend serviceName: hub-frontend
servicePort: 8083 servicePort: 8083
path: / path: /
+3 -3
View File
@@ -2,8 +2,8 @@ apiVersion: v1
kind: Service kind: Service
metadata: metadata:
labels: labels:
app: chat-frontend app: hub-frontend
name: chat-frontend name: hub-frontend
namespace: zhishuyun namespace: zhishuyun
spec: spec:
ports: ports:
@@ -11,4 +11,4 @@ spec:
port: 8083 port: 8083
targetPort: 80 targetPort: 80
selector: selector:
app: chat-frontend app: hub-frontend
+6 -6
View File
@@ -2,23 +2,23 @@ apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
labels: labels:
app: chat-frontend app: hub-frontend
name: chat-frontend name: hub-frontend
namespace: zhishuyun-test namespace: zhishuyun-test
spec: spec:
replicas: 1 replicas: 1
revisionHistoryLimit: 5 revisionHistoryLimit: 5
selector: selector:
matchLabels: matchLabels:
app: chat-frontend app: hub-frontend
template: template:
metadata: metadata:
labels: labels:
app: chat-frontend app: hub-frontend
spec: spec:
containers: containers:
- image: ghcr.io/zhishuyun/chat-frontend:${TAG} - image: ghcr.io/zhishuyun/hub-frontend:${TAG}
name: chat-frontend name: hub-frontend
ports: ports:
- containerPort: 80 - containerPort: 80
resources: resources:
+4 -4
View File
@@ -1,7 +1,7 @@
apiVersion: networking.k8s.io/v1beta1 apiVersion: networking.k8s.io/v1beta1
kind: Ingress kind: Ingress
metadata: metadata:
name: chat-frontend name: hub-frontend
namespace: zhishuyun-test namespace: zhishuyun-test
annotations: annotations:
kubernetes.io/ingress.class: 'nginx' kubernetes.io/ingress.class: 'nginx'
@@ -10,13 +10,13 @@ metadata:
spec: spec:
tls: tls:
- hosts: - hosts:
- chat.test.zhishuyun.com - hub.test.zhishuyun.com
secretName: tls-wildcard-test-zhishuyun-com secretName: tls-wildcard-test-zhishuyun-com
rules: rules:
- host: chat.test.zhishuyun.com - host: hub.test.zhishuyun.com
http: http:
paths: paths:
- backend: - backend:
serviceName: chat-frontend serviceName: hub-frontend
servicePort: 8083 servicePort: 8083
path: / path: /
+3 -3
View File
@@ -2,8 +2,8 @@ apiVersion: v1
kind: Service kind: Service
metadata: metadata:
labels: labels:
app: chat-frontend app: hub-frontend
name: chat-frontend name: hub-frontend
namespace: zhishuyun-test namespace: zhishuyun-test
spec: spec:
ports: ports:
@@ -11,4 +11,4 @@ spec:
port: 8083 port: 8083
targetPort: 80 targetPort: 80
selector: selector:
app: chat-frontend app: hub-frontend
+1 -1
View File
@@ -4,7 +4,7 @@
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" /> <link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>知数云</title> <title>知数云 - 数字化服务的智慧之选</title>
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>
-2
View File
@@ -21,12 +21,10 @@ export default defineComponent({
}, },
async mounted() { async mounted() {
const { data: user } = await userOperator.getMe(); const { data: user } = await userOperator.getMe();
console.log('suer', user);
this.$store.dispatch('setUser', user); this.$store.dispatch('setUser', user);
const { data: applications } = await applicationOperator.getAll({ const { data: applications } = await applicationOperator.getAll({
user_id: user.id user_id: user.id
}); });
console.log('applicatioins', applications);
this.$store.dispatch('setApplications', applications); this.$store.dispatch('setApplications', applications);
} }
}); });
-7
View File
@@ -1,7 +0,0 @@
import message from './message';
import title from './title';
export default {
message,
title
};
-28
View File
@@ -1,28 +0,0 @@
export default {
noToken: '请先申请对应服务',
newMessagePlaceholder: '请输入你的问题...',
noInput: '问题不能为空',
apiInfo: '本服务由「知数云」提供技术支持',
tryForFree: '免费使用',
initializing: '初始化中,请稍后...',
writeCode: '写一段 JavaScript 代码,输出 Hello World',
writeEmail: '写一封邮件给 Bob,告诉他我刚刚搬家了',
explainDefinition: '用简单的术语解释量子计算',
rememberHistory: '可以记住用户说过的话',
supportStream: '支持流式数据传输',
rejectInvalidPrompt: '可以拒绝回答不恰当的提问',
generateInCorrect: '可能偶尔产生不正确的信息',
generateHarmfulInfo: '可能偶尔产生有害的指令或有偏见的内容',
onlyKnowBefore2021: '对2021年之后的世界和事件了解有限',
errorBusy: 'Worker正在忙碌中,请稍后重试',
errorApiError: '回答失败,请稍后重试',
errorBadRequest: '请求内容不规范,请重新提问',
errorNoConversation: '对话内容不存在或者已经过期,请发起新的会话',
confirmDelete: '确定删除',
errorUsedUp: '您的套餐次数已经用完,请购买更多次数继续使用',
errorUnknown: '服务器出现未知错误,请稍后重试或联系客服',
errorTimeout: '回答问题超时,请稍后重试',
howToBreakLine: '按 Shift+Enter 键可以换行',
remainingCount: '剩余次数',
usedCount: '使用次数'
};
-5
View File
@@ -1,5 +0,0 @@
export default {
example: '样例',
capabilities: '功能',
limitations: '限制'
};
+3 -3
View File
@@ -1,5 +1,5 @@
<script lang="ts"> <script lang="ts">
import { getAuthBaseUrl, getChatBaseUrl } from '@/utils'; import { getAuthBaseUrl, getHubBaseUrl } from '@/utils';
import { defineComponent } from 'vue'; import { defineComponent } from 'vue';
interface IData { interface IData {
@@ -14,10 +14,10 @@ export default defineComponent({
}; };
}, },
async mounted() { async mounted() {
const chatBaseUrl = getChatBaseUrl(); const hubBaseUrl = getHubBaseUrl();
const authBaseUrl = getAuthBaseUrl(); const authBaseUrl = getAuthBaseUrl();
// callback url used to init access token and then redirect back of `redirect` // callback url used to init access token and then redirect back of `redirect`
const callbackUrl = `${chatBaseUrl}/auth/callback?redirect=${this.redirect}`; const callbackUrl = `${hubBaseUrl}/auth/callback?redirect=${this.redirect}`;
// redirect to auth service to get access token then redirect back // redirect to auth service to get access token then redirect back
const targetUrl = `${authBaseUrl}/auth/login?redirect=${callbackUrl}`; const targetUrl = `${authBaseUrl}/auth/login?redirect=${callbackUrl}`;
window.location.href = targetUrl; window.location.href = targetUrl;
+3 -3
View File
@@ -9,8 +9,8 @@
<div class="pt-4"> <div class="pt-4">
<reference-image class="mb-4" @change="references = $event" /> <reference-image class="mb-4" @change="references = $event" />
<prompt-input v-model="prompt" class="mb-4" /> <prompt-input v-model="prompt" class="mb-4" />
<elements-selector v-model="elements" :advanced="preset.advanced" class="mb-4" /> <elements-selector v-model="elements" :advanced="preset?.advanced" class="mb-4" />
<ignore-selector v-if="preset.advanced" v-model="ignore" class="mb-4" /> <ignore-selector v-if="preset?.advanced" v-model="ignore" class="mb-4" />
<final-prompt v-if="finalPrompt" :model-value="finalPrompt" /> <final-prompt v-if="finalPrompt" :model-value="finalPrompt" />
<el-button type="primary" class="btn btn-generate" :disabled="!finalPrompt" @click="onGenerate"> <el-button type="primary" class="btn btn-generate" :disabled="!finalPrompt" @click="onGenerate">
{{ $t('midjourney.button.generate') }} {{ $t('midjourney.button.generate') }}
@@ -84,7 +84,7 @@ export default defineComponent({
return { return {
applications: [], applications: [],
channel: MIDJOURNEY_CHANNEL_FAST, channel: MIDJOURNEY_CHANNEL_FAST,
preset: this.$store.getters.midjourney.preset, preset: this.$store.getters.midjourney.preset || {},
prompt: '', prompt: '',
elements: [], elements: [],
ignore: '', ignore: '',
+2
View File
@@ -1,4 +1,5 @@
import { createRouter, createWebHistory } from 'vue-router'; import { createRouter, createWebHistory } from 'vue-router';
import auth from './auth';
import chat from './chat'; import chat from './chat';
import midjourney from './midjourney'; import midjourney from './midjourney';
import { ROUTE_CONVERSATION_NEW, ROUTE_INDEX } from './constants'; import { ROUTE_CONVERSATION_NEW, ROUTE_INDEX } from './constants';
@@ -11,6 +12,7 @@ const routes = [
name: ROUTE_CONVERSATION_NEW name: ROUTE_CONVERSATION_NEW
} }
}, },
auth,
chat, chat,
midjourney midjourney
]; ];
+1 -1
View File
@@ -10,7 +10,7 @@ const store = createStore({
return { return {
user: {}, user: {},
token: { token: {
access: import.meta.env.VITE_ACCESS_TOKEN?.toString(), access: undefined,
refresh: undefined refresh: undefined
}, },
setting: { setting: {
+4 -4
View File
@@ -20,14 +20,14 @@ export const getDataBaseUrl = () => {
* Get base url of app * Get base url of app
* @returns * @returns
*/ */
export const getChatBaseUrl = () => { export const getHubBaseUrl = () => {
const env = getEnv(); const env = getEnv();
if (env === ENV_LOCAL) { if (env === ENV_LOCAL) {
return 'https://chat.local.zhishuyun.com'; return 'https://hub.local.zhishuyun.com';
} else if (env === ENV_TEST) { } else if (env === ENV_TEST) {
return 'https://chat.test.zhishuyun.com'; return 'https://hub.test.zhishuyun.com';
} else { } else {
return 'https://chat.zhishuyun.com'; return 'https://hub.zhishuyun.com';
} }
}; };