- Add Docker Compose configurations for dev, prod, and standalone environments - Add database initialization scripts (init-db.sh, init-db-docker.sh) - Add enhanced start-docker-linux.sh with DB init support - Add comprehensive database initialization guide - Support for automatic dbexport.pgsql import on first run - Include safety checks for production environment
202 lines
5.2 KiB
Plaintext
202 lines
5.2 KiB
Plaintext
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
|
<%@ page import="com.pms.common.utils.*"%>
|
|
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
|
|
<%@ page import="java.util.*" %>
|
|
<%@include file= "/init.jsp" %>
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Gantt Chart Example</title>
|
|
<meta charset="UTF-8">
|
|
<!-- DHTMLX Gantt Chart 라이브러리 CDN -->
|
|
<script src="/js/dhtmlxgantt.js"></script>
|
|
<link rel="stylesheet" href="/css/dhtmlxgantt.css">
|
|
<link rel="stylesheet" href="/css/controls_styles.css">
|
|
|
|
<style>
|
|
html, body {
|
|
height: 100%;
|
|
padding: 0px;
|
|
margin: 0px;
|
|
overflow: hidden;
|
|
}
|
|
</style>
|
|
|
|
</head>
|
|
<body>
|
|
<script>
|
|
var demo_tasks = {
|
|
"data":[
|
|
{"id":1, "text":"Project #2", "start_date":"01-04-2023", "duration":"18", "progress": 0.4, "open": true},
|
|
{"id":2, "text":"Task #4.3", "start_date":"03-04-2023", "duration":"5", "progress": 0, "open": true}
|
|
]
|
|
};
|
|
var newtask={"data":[]};
|
|
|
|
$.ajax({
|
|
url:"/project/wbsTaskProductGanttdetail.do",
|
|
type:"POST",
|
|
data:{"OBJID":"${OBJID}"},
|
|
dataType:"json",
|
|
async:false,
|
|
success:function(data){
|
|
$.each(data, function(i){
|
|
for(var j=0;j<data[i].length;j++){
|
|
var addTask = {"id": j+1, "text": data[i][j].TASK_NAME, "start_date": data[i][j].PLAN_START, "duration": data[i][j].DU, "progress": 0, "open": false};
|
|
console.log(addTask);
|
|
newtask.data.push(addTask);
|
|
}
|
|
|
|
});
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
</script>
|
|
|
|
|
|
|
|
<div id="gantt_here" style='width:100%; height: calc(100vh - 52px);'></div>
|
|
<div class="gantt_control">
|
|
|
|
<input type="button" value="Zoom In" onclick="zoomIn()">
|
|
<input type="button" value="Zoom Out" onclick="zoomOut()">
|
|
|
|
<input type="radio" id="scale1" class="gantt_radio" name="scale" value="day">
|
|
<label for="scale1">일</label>
|
|
|
|
<input type="radio" id="scale2" class="gantt_radio" name="scale" value="week">
|
|
<label for="scale2">주</label>
|
|
|
|
<input type="radio" id="scale3" class="gantt_radio" name="scale" value="month" checked>
|
|
<label for="scale3">월</label>
|
|
|
|
<input type="radio" id="scale4" class="gantt_radio" name="scale" value="quarter">
|
|
<label for="scale4">분기</label>
|
|
|
|
<input type="radio" id="scale5" class="gantt_radio" name="scale" value="year">
|
|
<label for="scale5">년</label>
|
|
|
|
<input value="Export to PDF" type="button" onclick='gantt.exportToPDF({ callback:show_result })'>
|
|
<input value="Export to PNG" type="button" onclick='gantt.exportToPNG({ callback:show_result })'>
|
|
</div>
|
|
|
|
<script>
|
|
|
|
var zoomConfig = {
|
|
levels: [
|
|
{
|
|
name:"day",
|
|
scale_height: 27,
|
|
min_column_width:80,
|
|
scales:[
|
|
{unit: "day", step: 1, format: "%d %M"}
|
|
]
|
|
},
|
|
{
|
|
name:"week",
|
|
scale_height: 50,
|
|
min_column_width:50,
|
|
scales:[
|
|
{unit: "week", step: 1, format: function (date) {
|
|
var dateToStr = gantt.date.date_to_str("%d %M");
|
|
var endDate = gantt.date.add(date, -6, "day");
|
|
var weekNum = gantt.date.date_to_str("%W")(date);
|
|
return "#" + weekNum + ", " + dateToStr(date) + " - " + dateToStr(endDate);
|
|
}},
|
|
{unit: "day", step: 1, format: "%j %D"}
|
|
]
|
|
},
|
|
{
|
|
name:"month",
|
|
scale_height: 50,
|
|
min_column_width:120,
|
|
scales:[
|
|
{unit: "month", format: "%F, %Y"},
|
|
{unit: "week", format: "Week #%W"}
|
|
]
|
|
},
|
|
{
|
|
name:"quarter",
|
|
height: 50,
|
|
min_column_width:90,
|
|
scales:[
|
|
{unit: "month", step: 1, format: "%M"},
|
|
{
|
|
unit: "quarter", step: 1, format: function (date) {
|
|
var dateToStr = gantt.date.date_to_str("%M");
|
|
var endDate = gantt.date.add(gantt.date.add(date, 3, "month"), -1, "day");
|
|
return dateToStr(date) + " - " + dateToStr(endDate);
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
name:"year",
|
|
scale_height: 50,
|
|
min_column_width: 30,
|
|
scales:[
|
|
{unit: "year", step: 1, format: "%Y"}
|
|
]
|
|
}
|
|
]
|
|
};
|
|
|
|
gantt.ext.zoom.init(zoomConfig);
|
|
gantt.ext.zoom.setLevel("month");
|
|
gantt.ext.zoom.attachEvent("onAfterZoom", function(level, config){
|
|
document.querySelector(".gantt_radio[value='" +config.name+ "']").checked = true;
|
|
})
|
|
|
|
|
|
function show_result(info) {
|
|
if (!info)
|
|
gantt.message({
|
|
text: "Server error",
|
|
type: "error",
|
|
expire: -1
|
|
});
|
|
else
|
|
gantt.message({
|
|
text: "Stored at <a href='" + info.url + "'>다운로드받기</a>",
|
|
expire: -1
|
|
});
|
|
}
|
|
|
|
gantt.plugins({
|
|
export_api: true,
|
|
});
|
|
|
|
|
|
gantt.templates.task_text = function (s, e, task) {
|
|
return task.text;
|
|
};
|
|
|
|
gantt.config.columns[0].template = function (obj) {
|
|
return obj.text;
|
|
};
|
|
gantt.init("gantt_here");
|
|
//gantt.parse(demo_tasks);
|
|
gantt.parse(newtask);
|
|
|
|
|
|
|
|
function zoomIn(){
|
|
gantt.ext.zoom.zoomIn();
|
|
}
|
|
function zoomOut(){
|
|
gantt.ext.zoom.zoomOut()
|
|
}
|
|
|
|
var radios = document.getElementsByName("scale");
|
|
for (var i = 0; i < radios.length; i++) {
|
|
radios[i].onclick = function (event) {
|
|
gantt.ext.zoom.setLevel(event.target.value);
|
|
};
|
|
}
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|
|
|