Files
Groupware/Project/Web/wwwroot/login.html
backuppc faa912532f perf: CDN 대신 로컬 CSS 파일 사용으로 페이지 전환 속도 개선
- 모든 HTML 파일에서 cdn.tailwindcss.com 대신 /lib/css/tailwind.min.css 사용
- 중복되는 인라인 스타일을 /css/common.css로 통합
- 외부 네트워크 의존성 제거로 페이지 로딩 지연 해결

변경된 파일:
- DashBoard/index.html
- Todo/index.html
- Jobreport/index.html
- Kuntae/index.html
- Common.html
- login.html
- Project/index.html

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 17:38:17 +09:00

378 lines
16 KiB
HTML

<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>로그인 - GroupWare</title>
<link href="/lib/css/tailwind.min.css" rel="stylesheet">
<link href="/css/common.css" rel="stylesheet">
<style>
.animate-bounce-in {
animation: bounceIn 0.6s ease-out;
}
@keyframes bounceIn {
0% { transform: scale(0.3); opacity: 0; }
50% { transform: scale(1.05); }
70% { transform: scale(0.9); }
100% { transform: scale(1); opacity: 1; }
}
.card-hover:hover {
transform: translateY(-2px);
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
.input-focus {
transition: all 0.3s ease;
}
.input-focus:focus {
transform: scale(1.02);
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.floating-label {
transition: all 0.3s ease;
}
.input-field:focus + .floating-label,
.input-field:not(:placeholder-shown) + .floating-label {
transform: translateY(-1.5rem) scale(0.85);
color: #3b82f6;
}
/* 드롭다운 스타일 */
select.input-field option {
background-color: #1f2937;
color: white;
}
select.input-field:focus option:checked {
background-color: #3b82f6;
}
select.input-field option:hover {
background-color: #374151;
}
</style>
</head>
<body class="gradient-bg min-h-screen flex items-center justify-center p-4">
<div class="w-full max-w-md">
<!-- 로그인 카드 -->
<div class="glass-effect rounded-3xl p-8 card-hover animate-bounce-in">
<!-- 로고 및 제목 -->
<div class="text-center mb-8 animate-fade-in">
<div class="w-16 h-16 bg-white/20 rounded-full flex items-center justify-center mx-auto mb-4">
<svg class="w-8 h-8 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"></path>
</svg>
</div>
<h1 class="text-2xl font-bold text-white mb-2">GroupWare</h1>
<p class="text-white/70 text-sm">로그인하여 시스템에 접속하세요</p>
</div>
<!-- 로그인 폼 -->
<form id="loginForm" class="space-y-6 animate-slide-up">
<!-- Gcode 드롭다운 -->
<div class="relative">
<select
id="gcode"
name="gcode"
class="input-field w-full px-4 py-3 bg-white/10 border border-white/20 rounded-xl text-white focus:outline-none focus:border-primary-400 input-focus appearance-none"
required
>
<option value="" class="text-white/60">부서를 선택하세요</option>
</select>
<div class="absolute right-3 top-3 pointer-events-none">
<svg class="w-5 h-5 text-white/40" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path>
</svg>
</div>
</div>
<!-- 사용자 ID 입력 -->
<div class="relative">
<input
type="text"
id="userId"
name="userId"
class="input-field w-full px-4 py-3 bg-white/10 border border-white/20 rounded-xl text-white placeholder-white/60 focus:outline-none focus:border-primary-400 input-focus"
placeholder="사원번호"
required
>
<div class="absolute right-3 top-3">
<svg class="w-5 h-5 text-white/40" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"></path>
</svg>
</div>
</div>
<!-- 비밀번호 입력 -->
<div class="relative">
<input
type="password"
id="password"
name="password"
class="input-field w-full px-4 py-3 bg-white/10 border border-white/20 rounded-xl text-white placeholder-white/60 focus:outline-none focus:border-primary-400 input-focus"
placeholder="비밀번호"
required
>
<div class="absolute right-3 top-3">
<svg class="w-5 h-5 text-white/40" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"></path>
</svg>
</div>
</div>
<!-- 로그인 버튼 -->
<button
type="submit"
class="w-full bg-primary-500 hover:bg-primary-600 text-white font-semibold py-3 px-4 rounded-xl transition-all duration-300 transform hover:scale-105 focus:outline-none focus:ring-2 focus:ring-primary-400 focus:ring-offset-2 focus:ring-offset-transparent"
>
<span class="flex items-center justify-center">
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 16l-4-4m0 0l4-4m-4 4h14m-5 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h7a3 3 0 013 3v1"></path>
</svg>
로그인
</span>
</button>
</form>
<!-- 추가 옵션 -->
<div class="mt-6 text-center">
<div class="flex items-center justify-center space-x-4 text-sm">
<label class="flex items-center text-white/70 hover:text-white cursor-pointer transition-colors">
<input type="checkbox" class="mr-2 w-4 h-4 text-primary-500 bg-white/10 border-white/20 rounded focus:ring-primary-400 focus:ring-2">
로그인 정보 저장
</label>
<a href="#" class="text-primary-300 hover:text-primary-200 transition-colors">비밀번호 찾기</a>
</div>
</div>
</div>
<!-- 푸터 -->
<div class="text-center mt-6 animate-fade-in">
<p class="text-white/50 text-sm">
© 2024 GroupWare System. All rights reserved.
</p>
</div>
<!-- 로딩 인디케이터 -->
<div id="loadingIndicator" class="fixed top-4 right-4 bg-white/20 backdrop-blur-sm rounded-full px-4 py-2 text-white text-sm hidden">
<div class="flex items-center">
<div class="animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"></div>
로그인 중...
</div>
</div>
<!-- 에러 메시지 -->
<div id="errorMessage" class="fixed top-4 left-1/2 transform -translate-x-1/2 bg-danger-500 text-white px-6 py-3 rounded-lg shadow-lg hidden">
<div class="flex items-center">
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
</svg>
<span id="errorText">로그인에 실패했습니다.</span>
</div>
</div>
<!-- 성공 메시지 -->
<div id="successMessage" class="fixed top-4 left-1/2 transform -translate-x-1/2 bg-success-500 text-white px-6 py-3 rounded-lg shadow-lg hidden">
<div class="flex items-center">
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path>
</svg>
<span id="successText">로그인에 성공했습니다.</span>
</div>
</div>
</div>
<script>
// 비동기 프록시 캐싱 (한 번만 초기화)
const machine = window.chrome.webview.hostObjects.machine;
// 폼 제출 처리
document.getElementById('loginForm').addEventListener('submit', function(e) {
e.preventDefault();
const gcode = document.getElementById('gcode').value;
const userId = document.getElementById('userId').value;
const password = document.getElementById('password').value;
const rememberMe = document.querySelector('input[type="checkbox"]').checked;
if (!gcode || !userId || !password) {
showError('그룹코드/사용자ID/비밀번호를 입력해주세요.');
return;
}
// 로딩 표시
showLoading();
// WebView2 HostObject를 통해 C# Login 함수 호출
(async () => {
try {
const jsonResult = await machine.Login(gcode, userId, password, rememberMe);
const data = JSON.parse(jsonResult);
hideLoading();
if (data.Success) {
// 로그인 성공
showSuccess(data.Message);
// 버전 경고가 있으면 표시
if (data.VersionWarning) {
alert(data.VersionWarning);
}
// WebView2에 로그인 성공 메시지 전송
if (window.chrome && window.chrome.webview) {
window.chrome.webview.postMessage('LOGIN_SUCCESS');
}
// 리다이렉트 URL이 있으면 이동, 없으면 대시보드로 이동
setTimeout(() => {
window.location.href = data.RedirectUrl || '/DashBoard/index.html';
}, 1000);
} else {
// 로그인 실패
showError(data.Message || '로그인에 실패했습니다.');
}
} catch (error) {
hideLoading();
console.error('로그인 요청 중 오류 발생:', error);
showError('서버 연결에 실패했습니다. 다시 시도해주세요.');
}
})();
});
// 입력 필드 포커스 효과
document.querySelectorAll('.input-field').forEach(input => {
input.addEventListener('focus', function() {
this.parentElement.classList.add('ring-2', 'ring-primary-400');
});
input.addEventListener('blur', function() {
this.parentElement.classList.remove('ring-2', 'ring-primary-400');
});
});
// 로딩 표시 함수
function showLoading() {
document.getElementById('loadingIndicator').classList.remove('hidden');
}
function hideLoading() {
document.getElementById('loadingIndicator').classList.add('hidden');
}
// 에러 메시지 표시 함수
function showError(message) {
const errorDiv = document.getElementById('errorMessage');
const errorText = document.getElementById('errorText');
errorText.textContent = message;
errorDiv.classList.remove('hidden');
// 3초 후 자동 숨김
setTimeout(() => {
errorDiv.classList.add('hidden');
}, 3000);
}
// 성공 메시지 표시 함수
function showSuccess(message) {
const successDiv = document.getElementById('successMessage');
const successText = document.getElementById('successText');
successText.textContent = message;
successDiv.classList.remove('hidden');
// 3초 후 자동 숨김
setTimeout(() => {
successDiv.classList.add('hidden');
}, 3000);
}
// 그룹 목록 로드
async function loadUserGroups() {
try {
// WebView2 HostObject를 통해 C# 함수 호출
const machine = window.chrome.webview.hostObjects.machine;
const jsonData = await machine.GetUserGroups();
const data = JSON.parse(jsonData);
const gcodeSelect = document.getElementById('gcode');
// 기존 옵션 제거 (첫 번째 옵션 제외)
while (gcodeSelect.children.length > 1) {
gcodeSelect.removeChild(gcodeSelect.lastChild);
}
// 데이터 추가
data.forEach(group => {
if (group.gcode && group.name) {
const option = document.createElement('option');
option.value = group.gcode;
option.textContent = group.name;
option.className = 'text-gray-800';
gcodeSelect.appendChild(option);
}
});
// 이전 로그인 정보 설정
setPreviousLoginInfo();
} catch (error) {
console.error('그룹 목록 로드 중 오류 발생:', error);
showError('부서 목록을 불러오는 중 오류가 발생했습니다.');
}
}
// 이전 로그인 정보 설정
async function setPreviousLoginInfo() {
try {
// WebView2 HostObject를 통해 C# GetPreviousLoginInfo 함수 호출
const machine = window.chrome.webview.hostObjects.machine;
const jsonResult = await machine.GetPreviousLoginInfo();
const data = JSON.parse(jsonResult);
if (data.Success && data.Data) {
handlePreviousLoginInfo(data.Data);
}
} catch (error) {
console.error('이전 로그인 정보 로드 중 오류 발생:', error);
// 오류가 발생해도 기본 포커스 설정
setTimeout(() => {
document.getElementById('gcode').focus();
}, 100);
}
}
// 이전 로그인 정보 처리
function handlePreviousLoginInfo(data) {
let hasPreviousInfo = false;
if (data && data.LastGcode) {
// 부서 선택
const gcodeSelect = document.getElementById('gcode');
gcodeSelect.value = data.LastGcode;
hasPreviousInfo = true;
}
if (data && data.LastId) {
// 사용자 ID 설정
document.getElementById('userId').value = data.LastId;
hasPreviousInfo = true;
}
// 이전 로그인 정보가 있으면 비밀번호 필드에, 없으면 부서 선택에 포커스
setTimeout(() => {
if (hasPreviousInfo) {
document.getElementById('password').focus();
} else {
document.getElementById('gcode').focus();
}
}, 100);
}
// 페이지 로드 시 애니메이션
document.addEventListener('DOMContentLoaded', function() {
// 그룹 목록 로드
loadUserGroups();
});
</script>
</body>
</html>