Spaces:
Runtime error
Runtime error
buletomato25
commited on
Commit
·
dd60d3f
1
Parent(s):
78ea8bf
guruguru
Browse files- static/feedback.js +4 -10
- static/loading.css +2 -2
- static/talk_detail.js +5 -1
- templates/feedback.html +6 -0
- templates/talkDetail.html +6 -0
static/feedback.js
CHANGED
|
@@ -12,6 +12,8 @@ async function getTranscription() {
|
|
| 12 |
}
|
| 13 |
|
| 14 |
async function getAnalysis() {
|
|
|
|
|
|
|
| 15 |
try {
|
| 16 |
await getTranscription();
|
| 17 |
|
|
@@ -32,16 +34,7 @@ async function getAnalysis() {
|
|
| 32 |
const pleasantConversation = analysis.pleasantConversation;
|
| 33 |
const blameOrHarassment = analysis.blameOrHarassment;
|
| 34 |
|
| 35 |
-
|
| 36 |
-
console.log(
|
| 37 |
-
conversationLevel,
|
| 38 |
-
harassmentPresent,
|
| 39 |
-
harassmentType,
|
| 40 |
-
repetition,
|
| 41 |
-
pleasantConversation,
|
| 42 |
-
blameOrHarassment
|
| 43 |
-
);
|
| 44 |
-
|
| 45 |
// DOMに表示
|
| 46 |
document.getElementById(
|
| 47 |
"level"
|
|
@@ -62,6 +55,7 @@ async function getAnalysis() {
|
|
| 62 |
"Harassment_volume"
|
| 63 |
).innerText = `非難またはハラスメントの程度: ${blameOrHarassment}`;
|
| 64 |
} catch (error) {
|
|
|
|
| 65 |
console.error("Failed to fetch analysis data:", error);
|
| 66 |
}
|
| 67 |
}
|
|
|
|
| 12 |
}
|
| 13 |
|
| 14 |
async function getAnalysis() {
|
| 15 |
+
const loader = document.getElementById("loader");
|
| 16 |
+
loader.style.display = "block";
|
| 17 |
try {
|
| 18 |
await getTranscription();
|
| 19 |
|
|
|
|
| 34 |
const pleasantConversation = analysis.pleasantConversation;
|
| 35 |
const blameOrHarassment = analysis.blameOrHarassment;
|
| 36 |
|
| 37 |
+
loader.style.display = "none";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
// DOMに表示
|
| 39 |
document.getElementById(
|
| 40 |
"level"
|
|
|
|
| 55 |
"Harassment_volume"
|
| 56 |
).innerText = `非難またはハラスメントの程度: ${blameOrHarassment}`;
|
| 57 |
} catch (error) {
|
| 58 |
+
loader.style.display = "none";
|
| 59 |
console.error("Failed to fetch analysis data:", error);
|
| 60 |
}
|
| 61 |
}
|
static/loading.css
CHANGED
|
@@ -18,12 +18,12 @@
|
|
| 18 |
}
|
| 19 |
|
| 20 |
.one {
|
| 21 |
-
border-top: 1px solid #
|
| 22 |
animation: rotate-left 1s linear infinite;
|
| 23 |
}
|
| 24 |
|
| 25 |
.two {
|
| 26 |
-
border-right: 1px solid #
|
| 27 |
animation: rotate-right 1s linear infinite;
|
| 28 |
}
|
| 29 |
|
|
|
|
| 18 |
}
|
| 19 |
|
| 20 |
.one {
|
| 21 |
+
border-top: 1px solid #8834e8;
|
| 22 |
animation: rotate-left 1s linear infinite;
|
| 23 |
}
|
| 24 |
|
| 25 |
.two {
|
| 26 |
+
border-right: 1px solid #a28ecb;
|
| 27 |
animation: rotate-right 1s linear infinite;
|
| 28 |
}
|
| 29 |
|
static/talk_detail.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
| 1 |
async function displayTranscription() {
|
| 2 |
const transcriptionElement = document.getElementById("transcription");
|
|
|
|
|
|
|
| 3 |
|
| 4 |
try {
|
| 5 |
const response = await fetch("/transcription");
|
|
@@ -19,10 +21,12 @@ async function displayTranscription() {
|
|
| 19 |
console.log("フォーマットテキスト:", formattedText);
|
| 20 |
transcriptionElement.textContent = formattedText;
|
| 21 |
*/
|
| 22 |
-
transcriptionElement.textContent = conversations;
|
| 23 |
|
|
|
|
|
|
|
| 24 |
console.log(conversations);
|
| 25 |
} catch (error) {
|
|
|
|
| 26 |
transcriptionElement.textContent = `エラー: ${error.message}`;
|
| 27 |
console.error("データ取得エラー:", error);
|
| 28 |
}
|
|
|
|
| 1 |
async function displayTranscription() {
|
| 2 |
const transcriptionElement = document.getElementById("transcription");
|
| 3 |
+
const loader = document.getElementById("loader");
|
| 4 |
+
loader.style.display = "block";
|
| 5 |
|
| 6 |
try {
|
| 7 |
const response = await fetch("/transcription");
|
|
|
|
| 21 |
console.log("フォーマットテキスト:", formattedText);
|
| 22 |
transcriptionElement.textContent = formattedText;
|
| 23 |
*/
|
|
|
|
| 24 |
|
| 25 |
+
transcriptionElement.textContent = conversations;
|
| 26 |
+
loader.style.display = "none";
|
| 27 |
console.log(conversations);
|
| 28 |
} catch (error) {
|
| 29 |
+
loader.style.display = "none";
|
| 30 |
transcriptionElement.textContent = `エラー: ${error.message}`;
|
| 31 |
console.error("データ取得エラー:", error);
|
| 32 |
}
|
templates/feedback.html
CHANGED
|
@@ -106,6 +106,12 @@
|
|
| 106 |
</style>
|
| 107 |
</head>
|
| 108 |
<body>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
<div class="main-content relative">
|
| 110 |
<!-- Title -->
|
| 111 |
<div class="main-title">会話フィードバック</div>
|
|
|
|
| 106 |
</style>
|
| 107 |
</head>
|
| 108 |
<body>
|
| 109 |
+
<div class="loader" id="loader">
|
| 110 |
+
<div class="one"></div>
|
| 111 |
+
<div class="two"></div>
|
| 112 |
+
<div class="three"></div>
|
| 113 |
+
<div class="four"></div>
|
| 114 |
+
</div>
|
| 115 |
<div class="main-content relative">
|
| 116 |
<!-- Title -->
|
| 117 |
<div class="main-title">会話フィードバック</div>
|
templates/talkDetail.html
CHANGED
|
@@ -13,6 +13,12 @@
|
|
| 13 |
<body
|
| 14 |
class="bg-gray-100 dark:bg-gray-900 text-gray-900 dark:text-gray-100 min-h-screen flex items-center justify-center"
|
| 15 |
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
<div
|
| 17 |
class="container mx-auto p-6 bg-white dark:bg-gray-800 shadow-lg rounded-2xl"
|
| 18 |
>
|
|
|
|
| 13 |
<body
|
| 14 |
class="bg-gray-100 dark:bg-gray-900 text-gray-900 dark:text-gray-100 min-h-screen flex items-center justify-center"
|
| 15 |
>
|
| 16 |
+
<div class="loader" id="loader">
|
| 17 |
+
<div class="one"></div>
|
| 18 |
+
<div class="two"></div>
|
| 19 |
+
<div class="three"></div>
|
| 20 |
+
<div class="four"></div>
|
| 21 |
+
</div>
|
| 22 |
<div
|
| 23 |
class="container mx-auto p-6 bg-white dark:bg-gray-800 shadow-lg rounded-2xl"
|
| 24 |
>
|