File tree Expand file tree Collapse file tree 3 files changed +10
-10
lines changed
resources/assets/scripts/components/dashboard Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " pterodactyl-panel" ,
33 "dependencies" : {
4+ "date-fns" : " ^1.29.0" ,
45 "vue" : " ^2.5.7" ,
56 "vue-axios" : " ^2.1.1" ,
67 "vue-router" : " ^3.0.1" ,
2728 "jquery" : " ^3.3.1" ,
2829 "jwt-decode" : " ^2.2.0" ,
2930 "lodash" : " ^4.17.5" ,
30- "luxon" : " ^1.2.1" ,
3131 "postcss" : " ^6.0.21" ,
3232 "postcss-import" : " ^11.1.0" ,
3333 "postcss-loader" : " ^2.1.5" ,
Original file line number Diff line number Diff line change 2828</template >
2929
3030<script >
31- import { DateTime } from ' luxon' ;
3231 import Server from ' ../../models/server' ;
3332 import _ from ' lodash' ;
33+ import differenceInSeconds from ' date-fns/difference_in_seconds' ;
3434 import Flash from ' ../Flash' ;
3535 import ServerBox from ' ./ServerBox' ;
3636 import Navigation from ' ../core/Navigation' ;
4040 components: { Navigation, ServerBox, Flash },
4141 data : function () {
4242 return {
43- backgroundedAt: DateTime . local (),
43+ backgroundedAt: new Date (),
4444 documentVisible: true ,
4545 loading: true ,
4646 search: ' ' ,
156156 */
157157 _handleDocumentVisibilityChange : function (isVisible ) {
158158 if (! isVisible) {
159- this .backgroundedAt = DateTime . local ();
159+ this .backgroundedAt = new Date ();
160160 return ;
161161 }
162162
163163 // If it has been more than 30 seconds since this window was put into the background
164164 // lets go ahead and refresh all of the listed servers so that they have fresh stats.
165- const diff = DateTime . local (). diff ( this .backgroundedAt , ' seconds ' );
166- this ._iterateServerResourceUse (diff . seconds > 30 ? 1 : 5000 );
165+ const diff = differenceInSeconds ( new Date (), this .backgroundedAt );
166+ this ._iterateServerResourceUse (diff > 30 ? 1 : 5000 );
167167 },
168168 }
169169 };
Original file line number Diff line number Diff line change @@ -2032,6 +2032,10 @@ d@1:
20322032 dependencies :
20332033 es5-ext "^0.10.9"
20342034
2035+ date-fns@^1.29.0 :
2036+ version "1.29.0"
2037+ resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.29.0.tgz#12e609cdcb935127311d04d33334e2960a2a54e6"
2038+
20352039date-now@^0.1.4 :
20362040 version "0.1.4"
20372041 resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b"
@@ -3662,10 +3666,6 @@ lru-cache@^4.0.1, lru-cache@^4.1.1:
36623666 pseudomap "^1.0.2"
36633667 yallist "^2.1.2"
36643668
3665- luxon@^1.2.1 :
3666- version "1.2.1"
3667- resolved "https://registry.yarnpkg.com/luxon/-/luxon-1.2.1.tgz#5c4948d141939c2b2820f0c3a99276932245efb1"
3668-
36693669make-dir@^1.0.0 :
36703670 version "1.3.0"
36713671 resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c"
You can’t perform that action at this time.
0 commit comments