App.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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. </template>
  58. <script>
  59. import Tweet from './components/Tweet.vue'
  60. export default {
  61. components: { Tweet },
  62. data: function() {
  63. return {
  64. tweetToSubmit: '',
  65. tweets : [
  66. {
  67. topics: "#house #mouse",
  68. text: "I am a house in a mouse"
  69. },
  70. {
  71. topics: "#sports",
  72. text: "Lets go my team"
  73. }
  74. ],
  75. topicList : [
  76. { topic: " house" },
  77. { topic: " mouse" },
  78. { topic: " sports" },
  79. ],
  80. selectedTopics: [],
  81. tweetsArchive: [
  82. {
  83. topics: "#sports",
  84. text: "Lets go other team"
  85. }
  86. ],
  87. topicListArchive : [
  88. {topic: " sports"},
  89. ],
  90. selectedTopicsArchive: []
  91. }
  92. },
  93. methods: {
  94. submitTweet () {
  95. this.tweetToSubmit = this.$refs.my_input.value
  96. document.getElementById('tweetInput').value = ''
  97. },
  98. //todo! call from goCode somehow
  99. updateTopics () {
  100. this.topicList = [{topic : this.topicList[1].topic}, {topic: "b"}]
  101. this.topicList.push({topic : this.topicList[0].topic})
  102. }
  103. }
  104. }
  105. </script>
  106. <style>
  107. @import './assets/base.css';
  108. body, html {
  109. width: 100%;
  110. height: 100%;
  111. margin: 0;
  112. }
  113. .container {
  114. width: 100%;
  115. height: 100%;
  116. }
  117. .leftpane {
  118. width: 25%;
  119. height: 100%;
  120. float: left;
  121. background-color: #0058b759;
  122. border-collapse: collapse;
  123. }
  124. .middlepane {
  125. width: 50%;
  126. height: 100%;
  127. float: left;
  128. border-collapse: collapse;
  129. }
  130. .rightpane {
  131. width: 25%;
  132. height: 100%;
  133. position: relative;
  134. float: right;
  135. background-color: #ffd700;
  136. border-collapse: collapse;
  137. }
  138. .toppane {
  139. margin-top: 10px;
  140. width: 100%;
  141. height: 100px;
  142. border-collapse: collapse;
  143. }
  144. form {
  145. text-align: center;
  146. }
  147. </style>