map: rename from locations
parent
348c887499
commit
adc16bec29
|
@ -21,7 +21,7 @@ return [
|
|||
['name' => 'Page#videos', 'url' => '/videos', 'verb' => 'GET'],
|
||||
['name' => 'Page#archive', 'url' => '/archive', 'verb' => 'GET'],
|
||||
['name' => 'Page#thisday', 'url' => '/thisday', 'verb' => 'GET'],
|
||||
['name' => 'Page#locations', 'url' => '/locations', 'verb' => 'GET'],
|
||||
['name' => 'Page#map', 'url' => '/map', 'verb' => 'GET'],
|
||||
|
||||
// Routes with params
|
||||
w(['name' => 'Page#folder', 'url' => '/folders/{path}', 'verb' => 'GET'], 'path'),
|
||||
|
@ -66,6 +66,8 @@ return [
|
|||
['name' => 'Places#places', 'url' => '/api/places', 'verb' => 'GET'],
|
||||
['name' => 'Places#preview', 'url' => '/api/places/preview/{id}', 'verb' => 'GET'],
|
||||
|
||||
['name' => 'Map#clusters', 'url' => '/api/map/clusters', 'verb' => 'GET'],
|
||||
|
||||
['name' => 'Archive#archive', 'url' => '/api/archive/{id}', 'verb' => 'PATCH'],
|
||||
|
||||
['name' => 'Image#preview', 'url' => '/api/image/preview/{id}', 'verb' => 'GET'],
|
||||
|
@ -81,8 +83,6 @@ return [
|
|||
['name' => 'Download#file', 'url' => '/api/download/{handle}', 'verb' => 'GET'],
|
||||
['name' => 'Download#one', 'url' => '/api/stream/{fileid}', 'verb' => 'GET'],
|
||||
|
||||
['name' => 'Location#clusters', 'url' => '/api/locations/clusters', 'verb' => 'GET'],
|
||||
|
||||
// Config API
|
||||
['name' => 'Other#setUserConfig', 'url' => '/api/config/{key}', 'verb' => 'PUT'],
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace OCA\Memories\Controller;
|
|||
use OCP\AppFramework\Http;
|
||||
use OCP\AppFramework\Http\JSONResponse;
|
||||
|
||||
class LocationController extends ApiBase
|
||||
class MapController extends ApiBase
|
||||
{
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
|
@ -35,13 +35,6 @@ class LocationController extends ApiBase
|
|||
*/
|
||||
public function clusters(): JSONResponse
|
||||
{
|
||||
// Get the folder to show
|
||||
try {
|
||||
$uid = $this->getUID();
|
||||
} catch (\Exception $e) {
|
||||
return new JSONResponse(['message' => $e->getMessage()], Http::STATUS_PRECONDITION_FAILED);
|
||||
}
|
||||
|
||||
// Get the folder to show
|
||||
$root = null;
|
||||
|
|
@ -84,7 +84,6 @@ class PageController extends Controller
|
|||
|
||||
// Apps enabled
|
||||
$this->initialState->provideInitialState('systemtags', true === $this->appManager->isEnabledForUser('systemtags'));
|
||||
$this->initialState->provideInitialState('maps', true === $this->appManager->isEnabledForUser('maps'));
|
||||
$this->initialState->provideInitialState('recognize', \OCA\Memories\Util::recognizeIsEnabled($this->appManager));
|
||||
$this->initialState->provideInitialState('facerecognitionInstalled', \OCA\Memories\Util::facerecognitionIsInstalled($this->appManager));
|
||||
$this->initialState->provideInitialState('facerecognitionEnabled', \OCA\Memories\Util::facerecognitionIsEnabled($this->config, $uid));
|
||||
|
@ -243,7 +242,7 @@ class PageController extends Controller
|
|||
*
|
||||
* @NoCSRFRequired
|
||||
*/
|
||||
public function locations()
|
||||
public function map()
|
||||
{
|
||||
return $this->main();
|
||||
}
|
||||
|
|
18
src/App.vue
18
src/App.vue
|
@ -151,7 +151,7 @@ export default defineComponent({
|
|||
},
|
||||
|
||||
removeNavGap(): boolean {
|
||||
return this.$route.name === "locations";
|
||||
return this.$route.name === "map";
|
||||
},
|
||||
},
|
||||
|
||||
|
@ -263,23 +263,17 @@ export default defineComponent({
|
|||
title: t("memories", "Places"),
|
||||
if: this.config_placesGis > 0,
|
||||
},
|
||||
{
|
||||
name: "map",
|
||||
icon: MapIcon,
|
||||
title: t("memories", "Map"),
|
||||
},
|
||||
{
|
||||
name: "tags",
|
||||
icon: TagsIcon,
|
||||
title: t("memories", "Tags"),
|
||||
if: this.config_tagsEnabled,
|
||||
},
|
||||
{
|
||||
name: "maps",
|
||||
icon: MapIcon,
|
||||
title: t("memories", "Maps"),
|
||||
if: this.config_mapsEnabled,
|
||||
},
|
||||
{
|
||||
name: "locations",
|
||||
icon: MapIcon,
|
||||
title: t("memories", "Locations"),
|
||||
},
|
||||
];
|
||||
},
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<script lang="ts">
|
||||
import { defineComponent } from "vue";
|
||||
import Timeline from "./Timeline.vue";
|
||||
import LocationTopMatter from "./top-matter/LocationTopMatter.vue";
|
||||
import MapSplitMatter from "./top-matter/MapSplitMatter.vue";
|
||||
|
||||
export default defineComponent({
|
||||
name: "SplitTimeline",
|
||||
|
@ -24,8 +24,8 @@ export default defineComponent({
|
|||
computed: {
|
||||
primary() {
|
||||
switch (this.$route.name) {
|
||||
case "locations":
|
||||
return LocationTopMatter;
|
||||
case "map":
|
||||
return MapSplitMatter;
|
||||
default:
|
||||
return "None";
|
||||
}
|
||||
|
|
|
@ -395,9 +395,7 @@ export default defineComponent({
|
|||
},
|
||||
|
||||
isMobileLayout() {
|
||||
return (
|
||||
globalThis.windowInnerWidth <= 600 || this.$route.name === "locations"
|
||||
);
|
||||
return globalThis.windowInnerWidth <= 600 || this.$route.name === "map";
|
||||
},
|
||||
|
||||
allowBreakout() {
|
||||
|
@ -690,7 +688,7 @@ export default defineComponent({
|
|||
}
|
||||
|
||||
// Map Bounds
|
||||
if (this.$route.name === "locations" && this.$route.query.b) {
|
||||
if (this.$route.name === "map" && this.$route.query.b) {
|
||||
query.set("mapbounds", <string>this.$route.query.b);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<div class="location-top-matter">
|
||||
<div class="map-matter">
|
||||
<l-map
|
||||
class="map"
|
||||
ref="map"
|
||||
|
@ -46,7 +46,7 @@ Icon.Default.mergeOptions({
|
|||
});
|
||||
|
||||
export default defineComponent({
|
||||
name: "LocationTopMatter",
|
||||
name: "MapSplitMatter",
|
||||
components: {
|
||||
LMap,
|
||||
LTileLayer,
|
||||
|
@ -97,7 +97,7 @@ export default defineComponent({
|
|||
query.set("zoom", zoom);
|
||||
|
||||
// Make API call
|
||||
const url = API.Q(API.CLUSTERS(), query);
|
||||
const url = API.Q(API.MAP_CLUSTERS(), query);
|
||||
const res = await axios.get(url);
|
||||
this.clusters = res.data;
|
||||
},
|
||||
|
@ -106,7 +106,7 @@ export default defineComponent({
|
|||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.location-top-matter {
|
||||
.map-matter {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
|
@ -36,7 +36,6 @@ export default defineComponent({
|
|||
config_facerecognitionEnabled: Boolean(
|
||||
loadState("memories", "facerecognitionEnabled", <string>"")
|
||||
),
|
||||
config_mapsEnabled: Boolean(loadState("memories", "maps", <string>"")),
|
||||
config_albumsEnabled: Boolean(loadState("memories", "albums", <string>"")),
|
||||
|
||||
config_placesGis: Number(loadState("memories", "places_gis", <string>"-1")),
|
||||
|
|
|
@ -141,11 +141,11 @@ export default new Router({
|
|||
},
|
||||
|
||||
{
|
||||
path: "/locations",
|
||||
path: "/map",
|
||||
component: SplitTimeline,
|
||||
name: "locations",
|
||||
name: "map",
|
||||
props: (route) => ({
|
||||
rootTitle: t("memories", "Locations"),
|
||||
rootTitle: t("memories", "Map"),
|
||||
}),
|
||||
},
|
||||
],
|
||||
|
|
|
@ -123,7 +123,7 @@ export class API {
|
|||
return gen(`${BASE}/config/{setting}`, { setting });
|
||||
}
|
||||
|
||||
static CLUSTERS() {
|
||||
return tok(gen(`${BASE}/locations/clusters`));
|
||||
static MAP_CLUSTERS() {
|
||||
return tok(gen(`${BASE}/map/clusters`));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@ declare module "vue" {
|
|||
config_recognizeEnabled: boolean;
|
||||
config_facerecognitionInstalled: boolean;
|
||||
config_facerecognitionEnabled: boolean;
|
||||
config_mapsEnabled: boolean;
|
||||
config_albumsEnabled: boolean;
|
||||
config_placesGis: number;
|
||||
config_squareThumbs: boolean;
|
||||
|
|
Loading…
Reference in New Issue