parent
d3e6eca84d
commit
6225cd8e6d
@ -0,0 +1,64 @@
|
|||||||
|
<script setup>
|
||||||
|
import '@/assets/main.css'
|
||||||
|
import { useApiClient } from '@/components/apiClient'
|
||||||
|
import { onMounted, ref, reactive } from 'vue'
|
||||||
|
|
||||||
|
const apiClient = useApiClient()
|
||||||
|
|
||||||
|
async function getCryptoKeyDtoList() {
|
||||||
|
const response = await apiClient.post('/app-api/agent/getCryptoKeyDtoList')
|
||||||
|
return response.data
|
||||||
|
}
|
||||||
|
|
||||||
|
let dfxCryptoKeyDtoList = ref([])
|
||||||
|
const cryptoKeyDto = reactive({})
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
dfxCryptoKeyDtoList.value = await getCryptoKeyDtoList()
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<main class="dfx-main container w-100">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12 pt-2 border-bottom">
|
||||||
|
<h3 class="h3">암호화 키 관리</h3>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<article class="col-12 pt-3">
|
||||||
|
<table class="table table-striped table-bordered align-middle">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th scope="col" class="text-center"></th>
|
||||||
|
<th scope="col" class="text-center">Key</th>
|
||||||
|
<th scope="col" class="text-center">Hash</th>
|
||||||
|
<th scope="col" class="text-center">Algorithm</th>
|
||||||
|
<th scope="col" class="text-center">Mode</th>
|
||||||
|
<th scope="col" class="text-center">Target agent</th>
|
||||||
|
<th scope="col" class="text-center">Applied at</th>
|
||||||
|
<th scope="col" class="text-center">Data encryption</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody class="table-group-divider">
|
||||||
|
<tr v-if="dfxCryptoKeyDtoList.length > 0" v-for="(cryptoKeyDto, index) in dfxCryptoKeyDtoList" :key="index">
|
||||||
|
<td scope="row" class="text-center"><input type="checkbox" class="form-check-input" v-model="cryptoKeyDto.selected" /></td>
|
||||||
|
<td class="text-center">{{ cryptoKeyDto.keyValue }}</td>
|
||||||
|
<td class="text-center">{{ cryptoKeyDto.hashValue }}</td>
|
||||||
|
<td class="text-center">{{ cryptoKeyDto.algorithmName }}</td>
|
||||||
|
<td class="text-center">{{ cryptoKeyDto.modeName }}</td>
|
||||||
|
<td class="text-center">{{ cryptoKeyDto.targetAgentHostId }}</td>
|
||||||
|
<td class="text-center">{{ cryptoKeyDto.applyTs }}</td>
|
||||||
|
<td class="text-center">{{ cryptoKeyDto.dataEncryptionYn }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr v-else>
|
||||||
|
<td scope="row" class="text-center" colspan="7">no datas.</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</article>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style></style>
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
package com.bsmlab.dfx.dfxconsole.app.agent.service;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Setter
|
||||||
|
@Getter
|
||||||
|
@Builder
|
||||||
|
@ToString
|
||||||
|
public class DfxCryptoKeyDto {
|
||||||
|
private String keyValue;
|
||||||
|
private String hashValue;
|
||||||
|
private String algorithmName;
|
||||||
|
private String modeName;
|
||||||
|
private String targetAgentHostId;
|
||||||
|
private long applyTs;
|
||||||
|
private String dataEncryptionYn;
|
||||||
|
}
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
package com.bsmlab.dfx.dfxconsole.app.agent.service;
|
||||||
|
|
||||||
|
import com.bsmlab.dfx.dfxconsole.framework.dto.SearchParameterDto;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface DfxCryptoKeyMapper {
|
||||||
|
List<DfxCryptoKeyDto> selectDfxCryptoKeyList(SearchParameterDto searchParameterDto);
|
||||||
|
int selectDfxCryptoKeyListTotalCount(SearchParameterDto searchParameterDto);
|
||||||
|
DfxCryptoKeyDto selectDfxCryptoKeyByKeyValue(DfxCryptoKeyDto dfxCryptoKeyDto);
|
||||||
|
void insertDfxCryptoKey(DfxCryptoKeyDto dfxCryptoKeyDto);
|
||||||
|
int updateDfxCryptoKeyToApply(DfxCryptoKeyDto dfxCryptoKeyDto);
|
||||||
|
}
|
||||||
@ -0,0 +1,68 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.bsmlab.dfx.dfxconsole.app.agent.service.DfxCryptoKeyMapper">
|
||||||
|
|
||||||
|
<select id="selectDfxCryptoKeyList" resultType="com.bsmlab.dfx.dfxconsole.app.agent.service.DfxCryptoKeyDto">
|
||||||
|
<![CDATA[
|
||||||
|
SELECT A.KEY_VALUE, A.HASH_VALUE, A.ALGORITHM_NAME, A.MODE_NAME, A.TARGET_AGENT_HOST_ID
|
||||||
|
, (EXTRACT(EPOCH FROM A.APPLY_TS) * 1000)::BIGINT AS APPLY_TS
|
||||||
|
, A.DATA_ENCRYPTION_YN
|
||||||
|
FROM (
|
||||||
|
SELECT KEY_VALUE, HASH_VALUE, ALGORITHM_NAME, MODE_NAME, TARGET_AGENT_HOST_ID, APPLY_TS, DATA_ENCRYPTION_YN
|
||||||
|
FROM TB_DFX_CRYPTO_KEY
|
||||||
|
WHERE 1 = 1
|
||||||
|
ORDER BY TARGET_AGENT_HOST_ID, KEY_VALUE
|
||||||
|
LIMIT #{itemCountPerPage}
|
||||||
|
OFFSET (#{page} - 1) * #{itemCountPerPage}
|
||||||
|
) A
|
||||||
|
WHERE 1 = 1
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectDfxCryptoKeyListTotalCount" resultType="int">
|
||||||
|
<![CDATA[
|
||||||
|
SELECT COUNT(*)
|
||||||
|
FROM (
|
||||||
|
SELECT KEY_VALUE, HASH_VALUE, ALGORITHM_NAME, MODE_NAME, TARGET_AGENT_HOST_ID, APPLY_TS, DATA_ENCRYPTION_YN
|
||||||
|
FROM TB_DFX_CRYPTO_KEY
|
||||||
|
WHERE 1 = 1
|
||||||
|
) A
|
||||||
|
WHERE 1 = 1
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectDfxCryptoKeyByKeyValue" parameterType="com.bsmlab.dfx.dfxconsole.app.agent.service.DfxCryptoKeyDto" resultType="com.bsmlab.dfx.dfxconsole.app.agent.service.DfxCryptoKeyDto">
|
||||||
|
<![CDATA[
|
||||||
|
SELECT KEY_VALUE, HASH_VALUE, ALGORITHM_NAME, MODE_NAME, TARGET_AGENT_HOST_ID, (EXTRACT(EPOCH FROM APPLY_TS) * 1000)::BIGINT AS APPLY_TS, DATA_ENCRYPTION_YN
|
||||||
|
FROM TB_DFX_CRYPTO_KEY
|
||||||
|
WHERE 1 = 1
|
||||||
|
AND KEY_VALUE = #{keyValue}
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertDfxCryptoKey" parameterType="com.bsmlab.dfx.dfxconsole.app.agent.service.DfxCryptoKeyDto">
|
||||||
|
<![CDATA[
|
||||||
|
INSERT INTO TB_DFX_AGENT_MESSAGE (
|
||||||
|
KEY_VALUE, HASH_VALUE, ALGORITHM_NAME, MODE_NAME, TARGET_AGENT_HOST_ID
|
||||||
|
, APPLY_TS
|
||||||
|
, DATA_ENCRYPTION_YN
|
||||||
|
)
|
||||||
|
VALUES (
|
||||||
|
#{keyValue}, #{hashValue}, #{algorithmName}, #{modeName}, #{targetAgentHostId}
|
||||||
|
, #{applyTs, jdbcType=TIMESTAMP_WITH_TIMEZONE, javaType=Long}
|
||||||
|
, #{dataEncryptionYn}
|
||||||
|
]]>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateDfxCryptoKeyToApply" parameterType="com.bsmlab.dfx.dfxconsole.app.agent.service.DfxCryptoKeyDto">
|
||||||
|
<![CDATA[
|
||||||
|
UPDATE TB_DFX_AGENT_MESSAGE
|
||||||
|
SET TARGET_AGENT_HOST_ID = #{targetAgentHostId}
|
||||||
|
, APPLY_TS = NOW()
|
||||||
|
, DATA_ENCRYPTION_YN = #{dataEncryptionYn}
|
||||||
|
WHERE 1 = 1
|
||||||
|
KEY_VALUE = #{keyValue}
|
||||||
|
]]>
|
||||||
|
</update>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
Loading…
Reference in new issue