Browse Source

add switcher

modals-to-spa
stingl 4 years ago
parent
commit
d7b2e4433f
  1. 4
      css/app.css
  2. 29
      index.html
  3. 15
      js/app.js

4
css/app.css

@ -150,4 +150,8 @@ nav, .card {
.form-control { .form-control {
margin-bottom: 1em; margin-bottom: 1em;
}
.switch-portal-button {
margin-bottom: 0.5em;
} }

29
index.html

@ -8,6 +8,7 @@
<title>Timetrack</title> <title>Timetrack</title>
<link rel="manifest" href="js/manifest.json"> <link rel="manifest" href="js/manifest.json">
<link rel="shortcut icon" type="image/x-icon" href="assets/img/favicon.ico"> <link rel="shortcut icon" type="image/x-icon" href="assets/img/favicon.ico">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/izitoast/1.4.0/css/iziToast.css">
</head> </head>
<body oncontextmenu="return false;"> <body oncontextmenu="return false;">
@ -388,18 +389,25 @@
<div class="col-12"> <div class="col-12">
<div class="form-group"> <div class="form-group">
<label class="text-muted">Portalname:</label> <label class="text-muted">Portalname:</label>
<input class="form-control" @keydown="updateStorage()" v-model="portal"/> <input class="form-control" @change="updateStorage()" @keydown="updateStorage()" v-model="portal"/>
</div> </div>
</div> </div>
<div class="col"> <template v-if="portal && portal !== ''">
<a class="btn btn-info btn-switcher" href="https://my.vemap.docker" target="_blank">Docker</a> <div class="col-12 switch-portal-button">
</div> <a class="btn btn-danger btn-switcher" href="javascript:" @click="sendPortalChangeRequest">
<div class="col"> <i class="fas fa-random"></i> Wechsle Portal
<a class="btn btn-warning btn-switcher" :href="getPortalLink(true)" target="_blank">Test</a> </a>
</div> </div>
<div class="col"> <div class="col">
<a class="btn btn-success btn-switcher" :href="getPortalLink()" target="_blank">Live</a> <a class="btn btn-info btn-switcher" href="https://my.vemap.docker" target="_blank">Docker</a>
</div> </div>
<div class="col">
<a class="btn btn-warning btn-switcher" :href="getPortalLink(true)" target="_blank">Test</a>
</div>
<div class="col">
<a class="btn btn-success btn-switcher" :href="getPortalLink()" target="_blank">Live</a>
</div>
</template>
</div> </div>
</div> </div>
</div> </div>
@ -469,6 +477,7 @@
</div> </div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/izitoast/1.4.0/js/iziToast.min.js"></script>
<script src="https://kit.fontawesome.com/b54a4cceff.js" crossorigin="anonymous"></script> <script src="https://kit.fontawesome.com/b54a4cceff.js" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment-with-locales.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment-with-locales.min.js"></script>
<script src="https://unpkg.com/vue@next"></script> <script src="https://unpkg.com/vue@next"></script>

15
js/app.js

@ -312,6 +312,21 @@ const TimeTrack = {
return collection; return collection;
}, },
sendPortalChangeRequest() {
let vue = this;
axios.get(
'https://settings.vemap.docker/?portal2change=' + this.portal
).then((response) => {
// console.log(response)
}).catch((error) => {
// An error is expected here due to apache restarting
iziToast.show({
message: 'Portal-Wechsel erfolgreich',
color: 'green'
});
vue.updateStorage();
})
}
}, },
watch: { watch: {
showPT() { showPT() {