update
This commit is contained in:
@@ -1,305 +1,223 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}XML 파일 관리 & 배포 - Dell Server Info{% endblock %}
|
||||
|
||||
{% block extra_css %}
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/scp.css') }}">
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>XML 파일 관리</title>
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
|
||||
<style>
|
||||
body {
|
||||
background-color: #f5f5f5;
|
||||
padding: 20px 0;
|
||||
}
|
||||
<h1 class="main-title">설정 파일 관리 (SCP)</h1>
|
||||
<p class="subtitle">iDRAC 서버 설정(XML)을 내보내거나 가져오고, 버전을 비교할 수 있습니다.</p>
|
||||
|
||||
.main-title {
|
||||
font-size: 1.8rem;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
color: #666;
|
||||
font-size: 0.95rem;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.card {
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
||||
margin-bottom: 20px;
|
||||
background: white;
|
||||
}
|
||||
|
||||
.card-header-custom {
|
||||
background-color: #007bff;
|
||||
color: white;
|
||||
padding: 12px 20px;
|
||||
font-weight: 600;
|
||||
border-radius: 8px 8px 0 0;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.card-body {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.form-label {
|
||||
font-weight: 500;
|
||||
color: #555;
|
||||
margin-bottom: 8px;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.form-control {
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 4px;
|
||||
padding: 8px 12px;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background-color: #007bff;
|
||||
border: none;
|
||||
padding: 8px 24px;
|
||||
font-weight: 500;
|
||||
border-radius: 4px;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.btn-success {
|
||||
background-color: #28a745;
|
||||
border: none;
|
||||
padding: 6px 16px;
|
||||
font-weight: 500;
|
||||
border-radius: 4px;
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
.btn-danger {
|
||||
background-color: #dc3545;
|
||||
border: none;
|
||||
padding: 6px 16px;
|
||||
font-weight: 500;
|
||||
border-radius: 4px;
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
.upload-section {
|
||||
background-color: #f8f9fa;
|
||||
padding: 15px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.custom-file-label {
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 4px;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.custom-file-label::after {
|
||||
background-color: #007bff;
|
||||
color: white;
|
||||
border-radius: 0 3px 3px 0;
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
/* 아이콘 + 뱃지 스타일 */
|
||||
.file-list {
|
||||
max-height: 500px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.icon-badge-item {
|
||||
border: 1px solid #e9ecef;
|
||||
border-radius: 6px;
|
||||
padding: 10px 15px;
|
||||
margin-bottom: 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
transition: all 0.3s;
|
||||
background: white;
|
||||
}
|
||||
|
||||
.icon-badge-item:hover {
|
||||
background-color: #f8f9fa;
|
||||
border-color: #007bff;
|
||||
transform: translateX(3px);
|
||||
}
|
||||
|
||||
.icon-badge-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.file-icon-small {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
background: #007bff;
|
||||
border-radius: 6px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: white;
|
||||
font-size: 16px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.file-name-section {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.file-name-badge {
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
font-size: 0.9rem;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.badge-custom {
|
||||
background-color: #e7f3ff;
|
||||
color: #007bff;
|
||||
padding: 3px 10px;
|
||||
border-radius: 10px;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 500;
|
||||
white-space: nowrap;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.action-buttons {
|
||||
display: flex;
|
||||
gap: 6px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.empty-message {
|
||||
text-align: center;
|
||||
color: #999;
|
||||
padding: 30px;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 1200px;
|
||||
}
|
||||
|
||||
/* 스크롤바 스타일 */
|
||||
.file-list::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
|
||||
.file-list::-webkit-scrollbar-track {
|
||||
background: #f1f1f1;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.file-list::-webkit-scrollbar-thumb {
|
||||
background: #888;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.file-list::-webkit-scrollbar-thumb:hover {
|
||||
background: #555;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1 class="main-title">XML 파일 관리</h1>
|
||||
<p class="subtitle">XML 파일을 업로드하고 관리할 수 있습니다</p>
|
||||
|
||||
<!-- XML 파일 업로드 폼 -->
|
||||
<div class="row">
|
||||
<!-- 왼쪽: 파일 업로드 및 내보내기 -->
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-header-custom">
|
||||
<i class="fas fa-cloud-upload-alt mr-2"></i>파일 업로드
|
||||
<span><i class="fas fa-cloud-upload-alt me-2"></i>파일 등록</span>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="{{ url_for('xml.upload_xml') }}" method="POST" enctype="multipart/form-data">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
|
||||
<!-- 1. PC에서 업로드 -->
|
||||
<h6 class="mb-3"><i class="fas fa-laptop me-2"></i>PC에서 업로드</h6>
|
||||
<form action="{{ url_for('xml.upload_xml') }}" method="POST" enctype="multipart/form-data" class="mb-4">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
||||
<div class="upload-section">
|
||||
<div class="form-group mb-2">
|
||||
<label for="xmlFile" class="form-label">XML 파일 선택</label>
|
||||
<div class="mb-2">
|
||||
<div class="custom-file">
|
||||
<input type="file" class="custom-file-input" id="xmlFile" name="xmlFile" accept=".xml" onchange="updateFileName(this)">
|
||||
<label class="custom-file-label" for="xmlFile" id="fileLabel">파일을 선택하세요</label>
|
||||
<input type="file" class="custom-file-input" id="xmlFile" name="xmlFile" accept=".xml"
|
||||
onchange="updateFileName(this)">
|
||||
<label class="custom-file-label" for="xmlFile" id="fileLabel">파일 선택</label>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="fas fa-upload mr-1"></i>업로드
|
||||
<button type="submit" class="btn btn-primary w-100">
|
||||
<i class="fas fa-upload me-1"></i>업로드
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- XML 파일 목록 -->
|
||||
<div class="card">
|
||||
<div class="card-header-custom">
|
||||
<i class="fas fa-list mr-2"></i>파일 목록
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{% if xml_files %}
|
||||
<div class="file-list">
|
||||
{% for xml_file in xml_files %}
|
||||
<div class="icon-badge-item">
|
||||
<div class="icon-badge-left">
|
||||
<div class="file-icon-small">
|
||||
<i class="fas fa-file-code"></i>
|
||||
</div>
|
||||
<div class="file-name-section">
|
||||
<span class="file-name-badge" title="{{ xml_file }}">{{ xml_file }}</span>
|
||||
<span class="badge-custom">XML</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="action-buttons">
|
||||
<!-- 파일 편집 버튼 -->
|
||||
<a href="{{ url_for('xml.edit_xml', filename=xml_file) }}" class="btn btn-success btn-sm">
|
||||
<i class="fas fa-edit"></i> 편집
|
||||
</a>
|
||||
<!-- 파일 삭제 버튼 -->
|
||||
<form action="{{ url_for('xml.delete_xml', filename=xml_file) }}" method="POST" style="display:inline;">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
|
||||
<button type="submit" class="btn btn-danger btn-sm" onclick="return confirm('정말 삭제하시겠습니까?')">
|
||||
<i class="fas fa-trash"></i> 삭제
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="empty-message">
|
||||
<i class="fas fa-folder-open" style="font-size: 2rem; color: #ddd;"></i>
|
||||
<p class="mt-2 mb-0">파일이 없습니다.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
<hr>
|
||||
|
||||
<!-- 2. iDRAC에서 내보내기 -->
|
||||
<h6 class="mb-3"><i class="fas fa-server me-2"></i>iDRAC에서 추출 (Export)</h6>
|
||||
<button type="button" class="btn btn-outline-primary w-100" data-bs-toggle="modal"
|
||||
data-bs-target="#exportModal">
|
||||
<i class="fas fa-download me-1"></i>설정 추출하기
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
|
||||
<script>
|
||||
function updateFileName(input) {
|
||||
const fileName = input.files[0]?.name || '파일을 선택하세요';
|
||||
document.getElementById('fileLabel').textContent = fileName;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
<!-- 오른쪽: 파일 목록 및 작업 -->
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header-custom">
|
||||
<span><i class="fas fa-list me-2"></i>파일 목록</span>
|
||||
<button class="btn btn-light btn-sm text-primary" id="compareBtn"
|
||||
data-url="{{ url_for('scp.diff_scp') }}" onclick="compareSelected()">
|
||||
<i class="fas fa-exchange-alt me-1"></i>선택 비교
|
||||
</button>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{% if xml_files %}
|
||||
<div class="file-list">
|
||||
{% for xml_file in xml_files %}
|
||||
<div class="icon-badge-item">
|
||||
<div class="icon-badge-left">
|
||||
<input type="checkbox" class="select-checkbox file-selector" value="{{ xml_file }}">
|
||||
<div class="file-icon-small">
|
||||
<i class="fas fa-file-code"></i>
|
||||
</div>
|
||||
<div class="file-name-section">
|
||||
<span class="file-name-badge" title="{{ xml_file }}">{{ xml_file }}</span>
|
||||
<span class="badge-custom">XML</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="action-buttons">
|
||||
<!-- 배포 버튼 -->
|
||||
<button type="button" class="btn btn-info btn-sm text-white"
|
||||
onclick="openDeployModal('{{ xml_file }}')">
|
||||
<i class="fas fa-plane-departure"></i> <span>배포</span>
|
||||
</button>
|
||||
<!-- 편집 버튼 -->
|
||||
<a href="{{ url_for('xml.edit_xml', filename=xml_file) }}" class="btn btn-success btn-sm">
|
||||
<i class="fas fa-edit"></i> <span>편집</span>
|
||||
</a>
|
||||
<!-- 삭제 버튼 -->
|
||||
<form action="{{ url_for('xml.delete_xml', filename=xml_file) }}" method="POST"
|
||||
style="display:inline;">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
||||
<button type="submit" class="btn btn-danger btn-sm"
|
||||
onclick="return confirm('정말 삭제하시겠습니까?')">
|
||||
<i class="fas fa-trash"></i> <span>삭제</span>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="empty-message">
|
||||
<i class="fas fa-folder-open" style="font-size: 2rem; color: #ddd;"></i>
|
||||
<p class="mt-2 mb-0">파일이 없습니다.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Export Modal -->
|
||||
<div class="modal fade" id="exportModal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<form action="{{ url_for('scp.export_scp') }}" method="POST">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">iDRAC 설정 내보내기</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="alert alert-info py-2" style="font-size: 0.9rem;">
|
||||
<i class="fas fa-info-circle me-1"></i> 네트워크 공유 폴더(CIFS)가 필요합니다.
|
||||
</div>
|
||||
|
||||
<h6>대상 iDRAC</h6>
|
||||
<div class="mb-2"><input type="text" class="form-control" name="target_ip" placeholder="iDRAC IP"
|
||||
required></div>
|
||||
<div class="row mb-3">
|
||||
<div class="col"><input type="text" class="form-control" name="username" placeholder="User"
|
||||
required></div>
|
||||
<div class="col"><input type="password" class="form-control" name="password"
|
||||
placeholder="Password" required></div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<h6>네트워크 공유 (저장소)</h6>
|
||||
<div class="mb-2"><input type="text" class="form-control" name="share_ip"
|
||||
placeholder="Share Server IP" required></div>
|
||||
<div class="mb-2"><input type="text" class="form-control" name="share_name"
|
||||
placeholder="Share Name (e.g. public)" required></div>
|
||||
<div class="mb-2"><input type="text" class="form-control" name="filename"
|
||||
placeholder="Save Filename (e.g. backup.xml)" required></div>
|
||||
<div class="row">
|
||||
<div class="col"><input type="text" class="form-control" name="share_user"
|
||||
placeholder="Share User"></div>
|
||||
<div class="col"><input type="password" class="form-control" name="share_pwd"
|
||||
placeholder="Share Password"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">취소</button>
|
||||
<button type="submit" class="btn btn-primary">내보내기 시작</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Deploy (Import) Modal -->
|
||||
<div class="modal fade" id="deployModal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<form action="{{ url_for('scp.import_scp') }}" method="POST">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">설정 배포 (Import)</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="alert alert-warning py-2" style="font-size: 0.9rem;">
|
||||
<i class="fas fa-exclamation-triangle me-1"></i> 적용 후 서버가 재부팅될 수 있습니다.
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">배포할 파일</label>
|
||||
<input type="text" class="form-control" id="deployFilename" name="filename" readonly>
|
||||
</div>
|
||||
|
||||
<h6>대상 iDRAC</h6>
|
||||
<div class="mb-2"><input type="text" class="form-control" name="target_ip" placeholder="iDRAC IP"
|
||||
required></div>
|
||||
<div class="row mb-3">
|
||||
<div class="col"><input type="text" class="form-control" name="username" placeholder="User"
|
||||
required></div>
|
||||
<div class="col"><input type="password" class="form-control" name="password"
|
||||
placeholder="Password" required></div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<h6>네트워크 공유 (소스 위치)</h6>
|
||||
<div class="mb-2"><input type="text" class="form-control" name="share_ip"
|
||||
placeholder="Share Server IP" required></div>
|
||||
<div class="mb-2"><input type="text" class="form-control" name="share_name" placeholder="Share Name"
|
||||
required></div>
|
||||
<div class="row mb-3">
|
||||
<div class="col"><input type="text" class="form-control" name="share_user"
|
||||
placeholder="Share User"></div>
|
||||
<div class="col"><input type="password" class="form-control" name="share_pwd"
|
||||
placeholder="Share Password"></div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">적용 모드</label>
|
||||
<select class="form-select" name="import_mode">
|
||||
<option value="Replace">전체 교체 (Replace)</option>
|
||||
<option value="Append">변경분만 적용 (Append)</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">취소</button>
|
||||
<button type="submit" class="btn btn-danger">배포 시작</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
<script src="{{ url_for('static', filename='js/scp.js') }}"></script>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user