Add /admin page
This commit is contained in:
34
app/src/admin.js
Normal file
34
app/src/admin.js
Normal file
@@ -0,0 +1,34 @@
|
||||
import 'babel-polyfill';
|
||||
import Vue from 'vue';
|
||||
import Admin from './Admin.vue';
|
||||
|
||||
function parseDate(str) {
|
||||
if(!str) return str;
|
||||
return new Date(str);
|
||||
}
|
||||
|
||||
function formatDate(dt) {
|
||||
if(dt === null) return "";
|
||||
const f = function(d) {
|
||||
return d < 10 ? '0' + d : d;
|
||||
};
|
||||
return dt.getFullYear() + '-' + f(dt.getMonth() + 1) + '-' + f(dt.getDate()) + ' ' + f(dt.getHours()) + ':' + f(dt.getMinutes());
|
||||
}
|
||||
function isDate(d) {
|
||||
return Object.prototype.toString.call(d) === '[object Date]';
|
||||
}
|
||||
|
||||
Vue.filter('date', function(val, format) {
|
||||
if(!isDate(val)) {
|
||||
val = parseDate(val);
|
||||
}
|
||||
return isDate(val) ? formatDate(val, format) : val;
|
||||
});
|
||||
|
||||
|
||||
new Vue({
|
||||
el: '#admin',
|
||||
render: h => h(Admin)
|
||||
});
|
||||
|
||||
window.PSITRANSFER_VERSION = PSITRANSFER_VERSION;
|
||||
Reference in New Issue
Block a user