Add link to maps (fix #121)

old-stable24
Varun Patil 2022-10-26 11:58:06 -07:00
parent 87952fa8e5
commit 1bf6773d8d
4 changed files with 18 additions and 0 deletions

View File

@ -87,6 +87,7 @@ class PageController extends Controller
// Apps enabled // Apps enabled
$this->initialState->provideInitialState('systemtags', true === $this->appManager->isEnabledForUser('systemtags')); $this->initialState->provideInitialState('systemtags', true === $this->appManager->isEnabledForUser('systemtags'));
$this->initialState->provideInitialState('recognize', true === $this->appManager->isEnabledForUser('recognize')); $this->initialState->provideInitialState('recognize', true === $this->appManager->isEnabledForUser('recognize'));
$this->initialState->provideInitialState('maps', true === $this->appManager->isEnabledForUser('maps'));
$this->initialState->provideInitialState('version', $this->appManager->getAppInfo('memories')['version']); $this->initialState->provideInitialState('version', $this->appManager->getAppInfo('memories')['version']);
$policy = new ContentSecurityPolicy(); $policy = new ContentSecurityPolicy();

View File

@ -39,6 +39,10 @@
:title="t('memories', 'Tags')"> :title="t('memories', 'Tags')">
<TagsIcon slot="icon" :size="20" /> <TagsIcon slot="icon" :size="20" />
</NcAppNavigationItem> </NcAppNavigationItem>
<NcAppNavigationItem :to="{name: 'maps'}" v-if="config_mapsEnabled"
:title="t('memories', 'Maps')">
<MapIcon slot="icon" :size="20" />
</NcAppNavigationItem>
</template> </template>
<template #footer> <template #footer>
<NcAppNavigationSettings :title="t('memories', 'Settings')"> <NcAppNavigationSettings :title="t('memories', 'Settings')">
@ -78,6 +82,7 @@ import ArchiveIcon from 'vue-material-design-icons/PackageDown.vue';
import CalendarIcon from 'vue-material-design-icons/Calendar.vue'; import CalendarIcon from 'vue-material-design-icons/Calendar.vue';
import PeopleIcon from 'vue-material-design-icons/AccountBoxMultiple.vue'; import PeopleIcon from 'vue-material-design-icons/AccountBoxMultiple.vue';
import TagsIcon from 'vue-material-design-icons/Tag.vue'; import TagsIcon from 'vue-material-design-icons/Tag.vue';
import MapIcon from 'vue-material-design-icons/Map.vue';
@Component({ @Component({
components: { components: {
@ -99,6 +104,7 @@ import TagsIcon from 'vue-material-design-icons/Tag.vue';
CalendarIcon, CalendarIcon,
PeopleIcon, PeopleIcon,
TagsIcon, TagsIcon,
MapIcon,
}, },
}) })
export default class App extends Mixins(GlobalMixin, UserConfig) { export default class App extends Mixins(GlobalMixin, UserConfig) {

View File

@ -34,8 +34,10 @@ export default class UserConfig extends Vue {
config_timelinePath: string = loadState('memories', 'timelinePath') || ''; config_timelinePath: string = loadState('memories', 'timelinePath') || '';
config_foldersPath: string = loadState('memories', 'foldersPath') || '/'; config_foldersPath: string = loadState('memories', 'foldersPath') || '/';
config_showHidden = loadState('memories', 'showHidden') === "true"; config_showHidden = loadState('memories', 'showHidden') === "true";
config_tagsEnabled = Boolean(loadState('memories', 'systemtags')); config_tagsEnabled = Boolean(loadState('memories', 'systemtags'));
config_recognizeEnabled = Boolean(loadState('memories', 'recognize')); config_recognizeEnabled = Boolean(loadState('memories', 'recognize'));
config_mapsEnabled = Boolean(loadState('memories', 'maps'));
config_squareThumbs = localStorage.getItem('memories_squareThumbs') === '1'; config_squareThumbs = localStorage.getItem('memories_squareThumbs') === '1';
config_showFaceRect = localStorage.getItem('memories_showFaceRect') === '1'; config_showFaceRect = localStorage.getItem('memories_showFaceRect') === '1';

View File

@ -117,5 +117,14 @@
rootTitle: t('memories', 'Tags'), rootTitle: t('memories', 'Tags'),
}), }),
}, },
{
path: '/maps',
name: 'maps',
// router-link doesn't support external url, let's force the redirect
beforeEnter() {
window.open(generateUrl('/apps/maps'), '_blank')
},
},
], ],
}) })