mirror of
https://github.com/danbulant/Nertivia-Client
synced 2026-07-05 11:00:50 +00:00
added developer badge, added general tab.
This commit is contained in:
parent
67e7fcc2ef
commit
2e1b75d654
8 changed files with 277 additions and 17 deletions
|
|
@ -27,6 +27,7 @@ export default {
|
||||||
crown: require("twemoji/2/svg/1f451.svg"),
|
crown: require("twemoji/2/svg/1f451.svg"),
|
||||||
flower: require("twemoji/2/svg/1f33a.svg"),
|
flower: require("twemoji/2/svg/1f33a.svg"),
|
||||||
heart: require("twemoji/2/svg/2764.svg"),
|
heart: require("twemoji/2/svg/2764.svg"),
|
||||||
|
developer: require("twemoji/2/svg/2728.svg"),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
@ -46,6 +47,11 @@ export default {
|
||||||
name: "supporter",
|
name: "supporter",
|
||||||
emotePath: this.heart
|
emotePath: this.heart
|
||||||
};
|
};
|
||||||
|
if (this.$props.admin == 6)
|
||||||
|
return {
|
||||||
|
name: "developer",
|
||||||
|
emotePath: this.developer
|
||||||
|
};
|
||||||
return ""
|
return ""
|
||||||
},
|
},
|
||||||
statusColor() {
|
statusColor() {
|
||||||
|
|
@ -126,6 +132,15 @@ export default {
|
||||||
left: -3px;
|
left: -3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.developer {
|
||||||
|
background: linear-gradient(30deg, #6853b9, rgba(254, 94, 189, .8));
|
||||||
|
}
|
||||||
|
.developer .emote {
|
||||||
|
z-index: 999;
|
||||||
|
top: -3px;
|
||||||
|
left: -3px;
|
||||||
|
}
|
||||||
|
|
||||||
.emote {
|
.emote {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
|
|
|
||||||
|
|
@ -184,6 +184,10 @@ export default {
|
||||||
|
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
.container {
|
||||||
|
position: relative;
|
||||||
|
z-index: 999;
|
||||||
|
}
|
||||||
.presence-message {
|
.presence-message {
|
||||||
margin: 10px;
|
margin: 10px;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,97 @@
|
||||||
|
<template>
|
||||||
|
<div class="drop-down">
|
||||||
|
<div class="title">{{name}}</div>
|
||||||
|
<div class="current-select-box" ref="dropDown" @click="dropped = !dropped"><div class="name">{{selectedItem ? selectedItem.name : items[0].name}}</div><div class="material-icons">expand_more</div></div>
|
||||||
|
<div class="drop" v-if="dropped">
|
||||||
|
<div v-for="(item, index) of items" :key="index" class="item" :class="{selected: selectedItem === item}" @click="itemClick(item)">{{item.name}}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: ['items', 'name', 'selectedItem'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dropped: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
itemClick(item) {
|
||||||
|
this.$emit('change', item)
|
||||||
|
},
|
||||||
|
documentClick(e) {
|
||||||
|
const target = e.target;
|
||||||
|
const el = this.$refs.dropDown
|
||||||
|
if (((el !== target) && !el.contains(target)) && this.dropped) {
|
||||||
|
this.dropped = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
document.addEventListener('click', this.documentClick);
|
||||||
|
},
|
||||||
|
destroyed() {
|
||||||
|
document.removeEventListener('click', this.documentClick);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.drop-down {
|
||||||
|
background-color: rgb(44, 44, 44);
|
||||||
|
border-radius: 10px;
|
||||||
|
padding: 5px;
|
||||||
|
user-select: none;
|
||||||
|
cursor: default;
|
||||||
|
flex-shrink: 0;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.title {
|
||||||
|
margin-bottom: 2px;
|
||||||
|
}
|
||||||
|
.current-select-box {
|
||||||
|
background: rgba(22, 22, 22, 0.411);
|
||||||
|
border-radius: 10px;
|
||||||
|
padding: 5px;
|
||||||
|
cursor: pointer;
|
||||||
|
display: flex;
|
||||||
|
transition: 0.3s;
|
||||||
|
}
|
||||||
|
.current-select-box:hover {
|
||||||
|
background: rgba(22, 22, 22, 0.788);
|
||||||
|
}
|
||||||
|
.current-select-box div {
|
||||||
|
align-self: center;
|
||||||
|
}
|
||||||
|
.current-select-box .name {
|
||||||
|
margin: auto;
|
||||||
|
margin-left: 2px;
|
||||||
|
}
|
||||||
|
.drop {
|
||||||
|
position: absolute;
|
||||||
|
background: rgb(80, 80, 80);
|
||||||
|
border-radius: 10px;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 11111;
|
||||||
|
max-height: 100px;
|
||||||
|
overflow: auto;
|
||||||
|
padding: 2px;
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
.item {
|
||||||
|
padding: 5px;
|
||||||
|
border-radius: 5px;
|
||||||
|
margin-top: 2px;
|
||||||
|
margin-bottom: 2px;
|
||||||
|
background: rgba(37, 37, 37, 0.322);
|
||||||
|
}
|
||||||
|
.item:hover {
|
||||||
|
background: rgb(37, 37, 37);
|
||||||
|
}
|
||||||
|
.item.selected {
|
||||||
|
background: rgb(41, 41, 41);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|
@ -1,10 +1,30 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="content-inner">
|
<div class="content-inner">
|
||||||
<div class="top">
|
<div class="top">
|
||||||
<div class="server-avatar"></div>
|
<!-- <div class="server-avatar"></div> -->
|
||||||
<div class="server-name">{{server.name}}</div>
|
<div class="input">
|
||||||
|
<div class="input-title">Server Name</div>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
ref="name"
|
||||||
|
placeholder="Channel Name"
|
||||||
|
:default-value.prop="server.name"
|
||||||
|
@input="inputEvent('name', $event)"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="details">
|
||||||
|
<div class="options">
|
||||||
|
<drop-down
|
||||||
|
:items="channels"
|
||||||
|
:selected-item="defaultChannel"
|
||||||
|
name="Default Channel"
|
||||||
|
@change="changeEvent('default_channel_id', $event.channelID)"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="button save-button" v-if="changed">Save Changes</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
@ -12,34 +32,122 @@ import config from "@/config.js";
|
||||||
import { bus } from "@/main";
|
import { bus } from "@/main";
|
||||||
import Spinner from "@/components/Spinner.vue";
|
import Spinner from "@/components/Spinner.vue";
|
||||||
import ServerService from "@/services/ServerService";
|
import ServerService from "@/services/ServerService";
|
||||||
|
import DropDown from "./DropDownMenu";
|
||||||
import { mapState } from "vuex";
|
import { mapState } from "vuex";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {Spinner},
|
components: { Spinner, DropDown },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
changed: false,
|
||||||
|
update: {}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
inputEvent(name, event) {
|
||||||
|
this.$set(this.update, name, event.target.value);
|
||||||
|
},
|
||||||
|
changeEvent(name, value) {
|
||||||
|
this.$set(this.update, name, value);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
update(test) {
|
||||||
|
this.changed = true;
|
||||||
|
}
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
server() {
|
server() {
|
||||||
const serverID = this.$store.state.popoutsModule.serverSettings.serverID
|
const serverID = this.$store.state.popoutsModule.serverSettings.serverID;
|
||||||
return this.$store.getters['servers/servers'][serverID]
|
return this.$store.getters["servers/servers"][serverID];
|
||||||
|
},
|
||||||
|
defaultChannel() {
|
||||||
|
const channels = this.$store.getters.channels;
|
||||||
|
if (this.update.default_channel_id) {
|
||||||
|
return channels[this.update.default_channel_id];
|
||||||
|
}
|
||||||
|
return channels[this.server.default_channel_id];
|
||||||
|
},
|
||||||
|
channels() {
|
||||||
|
const serverID = this.$store.state.popoutsModule.serverSettings.serverID;
|
||||||
|
const channelsIds = this.$store.getters["servers/channelsIDs"][serverID];
|
||||||
|
if (channelsIds) {
|
||||||
|
let channels = [];
|
||||||
|
for (let channelID of channelsIds) {
|
||||||
|
channels.push(this.$store.getters.channels[channelID]);
|
||||||
|
}
|
||||||
|
return channels;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
.content-inner {
|
||||||
|
height: 100%;
|
||||||
|
overflow: auto;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
.server-avatar {
|
.server-avatar {
|
||||||
background: grey;
|
background: grey;
|
||||||
height: 90px;
|
height: 90px;
|
||||||
width: 90px;
|
width: 90px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
.top {
|
.top {
|
||||||
margin: 10px;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.details {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.options {
|
||||||
|
width: 230px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-self: center;
|
||||||
}
|
}
|
||||||
.server-name {
|
.server-name {
|
||||||
align-self: center;
|
align-self: center;
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
.input {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
background-color: rgb(44, 44, 44);
|
||||||
|
border-radius: 10px;
|
||||||
|
padding: 5px;
|
||||||
|
align-self: center;
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
|
.input input {
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
.button {
|
||||||
|
background: rgba(17, 148, 255, 0.692);
|
||||||
|
padding: 10px;
|
||||||
|
border-radius: 5px;
|
||||||
|
align-self: center;
|
||||||
|
margin: 5px;
|
||||||
|
cursor: pointer;
|
||||||
|
user-select: none;
|
||||||
|
transition: 0.3s;
|
||||||
|
}
|
||||||
|
.button:hover {
|
||||||
|
background: rgb(17, 148, 255);
|
||||||
|
}
|
||||||
|
.save-button {
|
||||||
|
margin-top: 50px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
<input type="text" ref="name" placeholder="Channel Name" :default-value.prop="channels[selectedChannelIndex].name" @input="inputEvent('name', $event)">
|
<input type="text" ref="name" placeholder="Channel Name" :default-value.prop="channels[selectedChannelIndex].name" @input="inputEvent('name', $event)">
|
||||||
</div>
|
</div>
|
||||||
<div class="button" v-if="update.name" @click="updateChannel">Save Changes</div>
|
<div class="button" v-if="update.name" @click="updateChannel">Save Changes</div>
|
||||||
<div class="button warn delete-server" v-if="server.default_channel_id !== channels[selectedChannelIndex].channelID" @click="deleteChannel">{{deleteButtonConfirmed ? 'ARE YOU SURE?' : 'Delete Channel' }}</div>
|
<div class="button warn delete-server" :class="{disabled: deleteClicked}" v-if="server.default_channel_id !== channels[selectedChannelIndex].channelID" @click="deleteChannel">{{deleteButtonConfirmed ? 'ARE YOU SURE?' : 'Delete Channel' }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -27,6 +27,7 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
deleteButtonConfirmed: false,
|
deleteButtonConfirmed: false,
|
||||||
|
deleteClicked: false,
|
||||||
selectedChannelIndex: 0,
|
selectedChannelIndex: 0,
|
||||||
update: {
|
update: {
|
||||||
name: null
|
name: null
|
||||||
|
|
@ -47,11 +48,15 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async deleteChannel() {
|
async deleteChannel() {
|
||||||
|
if (this.deleteClicked) return;
|
||||||
if (!this.deleteButtonConfirmed) {
|
if (!this.deleteButtonConfirmed) {
|
||||||
return this.deleteButtonConfirmed = true;
|
return this.deleteButtonConfirmed = true;
|
||||||
}
|
}
|
||||||
|
this.deleteClicked = true;
|
||||||
const {ok, error, result} = await ServerService.deleteChannel(this.server.server_id, this.channels[this.selectedChannelIndex].channelID)
|
const {ok, error, result} = await ServerService.deleteChannel(this.server.server_id, this.channels[this.selectedChannelIndex].channelID)
|
||||||
console.log({ok, error, result})
|
this.deleteButtonConfirmed = false;
|
||||||
|
this.selectedChannelIndex = null;
|
||||||
|
this.deleteClicked = false;
|
||||||
},
|
},
|
||||||
inputEvent(name, event) {
|
inputEvent(name, event) {
|
||||||
this.update.name = event.target.value
|
this.update.name = event.target.value
|
||||||
|
|
@ -109,10 +114,12 @@ export default {
|
||||||
display: flex;
|
display: flex;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
.channel .name {
|
.channel .name {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
.channel div {
|
.channel div {
|
||||||
align-self: center;
|
align-self: center;
|
||||||
|
|
@ -134,6 +141,7 @@ export default {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
.button {
|
.button {
|
||||||
background: rgba(17, 148, 255, 0.692);
|
background: rgba(17, 148, 255, 0.692);
|
||||||
|
|
@ -154,6 +162,13 @@ export default {
|
||||||
.button.warn:hover {
|
.button.warn:hover {
|
||||||
background: rgb(255, 17, 17);
|
background: rgb(255, 17, 17);
|
||||||
}
|
}
|
||||||
|
.button.disabled {
|
||||||
|
background: grey;
|
||||||
|
}
|
||||||
|
.button.disabled:hover {
|
||||||
|
background: grey;
|
||||||
|
}
|
||||||
|
|
||||||
.delete-server{
|
.delete-server{
|
||||||
margin: auto;
|
margin: auto;
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,9 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="header" :class="{critical: tabs[index].critical}"><div class="material-icons">{{tabs[index].icon}}</div><div>{{tabs[index].title}}</div></div>
|
<div class="header" :class="{critical: tabs[index].critical}"><div class="material-icons">{{tabs[index].icon}}</div><div>{{tabs[index].title}}</div></div>
|
||||||
<!-- <general v-if="index === 0"/> -->
|
<general v-if="index === 0"/>
|
||||||
<manage-channels v-if="index === 0"/>
|
<manage-channels v-if="index === 1"/>
|
||||||
<delete-server v-if="index === 1"/>
|
<delete-server v-if="index === 2"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -32,7 +32,7 @@ export default {
|
||||||
return {
|
return {
|
||||||
index: 0,
|
index: 0,
|
||||||
tabs: [
|
tabs: [
|
||||||
// {title: "General", icon: "info"},
|
{title: "General", icon: "info"},
|
||||||
{title: "Manage Channels", icon: "storage"},
|
{title: "Manage Channels", icon: "storage"},
|
||||||
// {title: "Manage Invites", icon: "local_post_office"},
|
// {title: "Manage Invites", icon: "local_post_office"},
|
||||||
{title: "Delete Server", icon: "warning", critical: true},
|
{title: "Delete Server", icon: "warning", critical: true},
|
||||||
|
|
@ -92,6 +92,8 @@ export default {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
.tabs {
|
.tabs {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
background: rgba(26, 26, 26, 0.897);
|
background: rgba(26, 26, 26, 0.897);
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 180px;
|
width: 180px;
|
||||||
|
|
@ -106,6 +108,7 @@ export default {
|
||||||
user-select: none;
|
user-select: none;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-content: center;
|
align-content: center;
|
||||||
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
.tab .material-icons {
|
.tab .material-icons {
|
||||||
margin-right: 3px;
|
margin-right: 3px;
|
||||||
|
|
@ -135,4 +138,19 @@ export default {
|
||||||
align-self: center;
|
align-self: center;
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 614px) {
|
||||||
|
.inner {
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
.tabs {
|
||||||
|
width: 100%;
|
||||||
|
height: 50px;
|
||||||
|
flex-direction: row;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
.tabs::-webkit-scrollbar {
|
||||||
|
height: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ export default {
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
z-index: 99;
|
z-index: 99999999;
|
||||||
display: flex;
|
display: flex;
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -194,7 +194,6 @@ export default {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.notifyAnimation{
|
.notifyAnimation{
|
||||||
animation: notifyAnime;
|
animation: notifyAnime;
|
||||||
animation-duration: 1s;
|
animation-duration: 1s;
|
||||||
|
|
@ -266,6 +265,9 @@ export default {
|
||||||
.tabs::-webkit-scrollbar {
|
.tabs::-webkit-scrollbar {
|
||||||
height: 5px;
|
height: 5px;
|
||||||
}
|
}
|
||||||
|
.tabs {
|
||||||
|
scrollbar-width: thin;
|
||||||
|
}
|
||||||
|
|
||||||
.tab {
|
.tab {
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
|
|
@ -326,6 +328,7 @@ export default {
|
||||||
|
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
||||||
textarea {
|
textarea {
|
||||||
font-family: "Roboto", sans-serif;
|
font-family: "Roboto", sans-serif;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue