diff --git a/frontend/a.js b/frontend/a.js
deleted file mode 100644
index 90109cd..0000000
--- a/frontend/a.js
+++ /dev/null
@@ -1,6 +0,0 @@
-let str = "[{\"photo\": \"6274031756223036782.jpg\", \"msg_id\": 26781, \"asset_id\": 6274031756223036782}, {\"photo\": \"6274031756223036783.jpg\", \"msg_id\": 26782, \"asset_id\": 6274031756223036783}, {\"photo\": \"6274031756223036784.jpg\", \"msg_id\": 26783, \"asset_id\": 6274031756223036784}, {\"photo\": \"6274031756223036785.jpg\", \"msg_id\": 26784, \"asset_id\": 6274031756223036785}, {\"photo\": \"6274031756223036786.jpg\", \"msg_id\": 26785, \"asset_id\": 6274031756223036786}, {\"photo\": \"6274031756223036787.jpg\", \"msg_id\": 26786, \"asset_id\": 6274031756223036787}, {\"photo\": \"6274031756223036788.jpg\", \"msg_id\": 26787, \"asset_id\": 6274031756223036788}, {\"photo\": \"6274031756223036789.jpg\", \"msg_id\": 26788, \"asset_id\": 6274031756223036789}, {\"photo\": \"6274031756223036790.jpg\", \"msg_id\": 26789, \"asset_id\": 6274031756223036790}, {\"photo\": \"6274031756223036791.jpg\", \"msg_id\": 26790, \"asset_id\": 6274031756223036791}]"
-str = str.replace(/"asset_id":\s(\d+)/g, (match, p1, p2, p3, offset, string) => {
- return `"asset_id": "${p1}"`
-})
-
-console.log(str)
\ No newline at end of file
diff --git a/frontend/data.json b/frontend/data.json
deleted file mode 100644
index 1096c20..0000000
--- a/frontend/data.json
+++ /dev/null
@@ -1,37 +0,0 @@
-[
- {
- "photo": "6330272214070443931.jpg",
- "msg_id": 26701,
- "asset_id": 6330272214070443931
- },
- {
- "photo": "6330272214070443932.jpg",
- "msg_id": 26702,
- "asset_id": 6330272214070443932
- },
- {
- "photo": "6330272214070443933.jpg",
- "msg_id": 26703,
- "asset_id": 6330272214070443933
- },
- {
- "photo": "6330272214070443934.jpg",
- "msg_id": 26704,
- "asset_id": 6330272214070443934
- },
- {
- "msg_id": 26705,
- "asset_id": 6330272213614202883,
- "document": {
- "Ext": ".mp4",
- "Size": 2235348,
- "Video": {
- "Width": 576,
- "Height": 1280,
- "Duration": 25.147
- },
- "Filename": "",
- "MimeType": "video/mp4"
- }
- }
-]
\ No newline at end of file
diff --git a/frontend/index.html b/frontend/index.html
index 46f9e60..7e8d9f6 100644
--- a/frontend/index.html
+++ b/frontend/index.html
@@ -4,7 +4,7 @@
-
Vite + Vue + TS
+ TGShow
diff --git a/frontend/src/.gitignore b/frontend/src/.gitignore
new file mode 100644
index 0000000..25fa0c7
--- /dev/null
+++ b/frontend/src/.gitignore
@@ -0,0 +1,3 @@
+
+*.js
+*.vue.js
\ No newline at end of file
diff --git a/frontend/src/components/ListItem.vue b/frontend/src/components/ListItem.vue
index 9f08aaf..9017bf6 100644
--- a/frontend/src/components/ListItem.vue
+++ b/frontend/src/components/ListItem.vue
@@ -27,14 +27,14 @@ export default defineComponent({
name: "ListItem",
props: {
item: {
- type: Object as PropType,
+ type: Object ,
required: true,
},
},
setup(props) {
const processedContent = computed(() => {
let content = props.item.Content.trim();
- return nl2br(content);
+ return nl2br(content,false);
});
return {
diff --git a/frontend/src/main.ts b/frontend/src/main.ts
index 9def2b4..d6fb815 100644
--- a/frontend/src/main.ts
+++ b/frontend/src/main.ts
@@ -1,8 +1,25 @@
import { createApp } from 'vue'
import App from './App.vue'
-import router from './router'
import './style.css'
+import { createRouter, createWebHistory } from 'vue-router'
+
+import ChannelMessages from './views/ChannelMessages.vue'
+import FavoritesMessages from './views/FavoritesMessages.vue'
+import Home from './views/Home.vue'
+
+const routes = [
+ { path: '/', component: Home, name: 'home' },
+ { path: '/favorites', component: FavoritesMessages, name: 'favorites' },
+ // { path: '/channels', component: Channel, name: 'channels' },
+ { path: '/channels/:channel/messages', component: ChannelMessages, name: 'channel-messages' },
+]
+
+const router = createRouter({
+ history: createWebHistory(),
+ routes,
+})
+
createApp(App)
.use(router)
.mount('#app')
diff --git a/frontend/src/request.ts b/frontend/src/request.ts
deleted file mode 100644
index 32076e5..0000000
--- a/frontend/src/request.ts
+++ /dev/null
@@ -1,38 +0,0 @@
-import axios from 'axios';
-
-axios.defaults.baseURL = '/api';
-axios.defaults.headers.post['Content-Type'] = 'application/json';
-axios.defaults.headers.put['Content-Type'] = 'application/json';
-
-export interface Pagination {
- page: number;
- limit: number;
-}
-
-export function channels() {
- return axios.get('/channels')
-}
-
-export function channelInfo(id) {
- return axios.get(`/channels/${id}`);
-}
-
-export function channelMessages(channelId, pagination: Pagination) {
- return axios.get(`/channels/${channelId}/messages`, {
- params: pagination,
- });
-}
-
-export function favoriteMessages(pagination: Pagination) {
- return axios.get('/favorites', {
- params: pagination,
- });
-}
-
-export function toggleFavoriteMessage(messageId) {
- return axios.patch(`/channels/${messageId}/messages`);
-}
-
-export function deleteMessage(messageID) {
- return axios.delete(`/messages/${messageID}`);
-}
\ No newline at end of file
diff --git a/frontend/src/router.ts b/frontend/src/router.ts
deleted file mode 100644
index 66ee53c..0000000
--- a/frontend/src/router.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import { createRouter, createWebHistory } from 'vue-router'
-
-import ChannelMessages from './views/ChannelMessages.vue'
-import FavoritesMessages from './views/FavoritesMessages.vue'
-import Home from './views/Home.vue'
-
-const routes = [
- { path: '/', component: Home, name: 'home' },
- { path: '/favorites', component: FavoritesMessages, name: 'favorites' },
- // { path: '/channels', component: Channel, name: 'channels' },
- { path: '/channels/:channel/messages', component: ChannelMessages, name: 'channel-messages' },
-]
-
-const router = createRouter({
- history: createWebHistory(),
- routes,
-})
-
-export default router
\ No newline at end of file
diff --git a/frontend/src/views/ChannelMessages.vue b/frontend/src/views/ChannelMessages.vue
index 2888a6b..1cb3743 100644
--- a/frontend/src/views/ChannelMessages.vue
+++ b/frontend/src/views/ChannelMessages.vue
@@ -6,8 +6,8 @@