From 0325be49f3517c6895a41e1d4e44c36de75c11a5 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Mon, 18 Apr 2022 03:15:56 +0900 Subject: [PATCH 01/10] =?UTF-8?q?feat(wip):=20=EC=83=88=20=EC=97=B0?= =?UTF-8?q?=EA=B0=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/ts/PageHistory.vue | 121 ++++++++++++++++++++++++++++++++++++++ hwe/ts/build_exports.json | 1 + hwe/ts/v_history.ts | 16 +++++ hwe/v_history.php | 55 +++++++++++++++++ 4 files changed, 193 insertions(+) create mode 100644 hwe/ts/PageHistory.vue create mode 100644 hwe/ts/v_history.ts create mode 100644 hwe/v_history.php diff --git a/hwe/ts/PageHistory.vue b/hwe/ts/PageHistory.vue new file mode 100644 index 00000000..49ac6300 --- /dev/null +++ b/hwe/ts/PageHistory.vue @@ -0,0 +1,121 @@ + + + + diff --git a/hwe/ts/build_exports.json b/hwe/ts/build_exports.json index 20a1c1ce..a2200c25 100644 --- a/hwe/ts/build_exports.json +++ b/hwe/ts/build_exports.json @@ -28,6 +28,7 @@ "v_NPCControl": "v_NPCControl.ts", "v_join": "v_join.ts", "v_main": "v_main.ts", + "v_history": "v_history.ts", "v_nationStratFinan": "v_nationStratFinan.ts", "v_processing": "v_processing.ts", "v_nationBetting": "v_nationBetting.ts", diff --git a/hwe/ts/v_history.ts b/hwe/ts/v_history.ts new file mode 100644 index 00000000..938f1a28 --- /dev/null +++ b/hwe/ts/v_history.ts @@ -0,0 +1,16 @@ +import "@scss/board.scss"; +import { createApp } from 'vue' +import PageHistory from '@/PageHistory.vue'; +import BootstrapVue3 from 'bootstrap-vue-3' +import { setAxiosXMLHttpRequest } from '@util/setAxiosXMLHttpRequest'; +import { auto500px } from "./util/auto500px"; +import { htmlReady } from "./util/htmlReady"; +import { insertCustomCSS } from "./util/customCSS"; + +setAxiosXMLHttpRequest(); +auto500px(); + +htmlReady(() => { + insertCustomCSS(); +}); +createApp(PageHistory).use(BootstrapVue3).mount('#app'); \ No newline at end of file diff --git a/hwe/v_history.php b/hwe/v_history.php new file mode 100644 index 00000000..5c937d5f --- /dev/null +++ b/hwe/v_history.php @@ -0,0 +1,55 @@ +setReadOnly(); +$userID = Session::getUserID(); + +$db = DB::db(); +$gameStor = KVStorage::getStorage($db, 'game_env'); + +$serverID = Util::getReq('serverID', 'string', null); +if (!$serverID) { + $serverID = UniqueConst::$serverID; +} + +[$f_year, $f_month] = $db->queryFirstList('SELECT year, month FROM ng_history WHERE server_id = %s ORDER BY year ASC, month ASC LIMIT 1', $serverID); +[$l_year, $l_month] = $db->queryFirstList('SELECT year, month FROM ng_history WHERE server_id = %s ORDER BY year DESC, month DESC LIMIT 1', $serverID); +[$currentYear, $currentMonth] = $gameStor->getValuesAsArray(['year', 'month']); + +$me = $db->queryFirstRow('SELECT con, turntime FROM general WHERE owner = %i', $userID); + +?> + + + + + <?= UniqueConst::$serverName ?>:연감 + + + + + [ + 'fisrtYearMonth' => Util::joinYearMonth($f_year, $f_month), + 'lastYearMonth' => Util::joinYearMonth($l_year, $l_month), + 'currentYearMonth' => Util::joinYearMonth($currentYear, $currentMonth), + 'serverNick' => DB::prefix(), + 'serverID' => UniqueConst::$serverID, + ], + 'query' => [ + 'serverID' => $serverID, + 'yearMonth' => Util::getReq('yearMonth', 'int'), + ], + ]) ?> + + + + +
+ + + \ No newline at end of file -- 2.54.0 From 758e9801f5ca954af44b51cf97718a522116b913 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Mon, 18 Apr 2022 03:50:05 +0900 Subject: [PATCH 02/10] =?UTF-8?q?feat:=20=EC=9B=90=EB=B3=B8=20=EB=A1=9C?= =?UTF-8?q?=EA=B7=B8=EB=A5=BC=20ts=EB=8B=A8=EC=97=90=EC=84=9C=20=EC=B2=98?= =?UTF-8?q?=EB=A6=AC=ED=95=98=EB=8A=94=20=EB=B3=80=ED=99=98=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/ts/utilGame/formatLog.ts | 58 ++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 hwe/ts/utilGame/formatLog.ts diff --git a/hwe/ts/utilGame/formatLog.ts b/hwe/ts/utilGame/formatLog.ts new file mode 100644 index 00000000..8491aead --- /dev/null +++ b/hwe/ts/utilGame/formatLog.ts @@ -0,0 +1,58 @@ +const regex = /<([RBGMCLSODYW]1?|1|\/)>/g; + +const convertMap: Record = { + "R": 'color: red;', + "B": 'color: blue;', + "G": 'color: green;', + "M": 'color: magenta;', + "C": 'color: cyan;', + "L": 'color: limegreen;', + "S": 'color: skyblue;', + "O": 'color: orangered;', + "D": 'color: orangered;', + "Y": 'color: yellow;', + "W": 'color: white;', + "1": 'font-size: 0.9em;', +} + +const convertMap2: Record = { + "1": 'font-size: 0.9em;', +} + +export function formatLog(text?: string): string { + if (!text) { + return ''; + } + + let matchRes; + let lastIndex = 0; + const result = []; + while ((matchRes = regex.exec(text)) !== null) { + const { + 0: partAll, + 1: subPart, + index, + } = matchRes; + if (lastIndex != index) { + result.push(text.slice(lastIndex, index)); + } + + if (subPart == '/') { + result.push(``); + } + else if (subPart.length == 2) { + result.push(``); + } + else { + result.push(``); + } + + lastIndex = index + partAll.length; + } + + if (lastIndex != text.length) { + result.push(text.slice(lastIndex)); + } + + return result.join(''); +} \ No newline at end of file -- 2.54.0 From afea85d5587c17ad83b56f4abfafbb10a981529d Mon Sep 17 00:00:00 2001 From: Hide_D Date: Mon, 18 Apr 2022 03:50:54 +0900 Subject: [PATCH 03/10] feat: wip --- hwe/ts/PageHistory.vue | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/hwe/ts/PageHistory.vue b/hwe/ts/PageHistory.vue index 49ac6300..48c4f52a 100644 --- a/hwe/ts/PageHistory.vue +++ b/hwe/ts/PageHistory.vue @@ -6,10 +6,18 @@ {{ date.year }}년 {{ date.month }}월 {{ date.queried ? `선택` : "" }} {{ date.current ? "현재" : "" }}
-
{{item}}
+
-
{{item}}
+
@@ -33,6 +41,7 @@ import type { HistoryObj } from "./defs/API/Global"; import { SammoAPI } from "./SammoAPI"; import { joinYearMonth } from "./util/joinYearMonth"; import { parseYearMonth } from "./util/parseYearMonth"; +import { formatLog } from "./utilGame/formatLog"; const queryYearMonth = ref(); const queryServerID = query.serverID; -- 2.54.0 From 683121f4a3daae193e44274d5fd4bd26f438dab4 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Mon, 18 Apr 2022 22:03:17 +0900 Subject: [PATCH 04/10] =?UTF-8?q?misc:=20Vue=20=EC=83=81=ED=95=98=EB=8B=A8?= =?UTF-8?q?=20=EB=B2=84=ED=8A=BC=EB=B0=94=EC=97=90=20'=EC=B0=BD=20?= =?UTF-8?q?=EB=8B=AB=EA=B8=B0'=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/ts/components/BottomBar.vue | 4 +++- hwe/ts/components/TopBackBar.vue | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/hwe/ts/components/BottomBar.vue b/hwe/ts/components/BottomBar.vue index b3286818..afbb3611 100644 --- a/hwe/ts/components/BottomBar.vue +++ b/hwe/ts/components/BottomBar.vue @@ -1,6 +1,8 @@ diff --git a/hwe/ts/components/TopBackBar.vue b/hwe/ts/components/TopBackBar.vue index af86e1d4..1826254d 100644 --- a/hwe/ts/components/TopBackBar.vue +++ b/hwe/ts/components/TopBackBar.vue @@ -1,6 +1,7 @@