Skip to content

Commit

Permalink
feat: add silent workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
FreekBes committed Jan 15, 2024
1 parent 4d1fabd commit 92219bc
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 31 deletions.
2 changes: 1 addition & 1 deletion public/img/f0.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/img/f1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions public/js/dragmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -5972,7 +5972,7 @@ var $author$project$Dragmap$hostModelDecoder = A3(
function (hostlist) {
var mapsettings = function () {
if (maybemapsettings.$ === 'Nothing') {
return A4($author$project$Dragmap$MapSettings, 1325, 1026, 60, 25);
return A4($author$project$Dragmap$MapSettings, 1625, 1026, 60, 25);
} else {
var settings = maybemapsettings.a;
return settings;
Expand All @@ -5993,7 +5993,7 @@ var $author$project$Dragmap$getHosts = function (hostfile) {
var hostlist = result2.a;
var hostmodel = {
hostList: hostlist,
mapSettings: A4($author$project$Dragmap$MapSettings, 1325, 1026, 60, 25),
mapSettings: A4($author$project$Dragmap$MapSettings, 1625, 1026, 60, 25),
movingHost: $elm$core$Maybe$Nothing
};
return $elm$core$Maybe$Just(hostmodel);
Expand All @@ -6012,7 +6012,7 @@ var $author$project$Dragmap$init = F2(
var hostmodel = $author$project$Dragmap$getHosts(hostfile);
var mapset = function () {
if (hostmodel.$ === 'Nothing') {
return A4($author$project$Dragmap$MapSettings, 1325, 1026, 60, 25);
return A4($author$project$Dragmap$MapSettings, 1625, 1026, 60, 25);
} else {
var hmodel = hostmodel.a;
return hmodel.mapSettings;
Expand Down Expand Up @@ -7648,4 +7648,4 @@ var $author$project$Main$view = function (model) {
var $author$project$Main$main = $elm$browser$Browser$element(
{init: $author$project$Main$init, subscriptions: $author$project$Main$subscriptions, update: $author$project$Main$update, view: $author$project$Main$view});
_Platform_export({'Main':{'init':$author$project$Main$main(
$elm$json$Json$Decode$succeed(_Utils_Tuple0))(0)}});}(this));
$elm$json$Json$Decode$succeed(_Utils_Tuple0))(0)}});}(this));
4 changes: 2 additions & 2 deletions public/js/interactive_maps.js
Original file line number Diff line number Diff line change
Expand Up @@ -5393,9 +5393,9 @@ var $author$project$Main$calcMapSettings = F2(
var _class = _v0.dw;
var orientation = _v0.a1;
var preheight = $elm$core$Basics$round(window.aR * 0.93);
var prewidth = $elm$core$Basics$round(preheight * 0.77);
var prewidth = $elm$core$Basics$round(preheight * 0.63);
var width = (_Utils_cmp(prewidth, window.bc) > -1) ? $elm$core$Basics$round(window.bc * 0.95) : prewidth;
var height = (_Utils_cmp(prewidth, window.bc) > -1) ? $elm$core$Basics$round(width * 1.299) : preheight;
var height = (_Utils_cmp(prewidth, window.bc) > -1) ? $elm$core$Basics$round(width * 1.584) : preheight;
switch (_class) {
case 0:
if (!orientation) {
Expand Down
4 changes: 2 additions & 2 deletions public/json/clusterf0.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"mapsettings": {
"heigth": 1325,
"heigth": 1625,
"width": 1026,
"active-size": 60,
"empty-size": 20
Expand Down Expand Up @@ -608,4 +608,4 @@
"top": 681
}
]
}
}
37 changes: 28 additions & 9 deletions public/json/clusterf1.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,36 @@
{
"mapsettings": {
"heigth": 1325,
"heigth": 1625,
"width": 1026,
"active-size": 60,
"empty-size": 20
},
"hosts":
[
"hosts": [
{
"hostname": "f1r5s7.codam.nl",
"left": 148,
"top": 971
},
{
"hostname": "f1r7s4.codam.nl",
"left": 186,
"top": 1555
},
{
"hostname": "f1r7s3.codam.nl",
"left": 187,
"top": 1472
},
{
"hostname": "f1r7s2.codam.nl",
"left": 89,
"top": 1472
},
{
"hostname": "f1r7s1.codam.nl",
"left": 89,
"top": 1555
},
{
"hostname": "f1r1s10.codam.nl",
"left": 899,
Expand Down Expand Up @@ -432,11 +456,6 @@
"left": 207,
"top": 1079
},
{
"hostname": "f1r5s7.codam.nl",
"left": 147,
"top": 970
},
{
"hostname": "f1r5s6.codam.nl",
"left": 206,
Expand Down Expand Up @@ -608,4 +627,4 @@
"top": 98
}
]
}
}
23 changes: 11 additions & 12 deletions src/elm/clustermap/Main.elm
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ type alias Model =
}


{-|
{-|
On initial loading we use the values passed from the flags to determine a map
size. I found that taking 90% of the width and hight values gives better
results.
results.
Firefox loads nicely with the width and hight from the flags, but chrome
doesn't. Also, performing getViewport in Firefox before the map is fully loaded
Expand All @@ -66,7 +66,7 @@ init { width, height, isFirefox } =
let
width90 =
round (toFloat width * 0.9)

height90 =
round (toFloat height * 0.9)

Expand All @@ -81,15 +81,15 @@ init { width, height, isFirefox } =

( f1model, f1cmd ) =
Clustermap.init Endpoint.clusterf1 Endpoint.activeSessions Asset.clusterf1 mapsettings

resizeTask =
if isFirefox then
Cmd.none
else
Task.perform BeResponsive BD.getViewport
in
( Model f0model f1model (Window width90 height90) device
, Platform.Cmd.batch
, Platform.Cmd.batch
[ Platform.Cmd.map Mapf0Msg f0cmd
, Platform.Cmd.map Mapf1Msg f1cmd
, resizeTask
Expand Down Expand Up @@ -125,7 +125,7 @@ calcMapSettings window { class, orientation } =
round (toFloat window.height * 0.93)

prewidth =
round (toFloat preheight * 0.77)
round (toFloat preheight * 0.63)

width =
if prewidth >= window.width then
Expand All @@ -136,7 +136,7 @@ calcMapSettings window { class, orientation } =

height =
if prewidth >= window.width then
round (toFloat width * 1.299)
round (toFloat width * 1.584)

else
preheight
Expand Down Expand Up @@ -319,15 +319,14 @@ classifyDevice window =
}

{-| Every 30 seconds both clusters are updated, also there is a listener for
onResize events.
onResize events.
-}
subscriptions : Model -> Sub Msg
subscriptions _ =
Sub.batch
[ Sub.map Mapf0Msg
Sub.batch
[ Sub.map Mapf0Msg
<| Time.every (5 * 1000) Clustermap.FetchSessions
, Sub.map Mapf1Msg
, Sub.map Mapf1Msg
<| Time.every (5 * 1000) Clustermap.FetchSessions
, BE.onResize OnResize
]

0 comments on commit 92219bc

Please sign in to comment.