|
@@ -0,0 +1,115 @@
|
|
|
+<template>
|
|
|
+ <div class="project-main-window-settings">
|
|
|
+ <h1>Project Settings</h1>
|
|
|
+
|
|
|
+ <div class="content">
|
|
|
+ <text-input placeholder="Name"
|
|
|
+ :value="name"
|
|
|
+ @input="nameF"
|
|
|
+ :error="nameError"
|
|
|
+ @clearError="nameError = false">
|
|
|
+ Name
|
|
|
+ </text-input>
|
|
|
+
|
|
|
+ <textarea-input placeholder="Description"
|
|
|
+ :value="description"
|
|
|
+ @input="descriptionF"
|
|
|
+ :error="descriptionError"
|
|
|
+ @clearError="descriptionError = false">
|
|
|
+ Description
|
|
|
+ </textarea-input>
|
|
|
+
|
|
|
+ <confirmed-button-input @click="deleteProject">
|
|
|
+ <template v-slot:first>
|
|
|
+ <button-input>
|
|
|
+ Delete Project
|
|
|
+ </button-input>
|
|
|
+ </template>
|
|
|
+ <template v-slot:second>
|
|
|
+ <button-input>
|
|
|
+ Do you really want to delete this project?
|
|
|
+ </button-input>
|
|
|
+ </template>
|
|
|
+ </confirmed-button-input>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import TextInput from "@/components/base/text-input";
|
|
|
+import TextareaInput from "@/components/base/textarea-input";
|
|
|
+import ConfirmedButtonInput from "@/components/base/confirmed-button-input";
|
|
|
+import ButtonInput from "@/components/base/button-input";
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: "project-main-window-settings",
|
|
|
+ components: {ButtonInput, ConfirmedButtonInput, TextareaInput, TextInput},
|
|
|
+ props: ['status', 'socket'],
|
|
|
+ data: function() {
|
|
|
+ return {
|
|
|
+ project: null,
|
|
|
+ projectPath: null,
|
|
|
+ name: '',
|
|
|
+ nameError: false,
|
|
|
+ description: '',
|
|
|
+ descriptionError: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ nameF: function(value) {
|
|
|
+ this.socket.set(this.projectPath + '/name', value);
|
|
|
+ this.update();
|
|
|
+ },
|
|
|
+ descriptionF: function(value) {
|
|
|
+ this.socket.set(this.projectPath + '/description', value);
|
|
|
+ this.update();
|
|
|
+ },
|
|
|
+ update: function() {
|
|
|
+ this.socket.set(this.projectPath + '/action', 'update');
|
|
|
+ },
|
|
|
+ deleteProject: function() {
|
|
|
+ this.socket.set(this.projectPath + '/action', 'delete');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created: function() {
|
|
|
+ for (let i = 0; i < this.status.projects.length; i++) {
|
|
|
+ if (this.status.projects[i].status === 'open') {
|
|
|
+ this.projectPath = 'projects/' + i;
|
|
|
+ this.project = this.status.projects[i];
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ this.name = this.project.name;
|
|
|
+ this.description = this.project.description;
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+.project-main-window-settings {
|
|
|
+ padding: 1rem;
|
|
|
+}
|
|
|
+
|
|
|
+h1 {
|
|
|
+ margin: 0;
|
|
|
+ font-family: "Roboto Condensed";
|
|
|
+
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ width: 100%;
|
|
|
+ white-space: nowrap;
|
|
|
+ overflow: hidden;
|
|
|
+}
|
|
|
+
|
|
|
+.content {
|
|
|
+ overflow: auto;
|
|
|
+ flex-grow: 1;
|
|
|
+}
|
|
|
+
|
|
|
+.content > * {
|
|
|
+ margin-bottom: 0.6rem;
|
|
|
+}
|
|
|
+
|
|
|
+/deep/ .content textarea {
|
|
|
+ height: 4rem;
|
|
|
+}
|
|
|
+</style>
|