Skip to content

Commit

Permalink
Add User Settings Menu to Home Page (#3290)
Browse files Browse the repository at this point in the history
* adding userSettings to the Home Page

* Update timesketch/frontend-ng/src/views/Home.vue

Co-authored-by: Janosch <[email protected]>

---------

Co-authored-by: Janosch <[email protected]>
  • Loading branch information
jaegeral and jkppr authored Feb 11, 2025
1 parent d677b4a commit b17313e
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion timesketch/frontend-ng/src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@ limitations under the License.
</v-list-item-content>
</v-list-item>

<v-list-item @click="showSettingsDialog = true">
<v-list-item-icon>
<v-icon>mdi-cog-outline</v-icon>
</v-list-item-icon>
<v-list-item-content>
<v-list-item-title>Settings</v-list-item-title>
</v-list-item-content>
</v-list-item>

<a href="/logout/" style="text-decoration: none; color: inherit">
<v-list-item>
<v-list-item-icon>
Expand Down Expand Up @@ -119,23 +128,34 @@ limitations under the License.
<ts-sketch-list></ts-sketch-list>
</div>
</v-container>

<!-- Settings dialog -->
<v-dialog v-model="showSettingsDialog" width="700px">
<ts-settings-dialog></ts-settings-dialog>
</v-dialog>

</v-main>
</div>
</template>

<script>
import ApiClient from '../utils/RestApiClient.js'
import TsSketchList from '../components/SketchList.vue'
import TsSettingsDialog from '../components/SettingsDialog.vue'


export default {
components: { TsSketchList },
components: { TsSketchList,
TsSettingsDialog,
},
data() {
return {
sketchForm: {
name: '',
},
createSketchDialog: false,
scenarioTemplates: [],
showSettingsDialog: false,
sketchNameRules: [
(v) => !!v || 'Sketch name is required.',
(v) => (v && v.length <= 255) || 'Sketch name is too long.',
Expand All @@ -146,6 +166,16 @@ export default {
currentUser() {
return this.$store.state.currentUser
},
userSettings() {
return this.$store.state.settings
},
systemSettings() {
return this.$store.state.systemSettings
},
},
mounted() {
this.$store.dispatch('updateSystemSettings')
this.$store.dispatch('updateUserSettings')
},
methods: {
toggleTheme: function () {
Expand Down

0 comments on commit b17313e

Please sign in to comment.