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 ./
RUN yarn
COPY . .
RUN yarn run init:https
RUN yarn build
# production stage
+6 -6
View File
@@ -2,23 +2,23 @@ apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: chat-frontend
name: chat-frontend
app: hub-frontend
name: hub-frontend
namespace: zhishuyun
spec:
replicas: 2
revisionHistoryLimit: 5
selector:
matchLabels:
app: chat-frontend
app: hub-frontend
template:
metadata:
labels:
app: chat-frontend
app: hub-frontend
spec:
containers:
- image: ghcr.io/zhishuyun/chat-frontend:${TAG}
name: chat-frontend
- image: ghcr.io/zhishuyun/hub-frontend:${TAG}
name: hub-frontend
ports:
- containerPort: 80
livenessProbe:
+4 -4
View File
@@ -1,7 +1,7 @@
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: chat-frontend
name: hub-frontend
namespace: zhishuyun
annotations:
kubernetes.io/ingress.class: 'nginx'
@@ -10,13 +10,13 @@ metadata:
spec:
tls:
- hosts:
- chat.zhishuyun.com
- hub.zhishuyun.com
secretName: tls-wildcard-zhishuyun-com
rules:
- host: chat.zhishuyun.com
- host: hub.zhishuyun.com
http:
paths:
- backend:
serviceName: chat-frontend
serviceName: hub-frontend
servicePort: 8083
path: /
+3 -3
View File
@@ -2,8 +2,8 @@ apiVersion: v1
kind: Service
metadata:
labels:
app: chat-frontend
name: chat-frontend
app: hub-frontend
name: hub-frontend
namespace: zhishuyun
spec:
ports:
@@ -11,4 +11,4 @@ spec:
port: 8083
targetPort: 80
selector:
app: chat-frontend
app: hub-frontend
+6 -6
View File
@@ -2,23 +2,23 @@ apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: chat-frontend
name: chat-frontend
app: hub-frontend
name: hub-frontend
namespace: zhishuyun-test
spec:
replicas: 1
revisionHistoryLimit: 5
selector:
matchLabels:
app: chat-frontend
app: hub-frontend
template:
metadata:
labels:
app: chat-frontend
app: hub-frontend
spec:
containers:
- image: ghcr.io/zhishuyun/chat-frontend:${TAG}
name: chat-frontend
- image: ghcr.io/zhishuyun/hub-frontend:${TAG}
name: hub-frontend
ports:
- containerPort: 80
resources:
+4 -4
View File
@@ -1,7 +1,7 @@
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: chat-frontend
name: hub-frontend
namespace: zhishuyun-test
annotations:
kubernetes.io/ingress.class: 'nginx'
@@ -10,13 +10,13 @@ metadata:
spec:
tls:
- hosts:
- chat.test.zhishuyun.com
- hub.test.zhishuyun.com
secretName: tls-wildcard-test-zhishuyun-com
rules:
- host: chat.test.zhishuyun.com
- host: hub.test.zhishuyun.com
http:
paths:
- backend:
serviceName: chat-frontend
serviceName: hub-frontend
servicePort: 8083
path: /
+3 -3
View File
@@ -2,8 +2,8 @@ apiVersion: v1
kind: Service
metadata:
labels:
app: chat-frontend
name: chat-frontend
app: hub-frontend
name: hub-frontend
namespace: zhishuyun-test
spec:
ports:
@@ -11,4 +11,4 @@ spec:
port: 8083
targetPort: 80
selector:
app: chat-frontend
app: hub-frontend
+1 -1
View File
@@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>知数云</title>
<title>知数云 - 数字化服务的智慧之选</title>
</head>
<body>
<div id="app"></div>
-2
View File
@@ -21,12 +21,10 @@ export default defineComponent({
},
async mounted() {
const { data: user } = await userOperator.getMe();
console.log('suer', user);
this.$store.dispatch('setUser', user);
const { data: applications } = await applicationOperator.getAll({
user_id: user.id
});
console.log('applicatioins', 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">
import { getAuthBaseUrl, getChatBaseUrl } from '@/utils';
import { getAuthBaseUrl, getHubBaseUrl } from '@/utils';
import { defineComponent } from 'vue';
interface IData {
@@ -14,10 +14,10 @@ export default defineComponent({
};
},
async mounted() {
const chatBaseUrl = getChatBaseUrl();
const hubBaseUrl = getHubBaseUrl();
const authBaseUrl = getAuthBaseUrl();
// 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
const targetUrl = `${authBaseUrl}/auth/login?redirect=${callbackUrl}`;
window.location.href = targetUrl;
+3 -3
View File
@@ -9,8 +9,8 @@
<div class="pt-4">
<reference-image class="mb-4" @change="references = $event" />
<prompt-input v-model="prompt" 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" />
<elements-selector v-model="elements" :advanced="preset?.advanced" class="mb-4" />
<ignore-selector v-if="preset?.advanced" v-model="ignore" class="mb-4" />
<final-prompt v-if="finalPrompt" :model-value="finalPrompt" />
<el-button type="primary" class="btn btn-generate" :disabled="!finalPrompt" @click="onGenerate">
{{ $t('midjourney.button.generate') }}
@@ -84,7 +84,7 @@ export default defineComponent({
return {
applications: [],
channel: MIDJOURNEY_CHANNEL_FAST,
preset: this.$store.getters.midjourney.preset,
preset: this.$store.getters.midjourney.preset || {},
prompt: '',
elements: [],
ignore: '',
+2
View File
@@ -1,4 +1,5 @@
import { createRouter, createWebHistory } from 'vue-router';
import auth from './auth';
import chat from './chat';
import midjourney from './midjourney';
import { ROUTE_CONVERSATION_NEW, ROUTE_INDEX } from './constants';
@@ -11,6 +12,7 @@ const routes = [
name: ROUTE_CONVERSATION_NEW
}
},
auth,
chat,
midjourney
];
+1 -1
View File
@@ -10,7 +10,7 @@ const store = createStore({
return {
user: {},
token: {
access: import.meta.env.VITE_ACCESS_TOKEN?.toString(),
access: undefined,
refresh: undefined
},
setting: {
+4 -4
View File
@@ -20,14 +20,14 @@ export const getDataBaseUrl = () => {
* Get base url of app
* @returns
*/
export const getChatBaseUrl = () => {
export const getHubBaseUrl = () => {
const env = getEnv();
if (env === ENV_LOCAL) {
return 'https://chat.local.zhishuyun.com';
return 'https://hub.local.zhishuyun.com';
} else if (env === ENV_TEST) {
return 'https://chat.test.zhishuyun.com';
return 'https://hub.test.zhishuyun.com';
} else {
return 'https://chat.zhishuyun.com';
return 'https://hub.zhishuyun.com';
}
};