5 Commits

Author SHA1 Message Date
eaf866154e Update package git.coopgo.io
Some checks failed
Build and Push Docker Image / build_and_push (push) Failing after 1m41s
2024-11-04 10:58:30 +01:00
06f42947b9 run 'go mod tidy'
Some checks failed
Build and Push Docker Image / build_and_push (push) Failing after 1m1s
2024-11-04 10:45:59 +01:00
acb5232b94 run 'go mod tidy'
Some checks failed
Build and Push Docker Image / build_and_push (push) Failing after 55s
2024-11-04 10:43:24 +01:00
8de170a009 add bookings on dashboard & kilometers on vehicles management
Some checks failed
Build and Push Docker Image / build_and_push (push) Failing after 59s
2024-10-29 12:08:24 +01:00
a0557b0971 edit go.mod - comments all replace
Some checks failed
Build and Push Docker Image / build_and_push (push) Failing after 58s
2024-10-28 10:05:31 +01:00
5 changed files with 1004 additions and 14 deletions

33
go.mod
View File

@@ -2,13 +2,13 @@ module git.coopgo.io/coopgo-apps/parcoursmob
go 1.18
replace git.coopgo.io/coopgo-platform/mobility-accounts => ../../coopgo-platform/mobility-accounts/
// replace git.coopgo.io/coopgo-platform/mobility-accounts => ../../coopgo-platform/mobility-accounts/
replace git.coopgo.io/coopgo-platform/groups-management => ../../coopgo-platform/groups-management/
// replace git.coopgo.io/coopgo-platform/groups-management => ../../coopgo-platform/groups-management/
replace git.coopgo.io/coopgo-platform/fleets => ../../coopgo-platform/fleets/
// replace git.coopgo.io/coopgo-platform/fleets => ../../coopgo-platform/fleets/
replace git.coopgo.io/coopgo-platform/agenda => ../../coopgo-platform/agenda/
// replace git.coopgo.io/coopgo-platform/agenda => ../../coopgo-platform/agenda/
// replace git.coopgo.io/coopgo-platform/emailing => ../../coopgo-platform/emailing/
@@ -30,11 +30,11 @@ require (
)
require (
git.coopgo.io/coopgo-platform/agenda v0.0.0-20230310121901-ef3add576f86
git.coopgo.io/coopgo-platform/agenda v1.0.0
git.coopgo.io/coopgo-platform/emailing v0.0.0-20221017030337-c71888d90c15
git.coopgo.io/coopgo-platform/fleets v0.0.0-20230310144446-feb935f8bf4e
git.coopgo.io/coopgo-platform/groups-management v0.0.0-20230310123255-5ef94ee0746c
git.coopgo.io/coopgo-platform/mobility-accounts v0.0.0-20230329105908-a76c0412a386
git.coopgo.io/coopgo-platform/fleets v1.0.0
git.coopgo.io/coopgo-platform/groups-management v1.0.0
git.coopgo.io/coopgo-platform/mobility-accounts v1.0.5
github.com/gorilla/securecookie v1.1.1
github.com/minio/minio-go/v7 v7.0.43
github.com/xuri/excelize/v2 v2.7.1
@@ -44,8 +44,11 @@ require (
ariga.io/atlas v0.13.1 // indirect
github.com/agext/levenshtein v1.2.1 // indirect
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/coreos/go-semver v0.3.0 // indirect
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
github.com/dgraph-io/ristretto v0.0.3 // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-openapi/inflect v0.19.0 // indirect
@@ -56,14 +59,18 @@ require (
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.1 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/gorilla/csrf v1.7.1 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hashicorp/hcl/v2 v2.16.2 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.15.9 // indirect
github.com/klauspost/cpuid/v2 v2.1.0 // indirect
github.com/leodido/go-urn v1.2.1 // indirect
github.com/lib/pq v1.10.9 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/goveralls v0.0.6 // indirect
github.com/mb0/wkt v0.0.0-20170420051526-a30afd545ee1 // indirect
github.com/minio/md5-simd v1.1.2 // indirect
github.com/minio/sha256-simd v1.0.0 // indirect
@@ -73,6 +80,13 @@ require (
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe // indirect
github.com/ory/fosite v0.42.2 // indirect
github.com/ory/go-acc v0.2.6 // indirect
github.com/ory/go-convenience v0.1.0 // indirect
github.com/ory/viper v1.7.5 // indirect
github.com/ory/x v0.0.214 // indirect
github.com/pborman/uuid v1.2.0 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pquerna/cachecontrol v0.1.0 // indirect
@@ -83,6 +97,7 @@ require (
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/spf13/afero v1.9.3 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/cobra v1.0.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
@@ -106,6 +121,7 @@ require (
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.7.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/tools v0.6.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef // indirect
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
@@ -113,5 +129,6 @@ require (
gopkg.in/mail.v2 v2.3.1 // indirect
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 // indirect
gopkg.in/square/go-jose.v2 v2.5.2-0.20210529014059-a5c7eec3c614 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

959
go.sum

File diff suppressed because it is too large Load Diff

View File

@@ -13,6 +13,8 @@ import (
"git.coopgo.io/coopgo-platform/groups-management/storage"
mobilityaccounts "git.coopgo.io/coopgo-platform/mobility-accounts/grpcapi"
"google.golang.org/protobuf/types/known/timestamppb"
fleets "git.coopgo.io/coopgo-platform/fleets/grpcapi"
fleetstorage "git.coopgo.io/coopgo-platform/fleets/storage"
)
func (h *ApplicationHandler) Dashboard(w http.ResponseWriter, r *http.Request) {
@@ -76,6 +78,18 @@ func (h *ApplicationHandler) Dashboard(w http.ResponseWriter, r *http.Request) {
sort.Sort(sorting.EventsByStartdate(events))
h.Renderer.Dashboard(w, r, accounts, count, count_members, events)
bookings := []fleetstorage.Booking{}
bookingsresp, err := h.services.GRPC.Fleets.GetBookings(context.TODO(), &fleets.GetBookingsRequest{
Namespaces: []string{"parcoursmob_dispositifs"},
})
if err == nil {
for _, b := range bookingsresp.Bookings {
bookings = append(bookings, b.ToStorageType())
}
}
h.Renderer.Dashboard(w, r, accounts, count, count_members, events, bookings)
}

View File

@@ -140,6 +140,9 @@ func (h *ApplicationHandler) VehiclesFleetAdd(w http.ResponseWriter, r *http.Req
fmt.Println(v)
dataMap["automatic"] = (v == "on")
}
if v := r.FormValue("kilometers"); v != "" {
dataMap["kilometers"] = v
}
data, err := structpb.NewValue(dataMap)
if err != nil {
@@ -614,6 +617,9 @@ func (h *ApplicationHandler) VehiclesFleetUpdate(w http.ResponseWriter, r *http.
if v := r.FormValue("licence_plate"); v != "" {
dataMap["licence_plate"] = v
}
if v := r.FormValue("kilometers"); v != "" {
dataMap["kilometers"] = v
}
if v := r.FormValue("automatic"); v != "" {
fmt.Println(v)
dataMap["automatic"] = (v == "on")

View File

@@ -4,11 +4,12 @@ import (
"net/http"
agendastorage "git.coopgo.io/coopgo-platform/agenda/storage"
fleetstorage "git.coopgo.io/coopgo-platform/fleets/storage"
)
const dashboardMenu = "dashboard"
func (renderer *Renderer) Dashboard(w http.ResponseWriter, r *http.Request, accounts []any, nbaccounts int, count_members int, events []agendastorage.Event) {
func (renderer *Renderer) Dashboard(w http.ResponseWriter, r *http.Request, accounts []any, nbaccounts int, count_members int, events []agendastorage.Event, fleets []fleetstorage.Booking) {
files := renderer.ThemeConfig.GetStringSlice("views.dashboard.files")
state := NewState(r, renderer.ThemeConfig, dashboardMenu)
state.ViewState = map[string]any{
@@ -18,6 +19,7 @@ func (renderer *Renderer) Dashboard(w http.ResponseWriter, r *http.Request, acco
},
"count_members": count_members,
"events": events,
"fleets": fleets,
}
renderer.Render("dashboard", w, r, files, state)