Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
fix(style): login settings modal
Browse files Browse the repository at this point in the history
  • Loading branch information
hibig committed Aug 22, 2023
1 parent 9c532f9 commit 0835269
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 45 deletions.
31 changes: 1 addition & 30 deletions src/layout/default-layout.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<template>
<a-layout class="layout" :class="{ mobile: appStore.hideMenu }">
<!-- <div v-if="navbar" class="layout-navbar">
<NavBar />
</div> -->
<BreadWrapper is-lazy> </BreadWrapper>
<a-layout
class="main-layout"
Expand Down Expand Up @@ -35,22 +32,8 @@
<Menu />
</div>
</a-layout-sider>
<a-drawer
v-if="hideMenu"
:visible="drawerVisible"
placement="left"
:footer="false"
mask-closable
:closable="false"
@cancel="drawerCancel"
>
<Menu />
</a-drawer>
<a-layout class="layout-content" :style="paddingStyle">
<TabBar v-if="appStore.tabBar" />
<!-- <div v-if="!hideMenu" class="layout-menu">
<Menu />
</div> -->
<a-layout-content class="page-content-wrap">
<PageLayout />
</a-layout-content>
Expand All @@ -67,7 +50,6 @@
import { ref, computed, watch, provide } from 'vue';
import { useRouter, useRoute } from 'vue-router';
import { useAppStore, useUserStore } from '@/store';
import NavBar from '@/components/navbar/index.vue';
import Menu from '@/components/menu/index.vue';
import Footer from '@/components/footer/index.vue';
import TabBar from '@/components/tab-bar/index.vue';
Expand Down Expand Up @@ -217,16 +199,7 @@
height: 34px;
}
}
// &::after {
// position: absolute;
// top: 0;
// right: -1px;
// display: block;
// width: 1px;
// height: 100%;
// background-color: var(--color-border);
// content: '';
// }
> :deep(.arco-layout-sider-children) {
overflow-y: hidden;
}
Expand Down Expand Up @@ -263,8 +236,6 @@
.layout-content {
position: relative;
min-height: 100vh;
// min-height: calc(100vh - 20px);
// margin-bottom: 20px;
overflow-y: hidden;
font-size: 0;
background-color: var(--color-fill-2);
Expand Down
5 changes: 3 additions & 2 deletions src/store/modules/user/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
updateUserSetting as updateSettings
} from '@/api/user';
import _ from 'lodash';
import { FirstGetPasswordCommand } from '@/views/login/config';
import { getUserResourcePermission } from '@/utils/auth';
import { removeRouteListener } from '@/utils/route-listener';
import { Actions } from '@/permissions/config';
Expand Down Expand Up @@ -156,8 +157,8 @@ const useUserStore = defineStore('user', {
// check first login and is admin user must change password, general user no need to change password when first login
isFirstLogin() {
return (
this.userSetting?.FirstLogin?.value !== 'Invalid' &&
this.isSystemAdmin()
this.userSetting?.FirstLogin?.value !==
FirstGetPasswordCommand.Invalid && this.isSystemAdmin()
);
}
}
Expand Down
13 changes: 8 additions & 5 deletions src/views/login/config/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
export const GET_ADMIN_PASSWORD =
'docker logs <id> 2>&1 | grep "Bootstrap Admin Password"';

export const FirstLoginGetPassword = {
Specified: 'login.config.defaultpswd',
Docker:
Expand All @@ -12,6 +9,12 @@ export const FirstLoginGetPassword = {
Invalid: 'Invalid'
};

export default {
GET_ADMIN_PASSWORD
export const FirstGetPasswordCommand = {
Specified: 'Specified',
Docker: 'Docker',
Kubernetes: 'Kubernetes',
Process: 'Process',
Invalid: 'Invalid'
};

export default {};
12 changes: 7 additions & 5 deletions src/views/login/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,8 @@
import Footer from '@/components/footer/index.vue';
import highlightBlock from '@/components/highlight-block/index.vue';
import copy from '@/components/copy/copy-command.vue';
import LoginBanner from './components/banner.vue';
import LoginForm from './components/login-form.vue';
import { GET_ADMIN_PASSWORD, FirstLoginGetPassword } from './config';
import { FirstLoginGetPassword, FirstGetPasswordCommand } from './config';
const { enterUserPage } = useEnterPage();
const userStore = useUserStore();
Expand All @@ -79,14 +78,17 @@
try {
const { data } = await getFirstLoginStatus();
const value = data?.value;
isFirstLogin.value = value !== 'Invalid';
isFirstLogin.value = value !== FirstGetPasswordCommand.Invalid;
firstLoginStatus.value = data;
} catch (error) {
// ignore
}
};
const specifiedPSWD = () => {
return _.get(firstLoginStatus.value, 'value') === 'Specified';
return (
_.get(firstLoginStatus.value, 'value') ===
FirstGetPasswordCommand.Specified
);
};
// enter page password-free
Expand All @@ -113,6 +115,7 @@
display: flex;
height: calc(100vh - 48px);
margin-top: 0;
overflow: auto;
background-image: url('../../assets/images/bg2.jpeg');
background-repeat: no-repeat;
background-position: center center;
Expand Down Expand Up @@ -184,7 +187,6 @@
padding-bottom: 40px;
.content-inner {
position: absolute;
padding: 20px;
background-color: rgba(255, 255, 255, 0.7);
border-radius: 8px;
Expand Down
5 changes: 2 additions & 3 deletions src/views/operation-hub/catalogs/components/add-catalog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
<template #extra>
<span>{{
$t('catalogs.form.source.desc', {
url: 'https://github.com/terraform-seal-modules'
url: sealCatalog
})
}}</span>
</template>
Expand Down Expand Up @@ -153,15 +153,13 @@

<script lang="ts" setup>
import { ref, reactive, PropType, computed } from 'vue';
import { urlReg } from '@/utils/validate';
import _, { toLower, get } from 'lodash';
import { ModalActionType } from '@/views/config/interface';
import {
ModalAction,
InputWidth,
validateLabelNameRegx
} from '@/views/config';
import { execSucceed } from '@/utils/monitor';
import EditPageFooter from '@/components/edit-page-footer/index.vue';
import ProviderIcon from '@/components/provider-icon/index.vue';
import { CatalogFormData } from '../config/interface';
Expand Down Expand Up @@ -203,6 +201,7 @@
value: 'Gitlab'
}
];
const sealCatalog = 'https://github.com/terraform-seal-modules';
const emit = defineEmits(['save', 'update:show', 'update:dataInfo']);
const formref = ref();
const loading = ref(false);
Expand Down

0 comments on commit 0835269

Please sign in to comment.