Spaces:
Runtime error
Runtime error
use tailwind css
Browse files- templates/talkDetail.html +68 -156
templates/talkDetail.html
CHANGED
|
@@ -1,156 +1,68 @@
|
|
| 1 |
-
<!DOCTYPE html>
|
| 2 |
-
<html lang="ja">
|
| 3 |
-
<head>
|
| 4 |
-
<meta charset="UTF-8" />
|
| 5 |
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 6 |
-
<title>会話詳細画面</title>
|
| 7 |
-
<
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
}
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
}
|
| 70 |
-
</style>
|
| 71 |
-
</head>
|
| 72 |
-
<body>
|
| 73 |
-
<div class="container">
|
| 74 |
-
<h2>会話の文字起こし表示</h2>
|
| 75 |
-
<div id="transcription">ここに会話内容が表示されます。</div>
|
| 76 |
-
<div class="flex">
|
| 77 |
-
<button
|
| 78 |
-
class="history-button"
|
| 79 |
-
id="detailButton"
|
| 80 |
-
onclick="showRecorder()"
|
| 81 |
-
>
|
| 82 |
-
録音画面を表示
|
| 83 |
-
</button>
|
| 84 |
-
<button
|
| 85 |
-
class="history-button"
|
| 86 |
-
id="detailButton"
|
| 87 |
-
onclick="showFeedback()"
|
| 88 |
-
>
|
| 89 |
-
フィードバック画面を表示
|
| 90 |
-
</button>
|
| 91 |
-
<!--
|
| 92 |
-
<form method="POST" action="/index">
|
| 93 |
-
<div class="feedback-space">
|
| 94 |
-
<input
|
| 95 |
-
class="history-button"
|
| 96 |
-
id="indexButton"
|
| 97 |
-
type="submit"
|
| 98 |
-
name="submit"
|
| 99 |
-
value="録音画面を表示"
|
| 100 |
-
/>
|
| 101 |
-
</div>
|
| 102 |
-
</form>
|
| 103 |
-
|
| 104 |
-
<form method="POST" action="/feedback">
|
| 105 |
-
<div class="feedback-space">
|
| 106 |
-
<input
|
| 107 |
-
class="history-button"
|
| 108 |
-
id="feedbackButton"
|
| 109 |
-
type="submit"
|
| 110 |
-
name="submit"
|
| 111 |
-
value="フィードバック画面を表示"
|
| 112 |
-
/>
|
| 113 |
-
</div>
|
| 114 |
-
</form>-->
|
| 115 |
-
</div>
|
| 116 |
-
</div>
|
| 117 |
-
|
| 118 |
-
<script>
|
| 119 |
-
// 会話データを表示
|
| 120 |
-
async function displayTranscription() {
|
| 121 |
-
const transcriptionElement = document.getElementById("transcription");
|
| 122 |
-
|
| 123 |
-
try {
|
| 124 |
-
// バックエンドからデータを取得(デモ用のURLを指定)
|
| 125 |
-
const response = await fetch("/api/transcription");
|
| 126 |
-
if (!response.ok) throw new Error("データ取得に失敗しました。");
|
| 127 |
-
|
| 128 |
-
const data = await response.json();
|
| 129 |
-
|
| 130 |
-
// 会話内容を整形して表示
|
| 131 |
-
const formattedText = data.conversations
|
| 132 |
-
.map((conv, index) => `【${conv.speaker}】 ${conv.text}`)
|
| 133 |
-
.join("\n");
|
| 134 |
-
|
| 135 |
-
transcriptionElement.textContent = formattedText;
|
| 136 |
-
} catch (error) {
|
| 137 |
-
transcriptionElement.textContent = `エラー: ${error.message}`;
|
| 138 |
-
console.error("データ取得エラー:", error);
|
| 139 |
-
}
|
| 140 |
-
}
|
| 141 |
-
|
| 142 |
-
// 初期化処理
|
| 143 |
-
displayTranscription();
|
| 144 |
-
|
| 145 |
-
//画面遷移
|
| 146 |
-
function showRecorder() {
|
| 147 |
-
// 録音画面へ遷移
|
| 148 |
-
window.location.href = "/index";
|
| 149 |
-
}
|
| 150 |
-
function showFeedback() {
|
| 151 |
-
// フィードバック画面へ遷移
|
| 152 |
-
window.location.href = "/feedback";
|
| 153 |
-
}
|
| 154 |
-
</script>
|
| 155 |
-
</body>
|
| 156 |
-
</html>
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="ja" class="dark">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8" />
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 6 |
+
<title>会話詳細画面</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
</head>
|
| 9 |
+
<body
|
| 10 |
+
class="bg-gray-100 dark:bg-gray-900 text-gray-900 dark:text-gray-100 min-h-screen flex items-center justify-center"
|
| 11 |
+
>
|
| 12 |
+
<div
|
| 13 |
+
class="container mx-auto p-6 bg-white dark:bg-gray-800 shadow-lg rounded-2xl"
|
| 14 |
+
>
|
| 15 |
+
<h2 class="text-2xl font-semibold mb-4">会話の文字起こし表示</h2>
|
| 16 |
+
<div
|
| 17 |
+
id="transcription"
|
| 18 |
+
class="p-4 bg-gray-200 dark:bg-gray-700 rounded-lg mb-4 max-h-96 overflow-y-auto"
|
| 19 |
+
>
|
| 20 |
+
ここに会話内容が表示されます。
|
| 21 |
+
</div>
|
| 22 |
+
<div class="flex justify-center gap-4">
|
| 23 |
+
<button
|
| 24 |
+
class="px-6 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors"
|
| 25 |
+
onclick="showRecorder()"
|
| 26 |
+
>
|
| 27 |
+
録音画面を表示
|
| 28 |
+
</button>
|
| 29 |
+
<button
|
| 30 |
+
class="px-6 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors"
|
| 31 |
+
onclick="showFeedback()"
|
| 32 |
+
>
|
| 33 |
+
フィードバック画面を表示
|
| 34 |
+
</button>
|
| 35 |
+
</div>
|
| 36 |
+
</div>
|
| 37 |
+
<script>
|
| 38 |
+
async function displayTranscription() {
|
| 39 |
+
const transcriptionElement = document.getElementById("transcription");
|
| 40 |
+
|
| 41 |
+
try {
|
| 42 |
+
const response = await fetch("/api/transcription");
|
| 43 |
+
if (!response.ok) throw new Error("データ取得に失敗しました。");
|
| 44 |
+
|
| 45 |
+
const data = await response.json();
|
| 46 |
+
const formattedText = data.conversations
|
| 47 |
+
.map((conv) => `【${conv.speaker}】 ${conv.text}`)
|
| 48 |
+
.join("\n");
|
| 49 |
+
|
| 50 |
+
transcriptionElement.textContent = formattedText;
|
| 51 |
+
} catch (error) {
|
| 52 |
+
transcriptionElement.textContent = `エラー: ${error.message}`;
|
| 53 |
+
console.error("データ取得エラー:", error);
|
| 54 |
+
}
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
displayTranscription();
|
| 58 |
+
|
| 59 |
+
function showRecorder() {
|
| 60 |
+
window.location.href = "/index";
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
function showFeedback() {
|
| 64 |
+
window.location.href = "/feedback";
|
| 65 |
+
}
|
| 66 |
+
</script>
|
| 67 |
+
</body>
|
| 68 |
+
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|