Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions core/cmd/server/conf/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ base:
remote_url:
repo_url: https://resource.fit2cloud.com/1panel/package
app_repo: https://apps-assets.fit2cloud.com
resource_url: https://resource.fit2cloud.com/1panel/resource

log:
level: debug
Expand Down
Binary file added frontend/src/assets/images/1panel-login-bg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed frontend/src/assets/images/1panel-login-bg.png
Binary file not shown.
Binary file added frontend/src/assets/images/1panel-login.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed frontend/src/assets/images/1panel-login.png
Binary file not shown.
47 changes: 32 additions & 15 deletions frontend/src/views/login/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@
:style="{ backgroundImage: `url(${backgroundImage})` }"
></div>
<div
:style="{ opacity: backgroundOpacity }"
class="w-[45%] min-h-[480px] bg-white rounded-lg shadow-lg relative z-10 border border-gray-200 flex overflow-hidden"
:style="{ opacity: backgroundOpacity, width: containerWidth, height: containerHeight }"
class="bg-white shadow-lg relative z-10 border border-gray-200 flex overflow-hidden"
>
<div class="grid md:grid-cols-2 gap-4 items-stretch w-full">
<div class="flex flex-col justify-center items-center w-full p-4">
<div class="grid grid-cols-1 md:grid-cols-2 items-stretch w-full h-full">
<div v-if="showLogo" class="flex flex-col justify-center items-center w-full">
<img :src="logoImage" class="max-w-full max-h-full object-contain" />
</div>
<div class="hidden md:block w-px bg-gray-200 absolute left-1/2 top-4 bottom-4"></div>
<div class="hidden md:flex items-center justify-center p-4">
<div :class="loginFormClass">
<LoginForm ref="loginRef"></LoginForm>
</div>
</div>
Expand All @@ -28,8 +27,8 @@ import { GlobalStore } from '@/store';

const gStore = GlobalStore();
const backgroundOpacity = ref(0.8);
const backgroundImage = ref(new URL('', import.meta.url).href);
const logoImage = ref(new URL('@/assets/images/1panel-login.png', import.meta.url).href);
const backgroundImage = ref(new URL('@/assets/images/1panel-login-bg.jpg', import.meta.url).href);
const logoImage = ref(new URL('@/assets/images/1panel-login.jpg', import.meta.url).href);

const mySafetyCode = defineProps({
code: {
Expand All @@ -38,8 +37,6 @@ const mySafetyCode = defineProps({
},
});

const screenWidth = ref(null);

const getStatus = async () => {
let code = mySafetyCode.code;
if (code != '') {
Expand All @@ -49,11 +46,31 @@ const getStatus = async () => {

onMounted(() => {
getStatus();
screenWidth.value = document.body.clientWidth;
window.onresize = () => {
return (() => {
screenWidth.value = document.body.clientWidth;
})();
});

const FIXED_WIDTH = 1000;
const FIXED_HEIGHT = 415;
const useWindowSize = () => {
const width = ref(window.innerWidth);
const height = ref(window.innerHeight);

const updateSize = () => {
width.value = window.innerWidth;
height.value = window.innerHeight;
};

onMounted(() => window.addEventListener('resize', updateSize));
onUnmounted(() => window.removeEventListener('resize', updateSize));

return { width, height };
};
const { width } = useWindowSize();
const showLogo = computed(() => width.value >= FIXED_WIDTH);
const containerWidth = computed(() => `${FIXED_WIDTH}px`);
const containerHeight = computed(() => `${FIXED_HEIGHT}px`);
const loginFormClass = computed(() => {
return showLogo.value
? 'hidden md:flex items-center justify-center p-4'
: 'flex items-center justify-center p-4 w-full';
});
</script>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry but there isn't enough information to perform such an analysis. The code provided seems like it's part of a larger system including imports, Vue components, and possibly some external assets used in different ways. To provide useful feedback about style adjustments, potential optimizations, etc., you will need more specifics about these elements - especially details on how their use is integrated within other parts of the application logic. Furthermore, please clarify whether we're discussing specific changes from previous code versions or looking into general areas where improvements could be made.

If this is for a component or library which already has extensive documentation or guidelines, those sources are likely best places to find guidance. If not, I would recommend using tools such as ESLint for static type checking or CSS Linter for visual inspection. They can help flag unnecessary properties in stylesheets, missing media queries in JavaScript, unused variables or functions, among others.

Loading