App.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <template>
  2. <div class="container">
  3. <div class="toppane">
  4. <form>
  5. <h1 style="font-size: large">Anonymous Topic Based PubSub Communication for Microblogging</h1>
  6. <input type="text" ref="my_input" id="tweetInput">
  7. <button @click.prevent="submitTweet()">Submit</button>
  8. <br>
  9. <h1 style="font-size: medium;">Input like: "text#topic1#topic2"</h1>
  10. </form>
  11. </div>
  12. <div class="leftpane">
  13. <h1 style="font-size: large;text-align: center;">Topic list</h1>
  14. <ol>
  15. <li v-for="topic in topicList">
  16. <input type="checkbox" :value="topic.topic" v-model="selectedTopics">
  17. <label :for="topic.topic">{{topic.topic}}</label>
  18. </li>
  19. </ol>
  20. <div class="impressum">
  21. <h1 style="font-size: medium;"><br>This is the gui accompanying the thesis Anonymous Topic Based PubSub Communication for Microblogging.
  22. <br><br>
  23. <a href="https://arxiv.org/pdf/2108.08624.pdf" target="_blank"> You can find the paper the thesis is based upon here</a>
  24. </h1>
  25. </div>
  26. </div>
  27. <div class="middlepane">
  28. <h1 style="font-size: large;text-align: center;">Tweets</h1>
  29. <ul>
  30. <Tweet
  31. v-for="(tweet, index) in tweets"
  32. :key=index
  33. :topics="tweet.topics"
  34. :text="tweet.text"
  35. ></Tweet>
  36. </ul>
  37. </div>
  38. <div class="rightpane">
  39. <h1 style="font-size: large;text-align: center;">Topic list for archived tweets</h1>
  40. <ol>
  41. <li v-for="topic in topicListArchive">
  42. <input type="checkbox" :value="topic.topic" v-model="selectedTopicsArchive">
  43. <label :for="topic.topic">{{topic.topic}}</label>
  44. </li>
  45. </ol>
  46. <br>
  47. <ul>
  48. <Tweet
  49. v-for="(tweet, index) in tweetsArchive"
  50. :key=index
  51. :topics="tweet.topics"
  52. :text="tweet.text"
  53. ></Tweet>
  54. </ul>
  55. </div>
  56. </div>
  57. <div id="formBody" style="display: flex;justify-content: center;align-items: center;height: 90vh;">
  58. <form method="POST" id="inputForm">
  59. <label for="message">Message</label>
  60. <input id="message" name="message" value="app.vue" type="text">
  61. <button type="submit" style="width:100px;">Go ...</button>
  62. </form>
  63. </div>
  64. <div id="serverMessageBox" style="text-align: center;">
  65. </div>
  66. </template>
  67. <script>
  68. import Tweet from './components/Tweet.vue'
  69. export default {
  70. components: { Tweet },
  71. data: function() {
  72. return {
  73. url : "127.0.0.1:5555",
  74. tweetToSubmit: '',
  75. tweets : [
  76. {
  77. topics: "#house #mouse",
  78. text: "I am a house in a mouse"
  79. },
  80. {
  81. topics: "#sports",
  82. text: "Lets go my team"
  83. }
  84. ],
  85. topicList : [
  86. { topic: " house" },
  87. { topic: " mouse" },
  88. { topic: " sports" },
  89. ],
  90. selectedTopics: [],
  91. tweetsArchive: [
  92. {
  93. topics: "#sports",
  94. text: "Lets go other team"
  95. }
  96. ],
  97. topicListArchive : [
  98. {topic: " sports"},
  99. ],
  100. selectedTopicsArchive: []
  101. }
  102. },
  103. methods: {
  104. submitTweet () {
  105. this.tweetToSubmit = this.$refs.my_input.value
  106. document.getElementById('tweetInput').value = ''
  107. },
  108. //todo! call from goCode somehow
  109. updateTopics () {
  110. this.topicList = [{topic : this.topicList[1].topic}, {topic: "b"}]
  111. this.topicList.push({topic : this.topicList[0].topic})
  112. }
  113. }
  114. }
  115. </script>
  116. <style>
  117. @import './assets/base.css';
  118. body, html {
  119. width: 100%;
  120. height: 100%;
  121. margin: 0;
  122. }
  123. .container {
  124. width: 100%;
  125. height: 100%;
  126. }
  127. .leftpane {
  128. width: 25%;
  129. height: 100%;
  130. float: left;
  131. background-color: #0058b759;
  132. border-collapse: collapse;
  133. }
  134. .middlepane {
  135. width: 50%;
  136. height: 100%;
  137. float: left;
  138. border-collapse: collapse;
  139. }
  140. .rightpane {
  141. width: 25%;
  142. height: 100%;
  143. position: relative;
  144. float: right;
  145. background-color: #ffd700;
  146. border-collapse: collapse;
  147. }
  148. .toppane {
  149. margin-top: 10px;
  150. width: 100%;
  151. height: 100px;
  152. border-collapse: collapse;
  153. }
  154. form {
  155. text-align: center;
  156. }
  157. </style>