Remove luxon completely.
This commit is contained in:
parent
e7faf979a1
commit
1acedc2de2
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "pterodactyl-panel",
|
"name": "pterodactyl-panel",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"date-fns": "^1.29.0",
|
||||||
"vue": "^2.5.7",
|
"vue": "^2.5.7",
|
||||||
"vue-axios": "^2.1.1",
|
"vue-axios": "^2.1.1",
|
||||||
"vue-router": "^3.0.1",
|
"vue-router": "^3.0.1",
|
||||||
|
@ -27,7 +28,6 @@
|
||||||
"jquery": "^3.3.1",
|
"jquery": "^3.3.1",
|
||||||
"jwt-decode": "^2.2.0",
|
"jwt-decode": "^2.2.0",
|
||||||
"lodash": "^4.17.5",
|
"lodash": "^4.17.5",
|
||||||
"luxon": "^1.2.1",
|
|
||||||
"postcss": "^6.0.21",
|
"postcss": "^6.0.21",
|
||||||
"postcss-import": "^11.1.0",
|
"postcss-import": "^11.1.0",
|
||||||
"postcss-loader": "^2.1.5",
|
"postcss-loader": "^2.1.5",
|
||||||
|
|
|
@ -28,9 +28,9 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { DateTime } from 'luxon';
|
|
||||||
import Server from '../../models/server';
|
import Server from '../../models/server';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
|
import differenceInSeconds from 'date-fns/difference_in_seconds';
|
||||||
import Flash from '../Flash';
|
import Flash from '../Flash';
|
||||||
import ServerBox from './ServerBox';
|
import ServerBox from './ServerBox';
|
||||||
import Navigation from '../core/Navigation';
|
import Navigation from '../core/Navigation';
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
components: { Navigation, ServerBox, Flash },
|
components: { Navigation, ServerBox, Flash },
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
backgroundedAt: DateTime.local(),
|
backgroundedAt: new Date(),
|
||||||
documentVisible: true,
|
documentVisible: true,
|
||||||
loading: true,
|
loading: true,
|
||||||
search: '',
|
search: '',
|
||||||
|
@ -156,14 +156,14 @@
|
||||||
*/
|
*/
|
||||||
_handleDocumentVisibilityChange: function (isVisible) {
|
_handleDocumentVisibilityChange: function (isVisible) {
|
||||||
if (!isVisible) {
|
if (!isVisible) {
|
||||||
this.backgroundedAt = DateTime.local();
|
this.backgroundedAt = new Date();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If it has been more than 30 seconds since this window was put into the background
|
// If it has been more than 30 seconds since this window was put into the background
|
||||||
// lets go ahead and refresh all of the listed servers so that they have fresh stats.
|
// lets go ahead and refresh all of the listed servers so that they have fresh stats.
|
||||||
const diff = DateTime.local().diff(this.backgroundedAt, 'seconds');
|
const diff = differenceInSeconds(new Date(), this.backgroundedAt);
|
||||||
this._iterateServerResourceUse(diff.seconds > 30 ? 1 : 5000);
|
this._iterateServerResourceUse(diff > 30 ? 1 : 5000);
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -2032,6 +2032,10 @@ d@1:
|
||||||
dependencies:
|
dependencies:
|
||||||
es5-ext "^0.10.9"
|
es5-ext "^0.10.9"
|
||||||
|
|
||||||
|
date-fns@^1.29.0:
|
||||||
|
version "1.29.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.29.0.tgz#12e609cdcb935127311d04d33334e2960a2a54e6"
|
||||||
|
|
||||||
date-now@^0.1.4:
|
date-now@^0.1.4:
|
||||||
version "0.1.4"
|
version "0.1.4"
|
||||||
resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b"
|
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:
|
||||||
pseudomap "^1.0.2"
|
pseudomap "^1.0.2"
|
||||||
yallist "^2.1.2"
|
yallist "^2.1.2"
|
||||||
|
|
||||||
luxon@^1.2.1:
|
|
||||||
version "1.2.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/luxon/-/luxon-1.2.1.tgz#5c4948d141939c2b2820f0c3a99276932245efb1"
|
|
||||||
|
|
||||||
make-dir@^1.0.0:
|
make-dir@^1.0.0:
|
||||||
version "1.3.0"
|
version "1.3.0"
|
||||||
resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c"
|
resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c"
|
||||||
|
|
Loading…
Reference in New Issue