Skip to content

Commit 076f3f0

Browse files
feat(website): Restrict unhealthy application selection during websit… (#8269)
1 parent 79c8349 commit 076f3f0

4 files changed

Lines changed: 20 additions & 4 deletions

File tree

core/app/api/v2/auth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func (b *BaseApi) Login(c *gin.Context) {
3939

4040
user, msgKey, err := authService.Login(c, req, string(entrance))
4141
go saveLoginLogs(c, err)
42-
if msgKey == "ErrAuth" {
42+
if msgKey == "ErrAuth" || msgKey == "ErrEntrance" {
4343
helper.BadAuth(c, msgKey, err)
4444
return
4545
}

frontend/src/assets/json/iso.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,12 @@
185185
"tw": "柬埔寨",
186186
"en": "Cambodia"
187187
},
188+
{
189+
"iso": "KN",
190+
"zh": "圣基茨和尼维斯",
191+
"tw": "聖基茨和尼維斯",
192+
"en": "St Kitts and Nevis"
193+
},
188194
{
189195
"iso": "CM",
190196
"zh": "喀麦隆",

frontend/src/views/login/components/login-form.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ import { useRouter } from 'vue-router';
181181
import type { ElForm } from 'element-plus';
182182
import { loginApi, getCaptcha, mfaLoginApi, getLoginSetting } from '@/api/modules/auth';
183183
import { GlobalStore, MenuStore, TabsStore } from '@/store';
184-
import { MsgSuccess } from '@/utils/message';
184+
import { MsgError, MsgSuccess } from '@/utils/message';
185185
import { useI18n } from 'vue-i18n';
186186
import { encryptPassword } from '@/utils/util';
187187
import { getXpackSettingForTheme } from '@/utils/xpack';
@@ -338,6 +338,7 @@ const login = (formEl: FormInstance | undefined) => {
338338
tabsStore.removeAllTabs();
339339
globalStore.currentNode = 'local';
340340
MsgSuccess(i18n.t('commons.msg.loginSuccess'));
341+
console.log('loiin syc');
341342
router.push({ name: 'home' });
342343
document.onkeydown = null;
343344
} catch (res) {
@@ -346,12 +347,15 @@ const login = (formEl: FormInstance | undefined) => {
346347
loginForm.captcha = '';
347348
errCaptcha.value = true;
348349
errAuthInfo.value = false;
350+
return;
349351
}
350352
if (res.message === 'ErrAuth') {
351353
globalStore.ignoreCaptcha = false;
352354
errCaptcha.value = false;
353355
errAuthInfo.value = true;
356+
return;
354357
}
358+
MsgError(res.message);
355359
}
356360
loginVerify();
357361
} finally {

frontend/src/views/website/website/create/index.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,19 @@
107107
:label="$t('website.appInstalled')"
108108
prop="appInstallId"
109109
>
110-
<el-select v-model="website.appInstallId" class="p-w-200">
110+
<el-select v-model="website.appInstallId" class="p-w-300">
111111
<el-option
112112
v-for="(appInstall, index) in appInstalls"
113113
:key="index"
114114
:label="appInstall.name"
115115
:value="appInstall.id"
116-
></el-option>
116+
:disabled="appInstall.status !== 'Running'"
117+
>
118+
<div class="flex justify-between items-center w-full">
119+
<span>{{ appInstall.name }}</span>
120+
<span><Status :key="appInstall.status" :status="appInstall.status"></Status></span>
121+
</div>
122+
</el-option>
117123
</el-select>
118124
</el-form-item>
119125
<div v-if="website.appType == 'new'">

0 commit comments

Comments
 (0)