Add prettier and format code (#58)
This commit is contained in:
parent
a7c348c815
commit
c097154a80
56 changed files with 3450 additions and 3127 deletions
18
.github/workflows/deploy.yml
vendored
18
.github/workflows/deploy.yml
vendored
|
@ -2,18 +2,18 @@ name: Deploy to Oracle Cloud
|
|||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
environment: oracle-cloud
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: alex-ac/github-action-ssh-docker-compose@master
|
||||
name: Docker-Compose Remote Deployment
|
||||
with:
|
||||
ssh_host: ${{ secrets.ORACLE_CLOUD_SSH_HOST }}
|
||||
ssh_private_key: ${{ secrets.ORACLE_CLOUD_SSH_PRIVATE_KEY }}
|
||||
ssh_user: ${{ secrets.ORACLE_CLOUD_SSH_USER }}
|
||||
docker_compose_prefix: fakelog.cf
|
||||
- uses: actions/checkout@v3
|
||||
- uses: alex-ac/github-action-ssh-docker-compose@master
|
||||
name: Docker-Compose Remote Deployment
|
||||
with:
|
||||
ssh_host: ${{ secrets.ORACLE_CLOUD_SSH_HOST }}
|
||||
ssh_private_key: ${{ secrets.ORACLE_CLOUD_SSH_PRIVATE_KEY }}
|
||||
ssh_user: ${{ secrets.ORACLE_CLOUD_SSH_USER }}
|
||||
docker_compose_prefix: fakelog.cf
|
||||
|
|
25
.github/workflows/prettier.yml
vendored
Normal file
25
.github/workflows/prettier.yml
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
name: Continuous Integration
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
prettier:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
# Make sure the actual branch is checked out when running on pull requests
|
||||
ref: ${{ github.head_ref }}
|
||||
# This is important to fetch the changes to the previous commit
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Prettify code
|
||||
uses: creyD/prettier_action@v4.3
|
||||
with:
|
||||
# This part is also where you can pass other options, for example:
|
||||
prettier_options: --check **/*
|
||||
dry: True
|
2
.github/workflows/tests.yml
vendored
2
.github/workflows/tests.yml
vendored
|
@ -2,7 +2,7 @@ name: Tests
|
|||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
|
|
7
.prettierrc
Normal file
7
.prettierrc
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"trailingComma": "es5",
|
||||
"tabWidth": 2,
|
||||
"semi": false,
|
||||
"singleQuote": true,
|
||||
"printWidth": 120
|
||||
}
|
|
@ -31,6 +31,7 @@ docker-compose up
|
|||
You can add `-d` to both `docker run` and `docker-compose up` in order to run in "detached" mode (in background)
|
||||
|
||||
## Nginx reverse proxy
|
||||
|
||||
We provide example nginx config file [fakelog.nginx](fakelog.nginx). You will need to change SSL certificates paths and domain names. You may need to change `proxy_pass` URL
|
||||
|
||||
## Login
|
||||
|
|
135
app.js
135
app.js
|
@ -1,89 +1,98 @@
|
|||
const express = require('express');
|
||||
const path = require('path');
|
||||
const logger = require('morgan');
|
||||
const cookieParser = require('cookie-parser');
|
||||
const bodyParser = require('body-parser');
|
||||
const cors = require("cors");
|
||||
const protocol = require("./src/utils/connection");
|
||||
const express = require('express')
|
||||
const path = require('path')
|
||||
const logger = require('morgan')
|
||||
const cookieParser = require('cookie-parser')
|
||||
const bodyParser = require('body-parser')
|
||||
const cors = require('cors')
|
||||
const protocol = require('./src/utils/connection')
|
||||
// const favicon = require('serve-favicon');
|
||||
|
||||
const subdomain = require('express-subdomain');
|
||||
const index = require('./src/routes/index');
|
||||
const api = require('./src/routes/api');
|
||||
const cufs = require('./src/routes/cufs');
|
||||
const uonetplus = require('./src/routes/uonetplus');
|
||||
const uonetplusOpiekun = require('./src/routes/uonetplus-opiekun');
|
||||
const uonetplusUczen = require('./src/routes/uonetplus-uczen');
|
||||
const uonetplusUczenplus = require('./src/routes/uonetplus-uczenplus/index');
|
||||
const uonetplusUzytkownik = require('./src/routes/uonetplus-uzytkownik');
|
||||
const uonetplusWiadomosciplus = require('./src/routes/uonetplus-wiadomosciplus');
|
||||
const subdomain = require('express-subdomain')
|
||||
const index = require('./src/routes/index')
|
||||
const api = require('./src/routes/api')
|
||||
const cufs = require('./src/routes/cufs')
|
||||
const uonetplus = require('./src/routes/uonetplus')
|
||||
const uonetplusOpiekun = require('./src/routes/uonetplus-opiekun')
|
||||
const uonetplusUczen = require('./src/routes/uonetplus-uczen')
|
||||
const uonetplusUczenplus = require('./src/routes/uonetplus-uczenplus/index')
|
||||
const uonetplusUzytkownik = require('./src/routes/uonetplus-uzytkownik')
|
||||
const uonetplusWiadomosciplus = require('./src/routes/uonetplus-wiadomosciplus')
|
||||
|
||||
const app = express();
|
||||
const app = express()
|
||||
|
||||
// view engine setup
|
||||
app.set('views', path.join(__dirname, 'src/views'));
|
||||
app.set('view engine', 'pug');
|
||||
app.set('views', path.join(__dirname, 'src/views'))
|
||||
app.set('view engine', 'pug')
|
||||
|
||||
// uncomment after placing your favicon in /public
|
||||
//app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));
|
||||
app.use(logger('dev'));
|
||||
app.use(bodyParser.json());
|
||||
app.use(bodyParser.urlencoded({ extended: false }));
|
||||
app.use(cookieParser());
|
||||
app.use(express.static(path.join(__dirname, 'public')));
|
||||
app.use(logger('dev'))
|
||||
app.use(bodyParser.json())
|
||||
app.use(bodyParser.urlencoded({ extended: false }))
|
||||
app.use(cookieParser())
|
||||
app.use(express.static(path.join(__dirname, 'public')))
|
||||
|
||||
app.use((req, res, next) => {
|
||||
res.locals.userInfo = require('./data/api/ListaUczniow')[1];
|
||||
res.locals.uonetplusUrl = protocol(req) + "://" + req.get('host').replace("uonetplus-opiekun", "uonetplus");
|
||||
res.locals.currentHost = protocol(req) + "://" + req.get('host');
|
||||
res.locals.proto = protocol(req);
|
||||
res.locals.host = req.get('host').replace(/(api|cufs|uonetplus|uonetplus-opiekun|uonetplus-uzytkownik)\./, "");
|
||||
res.locals.userInfo = require('./data/api/ListaUczniow')[1]
|
||||
res.locals.uonetplusUrl = protocol(req) + '://' + req.get('host').replace('uonetplus-opiekun', 'uonetplus')
|
||||
res.locals.currentHost = protocol(req) + '://' + req.get('host')
|
||||
res.locals.proto = protocol(req)
|
||||
res.locals.host = req.get('host').replace(/(api|cufs|uonetplus|uonetplus-opiekun|uonetplus-uzytkownik)\./, '')
|
||||
|
||||
res.cookie("UonetPlus_ASP.NET_SessionId", "", { httpOnly: true, domain: req.get("host") });
|
||||
res.cookie("ARR_DS_ARR301302", "", { httpOnly: true, domain: req.get("host") });
|
||||
res.cookie("ARR_" + req.get('host'), "1234567891012131314151617181920212223242526272829303132333435363", { httpOnly: true, domain: req.get("host") });
|
||||
next();
|
||||
});
|
||||
res.cookie('UonetPlus_ASP.NET_SessionId', '', {
|
||||
httpOnly: true,
|
||||
domain: req.get('host'),
|
||||
})
|
||||
res.cookie('ARR_DS_ARR301302', '', {
|
||||
httpOnly: true,
|
||||
domain: req.get('host'),
|
||||
})
|
||||
res.cookie('ARR_' + req.get('host'), '1234567891012131314151617181920212223242526272829303132333435363', {
|
||||
httpOnly: true,
|
||||
domain: req.get('host'),
|
||||
})
|
||||
next()
|
||||
})
|
||||
|
||||
const corsOpt = {
|
||||
origin: process.env.CORS_ALLOW_ORIGIN || '*'
|
||||
};
|
||||
app.use(cors(corsOpt));
|
||||
app.options('*', cors(corsOpt));
|
||||
origin: process.env.CORS_ALLOW_ORIGIN || '*',
|
||||
}
|
||||
app.use(cors(corsOpt))
|
||||
app.options('*', cors(corsOpt))
|
||||
|
||||
app.set('subdomain offset', +process.env.SUBDOMAIN_OFFSET || 2);
|
||||
app.use(subdomain('api', api));
|
||||
app.use(subdomain('cufs', cufs));
|
||||
app.use(subdomain('uonetplus', uonetplus));
|
||||
app.use(subdomain('uonetplus-opiekun', uonetplusOpiekun.use('/powiatwulkanowy/123456', uonetplusOpiekun)));
|
||||
app.use(subdomain('uonetplus-opiekun', uonetplusOpiekun.use('/powiatwulkanowy/123457', uonetplusOpiekun)));
|
||||
app.use(subdomain('uonetplus-opiekun', uonetplusOpiekun.use('/powiatwulkanowy/123458', uonetplusOpiekun)));
|
||||
app.use(subdomain('uonetplus-uczen', uonetplusUczen.use('/powiatwulkanowy/:customerSymbol', uonetplusUczen)));
|
||||
app.use(subdomain("uonetplus-uczenplus", uonetplusUczenplus.use("/powiatwulkanowy/:customerSymbol", uonetplusUczenplus)));
|
||||
app.use(subdomain('uonetplus-uzytkownik', uonetplusUzytkownik.use('/powiatwulkanowy', uonetplusUzytkownik)));
|
||||
app.use(subdomain('uonetplus-wiadomosciplus', uonetplusWiadomosciplus.use('/powiatwulkanowy', uonetplusWiadomosciplus)));
|
||||
app.use('/', index);
|
||||
app.set('subdomain offset', +process.env.SUBDOMAIN_OFFSET || 2)
|
||||
app.use(subdomain('api', api))
|
||||
app.use(subdomain('cufs', cufs))
|
||||
app.use(subdomain('uonetplus', uonetplus))
|
||||
app.use(subdomain('uonetplus-opiekun', uonetplusOpiekun.use('/powiatwulkanowy/123456', uonetplusOpiekun)))
|
||||
app.use(subdomain('uonetplus-opiekun', uonetplusOpiekun.use('/powiatwulkanowy/123457', uonetplusOpiekun)))
|
||||
app.use(subdomain('uonetplus-opiekun', uonetplusOpiekun.use('/powiatwulkanowy/123458', uonetplusOpiekun)))
|
||||
app.use(subdomain('uonetplus-uczen', uonetplusUczen.use('/powiatwulkanowy/:customerSymbol', uonetplusUczen)))
|
||||
app.use(subdomain('uonetplus-uczenplus', uonetplusUczenplus.use('/powiatwulkanowy/:customerSymbol', uonetplusUczenplus)))
|
||||
app.use(subdomain('uonetplus-uzytkownik', uonetplusUzytkownik.use('/powiatwulkanowy', uonetplusUzytkownik)))
|
||||
app.use(subdomain('uonetplus-wiadomosciplus', uonetplusWiadomosciplus.use('/powiatwulkanowy', uonetplusWiadomosciplus)))
|
||||
app.use('/', index)
|
||||
|
||||
// catch 404 and forward to error handler
|
||||
app.use((req, res, next) => {
|
||||
const err = new Error('Not Found');
|
||||
err.status = 404;
|
||||
next(err);
|
||||
});
|
||||
const err = new Error('Not Found')
|
||||
err.status = 404
|
||||
next(err)
|
||||
})
|
||||
|
||||
// error handler
|
||||
app.use((err, req, res, next) => {
|
||||
// set locals, only providing error in development
|
||||
res.locals.message = err.message;
|
||||
res.locals.error = req.app.get('env') === 'development' ? err : {};
|
||||
res.locals.message = err.message
|
||||
res.locals.error = req.app.get('env') === 'development' ? err : {}
|
||||
|
||||
// render the error page
|
||||
res.status(err.status || 500);
|
||||
res.render('error');
|
||||
});
|
||||
res.status(err.status || 500)
|
||||
res.render('error')
|
||||
})
|
||||
|
||||
if (typeof(PhusionPassenger) !== 'undefined') {
|
||||
app.listen('passenger');
|
||||
if (typeof PhusionPassenger !== 'undefined') {
|
||||
app.listen('passenger')
|
||||
}
|
||||
|
||||
module.exports = app;
|
||||
module.exports = app
|
||||
|
|
82
bin/www
82
bin/www
|
@ -3,81 +3,77 @@
|
|||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
const app = require('../app');
|
||||
const debug = require('debug')('fake-log:server');
|
||||
const http = require('http');
|
||||
const app = require('../app')
|
||||
const debug = require('debug')('fake-log:server')
|
||||
const http = require('http')
|
||||
|
||||
/**
|
||||
* Get port from environment and store in Express.
|
||||
*/
|
||||
const port = normalizePort(process.env.PORT || '3000');
|
||||
app.set('port', port);
|
||||
const port = normalizePort(process.env.PORT || '3000')
|
||||
app.set('port', port)
|
||||
|
||||
/**
|
||||
* Create HTTP server.
|
||||
*/
|
||||
const server = http.createServer(app);
|
||||
const server = http.createServer(app)
|
||||
|
||||
/**
|
||||
* Listen on provided port, on all network interfaces.
|
||||
*/
|
||||
server.listen(port);
|
||||
server.on('error', onError);
|
||||
server.on('listening', onListening);
|
||||
server.listen(port)
|
||||
server.on('error', onError)
|
||||
server.on('listening', onListening)
|
||||
|
||||
/**
|
||||
* Normalize a port into a number, string, or false.
|
||||
*/
|
||||
function normalizePort(val) {
|
||||
let port = parseInt(val, 10);
|
||||
let port = parseInt(val, 10)
|
||||
|
||||
if (isNaN(port)) {
|
||||
// named pipe
|
||||
return val;
|
||||
}
|
||||
if (isNaN(port)) {
|
||||
// named pipe
|
||||
return val
|
||||
}
|
||||
|
||||
if (port >= 0) {
|
||||
// port number
|
||||
return port;
|
||||
}
|
||||
if (port >= 0) {
|
||||
// port number
|
||||
return port
|
||||
}
|
||||
|
||||
return false;
|
||||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
* Event listener for HTTP server "error" event.
|
||||
*/
|
||||
function onError(error) {
|
||||
if (error.syscall !== 'listen') {
|
||||
throw error;
|
||||
}
|
||||
if (error.syscall !== 'listen') {
|
||||
throw error
|
||||
}
|
||||
|
||||
let bind = typeof port === 'string'
|
||||
? 'Pipe ' + port
|
||||
: 'Port ' + port;
|
||||
let bind = typeof port === 'string' ? 'Pipe ' + port : 'Port ' + port
|
||||
|
||||
// handle specific listen errors with friendly messages
|
||||
switch (error.code) {
|
||||
case 'EACCES':
|
||||
console.error(bind + ' requires elevated privileges');
|
||||
process.exit(1);
|
||||
break;
|
||||
case 'EADDRINUSE':
|
||||
console.error(bind + ' is already in use');
|
||||
process.exit(1);
|
||||
break;
|
||||
default:
|
||||
throw error;
|
||||
}
|
||||
// handle specific listen errors with friendly messages
|
||||
switch (error.code) {
|
||||
case 'EACCES':
|
||||
console.error(bind + ' requires elevated privileges')
|
||||
process.exit(1)
|
||||
break
|
||||
case 'EADDRINUSE':
|
||||
console.error(bind + ' is already in use')
|
||||
process.exit(1)
|
||||
break
|
||||
default:
|
||||
throw error
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Event listener for HTTP server "listening" event.
|
||||
*/
|
||||
function onListening() {
|
||||
let addr = server.address();
|
||||
let bind = typeof addr === 'string'
|
||||
? 'pipe ' + addr
|
||||
: 'port ' + addr.port;
|
||||
debug('Listening on ' + bind);
|
||||
let addr = server.address()
|
||||
let bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port
|
||||
debug('Listening on ' + bind)
|
||||
}
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
"IdPrzedmiot": 300,
|
||||
"IdKategoria": 26,
|
||||
"Wpis": "3",
|
||||
"Wartosc": 3.00,
|
||||
"Wartosc": 3.0,
|
||||
"WagaModyfikatora": null,
|
||||
"WagaOceny": 5.00,
|
||||
"WagaOceny": 5.0,
|
||||
"Licznik": null,
|
||||
"Mianownik": null,
|
||||
"Komentarz": null,
|
||||
|
@ -28,9 +28,9 @@
|
|||
"IdPrzedmiot": 300,
|
||||
"IdKategoria": 26,
|
||||
"Wpis": "4",
|
||||
"Wartosc": 4.00,
|
||||
"Wartosc": 4.0,
|
||||
"WagaModyfikatora": null,
|
||||
"WagaOceny": 5.00,
|
||||
"WagaOceny": 5.0,
|
||||
"Licznik": null,
|
||||
"Mianownik": null,
|
||||
"Komentarz": null,
|
||||
|
@ -50,9 +50,9 @@
|
|||
"IdPrzedmiot": 301,
|
||||
"IdKategoria": 28,
|
||||
"Wpis": "3",
|
||||
"Wartosc": 3.00,
|
||||
"Wartosc": 3.0,
|
||||
"WagaModyfikatora": null,
|
||||
"WagaOceny": 5.00,
|
||||
"WagaOceny": 5.0,
|
||||
"Licznik": null,
|
||||
"Mianownik": null,
|
||||
"Komentarz": null,
|
||||
|
@ -72,9 +72,9 @@
|
|||
"IdPrzedmiot": 301,
|
||||
"IdKategoria": 29,
|
||||
"Wpis": "3",
|
||||
"Wartosc": 3.00,
|
||||
"Wartosc": 3.0,
|
||||
"WagaModyfikatora": null,
|
||||
"WagaOceny": 6.00,
|
||||
"WagaOceny": 6.0,
|
||||
"Licznik": null,
|
||||
"Mianownik": null,
|
||||
"Komentarz": null,
|
||||
|
@ -94,9 +94,9 @@
|
|||
"IdPrzedmiot": 301,
|
||||
"IdKategoria": 28,
|
||||
"Wpis": "4",
|
||||
"Wartosc": 4.00,
|
||||
"Wartosc": 4.0,
|
||||
"WagaModyfikatora": null,
|
||||
"WagaOceny": 3.00,
|
||||
"WagaOceny": 3.0,
|
||||
"Licznik": null,
|
||||
"Mianownik": null,
|
||||
"Komentarz": null,
|
||||
|
@ -116,9 +116,9 @@
|
|||
"IdPrzedmiot": 301,
|
||||
"IdKategoria": 26,
|
||||
"Wpis": "4",
|
||||
"Wartosc": 4.00,
|
||||
"Wartosc": 4.0,
|
||||
"WagaModyfikatora": null,
|
||||
"WagaOceny": 1.00,
|
||||
"WagaOceny": 1.0,
|
||||
"Licznik": null,
|
||||
"Mianownik": null,
|
||||
"Komentarz": null,
|
||||
|
@ -138,9 +138,9 @@
|
|||
"IdPrzedmiot": 301,
|
||||
"IdKategoria": 29,
|
||||
"Wpis": "2",
|
||||
"Wartosc": 2.00,
|
||||
"Wartosc": 2.0,
|
||||
"WagaModyfikatora": null,
|
||||
"WagaOceny": 6.00,
|
||||
"WagaOceny": 6.0,
|
||||
"Licznik": null,
|
||||
"Mianownik": null,
|
||||
"Komentarz": null,
|
||||
|
@ -160,9 +160,9 @@
|
|||
"IdPrzedmiot": 301,
|
||||
"IdKategoria": 30,
|
||||
"Wpis": "3",
|
||||
"Wartosc": 3.00,
|
||||
"Wartosc": 3.0,
|
||||
"WagaModyfikatora": null,
|
||||
"WagaOceny": 2.00,
|
||||
"WagaOceny": 2.0,
|
||||
"Licznik": null,
|
||||
"Mianownik": null,
|
||||
"Komentarz": null,
|
||||
|
@ -182,9 +182,9 @@
|
|||
"IdPrzedmiot": 308,
|
||||
"IdKategoria": 26,
|
||||
"Wpis": "1",
|
||||
"Wartosc": 1.00,
|
||||
"Wartosc": 1.0,
|
||||
"WagaModyfikatora": null,
|
||||
"WagaOceny": 6.00,
|
||||
"WagaOceny": 6.0,
|
||||
"Licznik": null,
|
||||
"Mianownik": null,
|
||||
"Komentarz": null,
|
||||
|
@ -204,9 +204,9 @@
|
|||
"IdPrzedmiot": 308,
|
||||
"IdKategoria": 27,
|
||||
"Wpis": "2",
|
||||
"Wartosc": 2.00,
|
||||
"Wartosc": 2.0,
|
||||
"WagaModyfikatora": null,
|
||||
"WagaOceny": 5.00,
|
||||
"WagaOceny": 5.0,
|
||||
"Licznik": null,
|
||||
"Mianownik": null,
|
||||
"Komentarz": null,
|
||||
|
@ -226,9 +226,9 @@
|
|||
"IdPrzedmiot": 308,
|
||||
"IdKategoria": 28,
|
||||
"Wpis": "3",
|
||||
"Wartosc": 3.00,
|
||||
"Wartosc": 3.0,
|
||||
"WagaModyfikatora": null,
|
||||
"WagaOceny": 2.00,
|
||||
"WagaOceny": 2.0,
|
||||
"Licznik": null,
|
||||
"Mianownik": null,
|
||||
"Komentarz": null,
|
||||
|
@ -248,9 +248,9 @@
|
|||
"IdPrzedmiot": 308,
|
||||
"IdKategoria": 29,
|
||||
"Wpis": "4",
|
||||
"Wartosc": 4.00,
|
||||
"Wartosc": 4.0,
|
||||
"WagaModyfikatora": null,
|
||||
"WagaOceny": 5.00,
|
||||
"WagaOceny": 5.0,
|
||||
"Licznik": null,
|
||||
"Mianownik": null,
|
||||
"Komentarz": null,
|
||||
|
@ -270,9 +270,9 @@
|
|||
"IdPrzedmiot": 308,
|
||||
"IdKategoria": 30,
|
||||
"Wpis": "5",
|
||||
"Wartosc": 5.00,
|
||||
"Wartosc": 5.0,
|
||||
"WagaModyfikatora": null,
|
||||
"WagaOceny": 6.00,
|
||||
"WagaOceny": 6.0,
|
||||
"Licznik": null,
|
||||
"Mianownik": null,
|
||||
"Komentarz": null,
|
||||
|
@ -292,9 +292,9 @@
|
|||
"IdPrzedmiot": 308,
|
||||
"IdKategoria": 65,
|
||||
"Wpis": "6",
|
||||
"Wartosc": 6.00,
|
||||
"Wartosc": 6.0,
|
||||
"WagaModyfikatora": null,
|
||||
"WagaOceny": 1.00,
|
||||
"WagaOceny": 1.0,
|
||||
"Licznik": null,
|
||||
"Mianownik": null,
|
||||
"Komentarz": null,
|
||||
|
@ -314,9 +314,9 @@
|
|||
"IdPrzedmiot": 307,
|
||||
"IdKategoria": 27,
|
||||
"Wpis": "3",
|
||||
"Wartosc": 3.00,
|
||||
"Wartosc": 3.0,
|
||||
"WagaModyfikatora": null,
|
||||
"WagaOceny": 1.00,
|
||||
"WagaOceny": 1.0,
|
||||
"Licznik": null,
|
||||
"Mianownik": null,
|
||||
"Komentarz": null,
|
||||
|
@ -336,9 +336,9 @@
|
|||
"IdPrzedmiot": 307,
|
||||
"IdKategoria": 28,
|
||||
"Wpis": "5",
|
||||
"Wartosc": 5.00,
|
||||
"Wartosc": 5.0,
|
||||
"WagaModyfikatora": null,
|
||||
"WagaOceny": 3.00,
|
||||
"WagaOceny": 3.0,
|
||||
"Licznik": null,
|
||||
"Mianownik": null,
|
||||
"Komentarz": null,
|
||||
|
@ -358,9 +358,9 @@
|
|||
"IdPrzedmiot": 310,
|
||||
"IdKategoria": 28,
|
||||
"Wpis": "4",
|
||||
"Wartosc": 4.00,
|
||||
"Wartosc": 4.0,
|
||||
"WagaModyfikatora": null,
|
||||
"WagaOceny": 3.00,
|
||||
"WagaOceny": 3.0,
|
||||
"Licznik": null,
|
||||
"Mianownik": null,
|
||||
"Komentarz": null,
|
||||
|
@ -380,9 +380,9 @@
|
|||
"IdPrzedmiot": 311,
|
||||
"IdKategoria": 28,
|
||||
"Wpis": "3",
|
||||
"Wartosc": 3.00,
|
||||
"Wartosc": 3.0,
|
||||
"WagaModyfikatora": null,
|
||||
"WagaOceny": 3.00,
|
||||
"WagaOceny": 3.0,
|
||||
"Licznik": null,
|
||||
"Mianownik": null,
|
||||
"Komentarz": null,
|
||||
|
@ -402,9 +402,9 @@
|
|||
"IdPrzedmiot": 312,
|
||||
"IdKategoria": 28,
|
||||
"Wpis": "2",
|
||||
"Wartosc": 2.00,
|
||||
"Wartosc": 2.0,
|
||||
"WagaModyfikatora": null,
|
||||
"WagaOceny": 3.00,
|
||||
"WagaOceny": 3.0,
|
||||
"Licznik": null,
|
||||
"Mianownik": null,
|
||||
"Komentarz": null,
|
||||
|
@ -424,9 +424,9 @@
|
|||
"IdPrzedmiot": 313,
|
||||
"IdKategoria": 28,
|
||||
"Wpis": "1",
|
||||
"Wartosc": 1.00,
|
||||
"Wartosc": 1.0,
|
||||
"WagaModyfikatora": null,
|
||||
"WagaOceny": 3.00,
|
||||
"WagaOceny": 3.0,
|
||||
"Licznik": null,
|
||||
"Mianownik": null,
|
||||
"Komentarz": null,
|
||||
|
@ -446,9 +446,9 @@
|
|||
"IdPrzedmiot": 313,
|
||||
"IdKategoria": 28,
|
||||
"Wpis": "1",
|
||||
"Wartosc": 1.00,
|
||||
"Wartosc": 1.0,
|
||||
"WagaModyfikatora": null,
|
||||
"WagaOceny": 3.00,
|
||||
"WagaOceny": 3.0,
|
||||
"Licznik": null,
|
||||
"Mianownik": null,
|
||||
"Komentarz": null,
|
||||
|
@ -468,9 +468,9 @@
|
|||
"IdPrzedmiot": 313,
|
||||
"IdKategoria": 28,
|
||||
"Wpis": "75/100",
|
||||
"Wartosc": 0.00,
|
||||
"Wartosc": 0.0,
|
||||
"WagaModyfikatora": null,
|
||||
"WagaOceny": 0.00,
|
||||
"WagaOceny": 0.0,
|
||||
"Licznik": null,
|
||||
"Mianownik": null,
|
||||
"Komentarz": null,
|
||||
|
@ -490,9 +490,9 @@
|
|||
"IdPrzedmiot": 303,
|
||||
"IdKategoria": 28,
|
||||
"Wpis": "4",
|
||||
"Wartosc": 4.00,
|
||||
"Wartosc": 4.0,
|
||||
"WagaModyfikatora": null,
|
||||
"WagaOceny": 0.00,
|
||||
"WagaOceny": 0.0,
|
||||
"Licznik": null,
|
||||
"Mianownik": null,
|
||||
"Komentarz": null,
|
||||
|
|
|
@ -1,38 +1,38 @@
|
|||
[
|
||||
{
|
||||
"Opis": "",
|
||||
"Tytul": "Longman Repetytorium maturalne. Podręcznik wieloletni do języka angielskiego - poziom rozszerzony",
|
||||
"Autor": "Marta Umińska, Bob Hastings, Dominika Chandler, Rod Fricker, Beata Trapnell",
|
||||
"Wydawnictwo": "Pearson Central Europe Sp. z o.o.",
|
||||
"Przedmiot": "Język angielski",
|
||||
"Aktywny": false,
|
||||
"Id": 66
|
||||
},
|
||||
{
|
||||
"Opis": "",
|
||||
"Tytul": "Historia i Teraźniejszość",
|
||||
"Autor": "Izabella Modzelewska-Rysak, Leszek Rysak, Adam Cisek, Karol Wilczyński",
|
||||
"Wydawnictwo": "Wydawnictwa Szkolne i Pedagogiczne Sp. z o.o.",
|
||||
"Przedmiot": "Historia i Teraźniejszość",
|
||||
"Aktywny": true,
|
||||
"Id": 57
|
||||
},
|
||||
{
|
||||
"Opis": "",
|
||||
"Tytul": "Droga autostradą do Bukaresztu. Podręcznik wieloletni do języka rumuńskiego - poziom podstawowy",
|
||||
"Autor": "Marta Umińska, Bob Hastings, Dominika Chandler, Rod Fricker, Beata Trapnell",
|
||||
"Wydawnictwo": "Wydawnictwo Cenzury i Nauk Społecznych Sp. z o.o",
|
||||
"Przedmiot": "Język rumuński",
|
||||
"Aktywny": false,
|
||||
"Id": 69
|
||||
},
|
||||
{
|
||||
"Opis": "",
|
||||
"Tytul": "Drogą ku wyjścia z Unii Europejskiej. Podręcznik wieloletni do historii - poziom podstawowy",
|
||||
"Autor": "Marta Umińska, Mateusz Morawiecki, Kuba Szczodreń",
|
||||
"Wydawnictwo": "Wydawnictwo Cenzury i Nauk Społecznych Sp. z o.o",
|
||||
"Przedmiot": "Historia",
|
||||
"Aktywny": true,
|
||||
"Id": 80
|
||||
}
|
||||
{
|
||||
"Opis": "",
|
||||
"Tytul": "Longman Repetytorium maturalne. Podręcznik wieloletni do języka angielskiego - poziom rozszerzony",
|
||||
"Autor": "Marta Umińska, Bob Hastings, Dominika Chandler, Rod Fricker, Beata Trapnell",
|
||||
"Wydawnictwo": "Pearson Central Europe Sp. z o.o.",
|
||||
"Przedmiot": "Język angielski",
|
||||
"Aktywny": false,
|
||||
"Id": 66
|
||||
},
|
||||
{
|
||||
"Opis": "",
|
||||
"Tytul": "Historia i Teraźniejszość",
|
||||
"Autor": "Izabella Modzelewska-Rysak, Leszek Rysak, Adam Cisek, Karol Wilczyński",
|
||||
"Wydawnictwo": "Wydawnictwa Szkolne i Pedagogiczne Sp. z o.o.",
|
||||
"Przedmiot": "Historia i Teraźniejszość",
|
||||
"Aktywny": true,
|
||||
"Id": 57
|
||||
},
|
||||
{
|
||||
"Opis": "",
|
||||
"Tytul": "Droga autostradą do Bukaresztu. Podręcznik wieloletni do języka rumuńskiego - poziom podstawowy",
|
||||
"Autor": "Marta Umińska, Bob Hastings, Dominika Chandler, Rod Fricker, Beata Trapnell",
|
||||
"Wydawnictwo": "Wydawnictwo Cenzury i Nauk Społecznych Sp. z o.o",
|
||||
"Przedmiot": "Język rumuński",
|
||||
"Aktywny": false,
|
||||
"Id": 69
|
||||
},
|
||||
{
|
||||
"Opis": "",
|
||||
"Tytul": "Drogą ku wyjścia z Unii Europejskiej. Podręcznik wieloletni do historii - poziom podstawowy",
|
||||
"Autor": "Marta Umińska, Mateusz Morawiecki, Kuba Szczodreń",
|
||||
"Wydawnictwo": "Wydawnictwo Cenzury i Nauk Społecznych Sp. z o.o",
|
||||
"Przedmiot": "Historia",
|
||||
"Aktywny": true,
|
||||
"Id": 80
|
||||
}
|
||||
]
|
|
@ -1,18 +1,18 @@
|
|||
[
|
||||
{
|
||||
"Nazwa": "2021/2022",
|
||||
"Id": 2021
|
||||
},
|
||||
{
|
||||
"Nazwa": "2020/2021",
|
||||
"Id": 2020
|
||||
},
|
||||
{
|
||||
"Nazwa": "2019/2020",
|
||||
"Id": 2019
|
||||
},
|
||||
{
|
||||
"Nazwa": "2018/2019",
|
||||
"Id": 2018
|
||||
}
|
||||
{
|
||||
"Nazwa": "2021/2022",
|
||||
"Id": 2021
|
||||
},
|
||||
{
|
||||
"Nazwa": "2020/2021",
|
||||
"Id": 2020
|
||||
},
|
||||
{
|
||||
"Nazwa": "2019/2020",
|
||||
"Id": 2019
|
||||
},
|
||||
{
|
||||
"Nazwa": "2018/2019",
|
||||
"Id": 2018
|
||||
}
|
||||
]
|
|
@ -2,21 +2,21 @@
|
|||
{
|
||||
"Subject": "Edukacja dla bezpieczeństwa",
|
||||
"Value1": 78.19,
|
||||
"Value2": 80.00,
|
||||
"Value2": 80.0,
|
||||
"Label1": "78,19",
|
||||
"Label2": "80,00"
|
||||
},
|
||||
{
|
||||
"Subject": "Biologia",
|
||||
"Value1": 50.00,
|
||||
"Value2": 50.00,
|
||||
"Value1": 50.0,
|
||||
"Value2": 50.0,
|
||||
"Label1": "50,00",
|
||||
"Label2": "50,00"
|
||||
},
|
||||
{
|
||||
"Subject": "Język angielski",
|
||||
"Value1": 69.96,
|
||||
"Value2": 85.00,
|
||||
"Value2": 85.0,
|
||||
"Label1": "69,96",
|
||||
"Label2": "85,00"
|
||||
},
|
||||
|
|
|
@ -16,6 +16,6 @@
|
|||
"isNadzorOn": false,
|
||||
"isUploadPhotosOn": false,
|
||||
"isZglaszanieNieobecnosciOn": false,
|
||||
"isOneDriveAttachmentsHomeworksOn":true,
|
||||
"isPodrecznikiOn":true
|
||||
"isOneDriveAttachmentsHomeworksOn": true,
|
||||
"isPodrecznikiOn": true
|
||||
}
|
||||
|
|
|
@ -7,9 +7,7 @@
|
|||
"kodPocztowy": "00-000",
|
||||
"nrDomu": "1",
|
||||
"nrMieszkania": "",
|
||||
"dyrektorzy": [
|
||||
"Stanisław Konarowski"
|
||||
],
|
||||
"dyrektorzy": ["Stanisław Konarowski"],
|
||||
"stronaWwwUrl": "fakelog.cf",
|
||||
"mail": "sekretariat@fakelog.cf",
|
||||
"telSluzbowy": "",
|
||||
|
|
|
@ -20,16 +20,14 @@
|
|||
{
|
||||
"przedmiotNazwa": "Zajęcia artystyczne",
|
||||
"pozycja": 13,
|
||||
"nauczyciele": [
|
||||
"Jan Kowalski [JK]"
|
||||
],
|
||||
"nauczyciele": ["Jan Kowalski [JK]"],
|
||||
"ocenyCzastkowe": [
|
||||
{
|
||||
"wpis": "6",
|
||||
"dataOceny": "19.03.2024",
|
||||
"kategoriaKolumny": "Bieżące",
|
||||
"nazwaKolumny": "",
|
||||
"waga": 0.00,
|
||||
"waga": 0.0,
|
||||
"kolorOceny": 0,
|
||||
"nauczyciel": "Jan Kowalski [JK]",
|
||||
"zmienionaOdOstatniegoLogowania": true
|
||||
|
@ -39,7 +37,7 @@
|
|||
"dataOceny": "19.03.2024",
|
||||
"kategoriaKolumny": "Odpowiedź ustna",
|
||||
"nazwaKolumny": "Opis",
|
||||
"waga": 100.00,
|
||||
"waga": 100.0,
|
||||
"kolorOceny": 15748172,
|
||||
"nauczyciel": "Joanna Kowalska [JK]",
|
||||
"zmienionaOdOstatniegoLogowania": true
|
||||
|
|
|
@ -1,36 +1,36 @@
|
|||
[
|
||||
{
|
||||
{
|
||||
"IkonkaNazwa": null,
|
||||
"Num": null,
|
||||
"Zawartosc": [
|
||||
{
|
||||
"IkonkaNazwa": null,
|
||||
"Num": null,
|
||||
"Zawartosc": [
|
||||
{
|
||||
"IkonkaNazwa": null,
|
||||
"Num": null,
|
||||
"Zawartosc": [],
|
||||
"Rozszerzenie": false,
|
||||
"Nazwa": "<span class=\"dayHeader subDiv\">23.06.2022 - DZIŚ</span><br>",
|
||||
"Url": null,
|
||||
"Dane": null,
|
||||
"Symbol": null,
|
||||
"Nieaktywny": false
|
||||
},
|
||||
{
|
||||
"IkonkaNazwa": null,
|
||||
"Num": null,
|
||||
"Zawartosc": [],
|
||||
"Rozszerzenie": false,
|
||||
"Nazwa": "<span class=\"num\" style=\"\">2.</span> <span '>zaj. wych. klasa</span>",
|
||||
"Url": null,
|
||||
"Dane": null,
|
||||
"Symbol": null,
|
||||
"Nieaktywny": false
|
||||
}
|
||||
],
|
||||
"Zawartosc": [],
|
||||
"Rozszerzenie": false,
|
||||
"Nazwa": "",
|
||||
"Nazwa": "<span class=\"dayHeader subDiv\">23.06.2022 - DZIŚ</span><br>",
|
||||
"Url": null,
|
||||
"Dane": null,
|
||||
"Symbol": null,
|
||||
"Nieaktywny": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"IkonkaNazwa": null,
|
||||
"Num": null,
|
||||
"Zawartosc": [],
|
||||
"Rozszerzenie": false,
|
||||
"Nazwa": "<span class=\"num\" style=\"\">2.</span> <span '>zaj. wych. klasa</span>",
|
||||
"Url": null,
|
||||
"Dane": null,
|
||||
"Symbol": null,
|
||||
"Nieaktywny": false
|
||||
}
|
||||
],
|
||||
"Rozszerzenie": false,
|
||||
"Nazwa": "",
|
||||
"Url": null,
|
||||
"Dane": null,
|
||||
"Symbol": null,
|
||||
"Nieaktywny": false
|
||||
}
|
||||
]
|
|
@ -1,29 +1,30 @@
|
|||
[{
|
||||
[
|
||||
{
|
||||
"IkonkaNazwa": null,
|
||||
"Num": null,
|
||||
"Zawartosc": [
|
||||
{
|
||||
"IkonkaNazwa": null,
|
||||
"Num": null,
|
||||
"Zawartosc": [],
|
||||
"Rozszerzenie": false,
|
||||
"Nazwa": "Wydarzenia ",
|
||||
"Url": null,
|
||||
"Dane": "<p>W dniu 29 lutego 2024 r. uczniowie klasy 3d biorą udział w wyjściu na strzelnicę.</p>",
|
||||
"Symbol": "27.02.2024, Jan kowalski",
|
||||
"Nieaktywny": false
|
||||
},
|
||||
{
|
||||
"IkonkaNazwa": null,
|
||||
"Num": null,
|
||||
"Zawartosc": [],
|
||||
"Rozszerzenie": false,
|
||||
"Nazwa": "Platformy",
|
||||
"Url": null,
|
||||
"Dane": "<p>Platformy do wykorzystania dla uczniów w zakresie kompetencji cyfrowych:</p>",
|
||||
"Symbol": "05.12.2023, Malwina Czerwieńska",
|
||||
"Nieaktywny": false
|
||||
}
|
||||
{
|
||||
"IkonkaNazwa": null,
|
||||
"Num": null,
|
||||
"Zawartosc": [],
|
||||
"Rozszerzenie": false,
|
||||
"Nazwa": "Wydarzenia ",
|
||||
"Url": null,
|
||||
"Dane": "<p>W dniu 29 lutego 2024 r. uczniowie klasy 3d biorą udział w wyjściu na strzelnicę.</p>",
|
||||
"Symbol": "27.02.2024, Jan kowalski",
|
||||
"Nieaktywny": false
|
||||
},
|
||||
{
|
||||
"IkonkaNazwa": null,
|
||||
"Num": null,
|
||||
"Zawartosc": [],
|
||||
"Rozszerzenie": false,
|
||||
"Nazwa": "Platformy",
|
||||
"Url": null,
|
||||
"Dane": "<p>Platformy do wykorzystania dla uczniów w zakresie kompetencji cyfrowych:</p>",
|
||||
"Symbol": "05.12.2023, Malwina Czerwieńska",
|
||||
"Nieaktywny": false
|
||||
}
|
||||
],
|
||||
"Rozszerzenie": false,
|
||||
"Nazwa": "",
|
||||
|
@ -31,4 +32,5 @@
|
|||
"Dane": null,
|
||||
"Symbol": null,
|
||||
"Nieaktywny": false
|
||||
}]
|
||||
}
|
||||
]
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
[
|
||||
{
|
||||
{
|
||||
"IkonkaNazwa": null,
|
||||
"Num": null,
|
||||
"Zawartosc": [
|
||||
{
|
||||
"IkonkaNazwa": null,
|
||||
"Num": null,
|
||||
"Zawartosc": [
|
||||
{
|
||||
"IkonkaNazwa": null,
|
||||
"Num": 64253,
|
||||
"Zawartosc": [],
|
||||
"Rozszerzenie": false,
|
||||
"Nazwa": "j. polski 12.11.2019 Napisz krótki tekst (7 zdań) n...",
|
||||
"Url": "12.11.2019",
|
||||
"Dane": null,
|
||||
"Symbol": null,
|
||||
"Nieaktywny": false
|
||||
}
|
||||
],
|
||||
"Num": 64253,
|
||||
"Zawartosc": [],
|
||||
"Rozszerzenie": false,
|
||||
"Nazwa": null,
|
||||
"Url": "https://uonetplus-uczen.fakelog.cf/powiatwulkanowy/123456",
|
||||
"Nazwa": "j. polski 12.11.2019 Napisz krótki tekst (7 zdań) n...",
|
||||
"Url": "12.11.2019",
|
||||
"Dane": null,
|
||||
"Symbol": null,
|
||||
"Nieaktywny": false
|
||||
}
|
||||
}
|
||||
],
|
||||
"Rozszerzenie": false,
|
||||
"Nazwa": null,
|
||||
"Url": "https://uonetplus-uczen.fakelog.cf/powiatwulkanowy/123456",
|
||||
"Dane": null,
|
||||
"Symbol": null,
|
||||
"Nieaktywny": false
|
||||
}
|
||||
]
|
|
@ -1,47 +1,47 @@
|
|||
[
|
||||
{
|
||||
{
|
||||
"IkonkaNazwa": null,
|
||||
"Num": null,
|
||||
"Zawartosc": [
|
||||
{
|
||||
"IkonkaNazwa": null,
|
||||
"Num": null,
|
||||
"Zawartosc": [
|
||||
{
|
||||
"IkonkaNazwa": null,
|
||||
"Num": null,
|
||||
"Zawartosc": [],
|
||||
"Rozszerzenie": false,
|
||||
"Nazwa": "<span class=\"white\">Biologia klasa,</span> Podsumowanie wiadomości z kl. III.",
|
||||
"Url": null,
|
||||
"Dane": null,
|
||||
"Symbol": null,
|
||||
"Nieaktywny": false
|
||||
},
|
||||
{
|
||||
"IkonkaNazwa": null,
|
||||
"Num": null,
|
||||
"Zawartosc": [],
|
||||
"Rozszerzenie": false,
|
||||
"Nazwa": "<span class=\"white\">Chemia klasa,</span> Podsumowanie wiadomości z chemii.",
|
||||
"Url": null,
|
||||
"Dane": null,
|
||||
"Symbol": null,
|
||||
"Nieaktywny": false
|
||||
},
|
||||
{
|
||||
"IkonkaNazwa": null,
|
||||
"Num": null,
|
||||
"Zawartosc": [],
|
||||
"Rozszerzenie": false,
|
||||
"Nazwa": "<span class=\"white\">Edukacja dla bezpieczeństwa klasa,</span> Podsumowanie pracy na zajęciach edb.",
|
||||
"Url": null,
|
||||
"Dane": null,
|
||||
"Symbol": null,
|
||||
"Nieaktywny": false
|
||||
}
|
||||
],
|
||||
"Zawartosc": [],
|
||||
"Rozszerzenie": false,
|
||||
"Nazwa": "",
|
||||
"Nazwa": "<span class=\"white\">Biologia klasa,</span> Podsumowanie wiadomości z kl. III.",
|
||||
"Url": null,
|
||||
"Dane": null,
|
||||
"Symbol": null,
|
||||
"Nieaktywny": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"IkonkaNazwa": null,
|
||||
"Num": null,
|
||||
"Zawartosc": [],
|
||||
"Rozszerzenie": false,
|
||||
"Nazwa": "<span class=\"white\">Chemia klasa,</span> Podsumowanie wiadomości z chemii.",
|
||||
"Url": null,
|
||||
"Dane": null,
|
||||
"Symbol": null,
|
||||
"Nieaktywny": false
|
||||
},
|
||||
{
|
||||
"IkonkaNazwa": null,
|
||||
"Num": null,
|
||||
"Zawartosc": [],
|
||||
"Rozszerzenie": false,
|
||||
"Nazwa": "<span class=\"white\">Edukacja dla bezpieczeństwa klasa,</span> Podsumowanie pracy na zajęciach edb.",
|
||||
"Url": null,
|
||||
"Dane": null,
|
||||
"Symbol": null,
|
||||
"Nieaktywny": false
|
||||
}
|
||||
],
|
||||
"Rozszerzenie": false,
|
||||
"Nazwa": "",
|
||||
"Url": null,
|
||||
"Dane": null,
|
||||
"Symbol": null,
|
||||
"Nieaktywny": false
|
||||
}
|
||||
]
|
|
@ -1,25 +1,25 @@
|
|||
[
|
||||
{
|
||||
{
|
||||
"IkonkaNazwa": null,
|
||||
"Num": null,
|
||||
"Zawartosc": [
|
||||
{
|
||||
"IkonkaNazwa": null,
|
||||
"Num": null,
|
||||
"Zawartosc": [
|
||||
{
|
||||
"IkonkaNazwa": null,
|
||||
"Num": 64253,
|
||||
"Zawartosc": [],
|
||||
"Rozszerzenie": false,
|
||||
"Nazwa": "Język polski 10.10.2019 sprawdzian: Sprawdzian aktu komunikacji j...",
|
||||
"Url": "10.10.2019",
|
||||
"Dane": null,
|
||||
"Symbol": null,
|
||||
"Nieaktywny": false
|
||||
}
|
||||
],
|
||||
"Num": 64253,
|
||||
"Zawartosc": [],
|
||||
"Rozszerzenie": false,
|
||||
"Nazwa": null,
|
||||
"Url": "https://uonetplus-uczen.fakelog.cf/powiatwulkanowy/123456",
|
||||
"Nazwa": "Język polski 10.10.2019 sprawdzian: Sprawdzian aktu komunikacji j...",
|
||||
"Url": "10.10.2019",
|
||||
"Dane": null,
|
||||
"Symbol": null,
|
||||
"Nieaktywny": false
|
||||
}
|
||||
}
|
||||
],
|
||||
"Rozszerzenie": false,
|
||||
"Nazwa": null,
|
||||
"Url": "https://uonetplus-uczen.fakelog.cf/powiatwulkanowy/123456",
|
||||
"Dane": null,
|
||||
"Symbol": null,
|
||||
"Nieaktywny": false
|
||||
}
|
||||
]
|
|
@ -1,31 +1,31 @@
|
|||
[
|
||||
{
|
||||
"UnitName": "ZST-I",
|
||||
"People": [
|
||||
{
|
||||
"Name": "Jan Kowalski",
|
||||
"Position": "Przewodniczący Samorządu Uczniowskiego",
|
||||
"Division": "2tim (T 17)",
|
||||
"Id": 0
|
||||
},
|
||||
{
|
||||
"Name": "Jan Kowalski",
|
||||
"Position": "Z-ca przewodniczącego Samorządu Uczniowskiego",
|
||||
"Division": "2tm (T 17)",
|
||||
"Id": 0
|
||||
},
|
||||
{
|
||||
"Name": "Jan Kowalski",
|
||||
"Position": "Skarbnik",
|
||||
"Division": "1tm (T 17)",
|
||||
"Id": 0
|
||||
},
|
||||
{
|
||||
"Name": "Jan Kowalski",
|
||||
"Position": "Sekretarz",
|
||||
"Division": "2pma (T 17)",
|
||||
"Id": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
{
|
||||
"UnitName": "ZST-I",
|
||||
"People": [
|
||||
{
|
||||
"Name": "Jan Kowalski",
|
||||
"Position": "Przewodniczący Samorządu Uczniowskiego",
|
||||
"Division": "2tim (T 17)",
|
||||
"Id": 0
|
||||
},
|
||||
{
|
||||
"Name": "Jan Kowalski",
|
||||
"Position": "Z-ca przewodniczącego Samorządu Uczniowskiego",
|
||||
"Division": "2tm (T 17)",
|
||||
"Id": 0
|
||||
},
|
||||
{
|
||||
"Name": "Jan Kowalski",
|
||||
"Position": "Skarbnik",
|
||||
"Division": "1tm (T 17)",
|
||||
"Id": 0
|
||||
},
|
||||
{
|
||||
"Name": "Jan Kowalski",
|
||||
"Position": "Sekretarz",
|
||||
"Division": "2pma (T 17)",
|
||||
"Id": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
|
@ -1,23 +1,23 @@
|
|||
[
|
||||
{
|
||||
{
|
||||
"IkonkaNazwa": null,
|
||||
"Num": null,
|
||||
"Zawartosc": [
|
||||
{
|
||||
"IkonkaNazwa": null,
|
||||
"Num": null,
|
||||
"Zawartosc": [
|
||||
{
|
||||
"IkonkaNazwa": null,
|
||||
"Num": null,
|
||||
"Zawartosc": [],
|
||||
"Nazwa": "07.06.2021 Informacje o wycieczce: od 10:45 - 11:30 do 13:40 - 14:25; Wycieczka do sortowni odpadów w Łodzi.",
|
||||
"Url": null,
|
||||
"Dane": null,
|
||||
"Symbol": null,
|
||||
"Nieaktywny": false
|
||||
}
|
||||
],
|
||||
"Nazwa": "Jan Kowalski ",
|
||||
"Zawartosc": [],
|
||||
"Nazwa": "07.06.2021 Informacje o wycieczce: od 10:45 - 11:30 do 13:40 - 14:25; Wycieczka do sortowni odpadów w Łodzi.",
|
||||
"Url": null,
|
||||
"Dane": null,
|
||||
"Symbol": null,
|
||||
"Nieaktywny": false
|
||||
}
|
||||
}
|
||||
],
|
||||
"Nazwa": "Jan Kowalski ",
|
||||
"Url": null,
|
||||
"Dane": null,
|
||||
"Symbol": null,
|
||||
"Nieaktywny": false
|
||||
}
|
||||
]
|
|
@ -1,11 +1,11 @@
|
|||
version: "3.5"
|
||||
version: '3.5'
|
||||
services:
|
||||
fakelog:
|
||||
build: .
|
||||
environment:
|
||||
- SUBDOMAIN_OFFSET=3
|
||||
ports:
|
||||
- "3000:3000"
|
||||
- '3000:3000'
|
||||
networks:
|
||||
- internal_network
|
||||
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
"start": "node ./bin/www & npm run scss",
|
||||
"watch": "nodemon ./bin/www & npm run scss",
|
||||
"test": "jshint src/ app.js --verbose",
|
||||
"scss": "sass --watch public/stylesheets"
|
||||
"scss": "sass --watch public/stylesheets",
|
||||
"prettier": "prettier . --write"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/express": "^4.17.21",
|
||||
|
@ -21,6 +22,7 @@
|
|||
"lodash": "latest",
|
||||
"md5": "^2.3.0",
|
||||
"morgan": "~1.10.0",
|
||||
"prettier": "^3.2.5",
|
||||
"pug": "^3.0.2",
|
||||
"sass": "^1.71.1",
|
||||
"serve-favicon": "~2.5.0",
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
background: green;
|
||||
}
|
||||
|
||||
[class^="x"]:before {
|
||||
[class^='x']:before {
|
||||
color: #fff;
|
||||
padding: 2px;
|
||||
font-size: small;
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
justify-content: space-between;
|
||||
padding: 1rem 0;
|
||||
|
||||
[type="radio"], label[for] {
|
||||
[type='radio'],
|
||||
label[for] {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,8 @@ table:not(.presentData),
|
|||
}
|
||||
}
|
||||
|
||||
th, td {
|
||||
th,
|
||||
td {
|
||||
padding: 1rem;
|
||||
border: 1px solid #333333;
|
||||
width: 20%;
|
||||
|
|
|
@ -38,12 +38,12 @@ header[data-organization-name] {
|
|||
&::before {
|
||||
position: absolute;
|
||||
display: block;
|
||||
content: "";
|
||||
content: '';
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
top: 10px;
|
||||
margin-left: 30px;
|
||||
background: url(https://avatars3.githubusercontent.com/u/27146352?s=40)
|
||||
background: url(https://avatars3.githubusercontent.com/u/27146352?s=40);
|
||||
}
|
||||
|
||||
h1 {
|
||||
|
@ -83,7 +83,7 @@ header[data-organization-name] {
|
|||
|
||||
a {
|
||||
display: block;
|
||||
background: #8B0000;
|
||||
background: #8b0000;
|
||||
text-decoration: none;
|
||||
padding: 1rem;
|
||||
margin: 0 3px;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
.startScreen {
|
||||
|
||||
.topBar {
|
||||
background: #43434d;
|
||||
color: #fff;
|
||||
|
@ -35,7 +34,7 @@
|
|||
}
|
||||
|
||||
.applicationName {
|
||||
color: #8B0000;
|
||||
color: #8b0000;
|
||||
font-size: 40px;
|
||||
line-height: 70px;
|
||||
|
||||
|
@ -57,7 +56,6 @@
|
|||
.time {
|
||||
font-size: 36px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.content {
|
||||
|
@ -82,14 +80,16 @@
|
|||
}
|
||||
|
||||
// one school
|
||||
#idEmptyAppUczen, #idEmptyAppUczenExt {
|
||||
#idEmptyAppUczen,
|
||||
#idEmptyAppUczenExt {
|
||||
.name {
|
||||
padding: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
// many schools
|
||||
#idAppUczen, #idAppUczenExt {
|
||||
#idAppUczen,
|
||||
#idAppUczenExt {
|
||||
display: block;
|
||||
|
||||
br {
|
||||
|
|
|
@ -33,8 +33,8 @@ nav#menuGlowne {
|
|||
justify-content: space-between;
|
||||
|
||||
@at-root .button,
|
||||
a[class^="button"] {
|
||||
background: #8B0000;
|
||||
a[class^='button'] {
|
||||
background: #8b0000;
|
||||
padding: 0.5rem 1.5rem;
|
||||
display: inline-block;
|
||||
margin: 1rem 0;
|
||||
|
@ -47,12 +47,12 @@ nav#menuGlowne {
|
|||
}
|
||||
|
||||
.button-prev:before {
|
||||
content: "<";
|
||||
content: '<';
|
||||
margin-right: 0.5rem;
|
||||
}
|
||||
|
||||
.button-next:after {
|
||||
content: ">";
|
||||
content: '>';
|
||||
margin-left: 0.5rem;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,11 +2,14 @@ html {
|
|||
box-sizing: border-box;
|
||||
font-size: 62.5%;
|
||||
}
|
||||
*, *:before, *:after {
|
||||
*,
|
||||
*:before,
|
||||
*:after {
|
||||
box-sizing: inherit;
|
||||
}
|
||||
|
||||
html, body {
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
|
|
|
@ -9,7 +9,8 @@
|
|||
font-weight: normal;
|
||||
}
|
||||
|
||||
th, td {
|
||||
th,
|
||||
td {
|
||||
padding: 1rem;
|
||||
border: 1px solid #444444;
|
||||
width: 20%;
|
||||
|
|
|
@ -30,7 +30,7 @@ $primary: #d32f2f;
|
|||
font-size: 1.3rem;
|
||||
}
|
||||
|
||||
input:not([type="submit"]) {
|
||||
input:not([type='submit']) {
|
||||
display: block;
|
||||
width: 100%;
|
||||
border: 0;
|
||||
|
@ -38,7 +38,7 @@ $primary: #d32f2f;
|
|||
margin: 3px 0 20px;
|
||||
}
|
||||
|
||||
input[type="submit"] {
|
||||
input[type='submit'] {
|
||||
display: block;
|
||||
margin: 20px auto 0;
|
||||
background: $primary;
|
||||
|
@ -55,7 +55,7 @@ $primary: #d32f2f;
|
|||
|
||||
.Account {
|
||||
&:after {
|
||||
content: "|";
|
||||
content: '|';
|
||||
margin: 0 5px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
@import "scaffolding";
|
||||
@import "grades-table";
|
||||
@import "attendance";
|
||||
@import "timetable-table";
|
||||
@import "row-value";
|
||||
@import "filters";
|
||||
@import "header";
|
||||
@import "nav";
|
||||
@import "home";
|
||||
@import 'scaffolding';
|
||||
@import 'grades-table';
|
||||
@import 'attendance';
|
||||
@import 'timetable-table';
|
||||
@import 'row-value';
|
||||
@import 'filters';
|
||||
@import 'header';
|
||||
@import 'nav';
|
||||
@import 'home';
|
||||
|
|
|
@ -1,65 +1,66 @@
|
|||
const router = require('express').Router();
|
||||
const protocol = require('../utils/connection');
|
||||
const {format} = require("date-fns");
|
||||
const router = require('express').Router()
|
||||
const protocol = require('../utils/connection')
|
||||
const { format } = require('date-fns')
|
||||
|
||||
router.all("/", (req, res) => {
|
||||
const today = format(new Date(), "yyyy-MM-dd");
|
||||
router.all('/', (req, res) => {
|
||||
const today = format(new Date(), 'yyyy-MM-dd')
|
||||
|
||||
let base = protocol(req) + "://" + req.get('host');
|
||||
res.json({
|
||||
"status": "success",
|
||||
"start": base.replace("api.", ""),
|
||||
"repo": "https://github.com/wulkanowy/fake-log",
|
||||
"sdk": "https://github.com/wulkanowy/sdk",
|
||||
"docs": "https://gitlab.com/erupcja/uonet-api-docs",
|
||||
"api": [
|
||||
base + "/powiatwulkanowy/api/mobile/register/new",
|
||||
base + "/powiatwulkanowy/api/mobile/register/hebe",
|
||||
base + "/powiatwulkanowy/123456/api/mobile/register/hebe",
|
||||
base + "/powiatwulkanowy/123456/api/mobile/version?app=DzienniczekPlus%202.0",
|
||||
base + "/powiatwulkanowy/123456/api/mobile/heartbeat",
|
||||
base + "/powiatwulkanowy/123456/api/mobile/internal/time",
|
||||
base + "/powiatwulkanowy/123456/api/mobile/school/lucky?constituentId=2&day=" + today,
|
||||
base + "/powiatwulkanowy/123456/api/mobile/school/grade/byPupil??unitId=2&pupilId=111&periodId=101&lastSyncDate=1970-01-01%2001%3A00%3A00&lastId=-2147483648&pageSize=500",
|
||||
],
|
||||
"mobile-api": [
|
||||
base + "/powiatwulkanowy/mobile-api/Uczen.v3.UczenStart/Certyfikat",
|
||||
base + "/powiatwulkanowy/mobile-api/Uczen.v3.UczenStart/ListaUczniow",
|
||||
base + "/powiatwulkanowy/123456/mobile-api/Uczen.v3.Uczen/LogAppStart",
|
||||
base + "/powiatwulkanowy/123456/mobile-api/Uczen.v3.Uczen/Slowniki",
|
||||
base + "/powiatwulkanowy/123456/mobile-api/Uczen.v3.Uczen/PlanLekcjiZeZmianami",
|
||||
base + "/powiatwulkanowy/123456/mobile-api/Uczen.v3.Uczen/Oceny",
|
||||
base + "/powiatwulkanowy/123456/mobile-api/Uczen.v3.Uczen/OcenyPodsumowanie",
|
||||
base + "/powiatwulkanowy/123456/mobile-api/Uczen.v3.Uczen/Sprawdziany",
|
||||
base + "/powiatwulkanowy/123456/mobile-api/Uczen.v3.Uczen/UwagiUcznia",
|
||||
base + "/powiatwulkanowy/123456/mobile-api/Uczen.v3.Uczen/Frekwencje",
|
||||
base + "/powiatwulkanowy/123456/mobile-api/Uczen.v3.Uczen/ZadaniaDomowe",
|
||||
base + "/powiatwulkanowy/123456/mobile-api/Uczen.v3.Uczen/Nauczyciele",
|
||||
base + "/powiatwulkanowy/123456/mobile-api/Uczen.v3.Uczen/WiadomosciOdebrane",
|
||||
base + "/powiatwulkanowy/123456/mobile-api/Uczen.v3.Uczen/WiadomosciWyslane",
|
||||
base + "/powiatwulkanowy/123456/mobile-api/Uczen.v3.Uczen/WiadomosciUsuniete",
|
||||
base + "/powiatwulkanowy/123456/mobile-api/Uczen.v3.Uczen/DodajWiadomosc"
|
||||
]
|
||||
});
|
||||
});
|
||||
let base = protocol(req) + '://' + req.get('host')
|
||||
res.json({
|
||||
status: 'success',
|
||||
start: base.replace('api.', ''),
|
||||
repo: 'https://github.com/wulkanowy/fake-log',
|
||||
sdk: 'https://github.com/wulkanowy/sdk',
|
||||
docs: 'https://gitlab.com/erupcja/uonet-api-docs',
|
||||
api: [
|
||||
base + '/powiatwulkanowy/api/mobile/register/new',
|
||||
base + '/powiatwulkanowy/api/mobile/register/hebe',
|
||||
base + '/powiatwulkanowy/123456/api/mobile/register/hebe',
|
||||
base + '/powiatwulkanowy/123456/api/mobile/version?app=DzienniczekPlus%202.0',
|
||||
base + '/powiatwulkanowy/123456/api/mobile/heartbeat',
|
||||
base + '/powiatwulkanowy/123456/api/mobile/internal/time',
|
||||
base + '/powiatwulkanowy/123456/api/mobile/school/lucky?constituentId=2&day=' + today,
|
||||
base +
|
||||
'/powiatwulkanowy/123456/api/mobile/school/grade/byPupil??unitId=2&pupilId=111&periodId=101&lastSyncDate=1970-01-01%2001%3A00%3A00&lastId=-2147483648&pageSize=500',
|
||||
],
|
||||
'mobile-api': [
|
||||
base + '/powiatwulkanowy/mobile-api/Uczen.v3.UczenStart/Certyfikat',
|
||||
base + '/powiatwulkanowy/mobile-api/Uczen.v3.UczenStart/ListaUczniow',
|
||||
base + '/powiatwulkanowy/123456/mobile-api/Uczen.v3.Uczen/LogAppStart',
|
||||
base + '/powiatwulkanowy/123456/mobile-api/Uczen.v3.Uczen/Slowniki',
|
||||
base + '/powiatwulkanowy/123456/mobile-api/Uczen.v3.Uczen/PlanLekcjiZeZmianami',
|
||||
base + '/powiatwulkanowy/123456/mobile-api/Uczen.v3.Uczen/Oceny',
|
||||
base + '/powiatwulkanowy/123456/mobile-api/Uczen.v3.Uczen/OcenyPodsumowanie',
|
||||
base + '/powiatwulkanowy/123456/mobile-api/Uczen.v3.Uczen/Sprawdziany',
|
||||
base + '/powiatwulkanowy/123456/mobile-api/Uczen.v3.Uczen/UwagiUcznia',
|
||||
base + '/powiatwulkanowy/123456/mobile-api/Uczen.v3.Uczen/Frekwencje',
|
||||
base + '/powiatwulkanowy/123456/mobile-api/Uczen.v3.Uczen/ZadaniaDomowe',
|
||||
base + '/powiatwulkanowy/123456/mobile-api/Uczen.v3.Uczen/Nauczyciele',
|
||||
base + '/powiatwulkanowy/123456/mobile-api/Uczen.v3.Uczen/WiadomosciOdebrane',
|
||||
base + '/powiatwulkanowy/123456/mobile-api/Uczen.v3.Uczen/WiadomosciWyslane',
|
||||
base + '/powiatwulkanowy/123456/mobile-api/Uczen.v3.Uczen/WiadomosciUsuniete',
|
||||
base + '/powiatwulkanowy/123456/mobile-api/Uczen.v3.Uczen/DodajWiadomosc',
|
||||
],
|
||||
})
|
||||
})
|
||||
|
||||
// v3
|
||||
router.use("/powiatwulkanowy/mobile-api/Uczen.v3.UczenStart", require("./mobile-api/register"));
|
||||
router.use("/powiatwulkanowy/123456/mobile-api/Uczen.v3.Uczen", require("./mobile-api/student"));
|
||||
router.use("/powiatwulkanowy/123456/mobile-api/Uczen.v3.Uczen", require("./mobile-api/messages"));
|
||||
router.use("/powiatwulkanowy/123456/mobile-api/Push.v1.Push", require("./mobile-api/push"));
|
||||
router.use('/powiatwulkanowy/mobile-api/Uczen.v3.UczenStart', require('./mobile-api/register'))
|
||||
router.use('/powiatwulkanowy/123456/mobile-api/Uczen.v3.Uczen', require('./mobile-api/student'))
|
||||
router.use('/powiatwulkanowy/123456/mobile-api/Uczen.v3.Uczen', require('./mobile-api/messages'))
|
||||
router.use('/powiatwulkanowy/123456/mobile-api/Push.v1.Push', require('./mobile-api/push'))
|
||||
|
||||
// hebe
|
||||
router.use("/powiatwulkanowy/api/mobile/register", require("./api/register"));
|
||||
router.use("/powiatwulkanowy/123456/api/mobile/register", require("./api/register"));
|
||||
router.use("/powiatwulkanowy/123456/api/mobile", require("./api/student"));
|
||||
router.use("/powiatwulkanowy/123456/api/mobile/school", require("./api/school"));
|
||||
router.use('/powiatwulkanowy/api/mobile/register', require('./api/register'))
|
||||
router.use('/powiatwulkanowy/123456/api/mobile/register', require('./api/register'))
|
||||
router.use('/powiatwulkanowy/123456/api/mobile', require('./api/student'))
|
||||
router.use('/powiatwulkanowy/123456/api/mobile/school', require('./api/school'))
|
||||
|
||||
router.all("/*", (req, res) => {
|
||||
res.status(404).json({
|
||||
"status": "error",
|
||||
"message": "Not implemented yet"
|
||||
});
|
||||
});
|
||||
router.all('/*', (req, res) => {
|
||||
res.status(404).json({
|
||||
status: 'error',
|
||||
message: 'Not implemented yet',
|
||||
})
|
||||
})
|
||||
|
||||
module.exports = router;
|
||||
module.exports = router
|
||||
|
|
|
@ -1,231 +1,229 @@
|
|||
const router = require('express').Router({});
|
||||
const protocol = require('../../utils/connection');
|
||||
const {createEnvelope} = require("./utils");
|
||||
const router = require('express').Router({})
|
||||
const protocol = require('../../utils/connection')
|
||||
const { createEnvelope } = require('./utils')
|
||||
|
||||
router.all("/new", (req, res) => {
|
||||
const base = protocol(req) + "://" + req.get('host');
|
||||
router.all('/new', (req, res) => {
|
||||
const base = protocol(req) + '://' + req.get('host')
|
||||
|
||||
res.json(createEnvelope(0, "OK", "AccountPayload", {
|
||||
"LoginId": 207,
|
||||
"RestURL": base + "/powiatwulkanowy/",
|
||||
"UserLogin": "jan@fakelog.cf",
|
||||
"UserName": "jan@fakelog.cf"
|
||||
}));
|
||||
});
|
||||
res.json(
|
||||
createEnvelope(0, 'OK', 'AccountPayload', {
|
||||
LoginId: 207,
|
||||
RestURL: base + '/powiatwulkanowy/',
|
||||
UserLogin: 'jan@fakelog.cf',
|
||||
UserName: 'jan@fakelog.cf',
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
router.all("/hebe", (req, res) => {
|
||||
res.json(createEnvelope(0, "OK", "IEnumerable`1", [
|
||||
{
|
||||
"Capabilities": [
|
||||
"REGULAR",
|
||||
"AVG_ENABLED",
|
||||
"TOPICS_ENABLED",
|
||||
"LUCKY_NUMBERS",
|
||||
"ADDRESS_BOOK_PUPIL"
|
||||
router.all('/hebe', (req, res) => {
|
||||
res.json(
|
||||
createEnvelope(0, 'OK', 'IEnumerable`1', [
|
||||
{
|
||||
Capabilities: ['REGULAR', 'AVG_ENABLED', 'TOPICS_ENABLED', 'LUCKY_NUMBERS', 'ADDRESS_BOOK_PUPIL'],
|
||||
ClassDisplay: '8b',
|
||||
ConstituentUnit: {
|
||||
Address: 'ul. Wulkanowego 30, 30-300 Fakelog.cf, Polska',
|
||||
Id: 2,
|
||||
Name: 'Publiczna szkoła Wulkanowego nr 1 w fakelog.cf',
|
||||
Patron: 'Święty Wulkan',
|
||||
SchoolTopic: '12f446f1-1751-1711-10e1-101dd8b71c11',
|
||||
Short: 'SPL',
|
||||
},
|
||||
Educators: [
|
||||
{
|
||||
Id: 'e-222',
|
||||
Initials: 'MK',
|
||||
LoginId: 222,
|
||||
Name: 'Maria',
|
||||
Surname: 'Kowalska',
|
||||
Roles: [
|
||||
{
|
||||
Address: 'Kowalska Maria [KM] - wychowawca 8b (SPL)',
|
||||
AddressHash: 'ndghrsawrtb045a0a4cfa7bf6ea0e9d380a6b5sd',
|
||||
ClassSymbol: '8b (SPL)',
|
||||
ConstituentUnitSymbol: 'SPL',
|
||||
Initials: 'KM',
|
||||
Name: 'Maria',
|
||||
RoleName: 'Wychowawca',
|
||||
RoleOrder: 0,
|
||||
Surname: 'Kowalsk',
|
||||
UnitSymbol: null,
|
||||
},
|
||||
],
|
||||
"ClassDisplay": "8b",
|
||||
"ConstituentUnit": {
|
||||
"Address": "ul. Wulkanowego 30, 30-300 Fakelog.cf, Polska",
|
||||
"Id": 2,
|
||||
"Name": "Publiczna szkoła Wulkanowego nr 1 w fakelog.cf",
|
||||
"Patron": "Święty Wulkan",
|
||||
"SchoolTopic": "12f446f1-1751-1711-10e1-101dd8b71c11",
|
||||
"Short": "SPL"
|
||||
},
|
||||
],
|
||||
FullSync: false,
|
||||
InfoDisplay: '123456 - b8',
|
||||
Journal: {
|
||||
Id: 33,
|
||||
YearEnd: {
|
||||
Date: '2020-08-31',
|
||||
DateDisplay: '31.08.2020',
|
||||
Time: '00:00:00',
|
||||
Timestamp: 1598824800000,
|
||||
},
|
||||
YearStart: {
|
||||
Date: '2019-09-01',
|
||||
DateDisplay: '01.09.2019',
|
||||
Time: '00:00:00',
|
||||
Timestamp: 1567288800000,
|
||||
},
|
||||
},
|
||||
Login: {
|
||||
DisplayName: 'Jan Kowalski',
|
||||
FirstName: 'Jan',
|
||||
Id: 11,
|
||||
LoginRole: 'Uczen',
|
||||
SecondName: '',
|
||||
Surname: 'Kowalski',
|
||||
Value: 'jan@fakelog.cf',
|
||||
},
|
||||
Partition: 'powiatwulkanowy-123456',
|
||||
Periods: [
|
||||
{
|
||||
Current: false,
|
||||
End: {
|
||||
Date: '2018-01-21',
|
||||
DateDisplay: '21.01.2018',
|
||||
Time: '00:00:00',
|
||||
Timestamp: 1516489200000,
|
||||
},
|
||||
"Educators": [
|
||||
{
|
||||
"Id": "e-222",
|
||||
"Initials": "MK",
|
||||
"LoginId": 222,
|
||||
"Name": "Maria",
|
||||
"Surname": "Kowalska",
|
||||
"Roles": [
|
||||
{
|
||||
"Address": "Kowalska Maria [KM] - wychowawca 8b (SPL)",
|
||||
"AddressHash": "ndghrsawrtb045a0a4cfa7bf6ea0e9d380a6b5sd",
|
||||
"ClassSymbol": "8b (SPL)",
|
||||
"ConstituentUnitSymbol": "SPL",
|
||||
"Initials": "KM",
|
||||
"Name": "Maria",
|
||||
"RoleName": "Wychowawca",
|
||||
"RoleOrder": 0,
|
||||
"Surname": "Kowalsk",
|
||||
"UnitSymbol": null
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"FullSync": false,
|
||||
"InfoDisplay": "123456 - b8",
|
||||
"Journal": {
|
||||
"Id": 33,
|
||||
"YearEnd": {
|
||||
"Date": "2020-08-31",
|
||||
"DateDisplay": "31.08.2020",
|
||||
"Time": "00:00:00",
|
||||
"Timestamp": 1598824800000
|
||||
},
|
||||
"YearStart": {
|
||||
"Date": "2019-09-01",
|
||||
"DateDisplay": "01.09.2019",
|
||||
"Time": "00:00:00",
|
||||
"Timestamp": 1567288800000
|
||||
}
|
||||
Id: 97,
|
||||
Last: false,
|
||||
Level: 6,
|
||||
Number: 1,
|
||||
Start: {
|
||||
Date: '2017-09-01',
|
||||
DateDisplay: '01.09.2017',
|
||||
Time: '00:00:00',
|
||||
Timestamp: 1504216800000,
|
||||
},
|
||||
"Login": {
|
||||
"DisplayName": "Jan Kowalski",
|
||||
"FirstName": "Jan",
|
||||
"Id": 11,
|
||||
"LoginRole": "Uczen",
|
||||
"SecondName": "",
|
||||
"Surname": "Kowalski",
|
||||
"Value": "jan@fakelog.cf"
|
||||
},
|
||||
{
|
||||
Current: false,
|
||||
End: {
|
||||
Date: '2018-08-31',
|
||||
DateDisplay: '31.08.2018',
|
||||
Time: '00:00:00',
|
||||
Timestamp: 1535666400000,
|
||||
},
|
||||
"Partition": "powiatwulkanowy-123456",
|
||||
"Periods": [
|
||||
{
|
||||
"Current": false,
|
||||
"End": {
|
||||
"Date": "2018-01-21",
|
||||
"DateDisplay": "21.01.2018",
|
||||
"Time": "00:00:00",
|
||||
"Timestamp": 1516489200000
|
||||
},
|
||||
"Id": 97,
|
||||
"Last": false,
|
||||
"Level": 6,
|
||||
"Number": 1,
|
||||
"Start": {
|
||||
"Date": "2017-09-01",
|
||||
"DateDisplay": "01.09.2017",
|
||||
"Time": "00:00:00",
|
||||
"Timestamp": 1504216800000
|
||||
}
|
||||
},
|
||||
{
|
||||
"Current": false,
|
||||
"End": {
|
||||
"Date": "2018-08-31",
|
||||
"DateDisplay": "31.08.2018",
|
||||
"Time": "00:00:00",
|
||||
"Timestamp": 1535666400000
|
||||
},
|
||||
"Id": 98,
|
||||
"Last": true,
|
||||
"Level": 6,
|
||||
"Number": 2,
|
||||
"Start": {
|
||||
"Date": "2018-01-22",
|
||||
"DateDisplay": "22.01.2018",
|
||||
"Time": "00:00:00",
|
||||
"Timestamp": 1516575600000
|
||||
}
|
||||
},
|
||||
{
|
||||
"Current": false,
|
||||
"End": {
|
||||
"Date": "2019-01-27",
|
||||
"DateDisplay": "27.01.2019",
|
||||
"Time": "00:00:00",
|
||||
"Timestamp": 1548543600000
|
||||
},
|
||||
"Id": 99,
|
||||
"Last": false,
|
||||
"Level": 7,
|
||||
"Number": 1,
|
||||
"Start": {
|
||||
"Date": "2018-09-01",
|
||||
"DateDisplay": "01.09.2018",
|
||||
"Time": "00:00:00",
|
||||
"Timestamp": 1535752800000
|
||||
}
|
||||
},
|
||||
{
|
||||
"Current": false,
|
||||
"End": {
|
||||
"Date": "2019-08-31",
|
||||
"DateDisplay": "31.08.2019",
|
||||
"Time": "00:00:00",
|
||||
"Timestamp": 1567202400000
|
||||
},
|
||||
"Id": 100,
|
||||
"Last": true,
|
||||
"Level": 7,
|
||||
"Number": 2,
|
||||
"Start": {
|
||||
"Date": "2019-01-28",
|
||||
"DateDisplay": "28.01.2019",
|
||||
"Time": "00:00:00",
|
||||
"Timestamp": 1548630000000
|
||||
}
|
||||
},
|
||||
{
|
||||
"Current": false,
|
||||
"End": {
|
||||
"Date": "2020-02-09",
|
||||
"DateDisplay": "09.02.2020",
|
||||
"Time": "00:00:00",
|
||||
"Timestamp": 1581202800000
|
||||
},
|
||||
"Id": 101,
|
||||
"Last": false,
|
||||
"Level": 8,
|
||||
"Number": 1,
|
||||
"Start": {
|
||||
"Date": "2019-09-01",
|
||||
"DateDisplay": "01.09.2019",
|
||||
"Time": "00:00:00",
|
||||
"Timestamp": 1567288800000
|
||||
}
|
||||
},
|
||||
{
|
||||
"Current": true,
|
||||
"End": {
|
||||
"Date": "2020-08-31",
|
||||
"DateDisplay": "31.08.2020",
|
||||
"Time": "00:00:00",
|
||||
"Timestamp": 1598824800000
|
||||
},
|
||||
"Id": 102,
|
||||
"Last": true,
|
||||
"Level": 8,
|
||||
"Number": 2,
|
||||
"Start": {
|
||||
"Date": "2020-02-10",
|
||||
"DateDisplay": "10.02.2020",
|
||||
"Time": "00:00:00",
|
||||
"Timestamp": 1581289200000
|
||||
}
|
||||
}
|
||||
],
|
||||
"Pupil": {
|
||||
"FirstName": "Jan",
|
||||
"Id": 111,
|
||||
"LoginId": 11,
|
||||
"LoginValue": "jan@fakelog.cf",
|
||||
"SecondName": "",
|
||||
"Sex": true,
|
||||
"Surname": "Kowalski"
|
||||
Id: 98,
|
||||
Last: true,
|
||||
Level: 6,
|
||||
Number: 2,
|
||||
Start: {
|
||||
Date: '2018-01-22',
|
||||
DateDisplay: '22.01.2018',
|
||||
Time: '00:00:00',
|
||||
Timestamp: 1516575600000,
|
||||
},
|
||||
"SenderEntry": {
|
||||
"Address": "Jan Kowalski - uczeń 8b (SPL)",
|
||||
"AddressHash": "1234567890e676ea0c01114dc2fb610987654321",
|
||||
"Initials": "JK",
|
||||
"LoginId": 111
|
||||
},
|
||||
{
|
||||
Current: false,
|
||||
End: {
|
||||
Date: '2019-01-27',
|
||||
DateDisplay: '27.01.2019',
|
||||
Time: '00:00:00',
|
||||
Timestamp: 1548543600000,
|
||||
},
|
||||
"TopLevelPartition": "powiatwulkanowy",
|
||||
"Unit": {
|
||||
"Address": "ul. Wulkanowego 30, 30-300 Fakelog.cf, Polska",
|
||||
"DisplayName": "Publiczna szkoła Wulkanowego nr 1 w fakelog.",
|
||||
"Id": 2,
|
||||
"Name": "Publiczna szkoła Wulkanowego",
|
||||
"Patron": "Święty Wulkan",
|
||||
"RestURL": "https://api.fakelog.cf/powiatwulkanowy/123456/api",
|
||||
"Short": "123456",
|
||||
"Symbol": "123456"
|
||||
}
|
||||
}
|
||||
]));
|
||||
});
|
||||
Id: 99,
|
||||
Last: false,
|
||||
Level: 7,
|
||||
Number: 1,
|
||||
Start: {
|
||||
Date: '2018-09-01',
|
||||
DateDisplay: '01.09.2018',
|
||||
Time: '00:00:00',
|
||||
Timestamp: 1535752800000,
|
||||
},
|
||||
},
|
||||
{
|
||||
Current: false,
|
||||
End: {
|
||||
Date: '2019-08-31',
|
||||
DateDisplay: '31.08.2019',
|
||||
Time: '00:00:00',
|
||||
Timestamp: 1567202400000,
|
||||
},
|
||||
Id: 100,
|
||||
Last: true,
|
||||
Level: 7,
|
||||
Number: 2,
|
||||
Start: {
|
||||
Date: '2019-01-28',
|
||||
DateDisplay: '28.01.2019',
|
||||
Time: '00:00:00',
|
||||
Timestamp: 1548630000000,
|
||||
},
|
||||
},
|
||||
{
|
||||
Current: false,
|
||||
End: {
|
||||
Date: '2020-02-09',
|
||||
DateDisplay: '09.02.2020',
|
||||
Time: '00:00:00',
|
||||
Timestamp: 1581202800000,
|
||||
},
|
||||
Id: 101,
|
||||
Last: false,
|
||||
Level: 8,
|
||||
Number: 1,
|
||||
Start: {
|
||||
Date: '2019-09-01',
|
||||
DateDisplay: '01.09.2019',
|
||||
Time: '00:00:00',
|
||||
Timestamp: 1567288800000,
|
||||
},
|
||||
},
|
||||
{
|
||||
Current: true,
|
||||
End: {
|
||||
Date: '2020-08-31',
|
||||
DateDisplay: '31.08.2020',
|
||||
Time: '00:00:00',
|
||||
Timestamp: 1598824800000,
|
||||
},
|
||||
Id: 102,
|
||||
Last: true,
|
||||
Level: 8,
|
||||
Number: 2,
|
||||
Start: {
|
||||
Date: '2020-02-10',
|
||||
DateDisplay: '10.02.2020',
|
||||
Time: '00:00:00',
|
||||
Timestamp: 1581289200000,
|
||||
},
|
||||
},
|
||||
],
|
||||
Pupil: {
|
||||
FirstName: 'Jan',
|
||||
Id: 111,
|
||||
LoginId: 11,
|
||||
LoginValue: 'jan@fakelog.cf',
|
||||
SecondName: '',
|
||||
Sex: true,
|
||||
Surname: 'Kowalski',
|
||||
},
|
||||
SenderEntry: {
|
||||
Address: 'Jan Kowalski - uczeń 8b (SPL)',
|
||||
AddressHash: '1234567890e676ea0c01114dc2fb610987654321',
|
||||
Initials: 'JK',
|
||||
LoginId: 111,
|
||||
},
|
||||
TopLevelPartition: 'powiatwulkanowy',
|
||||
Unit: {
|
||||
Address: 'ul. Wulkanowego 30, 30-300 Fakelog.cf, Polska',
|
||||
DisplayName: 'Publiczna szkoła Wulkanowego nr 1 w fakelog.',
|
||||
Id: 2,
|
||||
Name: 'Publiczna szkoła Wulkanowego',
|
||||
Patron: 'Święty Wulkan',
|
||||
RestURL: 'https://api.fakelog.cf/powiatwulkanowy/123456/api',
|
||||
Short: '123456',
|
||||
Symbol: '123456',
|
||||
},
|
||||
},
|
||||
])
|
||||
)
|
||||
})
|
||||
|
||||
module.exports = router;
|
||||
module.exports = router
|
||||
|
|
|
@ -1,80 +1,89 @@
|
|||
const router = require('express').Router({});
|
||||
const {createEnvelope} = require("./utils");
|
||||
const {format} = require("date-fns");
|
||||
const {uuid} = require("uuidv4");
|
||||
const {getByValue} = require("./../../utils/dictMap");
|
||||
const router = require('express').Router({})
|
||||
const { createEnvelope } = require('./utils')
|
||||
const { format } = require('date-fns')
|
||||
const { uuid } = require('uuidv4')
|
||||
const { getByValue } = require('./../../utils/dictMap')
|
||||
|
||||
router.get("/grade/byPupil", (req, res) => {
|
||||
const subjects = require("../../../data/api/dictionaries/Przedmioty");
|
||||
const categories = require("../../../data/api/dictionaries/KategorieOcen");
|
||||
const teachers = require("../../../data/api/dictionaries/Nauczyciele");
|
||||
router.get('/grade/byPupil', (req, res) => {
|
||||
const subjects = require('../../../data/api/dictionaries/Przedmioty')
|
||||
const categories = require('../../../data/api/dictionaries/KategorieOcen')
|
||||
const teachers = require('../../../data/api/dictionaries/Nauczyciele')
|
||||
|
||||
res.json(createEnvelope(0, "OK", "IEnumerable`1", require("../../../data/api/student/Oceny").map(item => {
|
||||
res.json(
|
||||
createEnvelope(
|
||||
0,
|
||||
'OK',
|
||||
'IEnumerable`1',
|
||||
require('../../../data/api/student/Oceny').map((item) => {
|
||||
return {
|
||||
"Column": {
|
||||
"Category": {
|
||||
"Id": item.IdKategoria,
|
||||
"Code": getByValue(categories, "Id", item.IdKategoria).Kod,
|
||||
"Name": getByValue(categories, "Id", item.IdKategoria).Nazwa
|
||||
},
|
||||
"Code": getByValue(categories, "Id", item.IdKategoria).Kod,
|
||||
"Group": "",
|
||||
"Id": 0,
|
||||
"Key": uuid(),
|
||||
"Name": item.Opis,
|
||||
"Number": 0,
|
||||
"Period": 2,
|
||||
"Subject": {
|
||||
"Id": item.IdPrzedmiot,
|
||||
"Key": uuid(),
|
||||
"Kod": getByValue(subjects, "Id", item.IdPrzedmiot).Kod,
|
||||
"Name": getByValue(subjects, "Id", item.IdPrzedmiot).Nazwa,
|
||||
"Position": getByValue(subjects, "Id", item.IdPrzedmiot).Pozycja
|
||||
},
|
||||
"Weight": item.WagaOceny,
|
||||
Column: {
|
||||
Category: {
|
||||
Id: item.IdKategoria,
|
||||
Code: getByValue(categories, 'Id', item.IdKategoria).Kod,
|
||||
Name: getByValue(categories, 'Id', item.IdKategoria).Nazwa,
|
||||
},
|
||||
"Comment": item.Komentarz,
|
||||
"Content": item.Wpis,
|
||||
"ContentRaw": `${item.Wartosc}`,
|
||||
"Creator": {
|
||||
"Id": item.IdPracownikD,
|
||||
"Name": getByValue(teachers, "Id", item.IdPracownikD).Imie,
|
||||
"Surname": getByValue(teachers, "Id", item.IdPracownikD).Nazwisko,
|
||||
"DisplayName": getByValue(teachers, "Id", item.IdPracownikD).Imie
|
||||
Code: getByValue(categories, 'Id', item.IdKategoria).Kod,
|
||||
Group: '',
|
||||
Id: 0,
|
||||
Key: uuid(),
|
||||
Name: item.Opis,
|
||||
Number: 0,
|
||||
Period: 2,
|
||||
Subject: {
|
||||
Id: item.IdPrzedmiot,
|
||||
Key: uuid(),
|
||||
Kod: getByValue(subjects, 'Id', item.IdPrzedmiot).Kod,
|
||||
Name: getByValue(subjects, 'Id', item.IdPrzedmiot).Nazwa,
|
||||
Position: getByValue(subjects, 'Id', item.IdPrzedmiot).Pozycja,
|
||||
},
|
||||
"Modifier": {
|
||||
"Id": item.IdPracownikM,
|
||||
"Name": getByValue(teachers, "Id", item.IdPracownikM).Imie,
|
||||
"Surname": getByValue(teachers, "Id", item.IdPracownikM).Nazwisko,
|
||||
"DisplayName": getByValue(teachers, "Id", item.IdPracownikM).Imie
|
||||
},
|
||||
"DateCreated": {
|
||||
"Date": item.DataUtworzeniaTekst,
|
||||
"DateDisplay": item.DataUtworzeniaTekst,
|
||||
"Time": "00:01",
|
||||
"Timestamp": item.DataUtworzenia
|
||||
},
|
||||
"DateModify": {
|
||||
"Date": item.DataModyfikacjiTekst,
|
||||
"DateDisplay": item.DataModyfikacjiTekst,
|
||||
"Time": "00:02",
|
||||
"Timestamp": item.DataModyfikacji
|
||||
},
|
||||
"Id": item.Id,
|
||||
"Key": uuid(),
|
||||
"Numerator": item.Licznik,
|
||||
"Denominator": item.Mianownik,
|
||||
"PupilId": 111,
|
||||
"Value": item.Wartosc
|
||||
};
|
||||
})));
|
||||
});
|
||||
Weight: item.WagaOceny,
|
||||
},
|
||||
Comment: item.Komentarz,
|
||||
Content: item.Wpis,
|
||||
ContentRaw: `${item.Wartosc}`,
|
||||
Creator: {
|
||||
Id: item.IdPracownikD,
|
||||
Name: getByValue(teachers, 'Id', item.IdPracownikD).Imie,
|
||||
Surname: getByValue(teachers, 'Id', item.IdPracownikD).Nazwisko,
|
||||
DisplayName: getByValue(teachers, 'Id', item.IdPracownikD).Imie,
|
||||
},
|
||||
Modifier: {
|
||||
Id: item.IdPracownikM,
|
||||
Name: getByValue(teachers, 'Id', item.IdPracownikM).Imie,
|
||||
Surname: getByValue(teachers, 'Id', item.IdPracownikM).Nazwisko,
|
||||
DisplayName: getByValue(teachers, 'Id', item.IdPracownikM).Imie,
|
||||
},
|
||||
DateCreated: {
|
||||
Date: item.DataUtworzeniaTekst,
|
||||
DateDisplay: item.DataUtworzeniaTekst,
|
||||
Time: '00:01',
|
||||
Timestamp: item.DataUtworzenia,
|
||||
},
|
||||
DateModify: {
|
||||
Date: item.DataModyfikacjiTekst,
|
||||
DateDisplay: item.DataModyfikacjiTekst,
|
||||
Time: '00:02',
|
||||
Timestamp: item.DataModyfikacji,
|
||||
},
|
||||
Id: item.Id,
|
||||
Key: uuid(),
|
||||
Numerator: item.Licznik,
|
||||
Denominator: item.Mianownik,
|
||||
PupilId: 111,
|
||||
Value: item.Wartosc,
|
||||
}
|
||||
})
|
||||
)
|
||||
)
|
||||
})
|
||||
|
||||
router.all("/lucky", (req, res) => {
|
||||
res.json(createEnvelope(0, "OK", "LuckyNumberPayload", {
|
||||
"Day": format(new Date(), "yyyy-MM-dd"),
|
||||
"Number": format(new Date(), "d")
|
||||
}));
|
||||
});
|
||||
router.all('/lucky', (req, res) => {
|
||||
res.json(
|
||||
createEnvelope(0, 'OK', 'LuckyNumberPayload', {
|
||||
Day: format(new Date(), 'yyyy-MM-dd'),
|
||||
Number: format(new Date(), 'd'),
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
module.exports = router;
|
||||
module.exports = router
|
||||
|
|
|
@ -1,22 +1,24 @@
|
|||
const router = require('express').Router({});
|
||||
const {createEnvelope} = require("./utils");
|
||||
const {getTime, format} = require("date-fns");
|
||||
const router = require('express').Router({})
|
||||
const { createEnvelope } = require('./utils')
|
||||
const { getTime, format } = require('date-fns')
|
||||
|
||||
router.all("/version", (req, res) => {
|
||||
res.json(createEnvelope(105, "Podany czas jest nieprawidłowy", "Object", null));
|
||||
});
|
||||
router.all('/version', (req, res) => {
|
||||
res.json(createEnvelope(105, 'Podany czas jest nieprawidłowy', 'Object', null))
|
||||
})
|
||||
|
||||
router.all("/internal/time", (req, res) => {
|
||||
res.json(createEnvelope(0, "OK", "DateInfoPayload", {
|
||||
"Date": format(new Date(), "yyyy-MM-dd"),
|
||||
"DateDisplay": format(new Date(), "dd.MM.yyyy"),
|
||||
"Time": format(new Date(), "HH:mm:ss"),
|
||||
"Timestamp": getTime(new Date())
|
||||
}));
|
||||
});
|
||||
router.all('/internal/time', (req, res) => {
|
||||
res.json(
|
||||
createEnvelope(0, 'OK', 'DateInfoPayload', {
|
||||
Date: format(new Date(), 'yyyy-MM-dd'),
|
||||
DateDisplay: format(new Date(), 'dd.MM.yyyy'),
|
||||
Time: format(new Date(), 'HH:mm:ss'),
|
||||
Timestamp: getTime(new Date()),
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
router.all("/heartbeat", (req, res) => {
|
||||
res.json(createEnvelope(0, "OK", "Boolean", true));
|
||||
});
|
||||
router.all('/heartbeat', (req, res) => {
|
||||
res.json(createEnvelope(0, 'OK', 'Boolean', true))
|
||||
})
|
||||
|
||||
module.exports = router;
|
||||
module.exports = router
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
const {uuid} = require("uuidv4");
|
||||
const {getTime, format} = require("date-fns");
|
||||
const { uuid } = require('uuidv4')
|
||||
const { getTime, format } = require('date-fns')
|
||||
|
||||
exports.createEnvelope = (statusCode, statusMessage, type, body) => {
|
||||
return {
|
||||
"Envelope": body,
|
||||
"EnvelopeType": type,
|
||||
"InResponseTo": null,
|
||||
"RequestId": uuid(),
|
||||
"Status": {
|
||||
"Code": statusCode,
|
||||
"Message": statusMessage
|
||||
},
|
||||
"Timestamp": getTime(new Date()),
|
||||
"TimestampFormatted": format(new Date(), "yyyy-MM-dd HH:mm:ss")
|
||||
};
|
||||
};
|
||||
return {
|
||||
Envelope: body,
|
||||
EnvelopeType: type,
|
||||
InResponseTo: null,
|
||||
RequestId: uuid(),
|
||||
Status: {
|
||||
Code: statusCode,
|
||||
Message: statusMessage,
|
||||
},
|
||||
Timestamp: getTime(new Date()),
|
||||
TimestampFormatted: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,53 +1,74 @@
|
|||
const express = require('express');
|
||||
const fs = require('fs');
|
||||
const router = express.Router();
|
||||
const protocol = require('../utils/connection');
|
||||
const express = require('express')
|
||||
const fs = require('fs')
|
||||
const router = express.Router()
|
||||
const protocol = require('../utils/connection')
|
||||
|
||||
router.get("/", (req, res) => {
|
||||
res.redirect("/powiatwulkanowy/Account/LogOn");
|
||||
});
|
||||
router.get('/', (req, res) => {
|
||||
res.redirect('/powiatwulkanowy/Account/LogOn')
|
||||
})
|
||||
|
||||
router.get("/powiatwulkanowy(/)?", (req, res) => {
|
||||
res.redirect("/powiatwulkanowy/Account/LogOn");
|
||||
});
|
||||
router.get('/powiatwulkanowy(/)?', (req, res) => {
|
||||
res.redirect('/powiatwulkanowy/Account/LogOn')
|
||||
})
|
||||
|
||||
// GET login page
|
||||
router.get("/:symbol/Account/LogOn", (req, res) => {
|
||||
res.render("login-form", {title: "Logowanie (" + req.param("symbol") + ")"});
|
||||
});
|
||||
router.get('/:symbol/Account/LogOn', (req, res) => {
|
||||
res.render('login-form', {
|
||||
title: 'Logowanie (' + req.param('symbol') + ')',
|
||||
})
|
||||
})
|
||||
|
||||
// POST login
|
||||
router.post("/:symbol/Account/LogOn", (req, res) => {
|
||||
if ('jan@fakelog.cf' === req.body.LoginName && 'jan123' === req.body.Password) {
|
||||
res.cookie("Vulcan.CUFS.WebFrontEndCookie", "1234567891012131314151617181920212223242526+");
|
||||
res.cookie("ARR_cufs.vulcan.net.pl", "1234567891012131314151617181920212223242526272829303132333435363");
|
||||
return res.redirect("/" + req.param("symbol") + "/FS/LS?" +
|
||||
"wa=wsignin1.0&" +
|
||||
"wtrealm=" + protocol(req) + "%3a%2f%2fuonetplus.fakelog.localhost%3A300%2f" + req.param("symbol") + "%2fLoginEndpoint.aspx&" +
|
||||
"wctx=" + protocol(req) + "%3a%2f%2fuonetplus.fakelog.localhost%3A300%2f" + req.param("symbol") + "%2fLoginEndpoint.aspx");
|
||||
}
|
||||
router.post('/:symbol/Account/LogOn', (req, res) => {
|
||||
if ('jan@fakelog.cf' === req.body.LoginName && 'jan123' === req.body.Password) {
|
||||
res.cookie('Vulcan.CUFS.WebFrontEndCookie', '1234567891012131314151617181920212223242526+')
|
||||
res.cookie('ARR_cufs.vulcan.net.pl', '1234567891012131314151617181920212223242526272829303132333435363')
|
||||
return res.redirect(
|
||||
'/' +
|
||||
req.param('symbol') +
|
||||
'/FS/LS?' +
|
||||
'wa=wsignin1.0&' +
|
||||
'wtrealm=' +
|
||||
protocol(req) +
|
||||
'%3a%2f%2fuonetplus.fakelog.localhost%3A300%2f' +
|
||||
req.param('symbol') +
|
||||
'%2fLoginEndpoint.aspx&' +
|
||||
'wctx=' +
|
||||
protocol(req) +
|
||||
'%3a%2f%2fuonetplus.fakelog.localhost%3A300%2f' +
|
||||
req.param('symbol') +
|
||||
'%2fLoginEndpoint.aspx'
|
||||
)
|
||||
}
|
||||
|
||||
res.render("login-form", {title: "Logowanie (" + req.param("symbol") + ")", message: "Zła nazwa użytkownika lub hasło"});
|
||||
});
|
||||
res.render('login-form', {
|
||||
title: 'Logowanie (' + req.param('symbol') + ')',
|
||||
message: 'Zła nazwa użytkownika lub hasło',
|
||||
})
|
||||
})
|
||||
|
||||
router.get("/:symbol/FS/LS", (req, res) => {
|
||||
res.render("login-cert", {
|
||||
symbol: req.param("symbol"),
|
||||
cert: fs.readFileSync("public/cert.xml", "utf8"),
|
||||
uonetplusOpiekun: protocol(req) + "://" + req.get('host').replace("cufs.", "uonetplus.")
|
||||
});
|
||||
});
|
||||
router.get('/:symbol/FS/LS', (req, res) => {
|
||||
res.render('login-cert', {
|
||||
symbol: req.param('symbol'),
|
||||
cert: fs.readFileSync('public/cert.xml', 'utf8'),
|
||||
uonetplusOpiekun: protocol(req) + '://' + req.get('host').replace('cufs.', 'uonetplus.'),
|
||||
})
|
||||
})
|
||||
|
||||
router.get("/:symbol/AccountManage/UnlockAccount", (req, res) => {
|
||||
res.render("login-recover", {title: "Przywracanie dostępu"});
|
||||
});
|
||||
router.get('/:symbol/AccountManage/UnlockAccount', (req, res) => {
|
||||
res.render('login-recover', { title: 'Przywracanie dostępu' })
|
||||
})
|
||||
|
||||
router.post("/:symbol/AccountManage/UnlockAccount", (req, res) => {
|
||||
if (req.body['g-recaptcha-response']) {
|
||||
return res.render('summary', {title: "Podsumowanie operacji"});
|
||||
}
|
||||
router.post('/:symbol/AccountManage/UnlockAccount', (req, res) => {
|
||||
if (req.body['g-recaptcha-response']) {
|
||||
return res.render('summary', { title: 'Podsumowanie operacji' })
|
||||
}
|
||||
|
||||
res.render("login-recover", {title: "Przywracanie dostępu", message: "Mechanizm zabezpieczający przeciw robotom i robakom internetowym sygnalizuje, że żądanie nie zostało poprawnie autoryzowane"});
|
||||
});
|
||||
res.render('login-recover', {
|
||||
title: 'Przywracanie dostępu',
|
||||
message:
|
||||
'Mechanizm zabezpieczający przeciw robotom i robakom internetowym sygnalizuje, że żądanie nie zostało poprawnie autoryzowane',
|
||||
})
|
||||
})
|
||||
|
||||
module.exports = router;
|
||||
module.exports = router
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const protocol = require("../utils/connection");
|
||||
const express = require('express')
|
||||
const router = express.Router()
|
||||
const protocol = require('../utils/connection')
|
||||
|
||||
/* GET home page. */
|
||||
router.get('/', (req, res) => {
|
||||
res.render('index', {
|
||||
title: 'fake-log',
|
||||
proto: protocol(req),
|
||||
domain: req.get('host')
|
||||
});
|
||||
});
|
||||
domain: req.get('host'),
|
||||
})
|
||||
})
|
||||
|
||||
module.exports = router;
|
||||
module.exports = router
|
||||
|
|
|
@ -1,24 +1,24 @@
|
|||
const router = require('express').Router({});
|
||||
const api = require("../../utils/api");
|
||||
const router = require('express').Router({})
|
||||
const api = require('../../utils/api')
|
||||
|
||||
router.all("/ZmienStatusWiadomosci", (req, res) => {
|
||||
res.json(api.createResponse("Zmiana statusu wiadomości."));
|
||||
});
|
||||
router.all('/ZmienStatusWiadomosci', (req, res) => {
|
||||
res.json(api.createResponse('Zmiana statusu wiadomości.'))
|
||||
})
|
||||
|
||||
router.all("/WiadomosciOdebrane", (req, res) => {
|
||||
res.json(api.createResponse(require("../../../data/api/messages/WiadomosciOdebrane")));
|
||||
});
|
||||
router.all('/WiadomosciOdebrane', (req, res) => {
|
||||
res.json(api.createResponse(require('../../../data/api/messages/WiadomosciOdebrane')))
|
||||
})
|
||||
|
||||
router.all("/WiadomosciWyslane", (req, res) => {
|
||||
res.json(api.createResponse(require("../../../data/api/messages/WiadomosciWyslane")));
|
||||
});
|
||||
router.all('/WiadomosciWyslane', (req, res) => {
|
||||
res.json(api.createResponse(require('../../../data/api/messages/WiadomosciWyslane')))
|
||||
})
|
||||
|
||||
router.all("/WiadomosciUsuniete", (req, res) => {
|
||||
res.json(api.createResponse(require("../../../data/api/messages/WiadomosciUsuniete")));
|
||||
});
|
||||
router.all('/WiadomosciUsuniete', (req, res) => {
|
||||
res.json(api.createResponse(require('../../../data/api/messages/WiadomosciUsuniete')))
|
||||
})
|
||||
|
||||
router.all("/DodajWiadomosc", (req, res) => {
|
||||
res.json(api.createResponse(require("../../../data/api/messages/DodajWiadomosc")));
|
||||
});
|
||||
router.all('/DodajWiadomosc', (req, res) => {
|
||||
res.json(api.createResponse(require('../../../data/api/messages/DodajWiadomosc')))
|
||||
})
|
||||
|
||||
module.exports = router;
|
||||
module.exports = router
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
const router = require('express').Router({});
|
||||
const api = require("../../utils/api");
|
||||
const router = require('express').Router({})
|
||||
const api = require('../../utils/api')
|
||||
|
||||
router.all("/GetCertificatePushConfig", (req, res) => {
|
||||
res.json(api.createResponse("not implemented")); //TODO
|
||||
});
|
||||
router.all('/GetCertificatePushConfig', (req, res) => {
|
||||
res.json(api.createResponse('not implemented')) //TODO
|
||||
})
|
||||
|
||||
module.exports = router;
|
||||
module.exports = router
|
||||
|
|
|
@ -1,62 +1,66 @@
|
|||
const router = require('express').Router({});
|
||||
const protocol = require('../../utils/connection');
|
||||
const { getUnixTime, format } = require("date-fns");
|
||||
const api = require("../../utils/api");
|
||||
const router = require('express').Router({})
|
||||
const protocol = require('../../utils/connection')
|
||||
const { getUnixTime, format } = require('date-fns')
|
||||
const api = require('../../utils/api')
|
||||
|
||||
router.all("/Certyfikat", (req, res) => {
|
||||
const base = protocol(req) + "://" + req.get('host');
|
||||
router.all('/Certyfikat', (req, res) => {
|
||||
const base = protocol(req) + '://' + req.get('host')
|
||||
|
||||
// key gen
|
||||
// keytool -genkeypair -keystore myKeystore.p12 -storetype PKCS12 -storepass 012345678901234567890123456789AB -alias LoginCert -keyalg RSA -keysize 2048 -sigalg SHA1WithRSA -validity 99999 -dname "CN=Wulkanowy, OU=Wulkanowy, O=Wulkanowy, L=Jaroslaw, ST=podkarpackie, C=WLKNW" -ext san=dns:fakelog.cf,dns:localhost,ip:127.0.0.1
|
||||
// key gen
|
||||
// keytool -genkeypair -keystore myKeystore.p12 -storetype PKCS12 -storepass 012345678901234567890123456789AB -alias LoginCert -keyalg RSA -keysize 2048 -sigalg SHA1WithRSA -validity 99999 -dname "CN=Wulkanowy, OU=Wulkanowy, O=Wulkanowy, L=Jaroslaw, ST=podkarpackie, C=WLKNW" -ext san=dns:fakelog.cf,dns:localhost,ip:127.0.0.1
|
||||
|
||||
res.json({
|
||||
"IsError": false,
|
||||
"IsMessageForUser": false,
|
||||
"Message": null,
|
||||
"TokenKey": null,
|
||||
"TokenStatus": "CertGenerated",
|
||||
"TokenCert": {
|
||||
"CertyfikatKlucz": "7EBA57E1DDBA1C249D097A9FF1C9CCDD45351A6A",
|
||||
"CertyfikatKluczSformatowanyTekst": "7E-BA-57-E1-DD-BA-1C-24-9D-09-7A-9F-F1-C9-CC-DD-45-35-1A-6A",
|
||||
"CertyfikatDataUtworzenia": Math.round(new Date().getTime() / 1000),
|
||||
"CertyfikatDataUtworzeniaSformatowanyTekst": new Date().toUTCString(),
|
||||
"CertyfikatPfx": "MIIKYQIBAzCCChoGCSqGSIb3DQEHAaCCCgsEggoHMIIKAzCCBW8GCSqGSIb3DQEHAaCCBWAEggVcMIIFWDCCBVQGCyqGSIb3DQEMCgECoIIE+zCCBPcwKQYKKoZIhvcNAQwBAzAbBBSRxddtGxr1B3L4l6VE3c9VJ2uNtAIDAMNQBIIEyLpZHqyi1DevUp4RkJCJ3Da47HrAfOUdZ3aha2mGBoJa66Hd1zcQhe9KPllE12JhVbQHIjY/lkbrt7KZptj8KHmed5vd8k7TuvVooKUw44Mxd8drq++6E13OJj+CNcW5ehXdSyN2VL9SUFshZyJf4rzAvSGWY/CNwbEXggqbsp6Lyv72R69/kfJm1lbaz+Ha4fwlF9YXFOr8ghDLOCVdCS0gPz1LqWaoLaYUuAY2C7dZ5c9zgvtyd9LJz2xNyny46RrzAboF/xwO3XvyY2LaszOPQ4/W8QjGpbBshbpOMd0YP1P53U5J3O8pAJgv8EvQYWy1HG+K2PHDaXv7J20DGauvHA/M+UpHEJ82fj1f7fnTic4Su1Labm86IyG9TU2AKeIrPoHk5HHIbdl6QYi1I5iV+wC0yyXQQ0zGrg/AMOTfO7IMi7mJiWmLVVkIdP/6UcvQ4dw+72njQ+oLr8lXBC7msEI9w0P2kHbxTi/lQZ9nAOrd0UDkE9Hk85vJlb0GgJ8lsePW39IvMqP3pLLLX+5iKQAq/k3i8bPFxLT8jFAteLoO9epGFmcgEyzeD8ZtgY8O0VCSLBCa+6m6w3iVw6Hmw/usSRbRm9aE2Py/fTnf1g1M5N4NK7t95F8IauzXI6J3UfmPlYVxvO6BYDvAOHjMFl8TIVH4vidOIG/1GBgiKKSH0jjglMVXveoKwh8ssa2HeFJ1QFcg2i41DUyeV/6R3YVkpBY0V8mO05sTn/PsrtBKSNFPGeggGkV3IwqesMQgRxtRl2awgRBKyAH0+8Xf3a6Ep/e3Xbz9p9rCqTh3X06HEimljobJP0lxkrUcnblFCV8z8flAx+R3rfMALqgMr9PJRAXfQxPmVAWQzFX6mafCPBzZTW2Q9OFl724q9h8wPyot0Qtx5mlGTQzKQAs0HXS2tKgsHiKuY2QEqQ8Hf3cQyvF3BoL7NVH7OI0AU9dP602Lcc1j0zACUmFlCZi52Lq0Vj2NCOJ9lVhRxW/kqiSKWF8gYZ0Zkj4h2HajBqumDUFM1UvBt41Y894zw373QqXP5iGUbGmo/7k8qNsgQu9C7IG6sNuJj8Ry4yb2tcC32EglifOO4705Ym+iNlY/Rr8eVWgTv+0hfDALy8BFZR7JieTonfgP6GZ1FA45ZqI2vQrdpTriY7loN2OEtbdsjpvpvUDw7nkF2Ky9YNt3QMkHa8r+0njLVZKmFtggO09r9Yhg9o7IwfeSiq19Erya4NO85on8+8EOvasiQE6G6Vn+BHgkQ/MEh5Et2qZdd5oMbI32MGTKM6O/Ol+7dpM/49/0yu2JQ1ySOpm0cWjH+ylbBW92J60ZoHcdnYsj37FmVutRW8H5DjHRwOeC49PpSC9RRIwuL8qjvT3C67YG9RAMnXVmLd77Odz8HTiynlI7vzHPbLnde5Hd0jGXKeVQancInYwbsnsSXqE2X5AaEMf5WslMoRdBU/N9o3MxAvNjjAGJne2NxVDgZE1nv9/mBa+LOlapCVbsM+Iy6xdvzITEoBF2a3l6aR/1BYsDgDRcgS50KPorcaI8QnasdXNh1S8RJLYKIN7Qm0CfKDcTzx+Y0D+7fwdoWSI1jTerGgrEA8tOx/puGOXf478Gw2Itcaq30/ptyDFGMCEGCSqGSIb3DQEJFDEUHhIAbABvAGcAaQBuAGMAZQByAHQwIQYJKoZIhvcNAQkVMRQEElRpbWUgMTUzOTIwNjA4NjcxMjCCBIwGCSqGSIb3DQEHBqCCBH0wggR5AgEAMIIEcgYJKoZIhvcNAQcBMCkGCiqGSIb3DQEMAQYwGwQUNkBD+FMA6GpohJB9oxUP4e9R1aYCAwDDUICCBDiwrkiULdZav4v1TONDtLtb94wUHdqtZfysyAQO5j8yvTHsAMwAgkYCmwg28yk5tAaBG9Oi40/z5k6z4mIsqqOOTSdBG2hGNZKWi8X871XyybZd6VQ6jUcbavHsAaPx+0RUrc2MekF7n1XtxZmofT9DfWwEyi7jDQpFLF1Xi/lZMU8YGOmROIabdi2bLhO6e9RgEy6Sx3ka8KUe+XwdfKc8MeTCN9taLy4VBu2DfPKkZZvx5oV8vgQ484t666VfVxC/hAq/ZOXZmbX5XzucdxMwdZiVNrXwzksnd/vUFfFs9ZkfwkyRpbVQVXp476hfqnjWQvE70FBY8GXstNWnMPfPio1hWzt8ORGgdKIomOhlklFHTQUhEyHjKD3jZmO/0O0wywechsCA3H8UoIPb+odHhSpYhOgCbLvtM26gIHClfWwTvxAdXJW7BkSh/rvadU7vH3A3O+7tQQdJkHmPhnU/8hK+5j4+sPt03YSTuu1EGYsMs5PILVg+R31jwHFORhfgsWGh/sydAioSbsTjelULw6lHOBhPxoaTvAiAzluSrM4nfREr+PFIgYBNKtSbFhRUaEMsVZZ8CFKCzqJvCYQv/WuAtvEZU8aeU3cJRDEEikiPlM/tHfikm+nDoLNm9pzx5Yh26w9os5S64v1ZLilQUaDhSHa+WEz4y16eYEgNuiNFTPVaG4w7vL2/u1I7o/XFbGa1m4VfbN0+xwEIO8Cdyvl32IRu8SOFgJ4Kf97VP8IF9TrxvNobXC1ebzXyyzQ5yaY8mi8NjEyNUIvg564nm5p692P7OAbXEB5L+p8L/16vqGV3Us+ZCybjcxoi7OKeNsVVG67qRY+ZcJ5Fs6jGpB/E99Boiej+RZ7n4XqaxU3MzLNQ5x8I+7rfgFdtu2nzCw8nr8WFPdKwGvoAi7vR02zXeKyLp0i2yroMzTNgDU176XhMEHK24IOc6/1zFUN0Lr96ULrkRbIE7f0icvUFlHMH56Ye4ev6rKTUtpGKrYjFx08U1WdviZTPG9B6jcB+OJECHIpvdVARXFLAa52Ye8oAMm0ae1JkCAMm5227OfqO097aQrnNMptLP7qzwlF4GwW0WbGdPUVgYW5x4upptE1PYO+mlc2grCYy52NJ2DlXwAT1Agh2cVe+i1S2s9nGHHFoHSjCb5LMqPWE+oYnaICNmgiBAwIJp3Eqs47Vlriezi8cnlS6dZhBgqVC/tnoG56hYHRvD/az0k9ra7GDD9UChAQHwQAj8mjUbFDzwVKd6WwU+lGuLU873jI2cqe64Xz2DU/fXrci8bTH6N6+21l4rW1W+49JHoa+lIPe7m6WmHE37qFB9lbETtKpbF1OZjuykP9ySbC/rKfnwPwPILvxFSCYkWCiuZIcDgT0/yw0PHhvlwRlW49cJxDzLD0oA7FK39ywTNC99tWFIGtplc8BhWyVqo4wPjAhMAkGBSsOAwIaBQAEFH8M34p8W3P5DQjPhHJ3h1c21OEVBBRrY106fqyzCCmc0jpKuoimwORPGQIDAYag",
|
||||
"GrupaKlientow": "powiatwulkanowy",
|
||||
"AdresBazowyRestApi": base + "/powiatwulkanowy/",
|
||||
"UzytkownikLogin": "admin",
|
||||
"UzytkownikNazwa": "admin",
|
||||
"TypKonta": null
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
res.json({
|
||||
IsError: false,
|
||||
IsMessageForUser: false,
|
||||
Message: null,
|
||||
TokenKey: null,
|
||||
TokenStatus: 'CertGenerated',
|
||||
TokenCert: {
|
||||
CertyfikatKlucz: '7EBA57E1DDBA1C249D097A9FF1C9CCDD45351A6A',
|
||||
CertyfikatKluczSformatowanyTekst: '7E-BA-57-E1-DD-BA-1C-24-9D-09-7A-9F-F1-C9-CC-DD-45-35-1A-6A',
|
||||
CertyfikatDataUtworzenia: Math.round(new Date().getTime() / 1000),
|
||||
CertyfikatDataUtworzeniaSformatowanyTekst: new Date().toUTCString(),
|
||||
CertyfikatPfx:
|
||||
'MIIKYQIBAzCCChoGCSqGSIb3DQEHAaCCCgsEggoHMIIKAzCCBW8GCSqGSIb3DQEHAaCCBWAEggVcMIIFWDCCBVQGCyqGSIb3DQEMCgECoIIE+zCCBPcwKQYKKoZIhvcNAQwBAzAbBBSRxddtGxr1B3L4l6VE3c9VJ2uNtAIDAMNQBIIEyLpZHqyi1DevUp4RkJCJ3Da47HrAfOUdZ3aha2mGBoJa66Hd1zcQhe9KPllE12JhVbQHIjY/lkbrt7KZptj8KHmed5vd8k7TuvVooKUw44Mxd8drq++6E13OJj+CNcW5ehXdSyN2VL9SUFshZyJf4rzAvSGWY/CNwbEXggqbsp6Lyv72R69/kfJm1lbaz+Ha4fwlF9YXFOr8ghDLOCVdCS0gPz1LqWaoLaYUuAY2C7dZ5c9zgvtyd9LJz2xNyny46RrzAboF/xwO3XvyY2LaszOPQ4/W8QjGpbBshbpOMd0YP1P53U5J3O8pAJgv8EvQYWy1HG+K2PHDaXv7J20DGauvHA/M+UpHEJ82fj1f7fnTic4Su1Labm86IyG9TU2AKeIrPoHk5HHIbdl6QYi1I5iV+wC0yyXQQ0zGrg/AMOTfO7IMi7mJiWmLVVkIdP/6UcvQ4dw+72njQ+oLr8lXBC7msEI9w0P2kHbxTi/lQZ9nAOrd0UDkE9Hk85vJlb0GgJ8lsePW39IvMqP3pLLLX+5iKQAq/k3i8bPFxLT8jFAteLoO9epGFmcgEyzeD8ZtgY8O0VCSLBCa+6m6w3iVw6Hmw/usSRbRm9aE2Py/fTnf1g1M5N4NK7t95F8IauzXI6J3UfmPlYVxvO6BYDvAOHjMFl8TIVH4vidOIG/1GBgiKKSH0jjglMVXveoKwh8ssa2HeFJ1QFcg2i41DUyeV/6R3YVkpBY0V8mO05sTn/PsrtBKSNFPGeggGkV3IwqesMQgRxtRl2awgRBKyAH0+8Xf3a6Ep/e3Xbz9p9rCqTh3X06HEimljobJP0lxkrUcnblFCV8z8flAx+R3rfMALqgMr9PJRAXfQxPmVAWQzFX6mafCPBzZTW2Q9OFl724q9h8wPyot0Qtx5mlGTQzKQAs0HXS2tKgsHiKuY2QEqQ8Hf3cQyvF3BoL7NVH7OI0AU9dP602Lcc1j0zACUmFlCZi52Lq0Vj2NCOJ9lVhRxW/kqiSKWF8gYZ0Zkj4h2HajBqumDUFM1UvBt41Y894zw373QqXP5iGUbGmo/7k8qNsgQu9C7IG6sNuJj8Ry4yb2tcC32EglifOO4705Ym+iNlY/Rr8eVWgTv+0hfDALy8BFZR7JieTonfgP6GZ1FA45ZqI2vQrdpTriY7loN2OEtbdsjpvpvUDw7nkF2Ky9YNt3QMkHa8r+0njLVZKmFtggO09r9Yhg9o7IwfeSiq19Erya4NO85on8+8EOvasiQE6G6Vn+BHgkQ/MEh5Et2qZdd5oMbI32MGTKM6O/Ol+7dpM/49/0yu2JQ1ySOpm0cWjH+ylbBW92J60ZoHcdnYsj37FmVutRW8H5DjHRwOeC49PpSC9RRIwuL8qjvT3C67YG9RAMnXVmLd77Odz8HTiynlI7vzHPbLnde5Hd0jGXKeVQancInYwbsnsSXqE2X5AaEMf5WslMoRdBU/N9o3MxAvNjjAGJne2NxVDgZE1nv9/mBa+LOlapCVbsM+Iy6xdvzITEoBF2a3l6aR/1BYsDgDRcgS50KPorcaI8QnasdXNh1S8RJLYKIN7Qm0CfKDcTzx+Y0D+7fwdoWSI1jTerGgrEA8tOx/puGOXf478Gw2Itcaq30/ptyDFGMCEGCSqGSIb3DQEJFDEUHhIAbABvAGcAaQBuAGMAZQByAHQwIQYJKoZIhvcNAQkVMRQEElRpbWUgMTUzOTIwNjA4NjcxMjCCBIwGCSqGSIb3DQEHBqCCBH0wggR5AgEAMIIEcgYJKoZIhvcNAQcBMCkGCiqGSIb3DQEMAQYwGwQUNkBD+FMA6GpohJB9oxUP4e9R1aYCAwDDUICCBDiwrkiULdZav4v1TONDtLtb94wUHdqtZfysyAQO5j8yvTHsAMwAgkYCmwg28yk5tAaBG9Oi40/z5k6z4mIsqqOOTSdBG2hGNZKWi8X871XyybZd6VQ6jUcbavHsAaPx+0RUrc2MekF7n1XtxZmofT9DfWwEyi7jDQpFLF1Xi/lZMU8YGOmROIabdi2bLhO6e9RgEy6Sx3ka8KUe+XwdfKc8MeTCN9taLy4VBu2DfPKkZZvx5oV8vgQ484t666VfVxC/hAq/ZOXZmbX5XzucdxMwdZiVNrXwzksnd/vUFfFs9ZkfwkyRpbVQVXp476hfqnjWQvE70FBY8GXstNWnMPfPio1hWzt8ORGgdKIomOhlklFHTQUhEyHjKD3jZmO/0O0wywechsCA3H8UoIPb+odHhSpYhOgCbLvtM26gIHClfWwTvxAdXJW7BkSh/rvadU7vH3A3O+7tQQdJkHmPhnU/8hK+5j4+sPt03YSTuu1EGYsMs5PILVg+R31jwHFORhfgsWGh/sydAioSbsTjelULw6lHOBhPxoaTvAiAzluSrM4nfREr+PFIgYBNKtSbFhRUaEMsVZZ8CFKCzqJvCYQv/WuAtvEZU8aeU3cJRDEEikiPlM/tHfikm+nDoLNm9pzx5Yh26w9os5S64v1ZLilQUaDhSHa+WEz4y16eYEgNuiNFTPVaG4w7vL2/u1I7o/XFbGa1m4VfbN0+xwEIO8Cdyvl32IRu8SOFgJ4Kf97VP8IF9TrxvNobXC1ebzXyyzQ5yaY8mi8NjEyNUIvg564nm5p692P7OAbXEB5L+p8L/16vqGV3Us+ZCybjcxoi7OKeNsVVG67qRY+ZcJ5Fs6jGpB/E99Boiej+RZ7n4XqaxU3MzLNQ5x8I+7rfgFdtu2nzCw8nr8WFPdKwGvoAi7vR02zXeKyLp0i2yroMzTNgDU176XhMEHK24IOc6/1zFUN0Lr96ULrkRbIE7f0icvUFlHMH56Ye4ev6rKTUtpGKrYjFx08U1WdviZTPG9B6jcB+OJECHIpvdVARXFLAa52Ye8oAMm0ae1JkCAMm5227OfqO097aQrnNMptLP7qzwlF4GwW0WbGdPUVgYW5x4upptE1PYO+mlc2grCYy52NJ2DlXwAT1Agh2cVe+i1S2s9nGHHFoHSjCb5LMqPWE+oYnaICNmgiBAwIJp3Eqs47Vlriezi8cnlS6dZhBgqVC/tnoG56hYHRvD/az0k9ra7GDD9UChAQHwQAj8mjUbFDzwVKd6WwU+lGuLU873jI2cqe64Xz2DU/fXrci8bTH6N6+21l4rW1W+49JHoa+lIPe7m6WmHE37qFB9lbETtKpbF1OZjuykP9ySbC/rKfnwPwPILvxFSCYkWCiuZIcDgT0/yw0PHhvlwRlW49cJxDzLD0oA7FK39ywTNC99tWFIGtplc8BhWyVqo4wPjAhMAkGBSsOAwIaBQAEFH8M34p8W3P5DQjPhHJ3h1c21OEVBBRrY106fqyzCCmc0jpKuoimwORPGQIDAYag',
|
||||
GrupaKlientow: 'powiatwulkanowy',
|
||||
AdresBazowyRestApi: base + '/powiatwulkanowy/',
|
||||
UzytkownikLogin: 'admin',
|
||||
UzytkownikNazwa: 'admin',
|
||||
TypKonta: null,
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
router.all("/ListaUczniow", (req, res) => {
|
||||
const currDate = new Date();
|
||||
router.all('/ListaUczniow', (req, res) => {
|
||||
const currDate = new Date()
|
||||
|
||||
let semesterNumber;
|
||||
let semesterStart;
|
||||
let semesterEnd;
|
||||
if (currDate.getMonth() >= 8) {
|
||||
semesterNumber = 1;
|
||||
semesterStart = new Date(currDate.getFullYear(), 8, 1);
|
||||
semesterEnd = new Date(currDate.getFullYear() + 1, 0, 30);
|
||||
} else {
|
||||
semesterNumber = 2;
|
||||
semesterStart = new Date(currDate.getFullYear(), 0, 30);
|
||||
semesterEnd = new Date(currDate.getFullYear(), 7, 31);
|
||||
}
|
||||
let semesterNumber
|
||||
let semesterStart
|
||||
let semesterEnd
|
||||
if (currDate.getMonth() >= 8) {
|
||||
semesterNumber = 1
|
||||
semesterStart = new Date(currDate.getFullYear(), 8, 1)
|
||||
semesterEnd = new Date(currDate.getFullYear() + 1, 0, 30)
|
||||
} else {
|
||||
semesterNumber = 2
|
||||
semesterStart = new Date(currDate.getFullYear(), 0, 30)
|
||||
semesterEnd = new Date(currDate.getFullYear(), 7, 31)
|
||||
}
|
||||
|
||||
res.json(api.createResponse(require("../../../data/api/ListaUczniow").map(item => {
|
||||
res.json(
|
||||
api.createResponse(
|
||||
require('../../../data/api/ListaUczniow').map((item) => {
|
||||
return {
|
||||
...item,
|
||||
"OkresNumer": semesterNumber,
|
||||
"OkresDataOd": getUnixTime(semesterStart),
|
||||
"OkresDataDo": getUnixTime(semesterEnd),
|
||||
"OkresDataOdTekst": format(semesterStart, "yyyy-MM-dd"),
|
||||
"OkresDataDoTekst": format(semesterEnd, "yyyy-MM-dd")
|
||||
};
|
||||
})));
|
||||
});
|
||||
...item,
|
||||
OkresNumer: semesterNumber,
|
||||
OkresDataOd: getUnixTime(semesterStart),
|
||||
OkresDataDo: getUnixTime(semesterEnd),
|
||||
OkresDataOdTekst: format(semesterStart, 'yyyy-MM-dd'),
|
||||
OkresDataDoTekst: format(semesterEnd, 'yyyy-MM-dd'),
|
||||
}
|
||||
})
|
||||
)
|
||||
)
|
||||
})
|
||||
|
||||
module.exports = router;
|
||||
module.exports = router
|
||||
|
|
|
@ -1,110 +1,134 @@
|
|||
const router = require('express').Router({});
|
||||
const api = require('../../utils/api');
|
||||
const converter = require('../../utils/converter');
|
||||
const {addDays, differenceInDays, parseISO, startOfWeek, getTime} = require('date-fns');
|
||||
const router = require('express').Router({})
|
||||
const api = require('../../utils/api')
|
||||
const converter = require('../../utils/converter')
|
||||
const { addDays, differenceInDays, parseISO, startOfWeek, getTime } = require('date-fns')
|
||||
|
||||
router.all("/LogAppStart", (req, res) => {
|
||||
res.json(api.createResponse("Log"));
|
||||
});
|
||||
router.all('/LogAppStart', (req, res) => {
|
||||
res.json(api.createResponse('Log'))
|
||||
})
|
||||
|
||||
router.all("/UstawPushToken", (req, res) => {
|
||||
res.json(api.createResponse("Zapisano tokenId dla powiadomien PUSH"));
|
||||
});
|
||||
router.all('/UstawPushToken', (req, res) => {
|
||||
res.json(api.createResponse('Zapisano tokenId dla powiadomien PUSH'))
|
||||
})
|
||||
|
||||
router.all("/Slowniki", (req, res) => {
|
||||
res.json(api.createResponse({
|
||||
"TimeKey": Math.round(new Date().getTime() / 1000),
|
||||
"Nauczyciele": require("../../../data/api/dictionaries/Nauczyciele"),
|
||||
"Pracownicy": require("../../../data/api/dictionaries/Pracownicy"),
|
||||
"Przedmioty": require("../../../data/api/dictionaries/Przedmioty"),
|
||||
"PoryLekcji": require("../../../data/api/dictionaries/PoryLekcji"),
|
||||
"KategorieOcen": require("../../../data/api/dictionaries/KategorieOcen"),
|
||||
"KategorieUwag": require("../../../data/api/dictionaries/KategorieUwag"),
|
||||
"KategorieFrekwencji": require("../../../data/api/dictionaries/KategorieFrekwencji"),
|
||||
"TypyFrekwencji": require("../../../data/api/dictionaries/TypyFrekwencji")
|
||||
}));
|
||||
});
|
||||
router.all('/Slowniki', (req, res) => {
|
||||
res.json(
|
||||
api.createResponse({
|
||||
TimeKey: Math.round(new Date().getTime() / 1000),
|
||||
Nauczyciele: require('../../../data/api/dictionaries/Nauczyciele'),
|
||||
Pracownicy: require('../../../data/api/dictionaries/Pracownicy'),
|
||||
Przedmioty: require('../../../data/api/dictionaries/Przedmioty'),
|
||||
PoryLekcji: require('../../../data/api/dictionaries/PoryLekcji'),
|
||||
KategorieOcen: require('../../../data/api/dictionaries/KategorieOcen'),
|
||||
KategorieUwag: require('../../../data/api/dictionaries/KategorieUwag'),
|
||||
KategorieFrekwencji: require('../../../data/api/dictionaries/KategorieFrekwencji'),
|
||||
TypyFrekwencji: require('../../../data/api/dictionaries/TypyFrekwencji'),
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
router.all("/PlanLekcjiZeZmianami", (req, res) => {
|
||||
const timetable = require("../../../data/api/student/PlanLekcjiZeZmianami");
|
||||
const requestDate = req.body.DataPoczatkowa ? parseISO(req.body.DataPoczatkowa) : startOfWeek(new Date(), {weekStartsOn: 1});
|
||||
const baseOffset = differenceInDays(requestDate, parseISO(timetable[0].DzienTekst));
|
||||
router.all('/PlanLekcjiZeZmianami', (req, res) => {
|
||||
const timetable = require('../../../data/api/student/PlanLekcjiZeZmianami')
|
||||
const requestDate = req.body.DataPoczatkowa
|
||||
? parseISO(req.body.DataPoczatkowa)
|
||||
: startOfWeek(new Date(), { weekStartsOn: 1 })
|
||||
const baseOffset = differenceInDays(requestDate, parseISO(timetable[0].DzienTekst))
|
||||
|
||||
res.json(api.createResponse(timetable.map(item => {
|
||||
const date = addDays(parseISO(item.DzienTekst), baseOffset);
|
||||
res.json(
|
||||
api.createResponse(
|
||||
timetable.map((item) => {
|
||||
const date = addDays(parseISO(item.DzienTekst), baseOffset)
|
||||
return {
|
||||
...item,
|
||||
Dzien: getTime(date) / 1000,
|
||||
DzienTekst: converter.formatDate(date, true)
|
||||
};
|
||||
})));
|
||||
});
|
||||
...item,
|
||||
Dzien: getTime(date) / 1000,
|
||||
DzienTekst: converter.formatDate(date, true),
|
||||
}
|
||||
})
|
||||
)
|
||||
)
|
||||
})
|
||||
|
||||
router.all("/Oceny", (req, res) => {
|
||||
res.json(api.createResponse(require("../../../data/api/student/Oceny")));
|
||||
});
|
||||
router.all('/Oceny', (req, res) => {
|
||||
res.json(api.createResponse(require('../../../data/api/student/Oceny')))
|
||||
})
|
||||
|
||||
router.all("/OcenyPodsumowanie", (req, res) => {
|
||||
res.json(api.createResponse(require("../../../data/api/student/OcenyPodsumowanie")));
|
||||
});
|
||||
router.all('/OcenyPodsumowanie', (req, res) => {
|
||||
res.json(api.createResponse(require('../../../data/api/student/OcenyPodsumowanie')))
|
||||
})
|
||||
|
||||
router.all("/Sprawdziany", (req, res) => {
|
||||
const exams = require("../../../data/api/student/Sprawdziany");
|
||||
const requestDate = req.body.DataPoczatkowa ? parseISO(req.body.DataPoczatkowa) : startOfWeek(new Date(), {weekStartsOn: 1});
|
||||
const baseOffset = differenceInDays(requestDate, parseISO(exams[0].DataTekst));
|
||||
router.all('/Sprawdziany', (req, res) => {
|
||||
const exams = require('../../../data/api/student/Sprawdziany')
|
||||
const requestDate = req.body.DataPoczatkowa
|
||||
? parseISO(req.body.DataPoczatkowa)
|
||||
: startOfWeek(new Date(), { weekStartsOn: 1 })
|
||||
const baseOffset = differenceInDays(requestDate, parseISO(exams[0].DataTekst))
|
||||
|
||||
res.json(api.createResponse(exams.map(item => {
|
||||
const date = addDays(parseISO(item.DataTekst), baseOffset);
|
||||
res.json(
|
||||
api.createResponse(
|
||||
exams.map((item) => {
|
||||
const date = addDays(parseISO(item.DataTekst), baseOffset)
|
||||
return {
|
||||
...item,
|
||||
Data: getTime(date) / 1000,
|
||||
DataTekst: converter.formatDate(date, true)
|
||||
};
|
||||
})));
|
||||
});
|
||||
...item,
|
||||
Data: getTime(date) / 1000,
|
||||
DataTekst: converter.formatDate(date, true),
|
||||
}
|
||||
})
|
||||
)
|
||||
)
|
||||
})
|
||||
|
||||
router.all("/UwagiUcznia", (req, res) => {
|
||||
res.json(api.createResponse(require("../../../data/api/student/UwagiUcznia")));
|
||||
});
|
||||
router.all('/UwagiUcznia', (req, res) => {
|
||||
res.json(api.createResponse(require('../../../data/api/student/UwagiUcznia')))
|
||||
})
|
||||
|
||||
router.all("/Frekwencje", (req, res) => {
|
||||
const attendance = require("../../../data/api/student/Frekwencje");
|
||||
const requestDate = req.body.DataPoczatkowa ? parseISO(req.body.DataPoczatkowa) : startOfWeek(new Date(), {weekStartsOn: 1});
|
||||
const baseOffset = differenceInDays(requestDate, parseISO(attendance[0].DzienTekst));
|
||||
router.all('/Frekwencje', (req, res) => {
|
||||
const attendance = require('../../../data/api/student/Frekwencje')
|
||||
const requestDate = req.body.DataPoczatkowa
|
||||
? parseISO(req.body.DataPoczatkowa)
|
||||
: startOfWeek(new Date(), { weekStartsOn: 1 })
|
||||
const baseOffset = differenceInDays(requestDate, parseISO(attendance[0].DzienTekst))
|
||||
|
||||
res.json(api.createResponse({
|
||||
"DataPoczatkowa": 1524434400,
|
||||
"DataKoncowa": 1525039199,
|
||||
"DataPoczatkowaTekst": req.body.DataPoczatkowa,
|
||||
"DataKoncowaTekst": req.body.DataKoncowa,
|
||||
"Frekwencje": attendance.map(item => {
|
||||
const date = addDays(parseISO(item.DzienTekst), baseOffset);
|
||||
return {
|
||||
...item,
|
||||
Dzien: getTime(date) / 1000,
|
||||
DzienTekst: converter.formatDate(date, true)
|
||||
};
|
||||
})
|
||||
}));
|
||||
});
|
||||
|
||||
router.all("/ZadaniaDomowe", (req, res) => {
|
||||
const homework = require("../../../data/api/student/ZadaniaDomowe");
|
||||
const requestDate = req.body.DataPoczatkowa ? parseISO(req.body.DataPoczatkowa) : startOfWeek(new Date(), {weekStartsOn: 1});
|
||||
const baseOffset = differenceInDays(requestDate, parseISO(homework[0].DataTekst));
|
||||
|
||||
res.json(api.createResponse(homework.map(item => {
|
||||
const date = addDays(parseISO(item.DataTekst), baseOffset);
|
||||
res.json(
|
||||
api.createResponse({
|
||||
DataPoczatkowa: 1524434400,
|
||||
DataKoncowa: 1525039199,
|
||||
DataPoczatkowaTekst: req.body.DataPoczatkowa,
|
||||
DataKoncowaTekst: req.body.DataKoncowa,
|
||||
Frekwencje: attendance.map((item) => {
|
||||
const date = addDays(parseISO(item.DzienTekst), baseOffset)
|
||||
return {
|
||||
...item,
|
||||
Data: getTime(date) / 1000,
|
||||
DataTekst: converter.formatDate(date, true)
|
||||
};
|
||||
})));
|
||||
});
|
||||
...item,
|
||||
Dzien: getTime(date) / 1000,
|
||||
DzienTekst: converter.formatDate(date, true),
|
||||
}
|
||||
}),
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
router.all("/Nauczyciele", (req, res) => {
|
||||
res.json(api.createResponse(require("../../../data/api/student/Nauczyciele")));
|
||||
});
|
||||
router.all('/ZadaniaDomowe', (req, res) => {
|
||||
const homework = require('../../../data/api/student/ZadaniaDomowe')
|
||||
const requestDate = req.body.DataPoczatkowa
|
||||
? parseISO(req.body.DataPoczatkowa)
|
||||
: startOfWeek(new Date(), { weekStartsOn: 1 })
|
||||
const baseOffset = differenceInDays(requestDate, parseISO(homework[0].DataTekst))
|
||||
|
||||
module.exports = router;
|
||||
res.json(
|
||||
api.createResponse(
|
||||
homework.map((item) => {
|
||||
const date = addDays(parseISO(item.DataTekst), baseOffset)
|
||||
return {
|
||||
...item,
|
||||
Data: getTime(date) / 1000,
|
||||
DataTekst: converter.formatDate(date, true),
|
||||
}
|
||||
})
|
||||
)
|
||||
)
|
||||
})
|
||||
|
||||
router.all('/Nauczyciele', (req, res) => {
|
||||
res.json(api.createResponse(require('../../../data/api/student/Nauczyciele')))
|
||||
})
|
||||
|
||||
module.exports = router
|
||||
|
|
|
@ -1,430 +1,457 @@
|
|||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const converter = require('../utils/converter');
|
||||
const dictMap = require('../utils/dictMap');
|
||||
const { getGradeColorByCategoryName } = require("../utils/gradeColor");
|
||||
const _ = require('lodash');
|
||||
const express = require('express')
|
||||
const router = express.Router()
|
||||
const converter = require('../utils/converter')
|
||||
const dictMap = require('../utils/dictMap')
|
||||
const { getGradeColorByCategoryName } = require('../utils/gradeColor')
|
||||
const _ = require('lodash')
|
||||
|
||||
global.opiekunRoot = "/powiatwulkanowy/123456";
|
||||
global.opiekunRoot = '/powiatwulkanowy/123456'
|
||||
|
||||
router.all("/", (req, res) => {
|
||||
res.render("log-exception", {
|
||||
title: "Dziennik FakeUONET+",
|
||||
message: "Podany identyfikator klienta jest niepoprawny.",
|
||||
});
|
||||
});
|
||||
router.all('/', (req, res) => {
|
||||
res.render('log-exception', {
|
||||
title: 'Dziennik FakeUONET+',
|
||||
message: 'Podany identyfikator klienta jest niepoprawny.',
|
||||
})
|
||||
})
|
||||
|
||||
router.all("/powiatwulkanowy(/12345[678])?", (req, res) => {
|
||||
if (req.header("Referer") || "true" === req.query.login) {
|
||||
return res.redirect("/powiatwulkanowy/123456/Start/Index/");
|
||||
router.all('/powiatwulkanowy(/12345[678])?', (req, res) => {
|
||||
if (req.header('Referer') || 'true' === req.query.login) {
|
||||
return res.redirect('/powiatwulkanowy/123456/Start/Index/')
|
||||
}
|
||||
|
||||
res.render('login', {
|
||||
title: 'Uczeń',
|
||||
})
|
||||
})
|
||||
|
||||
router.get('/Start/Index/', (req, res) => {
|
||||
res.cookie('EfebSsoAuthCookie', 'asdfasdfasdfasdfasdfasdfas', {
|
||||
domain: req.get('host').replace('uonetplus-opiekun', ''),
|
||||
path: '/',
|
||||
httpOnly: true,
|
||||
})
|
||||
res.cookie('idBiezacyDziennik', '1234')
|
||||
res.render('opiekun/start', {
|
||||
title: 'Witryna ucznia i rodzica – Strona główna',
|
||||
})
|
||||
})
|
||||
|
||||
router.get('/Uczen/UczenOnChange', (req, res) => {
|
||||
res.cookie('idBiezacyUczen', req.query.id)
|
||||
|
||||
res.redirect(req.header('Referer') ? req.header('Referer') : '../?login=true')
|
||||
})
|
||||
|
||||
router.get('/Dziennik/DziennikOnChange', (req, res) => {
|
||||
res.cookie('idBiezacyDziennik', req.query.id)
|
||||
|
||||
res.redirect(req.header('Referer') ? req.header('Referer') : '../')
|
||||
})
|
||||
|
||||
router.get('/Uczen.mvc/DanePodstawowe', (req, res) => {
|
||||
res.render('opiekun/dane', {
|
||||
title: 'Witryna ucznia i rodzica – Dane ucznia',
|
||||
data: require('../../data/opiekun/dane.json'),
|
||||
})
|
||||
})
|
||||
|
||||
router.get('/Oceny(.mvc|)/Wszystkie', (req, res) => {
|
||||
let data
|
||||
let viewPath
|
||||
|
||||
const teachers = require('../../data/api/dictionaries/Nauczyciele')
|
||||
const subjects = require('../../data/api/dictionaries/Przedmioty')
|
||||
const details = require('../../data/api/student/Oceny')
|
||||
const subjectCategories = require('../../data/api/dictionaries/KategorieOcen')
|
||||
const summary = require('../../data/api/student/OcenyPodsumowanie')
|
||||
const descriptiveGrades = require('../../data/api/student/OcenyOpisowe')
|
||||
|
||||
if (req.query.details === '2') {
|
||||
data = details.map((item) => {
|
||||
const teacher = dictMap.getByValue(teachers, 'Id', item.IdPracownikD)
|
||||
const category = dictMap.getByValue(subjectCategories, 'Id', item.IdKategoria)
|
||||
return {
|
||||
subject: dictMap.getByValue(subjects, 'Id', item.IdPrzedmiot).Nazwa,
|
||||
value: item.Wpis === '' ? item.Komentarz : item.Wpis,
|
||||
color: getGradeColorByCategoryName(category.Nazwa),
|
||||
symbol: category.Kod,
|
||||
description: item.Opis,
|
||||
weight: item.Waga,
|
||||
date: converter.formatDate(new Date(item.DataUtworzenia * 1000)),
|
||||
teacher: teacher.Imie + ' ' + teacher.Nazwisko,
|
||||
}
|
||||
})
|
||||
viewPath = 'opiekun/oceny-szczegolowy'
|
||||
} else {
|
||||
viewPath = 'opiekun/oceny-skrocony'
|
||||
data = {
|
||||
normalGrades: subjects.map((item) => {
|
||||
return {
|
||||
subject: item.Nazwa,
|
||||
average: dictMap.getByValue(summary.SrednieOcen, 'IdPrzedmiot', item.Id).SredniaOcen,
|
||||
predictedRating: dictMap.getByValue(summary.OcenyPrzewidywane, 'IdPrzedmiot', item.Id).Wpis,
|
||||
finalRating: dictMap.getByValue(summary.OcenyPrzewidywane, 'IdPrzedmiot', item.Id).Wpis,
|
||||
}
|
||||
}),
|
||||
descriptiveGrades,
|
||||
}
|
||||
}
|
||||
|
||||
res.render("login", {
|
||||
title: "Uczeń"
|
||||
});
|
||||
});
|
||||
res.render(viewPath, {
|
||||
title: 'Witryna ucznia i rodzica – Oceny',
|
||||
data: data,
|
||||
})
|
||||
})
|
||||
|
||||
router.get("/Start/Index/", (req, res) => {
|
||||
res.cookie("EfebSsoAuthCookie", "asdfasdfasdfasdfasdfasdfas", {
|
||||
domain: req.get('host').replace("uonetplus-opiekun", ""),
|
||||
path: '/',
|
||||
httpOnly: true
|
||||
});
|
||||
res.cookie("idBiezacyDziennik", "1234");
|
||||
res.render("opiekun/start", {title: "Witryna ucznia i rodzica – Strona główna"});
|
||||
});
|
||||
router.get('/Statystyki.mvc/Uczen', (req, res) => {
|
||||
let data
|
||||
let viewPath
|
||||
|
||||
router.get("/Uczen/UczenOnChange", (req, res) => {
|
||||
res.cookie("idBiezacyUczen", req.query.id);
|
||||
if (req.query.rodzajWidoku === '1') {
|
||||
viewPath = 'opiekun/oceny-statystyki-czastkowe'
|
||||
data = require('../../data/opiekun/oceny-statystyki-czastkowe').map((item) => {
|
||||
return {
|
||||
subject: item.subject,
|
||||
grade: item.grade,
|
||||
pupilAmount: item.pupilAmount,
|
||||
pupilPercent: item.pupilAmount !== 0 ? 25.000003 : 0,
|
||||
classAmount: item.classAmount,
|
||||
classPercent: item.classAmount !== 0 ? 25.000003 : 0,
|
||||
}
|
||||
})
|
||||
} else {
|
||||
viewPath = 'opiekun/oceny-statystyki-roczne'
|
||||
data = require('../../data/opiekun/oceny-statystyki-roczne').map((item) => {
|
||||
return {
|
||||
subject: item.subject,
|
||||
grade: item.grade,
|
||||
amount: item.amount,
|
||||
percent: item.amount !== 0 ? 25.000003 : 0,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
res.redirect(req.header("Referer") ? req.header("Referer") : "../?login=true");
|
||||
});
|
||||
|
||||
router.get("/Dziennik/DziennikOnChange", (req, res) => {
|
||||
res.cookie("idBiezacyDziennik", req.query.id);
|
||||
|
||||
res.redirect(req.header("Referer") ? req.header("Referer") : "../");
|
||||
});
|
||||
|
||||
router.get("/Uczen.mvc/DanePodstawowe", (req, res) => {
|
||||
res.render("opiekun/dane", {
|
||||
title: "Witryna ucznia i rodzica – Dane ucznia",
|
||||
data: require("../../data/opiekun/dane.json")
|
||||
});
|
||||
});
|
||||
|
||||
router.get("/Oceny(\.mvc|)/Wszystkie", (req, res) => {
|
||||
let data;
|
||||
let viewPath;
|
||||
|
||||
const teachers = require("../../data/api/dictionaries/Nauczyciele");
|
||||
const subjects = require("../../data/api/dictionaries/Przedmioty");
|
||||
const details = require("../../data/api/student/Oceny");
|
||||
const subjectCategories = require("../../data/api/dictionaries/KategorieOcen");
|
||||
const summary = require("../../data/api/student/OcenyPodsumowanie");
|
||||
const descriptiveGrades = require("../../data/api/student/OcenyOpisowe");
|
||||
|
||||
if (req.query.details === '2') {
|
||||
data = details.map(item => {
|
||||
const teacher = dictMap.getByValue(teachers, "Id", item.IdPracownikD);
|
||||
const category = dictMap.getByValue(subjectCategories, "Id", item.IdKategoria);
|
||||
return {
|
||||
"subject": dictMap.getByValue(subjects, "Id", item.IdPrzedmiot).Nazwa,
|
||||
"value": item.Wpis === "" ? item.Komentarz : item.Wpis,
|
||||
"color": getGradeColorByCategoryName(category.Nazwa),
|
||||
"symbol": category.Kod,
|
||||
"description": item.Opis,
|
||||
"weight": item.Waga,
|
||||
"date": converter.formatDate(new Date(item.DataUtworzenia * 1000)),
|
||||
"teacher": teacher.Imie + " " + teacher.Nazwisko
|
||||
};
|
||||
});
|
||||
viewPath = "opiekun/oceny-szczegolowy";
|
||||
} else {
|
||||
viewPath = "opiekun/oceny-skrocony";
|
||||
data = {
|
||||
normalGrades: subjects.map(item => {
|
||||
return {
|
||||
"subject": item.Nazwa,
|
||||
"average": dictMap.getByValue(summary.SrednieOcen, "IdPrzedmiot", item.Id).SredniaOcen,
|
||||
"predictedRating": dictMap.getByValue(summary.OcenyPrzewidywane, "IdPrzedmiot", item.Id).Wpis,
|
||||
"finalRating": dictMap.getByValue(summary.OcenyPrzewidywane, "IdPrzedmiot", item.Id).Wpis
|
||||
};
|
||||
}),
|
||||
descriptiveGrades,
|
||||
};
|
||||
}
|
||||
|
||||
res.render(viewPath, {
|
||||
title: "Witryna ucznia i rodzica – Oceny",
|
||||
data: data
|
||||
});
|
||||
});
|
||||
|
||||
router.get("/Statystyki.mvc/Uczen", (req, res) => {
|
||||
let data;
|
||||
let viewPath;
|
||||
|
||||
if (req.query.rodzajWidoku === '1') {
|
||||
viewPath = "opiekun/oceny-statystyki-czastkowe";
|
||||
data = require("../../data/opiekun/oceny-statystyki-czastkowe").map(item => {
|
||||
return {
|
||||
subject: item.subject,
|
||||
grade: item.grade,
|
||||
pupilAmount: item.pupilAmount,
|
||||
pupilPercent: item.pupilAmount !== 0 ? 25.000003 : 0,
|
||||
classAmount: item.classAmount,
|
||||
classPercent: item.classAmount !== 0 ? 25.000003 : 0
|
||||
};
|
||||
});
|
||||
} else {
|
||||
viewPath = "opiekun/oceny-statystyki-roczne";
|
||||
data = require("../../data/opiekun/oceny-statystyki-roczne").map(item => {
|
||||
return {
|
||||
subject: item.subject,
|
||||
grade: item.grade,
|
||||
amount: item.amount,
|
||||
percent: item.amount !== 0 ? 25.000003 : 0
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
res.render(viewPath, {
|
||||
title: "Witryna ucznia i rodzica – Statystyki ucznia",
|
||||
data: data
|
||||
});
|
||||
});
|
||||
res.render(viewPath, {
|
||||
title: 'Witryna ucznia i rodzica – Statystyki ucznia',
|
||||
data: data,
|
||||
})
|
||||
})
|
||||
|
||||
router.get('/Frekwencja.mvc', (req, res) => {
|
||||
const sumStats = require("../../data/opiekun/frekwencja-statystyki").reduce((prev, current) => {
|
||||
const sumStats = require('../../data/opiekun/frekwencja-statystyki').reduce((prev, current) => {
|
||||
return {
|
||||
presence: prev.presence + current.presence,
|
||||
absence: prev.absence + current.absence,
|
||||
absenceExcused: prev.absenceExcused + current.absenceExcused,
|
||||
absenceForSchoolReasons: prev.absenceForSchoolReasons + current.absenceForSchoolReasons,
|
||||
lateness: prev.lateness + current.lateness,
|
||||
latenessExcused: prev.latenessExcused + current.latenessExcused,
|
||||
exemption: prev.exemption + current.exemption,
|
||||
}
|
||||
})
|
||||
res.render('opiekun/frekwencja', {
|
||||
title: 'Witryna ucznia i rodzica – Frekwencja',
|
||||
subjects: require('../../data/api/dictionaries/Przedmioty'),
|
||||
data: _.groupBy(
|
||||
require('../../data/api/student/Frekwencje').map((item) => {
|
||||
const category = dictMap.getByValue(
|
||||
require('../../data/api/dictionaries/KategorieFrekwencji'),
|
||||
'Id',
|
||||
item.IdKategoria
|
||||
)
|
||||
return {
|
||||
presence: prev.presence + current.presence,
|
||||
absence: prev.absence + current.absence,
|
||||
absenceExcused: prev.absenceExcused + current.absenceExcused,
|
||||
absenceForSchoolReasons: prev.absenceForSchoolReasons + current.absenceForSchoolReasons,
|
||||
lateness: prev.lateness + current.lateness,
|
||||
latenessExcused: prev.latenessExcused + current.latenessExcused,
|
||||
exemption: prev.exemption + current.exemption
|
||||
};
|
||||
});
|
||||
res.render("opiekun/frekwencja", {
|
||||
title: "Witryna ucznia i rodzica – Frekwencja",
|
||||
subjects: require("../../data/api/dictionaries/Przedmioty"),
|
||||
data: _.groupBy(require("../../data/api/student/Frekwencje").map(item => {
|
||||
const category = dictMap.getByValue(require("../../data/api/dictionaries/KategorieFrekwencji"), "Id", item.IdKategoria);
|
||||
return {
|
||||
number: item.Numer,
|
||||
subject: item.PrzedmiotNazwa,
|
||||
date: converter.formatDate(new Date(item.DzienTekst)),
|
||||
presence: category.Obecnosc,
|
||||
absence: category.Nieobecnosc,
|
||||
exemption: category.Zwolnienie,
|
||||
lateness: category.Spoznienie,
|
||||
excused: category.Usprawiedliwione,
|
||||
deleted: category.Usuniete,
|
||||
attendanceInfo: _.capitalize(category.Nazwa)
|
||||
};
|
||||
}), "number"),
|
||||
stats: require("../../data/opiekun/frekwencja-statystyki"),
|
||||
sumStats: sumStats,
|
||||
fullPresence: (
|
||||
(sumStats.presence + sumStats.lateness + sumStats.latenessExcused) /
|
||||
(sumStats.presence +
|
||||
sumStats.absence +
|
||||
sumStats.absenceExcused +
|
||||
sumStats.absenceForSchoolReasons +
|
||||
sumStats.lateness +
|
||||
sumStats.latenessExcused)
|
||||
) * 100,
|
||||
weekDays: converter.getWeekDaysFrom(req.query.data),
|
||||
tics: {
|
||||
prev: converter.getPrevWeekTick(req.query.data),
|
||||
next: converter.getNextWeekTick(req.query.data)
|
||||
number: item.Numer,
|
||||
subject: item.PrzedmiotNazwa,
|
||||
date: converter.formatDate(new Date(item.DzienTekst)),
|
||||
presence: category.Obecnosc,
|
||||
absence: category.Nieobecnosc,
|
||||
exemption: category.Zwolnienie,
|
||||
lateness: category.Spoznienie,
|
||||
excused: category.Usprawiedliwione,
|
||||
deleted: category.Usuniete,
|
||||
attendanceInfo: _.capitalize(category.Nazwa),
|
||||
}
|
||||
});
|
||||
});
|
||||
}),
|
||||
'number'
|
||||
),
|
||||
stats: require('../../data/opiekun/frekwencja-statystyki'),
|
||||
sumStats: sumStats,
|
||||
fullPresence:
|
||||
((sumStats.presence + sumStats.lateness + sumStats.latenessExcused) /
|
||||
(sumStats.presence +
|
||||
sumStats.absence +
|
||||
sumStats.absenceExcused +
|
||||
sumStats.absenceForSchoolReasons +
|
||||
sumStats.lateness +
|
||||
sumStats.latenessExcused)) *
|
||||
100,
|
||||
weekDays: converter.getWeekDaysFrom(req.query.data),
|
||||
tics: {
|
||||
prev: converter.getPrevWeekTick(req.query.data),
|
||||
next: converter.getNextWeekTick(req.query.data),
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
router.get("/UwagiOsiagniecia.mvc/Wszystkie", (req, res) => {
|
||||
const teachers = require("../../data/api/dictionaries/Nauczyciele");
|
||||
const categories = require("../../data/api/dictionaries/KategorieUwag");
|
||||
router.get('/UwagiOsiagniecia.mvc/Wszystkie', (req, res) => {
|
||||
const teachers = require('../../data/api/dictionaries/Nauczyciele')
|
||||
const categories = require('../../data/api/dictionaries/KategorieUwag')
|
||||
|
||||
res.render("opiekun/uwagi", {
|
||||
title: "Witryna ucznia i rodzica – Uwagi i osiągnięcia",
|
||||
notes: require("../../data/api/student/UwagiUcznia").map(item => {
|
||||
return {
|
||||
date: converter.formatDate(new Date(item.DataWpisuTekst)),
|
||||
teacher: `${item.PracownikImie} ${item.PracownikNazwisko} [${dictMap.getByValue(teachers, "Id", item.IdPracownik).Kod}]`,
|
||||
category: dictMap.getByValue(categories, "Id", item.IdKategoriaUwag).Nazwa,
|
||||
content: item.TrescUwagi
|
||||
};
|
||||
})
|
||||
});
|
||||
});
|
||||
res.render('opiekun/uwagi', {
|
||||
title: 'Witryna ucznia i rodzica – Uwagi i osiągnięcia',
|
||||
notes: require('../../data/api/student/UwagiUcznia').map((item) => {
|
||||
return {
|
||||
date: converter.formatDate(new Date(item.DataWpisuTekst)),
|
||||
teacher: `${item.PracownikImie} ${item.PracownikNazwisko} [${dictMap.getByValue(teachers, 'Id', item.IdPracownik).Kod}]`,
|
||||
category: dictMap.getByValue(categories, 'Id', item.IdKategoriaUwag).Nazwa,
|
||||
content: item.TrescUwagi,
|
||||
}
|
||||
}),
|
||||
})
|
||||
})
|
||||
|
||||
router.get("/Lekcja(\.mvc|)/PlanZajec", (req, res) => {
|
||||
const teachers = require("../../data/api/dictionaries/Nauczyciele");
|
||||
const days = _.groupBy(require("../../data/api/student/PlanLekcjiZeZmianami").filter((item) => item.PlanUcznia).map(item => {
|
||||
const teacher = dictMap.getByValue(teachers, "Id", item.IdPracownik);
|
||||
const oldTeacher = dictMap.getByValue(teachers, "Id", item.IdPracownikOld);
|
||||
const times = dictMap.getByValue(require("../../data/api/dictionaries/PoryLekcji"), "Id", item.IdPoraLekcji);
|
||||
router.get('/Lekcja(.mvc|)/PlanZajec', (req, res) => {
|
||||
const teachers = require('../../data/api/dictionaries/Nauczyciele')
|
||||
const days = _.groupBy(
|
||||
require('../../data/api/student/PlanLekcjiZeZmianami')
|
||||
.filter((item) => item.PlanUcznia)
|
||||
.map((item) => {
|
||||
const teacher = dictMap.getByValue(teachers, 'Id', item.IdPracownik)
|
||||
const oldTeacher = dictMap.getByValue(teachers, 'Id', item.IdPracownikOld)
|
||||
const times = dictMap.getByValue(require('../../data/api/dictionaries/PoryLekcji'), 'Id', item.IdPoraLekcji)
|
||||
return {
|
||||
number: item.NumerLekcji,
|
||||
id: item.IdPoraLekcji,
|
||||
gap: false,
|
||||
start: times.PoczatekTekst,
|
||||
end: times.KoniecTekst,
|
||||
subject: item.PrzedmiotNazwa,
|
||||
group: item.PodzialSkrot,
|
||||
teacher: `${teacher.Imie} ${teacher.Nazwisko}`,
|
||||
oldTeacher: !_.isEmpty(oldTeacher) ? `${oldTeacher.Imie} ${oldTeacher.Nazwisko}` : false,
|
||||
room: item.Sala,
|
||||
info: item.AdnotacjaOZmianie,
|
||||
changes: item.PogrubionaNazwa,
|
||||
canceled: item.PrzekreslonaNazwa,
|
||||
date: converter.formatDate(new Date(item.DzienTekst)),
|
||||
};
|
||||
}), "date");
|
||||
|
||||
const firstLesson = _.min(_.flatten(_.values(days)).map(e => e.number));
|
||||
const lastLesson = _.max(_.flatten(_.values(days)).map(e => e.number));
|
||||
|
||||
const daysWithGaps = _.mapValues(days, day => {
|
||||
const dayWithGaps = [];
|
||||
let prevNumber = null;
|
||||
|
||||
const beforeGap = day[0].number - firstLesson;
|
||||
|
||||
for (i = 0; i < beforeGap; i++) {
|
||||
const number = firstLesson + i;
|
||||
const times = dictMap.getByValue(require("../../data/api/dictionaries/PoryLekcji"), "Numer", number);
|
||||
dayWithGaps.push({
|
||||
number,
|
||||
gap: true,
|
||||
start: times.PoczatekTekst,
|
||||
end: times.KoniecTekst,
|
||||
});
|
||||
number: item.NumerLekcji,
|
||||
id: item.IdPoraLekcji,
|
||||
gap: false,
|
||||
start: times.PoczatekTekst,
|
||||
end: times.KoniecTekst,
|
||||
subject: item.PrzedmiotNazwa,
|
||||
group: item.PodzialSkrot,
|
||||
teacher: `${teacher.Imie} ${teacher.Nazwisko}`,
|
||||
oldTeacher: !_.isEmpty(oldTeacher) ? `${oldTeacher.Imie} ${oldTeacher.Nazwisko}` : false,
|
||||
room: item.Sala,
|
||||
info: item.AdnotacjaOZmianie,
|
||||
changes: item.PogrubionaNazwa,
|
||||
canceled: item.PrzekreslonaNazwa,
|
||||
date: converter.formatDate(new Date(item.DzienTekst)),
|
||||
}
|
||||
}),
|
||||
'date'
|
||||
)
|
||||
|
||||
day.forEach(lesson => {
|
||||
let gap = 0;
|
||||
if (prevNumber !== null) {
|
||||
gap = lesson.number - prevNumber - 1;
|
||||
}
|
||||
const firstLesson = _.min(_.flatten(_.values(days)).map((e) => e.number))
|
||||
const lastLesson = _.max(_.flatten(_.values(days)).map((e) => e.number))
|
||||
|
||||
for (i = 0; i < gap; i++) {
|
||||
const number = prevNumber + i + 1;
|
||||
const times = dictMap.getByValue(require("../../data/api/dictionaries/PoryLekcji"), "Numer", number);
|
||||
dayWithGaps.push({
|
||||
number,
|
||||
gap: true,
|
||||
start: times.PoczatekTekst,
|
||||
end: times.KoniecTekst,
|
||||
});
|
||||
}
|
||||
const daysWithGaps = _.mapValues(days, (day) => {
|
||||
const dayWithGaps = []
|
||||
let prevNumber = null
|
||||
|
||||
prevNumber = lesson.number;
|
||||
const beforeGap = day[0].number - firstLesson
|
||||
|
||||
dayWithGaps.push(lesson);
|
||||
});
|
||||
for (i = 0; i < beforeGap; i++) {
|
||||
const number = firstLesson + i
|
||||
const times = dictMap.getByValue(require('../../data/api/dictionaries/PoryLekcji'), 'Numer', number)
|
||||
dayWithGaps.push({
|
||||
number,
|
||||
gap: true,
|
||||
start: times.PoczatekTekst,
|
||||
end: times.KoniecTekst,
|
||||
})
|
||||
}
|
||||
|
||||
const afterGap = lastLesson - prevNumber;
|
||||
day.forEach((lesson) => {
|
||||
let gap = 0
|
||||
if (prevNumber !== null) {
|
||||
gap = lesson.number - prevNumber - 1
|
||||
}
|
||||
|
||||
for (i = 0; i < afterGap; i++) {
|
||||
const number = prevNumber + i + 1;
|
||||
const times = dictMap.getByValue(require("../../data/api/dictionaries/PoryLekcji"), "Numer", number);
|
||||
dayWithGaps.push({
|
||||
number,
|
||||
gap: true,
|
||||
start: times.PoczatekTekst,
|
||||
end: times.KoniecTekst,
|
||||
});
|
||||
}
|
||||
|
||||
return dayWithGaps;
|
||||
});
|
||||
|
||||
const data = _.groupBy(_.flatten(_.values(daysWithGaps)), "number");
|
||||
|
||||
res.render("opiekun/plan-zajec", {
|
||||
title: "Witryna ucznia i rodzica – Plan lekcji",
|
||||
data,
|
||||
weekDays: converter.getWeekDaysFrom(req.query.data),
|
||||
tics: {
|
||||
prev: converter.getPrevWeekTick(req.query.data),
|
||||
next: converter.getNextWeekTick(req.query.data)
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
router.get("/Lekcja(\.mvc|)/Zrealizowane", (req, res) => {
|
||||
res.render("opiekun/plan-zrealizowane", {
|
||||
title: "Witryna ucznia i rodzica – Plan lekcji",
|
||||
subjects: require("../../data/api/dictionaries/Przedmioty"),
|
||||
data: _.groupBy(require("../../data/opiekun/plan-zrealizowane.json").map(item => {
|
||||
return {
|
||||
// jshint ignore:start
|
||||
...item,
|
||||
// jshint ignore:end
|
||||
date: converter.formatDate(new Date(item.date))
|
||||
};
|
||||
}), "date")
|
||||
});
|
||||
});
|
||||
|
||||
router.get("/Sprawdziany.mvc/Terminarz", (req, res) => {
|
||||
const subjects = require("../../data/api/dictionaries/Przedmioty");
|
||||
const teachers = require("../../data/api/dictionaries/Nauczyciele");
|
||||
const days = converter.getWeekDaysFrom(req.query.data);
|
||||
res.render("opiekun/sprawdziany", {
|
||||
title: "Witryna ucznia i rodzica – Terminarz sprawdzianów",
|
||||
data: _.groupBy(require("../../data/api/student/Sprawdziany").map((item, index) => {
|
||||
const subject = dictMap.getByValue(subjects, "Id", item.IdPrzedmiot);
|
||||
const teacher = dictMap.getByValue(teachers, "Id", item.IdPracownik);
|
||||
let examType;
|
||||
switch (item.RodzajNumer) {
|
||||
case 1: examType = "Sprawdzian"; break;
|
||||
case 2: examType = "Kartkówka"; break;
|
||||
case 3: examType = "Praca klasowa"; break;
|
||||
default: examType = "Nieznany";
|
||||
}
|
||||
return {
|
||||
entryDate: "01.01.1970",
|
||||
date: days[index][1],
|
||||
// date: converter.formatDate(new Date(item.DataTekst)),
|
||||
// dayName: converter.getDayName(item.DataTekst),
|
||||
dayName: days[index][0],
|
||||
subject: `${subject.Nazwa} ${res.locals.userInfo.OddzialKod}${item.PodzialSkrot ? "|" + item.PodzialSkrot : ""}`,
|
||||
type: examType,
|
||||
description: item.Opis,
|
||||
teacher: `${teacher.Imie} ${teacher.Nazwisko}`,
|
||||
teacherSymbol: teacher.Kod
|
||||
};
|
||||
}), "date"),
|
||||
weekDays: converter.getWeekDaysFrom(req.query.data),
|
||||
tics: {
|
||||
prev: converter.getPrevWeekTick(req.query.data),
|
||||
next: converter.getNextWeekTick(req.query.data)
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
router.get("/ZadaniaDomowe.mvc", (req, res) => {
|
||||
const subjects = require("../../data/api/dictionaries/Przedmioty");
|
||||
res.render("opiekun/zadania", {
|
||||
title: "Witryna ucznia i rodzica – Zadania domowe",
|
||||
homework: require("../../data/api/student/ZadaniaDomowe").map(item => {
|
||||
const teacher = dictMap.getByValue(require("../../data/api/dictionaries/Nauczyciele"), "Id", item.IdPracownik);
|
||||
const date = converter.getDateString(req.query.data);
|
||||
return {
|
||||
date: converter.formatDate(date),
|
||||
dayName: converter.getDayName(date),
|
||||
entryDate: converter.formatDate(new Date(item.DataTekst)),
|
||||
teacher: teacher.Imie + " " + teacher.Nazwisko,
|
||||
teacherSymbol: teacher.Kod,
|
||||
subject: dictMap.getByValue(subjects, "Id", item.IdPrzedmiot).Nazwa,
|
||||
content: item.Opis
|
||||
};
|
||||
}),
|
||||
tics: {
|
||||
prev: converter.getPrevDayTick(req.query.data),
|
||||
next: converter.getNextDayTick(req.query.data)
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
router.get("/Szkola.mvc/Nauczyciele", (req, res) => {
|
||||
const teachers = require("../../data/api/student/Nauczyciele");
|
||||
const subjectsDict = require("../../data/api/dictionaries/Przedmioty");
|
||||
const teachersDict = require("../../data/api/dictionaries/Pracownicy");
|
||||
|
||||
const headmaster = dictMap.getByValue(teachersDict, "Id", teachers.NauczycieleSzkola[0].IdPracownik);
|
||||
const tutor = dictMap.getByValue(teachersDict, "Id", teachers.NauczycieleSzkola[3].IdPracownik);
|
||||
res.render("opiekun/szkola", {
|
||||
title: "Witryna ucznia i rodzica – Szkoła i nauczyciele",
|
||||
headMaster: `${headmaster.Imie} ${headmaster.Nazwisko}`,
|
||||
tutor: `${tutor.Imie} ${tutor.Nazwisko}`,
|
||||
teachers: teachers.NauczycielePrzedmioty.map(item => {
|
||||
const teacher = dictMap.getByValue(teachersDict, "Id", item.IdPracownik);
|
||||
return {
|
||||
subject: dictMap.getByValue(subjectsDict, "Id", item.IdPrzedmiot).Nazwa,
|
||||
name: `${teacher.Imie} ${teacher.Nazwisko} [${teacher.Kod}]`
|
||||
};
|
||||
for (i = 0; i < gap; i++) {
|
||||
const number = prevNumber + i + 1
|
||||
const times = dictMap.getByValue(require('../../data/api/dictionaries/PoryLekcji'), 'Numer', number)
|
||||
dayWithGaps.push({
|
||||
number,
|
||||
gap: true,
|
||||
start: times.PoczatekTekst,
|
||||
end: times.KoniecTekst,
|
||||
})
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
router.get("/DostepMobilny.mvc", (req, res) => {
|
||||
res.render('opiekun/mobilny', {
|
||||
title: "Witryna ucznia i rodzica – Dostęp mobilny",
|
||||
devices: require("../../data/opiekun/zarejestrowane-urzadzenia").map(item => {
|
||||
const created = item.DataUtworzenia.split(" ");
|
||||
return {
|
||||
// jshint ignore:start
|
||||
...item,
|
||||
// jshint ignore:end
|
||||
"DataUtworzenia": `${converter.formatDate(new Date(created[0]))} godz: ${created[1]}`
|
||||
};
|
||||
})
|
||||
});
|
||||
});
|
||||
prevNumber = lesson.number
|
||||
|
||||
dayWithGaps.push(lesson)
|
||||
})
|
||||
|
||||
const afterGap = lastLesson - prevNumber
|
||||
|
||||
for (i = 0; i < afterGap; i++) {
|
||||
const number = prevNumber + i + 1
|
||||
const times = dictMap.getByValue(require('../../data/api/dictionaries/PoryLekcji'), 'Numer', number)
|
||||
dayWithGaps.push({
|
||||
number,
|
||||
gap: true,
|
||||
start: times.PoczatekTekst,
|
||||
end: times.KoniecTekst,
|
||||
})
|
||||
}
|
||||
|
||||
return dayWithGaps
|
||||
})
|
||||
|
||||
const data = _.groupBy(_.flatten(_.values(daysWithGaps)), 'number')
|
||||
|
||||
res.render('opiekun/plan-zajec', {
|
||||
title: 'Witryna ucznia i rodzica – Plan lekcji',
|
||||
data,
|
||||
weekDays: converter.getWeekDaysFrom(req.query.data),
|
||||
tics: {
|
||||
prev: converter.getPrevWeekTick(req.query.data),
|
||||
next: converter.getNextWeekTick(req.query.data),
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
router.get('/Lekcja(.mvc|)/Zrealizowane', (req, res) => {
|
||||
res.render('opiekun/plan-zrealizowane', {
|
||||
title: 'Witryna ucznia i rodzica – Plan lekcji',
|
||||
subjects: require('../../data/api/dictionaries/Przedmioty'),
|
||||
data: _.groupBy(
|
||||
require('../../data/opiekun/plan-zrealizowane.json').map((item) => {
|
||||
return {
|
||||
// jshint ignore:start
|
||||
...item,
|
||||
// jshint ignore:end
|
||||
date: converter.formatDate(new Date(item.date)),
|
||||
}
|
||||
}),
|
||||
'date'
|
||||
),
|
||||
})
|
||||
})
|
||||
|
||||
router.get('/Sprawdziany.mvc/Terminarz', (req, res) => {
|
||||
const subjects = require('../../data/api/dictionaries/Przedmioty')
|
||||
const teachers = require('../../data/api/dictionaries/Nauczyciele')
|
||||
const days = converter.getWeekDaysFrom(req.query.data)
|
||||
res.render('opiekun/sprawdziany', {
|
||||
title: 'Witryna ucznia i rodzica – Terminarz sprawdzianów',
|
||||
data: _.groupBy(
|
||||
require('../../data/api/student/Sprawdziany').map((item, index) => {
|
||||
const subject = dictMap.getByValue(subjects, 'Id', item.IdPrzedmiot)
|
||||
const teacher = dictMap.getByValue(teachers, 'Id', item.IdPracownik)
|
||||
let examType
|
||||
switch (item.RodzajNumer) {
|
||||
case 1:
|
||||
examType = 'Sprawdzian'
|
||||
break
|
||||
case 2:
|
||||
examType = 'Kartkówka'
|
||||
break
|
||||
case 3:
|
||||
examType = 'Praca klasowa'
|
||||
break
|
||||
default:
|
||||
examType = 'Nieznany'
|
||||
}
|
||||
return {
|
||||
entryDate: '01.01.1970',
|
||||
date: days[index][1],
|
||||
// date: converter.formatDate(new Date(item.DataTekst)),
|
||||
// dayName: converter.getDayName(item.DataTekst),
|
||||
dayName: days[index][0],
|
||||
subject: `${subject.Nazwa} ${res.locals.userInfo.OddzialKod}${item.PodzialSkrot ? '|' + item.PodzialSkrot : ''}`,
|
||||
type: examType,
|
||||
description: item.Opis,
|
||||
teacher: `${teacher.Imie} ${teacher.Nazwisko}`,
|
||||
teacherSymbol: teacher.Kod,
|
||||
}
|
||||
}),
|
||||
'date'
|
||||
),
|
||||
weekDays: converter.getWeekDaysFrom(req.query.data),
|
||||
tics: {
|
||||
prev: converter.getPrevWeekTick(req.query.data),
|
||||
next: converter.getNextWeekTick(req.query.data),
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
router.get('/ZadaniaDomowe.mvc', (req, res) => {
|
||||
const subjects = require('../../data/api/dictionaries/Przedmioty')
|
||||
res.render('opiekun/zadania', {
|
||||
title: 'Witryna ucznia i rodzica – Zadania domowe',
|
||||
homework: require('../../data/api/student/ZadaniaDomowe').map((item) => {
|
||||
const teacher = dictMap.getByValue(require('../../data/api/dictionaries/Nauczyciele'), 'Id', item.IdPracownik)
|
||||
const date = converter.getDateString(req.query.data)
|
||||
return {
|
||||
date: converter.formatDate(date),
|
||||
dayName: converter.getDayName(date),
|
||||
entryDate: converter.formatDate(new Date(item.DataTekst)),
|
||||
teacher: teacher.Imie + ' ' + teacher.Nazwisko,
|
||||
teacherSymbol: teacher.Kod,
|
||||
subject: dictMap.getByValue(subjects, 'Id', item.IdPrzedmiot).Nazwa,
|
||||
content: item.Opis,
|
||||
}
|
||||
}),
|
||||
tics: {
|
||||
prev: converter.getPrevDayTick(req.query.data),
|
||||
next: converter.getNextDayTick(req.query.data),
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
router.get('/Szkola.mvc/Nauczyciele', (req, res) => {
|
||||
const teachers = require('../../data/api/student/Nauczyciele')
|
||||
const subjectsDict = require('../../data/api/dictionaries/Przedmioty')
|
||||
const teachersDict = require('../../data/api/dictionaries/Pracownicy')
|
||||
|
||||
const headmaster = dictMap.getByValue(teachersDict, 'Id', teachers.NauczycieleSzkola[0].IdPracownik)
|
||||
const tutor = dictMap.getByValue(teachersDict, 'Id', teachers.NauczycieleSzkola[3].IdPracownik)
|
||||
res.render('opiekun/szkola', {
|
||||
title: 'Witryna ucznia i rodzica – Szkoła i nauczyciele',
|
||||
headMaster: `${headmaster.Imie} ${headmaster.Nazwisko}`,
|
||||
tutor: `${tutor.Imie} ${tutor.Nazwisko}`,
|
||||
teachers: teachers.NauczycielePrzedmioty.map((item) => {
|
||||
const teacher = dictMap.getByValue(teachersDict, 'Id', item.IdPracownik)
|
||||
return {
|
||||
subject: dictMap.getByValue(subjectsDict, 'Id', item.IdPrzedmiot).Nazwa,
|
||||
name: `${teacher.Imie} ${teacher.Nazwisko} [${teacher.Kod}]`,
|
||||
}
|
||||
}),
|
||||
})
|
||||
})
|
||||
|
||||
router.get('/DostepMobilny.mvc', (req, res) => {
|
||||
res.render('opiekun/mobilny', {
|
||||
title: 'Witryna ucznia i rodzica – Dostęp mobilny',
|
||||
devices: require('../../data/opiekun/zarejestrowane-urzadzenia').map((item) => {
|
||||
const created = item.DataUtworzenia.split(' ')
|
||||
return {
|
||||
// jshint ignore:start
|
||||
...item,
|
||||
// jshint ignore:end
|
||||
DataUtworzenia: `${converter.formatDate(new Date(created[0]))} godz: ${created[1]}`,
|
||||
}
|
||||
}),
|
||||
})
|
||||
})
|
||||
|
||||
router.get('/DostepMobilny.mvc/Rejestruj', (req, res) => {
|
||||
res.render('opiekun/mobilny-rejestruj');
|
||||
});
|
||||
res.render('opiekun/mobilny-rejestruj')
|
||||
})
|
||||
|
||||
router.all('/DostepMobilny.mvc/PingForCertGeneratedToken', (req, res) => {
|
||||
res.json({
|
||||
success: true,
|
||||
data: req.body.idToken % 2 === 0
|
||||
});
|
||||
});
|
||||
res.json({
|
||||
success: true,
|
||||
data: req.body.idToken % 2 === 0,
|
||||
})
|
||||
})
|
||||
|
||||
router.get('/DostepMobilny.mvc/Wyrejestruj/:id', (req, res) => {
|
||||
res.render('opiekun/mobilny-wyrejestruj');
|
||||
});
|
||||
res.render('opiekun/mobilny-wyrejestruj')
|
||||
})
|
||||
|
||||
router.post("/DostepMobilny.mvc/PotwierdzWyrejestrowanie", (req, res) => {
|
||||
res.redirect("/DostepMobilny.mvc");
|
||||
});
|
||||
router.post('/DostepMobilny.mvc/PotwierdzWyrejestrowanie', (req, res) => {
|
||||
res.redirect('/DostepMobilny.mvc')
|
||||
})
|
||||
|
||||
module.exports = router;
|
||||
module.exports = router
|
||||
|
|
File diff suppressed because it is too large
Load diff
152
src/routes/uonetplus-uczenplus.js
Normal file
152
src/routes/uonetplus-uczenplus.js
Normal file
|
@ -0,0 +1,152 @@
|
|||
const { Router } = require('express')
|
||||
const protocol = require('../utils/connection')
|
||||
|
||||
const router = Router()
|
||||
|
||||
router.get('/', (req, res) => {
|
||||
const base = protocol(req) + '://' + req.get('host') + '/powiatwulkanowy/123456'
|
||||
res.json({
|
||||
loginEndpoint: base + '/LoginEndpoint.aspx',
|
||||
app: base + '/App',
|
||||
api: [
|
||||
base + '/api/Context',
|
||||
base + '/api/Cache',
|
||||
base + '/api/OkresyKlasyfikacyjne',
|
||||
base + '/api/Zebrania',
|
||||
base + '/api/SprawdzianyZadaniaDomowe',
|
||||
base + '/api/SprawdzianSzczegoly',
|
||||
base + '/api/ZadanieDomoweSzczegoly',
|
||||
base + '/api/Uwagi',
|
||||
base + '/api/Frekwencja',
|
||||
base + '/api/Oceny',
|
||||
base + '/api/Nauczyciele',
|
||||
base + '/api/Informacje',
|
||||
base + '/api/NieprzeczytaneWiadomosci',
|
||||
base + '/api/DostepOffice',
|
||||
base + '/api/ZarejestrowaneUrzadzenia',
|
||||
base + '/api/PodrecznikiLataSzkolne',
|
||||
base + '/api/SzczesliwyNumerTablica',
|
||||
base + '/api/WazneDzisiajTablica',
|
||||
base + '/api/WychowawcyTablica',
|
||||
base + '/api/RealizacjaZajec',
|
||||
base + '/api/PlanZajec',
|
||||
base + '/api/DniWolne',
|
||||
].sort(),
|
||||
})
|
||||
})
|
||||
|
||||
router.all('/LoginEndpoint.aspx', (req, res) => {
|
||||
res.redirect(protocol(req) + '://' + req.get('host') + '/powiatwulkanowy/123456/App')
|
||||
})
|
||||
|
||||
router.all('/App', (_req, res) => {
|
||||
res.render('uczenplus/app')
|
||||
})
|
||||
|
||||
router.all('/api/Context', (_req, res) => {
|
||||
res.json(require('../../data/uonetplus-uczenplus/Context.json'))
|
||||
})
|
||||
|
||||
router.all('/api/Cache', (_req, res) => {
|
||||
res.json(require('../../data/uonetplus-uczenplus/Cache.json'))
|
||||
})
|
||||
|
||||
router.all('/api/OkresyKlasyfikacyjne', (_req, res) => {
|
||||
res.json(require('../../data/uonetplus-uczenplus/OkresyKlasyfikacyjne.json'))
|
||||
})
|
||||
|
||||
router.all('/api/Zebrania', (_req, res) => {
|
||||
res.json(require('../../data/uonetplus-uczenplus/Zebrania.json'))
|
||||
})
|
||||
|
||||
router.all('/api/SprawdzianyZadaniaDomowe', (_req, res) => {
|
||||
res.json(
|
||||
require('../../data/uonetplus-uczenplus/SprawdzianyZadaniaDomowe.json').map((event) => {
|
||||
event.data = new Date().toISOString()
|
||||
return event
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
router.all('/api/SprawdzianSzczegoly', (_req, res) => {
|
||||
const data = require('../../data/uonetplus-uczenplus/SprawdzianSzczegoly.json')
|
||||
data.data = new Date().toISOString()
|
||||
res.json(data)
|
||||
})
|
||||
|
||||
router.all('/api/ZadanieDomoweSzczegoly', (_req, res) => {
|
||||
const data = require('../../data/uonetplus-uczenplus/ZadanieDomoweSzczegoly.json')
|
||||
data.data = new Date().toISOString()
|
||||
res.json(data)
|
||||
})
|
||||
|
||||
router.all('/api/Oceny', (_req, res) => {
|
||||
res.json(require('../../data/uonetplus-uczenplus/Oceny.json'))
|
||||
})
|
||||
|
||||
router.all('/api/Frekwencja', (_req, res) => {
|
||||
res.json(require('../../data/uonetplus-uczenplus/Frekwencja.json'))
|
||||
})
|
||||
|
||||
router.all('/api/Uwagi', (_req, res) => {
|
||||
res.json(require('../../data/uonetplus-uczenplus/Uwagi.json'))
|
||||
})
|
||||
|
||||
router.all('/api/Nauczyciele', (_req, res) => {
|
||||
res.json(require('../../data/uonetplus-uczenplus/Nauczyciele.json'))
|
||||
})
|
||||
|
||||
router.all('/api/Informacje', (_req, res) => {
|
||||
res.json(require('../../data/uonetplus-uczenplus/Informacje.json'))
|
||||
})
|
||||
|
||||
router.all('/api/WiadomosciNieodczytane', (_req, res) => {
|
||||
res.json({ liczbaNieodczytanychWiadomosci: 2 })
|
||||
})
|
||||
|
||||
router.all('/api/DostepOffice', (_req, res) => {
|
||||
res.json(require('../../data/uonetplus-uczenplus/DostepOffice.json'))
|
||||
})
|
||||
|
||||
router.all('/api/ZarejestrowaneUrzadzenia', (_req, res) => {
|
||||
res.json(require('../../data/uonetplus-uczenplus/ZarejestrowaneUrzadzenia.json'))
|
||||
})
|
||||
|
||||
router.all('/api/PodrecznikiLataSzkolne', (_req, res) => {
|
||||
res.json(require('../../data/uonetplus-uczenplus/PodrecznikiLataSzkolne.json'))
|
||||
})
|
||||
|
||||
router.all('/api/SzczesliwyNumerTablica', (_req, res) => {
|
||||
res.json(require('../../data/uonetplus-uczenplus/SzczesliwyNumerTablica.json'))
|
||||
})
|
||||
|
||||
router.all('/api/WazneDzisiajTablica', (_req, res) => {
|
||||
res.json(require('../../data/uonetplus-uczenplus/WazneDzisiajTablica.json'))
|
||||
})
|
||||
|
||||
router.all('/api/WychowawcyTablica', (_req, res) => {
|
||||
res.json(require('../../data/uonetplus-uczenplus/WychowawcyTablica.json'))
|
||||
})
|
||||
|
||||
router.all('/api/RealizacjaZajec', (_req, res) => {
|
||||
res.json(
|
||||
require('../../data/uonetplus-uczenplus/RealizacjaZajec.json').map((lesson) => {
|
||||
lesson.data = new Date().toISOString()
|
||||
return lesson
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
router.all('/api/PlanZajec', (_req, res) => {
|
||||
res.json(require('../../data/uonetplus-uczenplus/PlanZajec.json'))
|
||||
})
|
||||
|
||||
router.all('/api/DniWolne', (_req, res) => {
|
||||
res.json(require('../../data/uonetplus-uczenplus/DniWolne.json'))
|
||||
})
|
||||
|
||||
router.all('/api/*', (_req, res) => {
|
||||
res.status(404).send({ message: 'Nie odnaleziono zasobu.' })
|
||||
})
|
||||
|
||||
module.exports = router
|
|
@ -1,319 +1,327 @@
|
|||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const protocol = require('../utils/connection');
|
||||
const converter = require('../utils/converter');
|
||||
const {getRandomInt} = require("../utils/api");
|
||||
const md5 = require('md5');
|
||||
const express = require('express')
|
||||
const router = express.Router()
|
||||
const protocol = require('../utils/connection')
|
||||
const converter = require('../utils/converter')
|
||||
const { getRandomInt } = require('../utils/api')
|
||||
const md5 = require('md5')
|
||||
|
||||
router.get("/", (req, res) => {
|
||||
res.render("messages");
|
||||
});
|
||||
router.get('/', (req, res) => {
|
||||
res.render('messages')
|
||||
})
|
||||
|
||||
router.get("/-endpoints", (req, res) => {
|
||||
const base = protocol(req) + "://" + req.get('host') + "/powiatwulkanowy";
|
||||
res.json({
|
||||
status: "sucess",
|
||||
data: {
|
||||
endpoints: [
|
||||
"/Wiadomosc.mvc/GetInboxMessages",
|
||||
"/Wiadomosc.mvc/GetOutboxMessages",
|
||||
"/Wiadomosc.mvc/GetTrashboxMessages",
|
||||
"/Adresaci.mvc/GetAddressee",
|
||||
"/Wiadomosc.mvc/GetAdresaciWiadomosci",
|
||||
"/Wiadomosc.mvc/GetMessageSenderRoles",
|
||||
"/Wiadomosc.mvc/GetInboxMessageDetails",
|
||||
"/Wiadomosc.mvc/GetOutboxMessageDetails",
|
||||
"/Wiadomosc.mvc/GetTrashboxMessageDetails",
|
||||
"/Wiadomosc.mvc/GetAdresaciNiePrzeczytaliWiadomosci",
|
||||
"/Wiadomosc.mvc/GetAdresaciPrzeczytaliWiadomosc",
|
||||
"/Wiadomosc.mvc/GetMessageAddressee",
|
||||
"/Wiadomosc.mvc/DeleteInboxMessages",
|
||||
"/Wiadomosc.mvc/DeleteOutboxMessages",
|
||||
"/Wiadomosc.mvc/DeleteTrashboxMessages",
|
||||
"/NowaWiadomosc.mvc/GetJednostkiUzytkownika",
|
||||
"/NowaWiadomosc.mvc/InsertWiadomosc"
|
||||
].map(item => {
|
||||
return base + item;
|
||||
})
|
||||
router.get('/-endpoints', (req, res) => {
|
||||
const base = protocol(req) + '://' + req.get('host') + '/powiatwulkanowy'
|
||||
res.json({
|
||||
status: 'sucess',
|
||||
data: {
|
||||
endpoints: [
|
||||
'/Wiadomosc.mvc/GetInboxMessages',
|
||||
'/Wiadomosc.mvc/GetOutboxMessages',
|
||||
'/Wiadomosc.mvc/GetTrashboxMessages',
|
||||
'/Adresaci.mvc/GetAddressee',
|
||||
'/Wiadomosc.mvc/GetAdresaciWiadomosci',
|
||||
'/Wiadomosc.mvc/GetMessageSenderRoles',
|
||||
'/Wiadomosc.mvc/GetInboxMessageDetails',
|
||||
'/Wiadomosc.mvc/GetOutboxMessageDetails',
|
||||
'/Wiadomosc.mvc/GetTrashboxMessageDetails',
|
||||
'/Wiadomosc.mvc/GetAdresaciNiePrzeczytaliWiadomosci',
|
||||
'/Wiadomosc.mvc/GetAdresaciPrzeczytaliWiadomosc',
|
||||
'/Wiadomosc.mvc/GetMessageAddressee',
|
||||
'/Wiadomosc.mvc/DeleteInboxMessages',
|
||||
'/Wiadomosc.mvc/DeleteOutboxMessages',
|
||||
'/Wiadomosc.mvc/DeleteTrashboxMessages',
|
||||
'/NowaWiadomosc.mvc/GetJednostkiUzytkownika',
|
||||
'/NowaWiadomosc.mvc/InsertWiadomosc',
|
||||
].map((item) => {
|
||||
return base + item
|
||||
}),
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
router.get('/Wiadomosc.mvc/GetInboxMessages', (req, res) => {
|
||||
res.json({
|
||||
success: true,
|
||||
data: require('../../data/api/messages/WiadomosciOdebrane').map((item) => {
|
||||
const recipientsNumber = getRandomInt(60, 100)
|
||||
const readBy = getRandomInt(20, 60)
|
||||
const unreadBy = recipientsNumber - readBy
|
||||
return {
|
||||
Id: item.WiadomoscId * 2,
|
||||
Nieprzeczytana: !item.GodzinaPrzeczytania,
|
||||
Nieprzeczytane: unreadBy,
|
||||
Przeczytane: readBy,
|
||||
Data: converter.formatDate(new Date(item.DataWyslaniaUnixEpoch * 1000), true) + ' 00:00:00',
|
||||
Tresc: null,
|
||||
Temat: item.Tytul,
|
||||
Nadawca: {
|
||||
Id: '' + item.NadawcaId,
|
||||
Name: item.Nadawca,
|
||||
IdLogin: item.NadawcaId,
|
||||
Unreaded: false,
|
||||
Date: null,
|
||||
Role: 2,
|
||||
PushMessage: false,
|
||||
UnitId: 0,
|
||||
Hash: 'abcdef=',
|
||||
},
|
||||
IdWiadomosci: item.WiadomoscId,
|
||||
HasZalaczniki: true,
|
||||
FolderWiadomosci: 1,
|
||||
Adresaci: [],
|
||||
}
|
||||
}),
|
||||
})
|
||||
})
|
||||
|
||||
router.get('/Wiadomosc.mvc/GetOutboxMessages', (req, res) => {
|
||||
res.json({
|
||||
success: true,
|
||||
data: require('../../data/api/messages/WiadomosciWyslane').map((item) => {
|
||||
return {
|
||||
Id: item.WiadomoscId * 2,
|
||||
Nieprzeczytana: !item.GodzinaPrzeczytania,
|
||||
Nieprzeczytane: parseInt(item.Nieprzeczytane, 10),
|
||||
Przeczytane: parseInt(item.Przeczytane, 10),
|
||||
Data: converter.formatDate(new Date(item.DataWyslaniaUnixEpoch * 1000), true) + ' 00:00:00',
|
||||
Tresc: null,
|
||||
Temat: item.Tytul,
|
||||
Nadawca: {
|
||||
Id: '' + item.NadawcaId,
|
||||
Name: item.Nadawca,
|
||||
IdLogin: item.NadawcaId,
|
||||
Unreaded: false,
|
||||
Date: null,
|
||||
Role: 2,
|
||||
PushMessage: false,
|
||||
UnitId: 0,
|
||||
Hash: 'abcdef=',
|
||||
},
|
||||
IdWiadomosci: item.WiadomoscId,
|
||||
HasZalaczniki: false,
|
||||
FolderWiadomosci: 2,
|
||||
Adresaci: [],
|
||||
}
|
||||
}),
|
||||
})
|
||||
})
|
||||
|
||||
router.get('/Wiadomosc.mvc/GetTrashboxMessages', (req, res) => {
|
||||
res.json({
|
||||
success: true,
|
||||
data: require('../../data/api/messages/WiadomosciUsuniete').map((item) => {
|
||||
return {
|
||||
Id: item.WiadomoscId * 2,
|
||||
Nieprzeczytana: !item.GodzinaPrzeczytania,
|
||||
Nieprzeczytane: parseInt(item.Nieprzeczytane, 10),
|
||||
Przeczytane: parseInt(item.Przeczytane, 10),
|
||||
Data: converter.formatDate(new Date(item.DataWyslaniaUnixEpoch * 1000), true) + ' 00:00:00',
|
||||
Tresc: null,
|
||||
Temat: item.Tytul,
|
||||
Nadawca: {
|
||||
Id: '' + item.NadawcaId,
|
||||
Name: item.Nadawca,
|
||||
IdLogin: item.NadawcaId,
|
||||
Unreaded: false,
|
||||
Date: null,
|
||||
Role: 2,
|
||||
PushMessage: false,
|
||||
UnitId: 0,
|
||||
Hash: 'abcdef=',
|
||||
},
|
||||
IdWiadomosci: item.WiadomoscId,
|
||||
HasZalaczniki: false,
|
||||
FolderWiadomosci: 3,
|
||||
Adresaci: [],
|
||||
}
|
||||
}),
|
||||
})
|
||||
})
|
||||
|
||||
router.get('/NowaWiadomosc.mvc/GetJednostkiUzytkownika', (req, res) => {
|
||||
const user = require('../../data/api/ListaUczniow')[1]
|
||||
res.json({
|
||||
success: true,
|
||||
data: [
|
||||
{
|
||||
IdJednostkaSprawozdawcza: user.IdJednostkaSprawozdawcza,
|
||||
Skrot: user.JednostkaSprawozdawczaSkrot,
|
||||
Role: [1],
|
||||
NazwaNadawcy: user.Imie + ' ' + user.Nazwisko,
|
||||
WychowawcaWOddzialach: [],
|
||||
Id: user.Id,
|
||||
},
|
||||
],
|
||||
})
|
||||
})
|
||||
|
||||
router.all('/Adresaci.mvc/GetAddressee', (req, res) => {
|
||||
const user = require('../../data/api/ListaUczniow')[1]
|
||||
res.json({
|
||||
success: true,
|
||||
data: require('../../data/api/dictionaries/Pracownicy').map((item) => {
|
||||
return {
|
||||
Id: `${item.Id}rPracownik`,
|
||||
Name: `${item.Imie} ${item.Nazwisko} [${item.Kod}] - pracownik (${user.JednostkaSprawozdawczaSkrot})`,
|
||||
IdLogin: item.Id,
|
||||
UnitId: user.IdJednostkaSprawozdawcza,
|
||||
Role: 2,
|
||||
PushMessage: null,
|
||||
Hash: Buffer.from(md5(item.Id)).toString('base64'),
|
||||
}
|
||||
}),
|
||||
})
|
||||
})
|
||||
|
||||
router.get(['/Wiadomosc.mvc/GetAdresaciWiadomosci', '/Wiadomosc.mvc/GetMessageSenderRoles'], (req, res) => {
|
||||
const user = require('../../data/api/ListaUczniow')[1]
|
||||
res.json({
|
||||
success: true,
|
||||
data: require('../../data/api/dictionaries/Pracownicy')
|
||||
.slice(0, 2)
|
||||
.map((item) => {
|
||||
return {
|
||||
Id: `${item.Id}rPracownik`,
|
||||
Name: `${item.Imie} ${item.Nazwisko} [${item.Kod}] - pracownik (${user.JednostkaSprawozdawczaSkrot})`,
|
||||
IdLogin: item.Id,
|
||||
UnitId: null,
|
||||
Role: 2,
|
||||
PushMessage: null,
|
||||
Hash: Buffer.from(md5(item.Id)).toString('base64'),
|
||||
}
|
||||
});
|
||||
});
|
||||
}),
|
||||
})
|
||||
})
|
||||
|
||||
router.get("/Wiadomosc.mvc/GetInboxMessages", (req, res) => {
|
||||
router.all(
|
||||
[
|
||||
'/Wiadomosc.mvc/GetInboxMessageDetails',
|
||||
'/Wiadomosc.mvc/GetOutboxMessageDetails',
|
||||
'/Wiadomosc.mvc/GetTrashboxMessageDetails',
|
||||
],
|
||||
(req, res) => {
|
||||
const message = require('../../data/api/messages/WiadomosciOdebrane')[0]
|
||||
res.json({
|
||||
"success": true,
|
||||
"data": require("../../data/api/messages/WiadomosciOdebrane").map(item => {
|
||||
const recipientsNumber = getRandomInt(60, 100);
|
||||
const readBy = getRandomInt(20, 60);
|
||||
const unreadBy = recipientsNumber - readBy;
|
||||
return {
|
||||
"Id": item.WiadomoscId * 2,
|
||||
"Nieprzeczytana": !item.GodzinaPrzeczytania,
|
||||
"Nieprzeczytane": unreadBy,
|
||||
"Przeczytane": readBy,
|
||||
"Data": converter.formatDate(new Date(item.DataWyslaniaUnixEpoch * 1000), true) + ' 00:00:00',
|
||||
"Tresc": null,
|
||||
"Temat": item.Tytul,
|
||||
"Nadawca": {
|
||||
"Id": "" + item.NadawcaId,
|
||||
"Name": item.Nadawca,
|
||||
"IdLogin": item.NadawcaId,
|
||||
"Unreaded": false,
|
||||
"Date": null,
|
||||
"Role": 2,
|
||||
"PushMessage": false,
|
||||
"UnitId": 0,
|
||||
"Hash": "abcdef="
|
||||
},
|
||||
"IdWiadomosci": item.WiadomoscId,
|
||||
"HasZalaczniki": true,
|
||||
"FolderWiadomosci": 1,
|
||||
"Adresaci": []
|
||||
};
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
router.get("/Wiadomosc.mvc/GetOutboxMessages", (req, res) => {
|
||||
res.json({
|
||||
"success": true,
|
||||
"data": require("../../data/api/messages/WiadomosciWyslane").map(item => {
|
||||
return {
|
||||
"Id": item.WiadomoscId * 2,
|
||||
"Nieprzeczytana": !item.GodzinaPrzeczytania,
|
||||
"Nieprzeczytane": parseInt(item.Nieprzeczytane, 10),
|
||||
"Przeczytane": parseInt(item.Przeczytane, 10),
|
||||
"Data": converter.formatDate(new Date(item.DataWyslaniaUnixEpoch * 1000), true) + ' 00:00:00',
|
||||
"Tresc": null,
|
||||
"Temat": item.Tytul,
|
||||
"Nadawca": {
|
||||
"Id": "" + item.NadawcaId,
|
||||
"Name": item.Nadawca,
|
||||
"IdLogin": item.NadawcaId,
|
||||
"Unreaded": false,
|
||||
"Date": null,
|
||||
"Role": 2,
|
||||
"PushMessage": false,
|
||||
"UnitId": 0,
|
||||
"Hash": "abcdef="
|
||||
},
|
||||
"IdWiadomosci": item.WiadomoscId,
|
||||
"HasZalaczniki": false,
|
||||
"FolderWiadomosci": 2,
|
||||
"Adresaci": []
|
||||
};
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
router.get("/Wiadomosc.mvc/GetTrashboxMessages", (req, res) => {
|
||||
res.json({
|
||||
"success": true,
|
||||
"data": require("../../data/api/messages/WiadomosciUsuniete").map(item => {
|
||||
return {
|
||||
"Id": item.WiadomoscId * 2,
|
||||
"Nieprzeczytana": !item.GodzinaPrzeczytania,
|
||||
"Nieprzeczytane": parseInt(item.Nieprzeczytane, 10),
|
||||
"Przeczytane": parseInt(item.Przeczytane, 10),
|
||||
"Data": converter.formatDate(new Date(item.DataWyslaniaUnixEpoch * 1000), true) + ' 00:00:00',
|
||||
"Tresc": null,
|
||||
"Temat": item.Tytul,
|
||||
"Nadawca": {
|
||||
"Id": "" + item.NadawcaId,
|
||||
"Name": item.Nadawca,
|
||||
"IdLogin": item.NadawcaId,
|
||||
"Unreaded": false,
|
||||
"Date": null,
|
||||
"Role": 2,
|
||||
"PushMessage": false,
|
||||
"UnitId": 0,
|
||||
"Hash": "abcdef="
|
||||
},
|
||||
"IdWiadomosci": item.WiadomoscId,
|
||||
"HasZalaczniki": false,
|
||||
"FolderWiadomosci": 3,
|
||||
"Adresaci": []
|
||||
};
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
router.get("/NowaWiadomosc.mvc/GetJednostkiUzytkownika", (req, res) => {
|
||||
const user = require("../../data/api/ListaUczniow")[1];
|
||||
res.json({
|
||||
"success": true,
|
||||
"data": [
|
||||
{
|
||||
"IdJednostkaSprawozdawcza": user.IdJednostkaSprawozdawcza,
|
||||
"Skrot": user.JednostkaSprawozdawczaSkrot,
|
||||
"Role": [1],
|
||||
"NazwaNadawcy": user.Imie + " " + user.Nazwisko,
|
||||
"WychowawcaWOddzialach": [],
|
||||
"Id": user.Id
|
||||
}
|
||||
]
|
||||
});
|
||||
});
|
||||
|
||||
router.all("/Adresaci.mvc/GetAddressee", (req, res) => {
|
||||
const user = require("../../data/api/ListaUczniow")[1];
|
||||
res.json({
|
||||
"success": true,
|
||||
"data": require("../../data/api/dictionaries/Pracownicy").map(item => {
|
||||
return {
|
||||
"Id": `${item.Id}rPracownik`,
|
||||
"Name": `${item.Imie} ${item.Nazwisko} [${item.Kod}] - pracownik (${user.JednostkaSprawozdawczaSkrot})`,
|
||||
"IdLogin": item.Id,
|
||||
"UnitId": user.IdJednostkaSprawozdawcza,
|
||||
"Role": 2,
|
||||
"PushMessage": null,
|
||||
"Hash": Buffer.from(md5(item.Id)).toString('base64')
|
||||
};
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
router.get(["/Wiadomosc.mvc/GetAdresaciWiadomosci", "/Wiadomosc.mvc/GetMessageSenderRoles"], (req, res) => {
|
||||
const user = require("../../data/api/ListaUczniow")[1];
|
||||
res.json({
|
||||
"success": true,
|
||||
"data": require("../../data/api/dictionaries/Pracownicy").slice(0, 2).map(item => {
|
||||
return {
|
||||
"Id": `${item.Id}rPracownik`,
|
||||
"Name": `${item.Imie} ${item.Nazwisko} [${item.Kod}] - pracownik (${user.JednostkaSprawozdawczaSkrot})`,
|
||||
"IdLogin": item.Id,
|
||||
"UnitId": null,
|
||||
"Role": 2,
|
||||
"PushMessage": null,
|
||||
"Hash": Buffer.from(md5(item.Id)).toString('base64')
|
||||
};
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
router.all([
|
||||
"/Wiadomosc.mvc/GetInboxMessageDetails",
|
||||
"/Wiadomosc.mvc/GetOutboxMessageDetails",
|
||||
"/Wiadomosc.mvc/GetTrashboxMessageDetails"
|
||||
], (req, res) => {
|
||||
const message = require("../../data/api/messages/WiadomosciOdebrane")[0];
|
||||
res.json({
|
||||
"success": true,
|
||||
"data": {
|
||||
"Id": message.WiadomoscId,
|
||||
"Tresc": message.Tresc,
|
||||
"Zalaczniki": [
|
||||
{
|
||||
"Url": "https://1drv.ms/u/s!AmvjLDq5anT2psJ4nujoBUyclWOUhw",
|
||||
"IdOneDrive": "0123456789ABCDEF!123",
|
||||
"IdWiadomosc": message.WiadomoscId,
|
||||
"NazwaPliku": "nazwa_pliku.pptx",
|
||||
"Id": message.WiadomoscId * 3
|
||||
},
|
||||
{
|
||||
"Url": "https://wulkanowy.github.io/",
|
||||
"IdOneDrive": "0123456789ABCDEF!124",
|
||||
"IdWiadomosc": message.WiadomoscId,
|
||||
"NazwaPliku": "wulkanowy.txt",
|
||||
"Id": message.WiadomoscId * 4
|
||||
},
|
||||
{
|
||||
"Url": "https://github.com/wulkanowy/wulkanowy",
|
||||
"IdOneDrive": "0123456789ABCDEF!125",
|
||||
"IdWiadomosc": message.WiadomoscId,
|
||||
"NazwaPliku": "wulkanowy(2).txt",
|
||||
"Id": message.WiadomoscId * 5
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
});
|
||||
success: true,
|
||||
data: {
|
||||
Id: message.WiadomoscId,
|
||||
Tresc: message.Tresc,
|
||||
Zalaczniki: [
|
||||
{
|
||||
Url: 'https://1drv.ms/u/s!AmvjLDq5anT2psJ4nujoBUyclWOUhw',
|
||||
IdOneDrive: '0123456789ABCDEF!123',
|
||||
IdWiadomosc: message.WiadomoscId,
|
||||
NazwaPliku: 'nazwa_pliku.pptx',
|
||||
Id: message.WiadomoscId * 3,
|
||||
},
|
||||
{
|
||||
Url: 'https://wulkanowy.github.io/',
|
||||
IdOneDrive: '0123456789ABCDEF!124',
|
||||
IdWiadomosc: message.WiadomoscId,
|
||||
NazwaPliku: 'wulkanowy.txt',
|
||||
Id: message.WiadomoscId * 4,
|
||||
},
|
||||
{
|
||||
Url: 'https://github.com/wulkanowy/wulkanowy',
|
||||
IdOneDrive: '0123456789ABCDEF!125',
|
||||
IdWiadomosc: message.WiadomoscId,
|
||||
NazwaPliku: 'wulkanowy(2).txt',
|
||||
Id: message.WiadomoscId * 5,
|
||||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
router.all('/Wiadomosc.mvc/GetAdresaciNiePrzeczytaliWiadomosci', (req, res) => {
|
||||
const user = require("../../data/api/ListaUczniow")[1];
|
||||
const recipient = require("../../data/api/dictionaries/Pracownicy")[0];
|
||||
res.json({
|
||||
"success": true,
|
||||
"data": [
|
||||
{
|
||||
"Id": `${recipient.Id * 4}`, // ¯\_(ツ)_/¯
|
||||
"Name": `${recipient.Imie} ${recipient.Nazwisko} [${recipient.Kod}] - pracownik (${user.JednostkaSprawozdawczaSkrot})`,
|
||||
"IdLogin": recipient.Id,
|
||||
"UnitId": user.IdJednostkaSprawozdawcza,
|
||||
"Role": 2,
|
||||
"PushMessage": null,
|
||||
"Hash": Buffer.from(md5(recipient.Id)).toString('base64')
|
||||
},
|
||||
]
|
||||
});
|
||||
});
|
||||
const user = require('../../data/api/ListaUczniow')[1]
|
||||
const recipient = require('../../data/api/dictionaries/Pracownicy')[0]
|
||||
res.json({
|
||||
success: true,
|
||||
data: [
|
||||
{
|
||||
Id: `${recipient.Id * 4}`, // ¯\_(ツ)_/¯
|
||||
Name: `${recipient.Imie} ${recipient.Nazwisko} [${recipient.Kod}] - pracownik (${user.JednostkaSprawozdawczaSkrot})`,
|
||||
IdLogin: recipient.Id,
|
||||
UnitId: user.IdJednostkaSprawozdawcza,
|
||||
Role: 2,
|
||||
PushMessage: null,
|
||||
Hash: Buffer.from(md5(recipient.Id)).toString('base64'),
|
||||
},
|
||||
],
|
||||
})
|
||||
})
|
||||
|
||||
router.all('/Wiadomosc.mvc/GetAdresaciPrzeczytaliWiadomosc', (req, res) => {
|
||||
const user = require("../../data/api/ListaUczniow")[1];
|
||||
const recipient = require("../../data/api/dictionaries/Pracownicy")[1];
|
||||
res.json({
|
||||
"success": true,
|
||||
"data": [
|
||||
{
|
||||
"Nazwa": `${recipient.Imie} ${recipient.Nazwisko} [${recipient.Kod}] - pracownik (${user.JednostkaSprawozdawczaSkrot})`,
|
||||
"Data": "2020-04-07 19:05:00",
|
||||
"Id": recipient.Id * 8 // ¯\_(ツ)_/¯
|
||||
}
|
||||
]
|
||||
});
|
||||
});
|
||||
const user = require('../../data/api/ListaUczniow')[1]
|
||||
const recipient = require('../../data/api/dictionaries/Pracownicy')[1]
|
||||
res.json({
|
||||
success: true,
|
||||
data: [
|
||||
{
|
||||
Nazwa: `${recipient.Imie} ${recipient.Nazwisko} [${recipient.Kod}] - pracownik (${user.JednostkaSprawozdawczaSkrot})`,
|
||||
Data: '2020-04-07 19:05:00',
|
||||
Id: recipient.Id * 8, // ¯\_(ツ)_/¯
|
||||
},
|
||||
],
|
||||
})
|
||||
})
|
||||
|
||||
router.all("/Wiadomosc.mvc/GetMessageAddressee", (req, res) => {
|
||||
const user = require("../../data/api/ListaUczniow")[1];
|
||||
const recipient = require("../../data/api/dictionaries/Pracownicy")[1];
|
||||
res.json({
|
||||
"success": true,
|
||||
"data": [
|
||||
{
|
||||
"Id": recipient.Id * 8, // ¯\_(ツ)_/¯
|
||||
"Name": `${recipient.Imie} ${recipient.Nazwisko} [${recipient.Kod}] - pracownik (${user.JednostkaSprawozdawczaSkrot})`,
|
||||
"IdLogin": recipient.LoginId,
|
||||
"Role": 7,
|
||||
"Hash": "abcd==",
|
||||
}
|
||||
]
|
||||
});
|
||||
});
|
||||
router.all('/Wiadomosc.mvc/GetMessageAddressee', (req, res) => {
|
||||
const user = require('../../data/api/ListaUczniow')[1]
|
||||
const recipient = require('../../data/api/dictionaries/Pracownicy')[1]
|
||||
res.json({
|
||||
success: true,
|
||||
data: [
|
||||
{
|
||||
Id: recipient.Id * 8, // ¯\_(ツ)_/¯
|
||||
Name: `${recipient.Imie} ${recipient.Nazwisko} [${recipient.Kod}] - pracownik (${user.JednostkaSprawozdawczaSkrot})`,
|
||||
IdLogin: recipient.LoginId,
|
||||
Role: 7,
|
||||
Hash: 'abcd==',
|
||||
},
|
||||
],
|
||||
})
|
||||
})
|
||||
|
||||
router.all([
|
||||
"/Wiadomosc.mvc/DeleteInboxMessages",
|
||||
"/Wiadomosc.mvc/DeleteOutboxMessages",
|
||||
"/Wiadomosc.mvc/DeleteTrashboxMessages",
|
||||
], (req, res) => {
|
||||
router.all(
|
||||
[
|
||||
'/Wiadomosc.mvc/DeleteInboxMessages',
|
||||
'/Wiadomosc.mvc/DeleteOutboxMessages',
|
||||
'/Wiadomosc.mvc/DeleteTrashboxMessages',
|
||||
],
|
||||
(req, res) => {
|
||||
res.json({
|
||||
"success": true
|
||||
});
|
||||
});
|
||||
success: true,
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
router.all("/NowaWiadomosc.mvc/InsertWiadomosc", (req, res) => {
|
||||
let data = req.body.incomming;
|
||||
res.json({
|
||||
"success": true,
|
||||
"data": {
|
||||
"Adresaci": data.Adresaci.map(item => {
|
||||
item.PushMessage = false;
|
||||
return item;
|
||||
}),
|
||||
"Temat": data.Temat,
|
||||
"Tresc": data.Tresc,
|
||||
"Nadawca": {
|
||||
"Id": null,
|
||||
"Name": "Kowalski Jan",
|
||||
"IdLogin": 0,
|
||||
"UnitId": null,
|
||||
"Role": 0,
|
||||
"PushMessage": null,
|
||||
"Hash": "hash"
|
||||
},
|
||||
"WiadomoscPowitalna": false,
|
||||
"Id": data.Id
|
||||
}
|
||||
});
|
||||
});
|
||||
router.all('/NowaWiadomosc.mvc/InsertWiadomosc', (req, res) => {
|
||||
let data = req.body.incomming
|
||||
res.json({
|
||||
success: true,
|
||||
data: {
|
||||
Adresaci: data.Adresaci.map((item) => {
|
||||
item.PushMessage = false
|
||||
return item
|
||||
}),
|
||||
Temat: data.Temat,
|
||||
Tresc: data.Tresc,
|
||||
Nadawca: {
|
||||
Id: null,
|
||||
Name: 'Kowalski Jan',
|
||||
IdLogin: 0,
|
||||
UnitId: null,
|
||||
Role: 0,
|
||||
PushMessage: null,
|
||||
Hash: 'hash',
|
||||
},
|
||||
WiadomoscPowitalna: false,
|
||||
Id: data.Id,
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
module.exports = router;
|
||||
module.exports = router
|
||||
|
|
|
@ -1,197 +1,195 @@
|
|||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const protocol = require('../utils/connection');
|
||||
const {timestampToIsoTzFormat, dateToTimestamp} = require('../utils/converter');
|
||||
const {fromString} = require('uuidv4');
|
||||
const express = require('express')
|
||||
const router = express.Router()
|
||||
const protocol = require('../utils/connection')
|
||||
const { timestampToIsoTzFormat, dateToTimestamp } = require('../utils/converter')
|
||||
const { fromString } = require('uuidv4')
|
||||
|
||||
router.get("/", (req, res) => {
|
||||
res.render("messages");
|
||||
});
|
||||
router.get('/', (req, res) => {
|
||||
res.render('messages')
|
||||
})
|
||||
|
||||
router.get("/LoginEndpoint.aspx", (req, res) => {
|
||||
res.redirect("/");
|
||||
});
|
||||
router.get('/LoginEndpoint.aspx', (req, res) => {
|
||||
res.redirect('/')
|
||||
})
|
||||
|
||||
router.get("/-endpoints", (req, res) => {
|
||||
const base = protocol(req) + "://" + req.get('host') + "/powiatwulkanowy";
|
||||
res.json({
|
||||
status: "sucess",
|
||||
data: {
|
||||
endpoints: [
|
||||
"/api/Skrzynki",
|
||||
"/api/Pracownicy",
|
||||
"/api/Odebrane",
|
||||
"/api/OdebraneSkrzynka",
|
||||
"/api/Wyslane",
|
||||
"/api/WyslaneSkrzynka",
|
||||
"/api/Usuniete",
|
||||
"/api/UsunieteSkrzynka",
|
||||
"/api/WiadomoscSzczegoly",
|
||||
"/api/WiadomoscOdpowiedzPrzekaz",
|
||||
"/api/WiadomoscNowa",
|
||||
"/api/MoveTrash",
|
||||
"/api/Delete",
|
||||
].map(item => {
|
||||
return base + item;
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
router.get('/-endpoints', (req, res) => {
|
||||
const base = protocol(req) + '://' + req.get('host') + '/powiatwulkanowy'
|
||||
res.json({
|
||||
status: 'sucess',
|
||||
data: {
|
||||
endpoints: [
|
||||
'/api/Skrzynki',
|
||||
'/api/Pracownicy',
|
||||
'/api/Odebrane',
|
||||
'/api/OdebraneSkrzynka',
|
||||
'/api/Wyslane',
|
||||
'/api/WyslaneSkrzynka',
|
||||
'/api/Usuniete',
|
||||
'/api/UsunieteSkrzynka',
|
||||
'/api/WiadomoscSzczegoly',
|
||||
'/api/WiadomoscOdpowiedzPrzekaz',
|
||||
'/api/WiadomoscNowa',
|
||||
'/api/MoveTrash',
|
||||
'/api/Delete',
|
||||
].map((item) => {
|
||||
return base + item
|
||||
}),
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
router.get([
|
||||
"/api/Odebrane",
|
||||
"/api/OdebraneSkrzynka",
|
||||
], (req, res) => {
|
||||
const currentTimestamp = dateToTimestamp(new Date());
|
||||
res.json(require("../../data/api/messages/WiadomosciOdebrane").map((item, i) => {
|
||||
let itemTimestamp = item.DataWyslaniaUnixEpoch;
|
||||
if (i < 7) {
|
||||
itemTimestamp = currentTimestamp - (i * i * 3600 * 6);
|
||||
}
|
||||
return {
|
||||
"apiGlobalKey": fromString(item.WiadomoscId.toString()),
|
||||
"korespondenci": item.Nadawca + " - P - (Fake123456)",
|
||||
"temat": item.Tytul,
|
||||
"data": timestampToIsoTzFormat(itemTimestamp),
|
||||
"skrzynka": "Jan Kowalski - U - (Fake123456)",
|
||||
"hasZalaczniki": true,
|
||||
"przeczytana": !!item.GodzinaPrzeczytania,
|
||||
"nieprzeczytanePrzeczytanePrzez": null,
|
||||
"wazna": false,
|
||||
"uzytkownikRola": 2,
|
||||
"id": item.WiadomoscId
|
||||
};
|
||||
}));
|
||||
});
|
||||
router.get(['/api/Odebrane', '/api/OdebraneSkrzynka'], (req, res) => {
|
||||
const currentTimestamp = dateToTimestamp(new Date())
|
||||
res.json(
|
||||
require('../../data/api/messages/WiadomosciOdebrane').map((item, i) => {
|
||||
let itemTimestamp = item.DataWyslaniaUnixEpoch
|
||||
if (i < 7) {
|
||||
itemTimestamp = currentTimestamp - i * i * 3600 * 6
|
||||
}
|
||||
return {
|
||||
apiGlobalKey: fromString(item.WiadomoscId.toString()),
|
||||
korespondenci: item.Nadawca + ' - P - (Fake123456)',
|
||||
temat: item.Tytul,
|
||||
data: timestampToIsoTzFormat(itemTimestamp),
|
||||
skrzynka: 'Jan Kowalski - U - (Fake123456)',
|
||||
hasZalaczniki: true,
|
||||
przeczytana: !!item.GodzinaPrzeczytania,
|
||||
nieprzeczytanePrzeczytanePrzez: null,
|
||||
wazna: false,
|
||||
uzytkownikRola: 2,
|
||||
id: item.WiadomoscId,
|
||||
}
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
router.get([
|
||||
"/api/Wyslane",
|
||||
"/api/WyslaneSkrzynka",
|
||||
], (req, res) => {
|
||||
res.json(require("../../data/api/messages/WiadomosciWyslane").map(item => {
|
||||
return {
|
||||
"apiGlobalKey": fromString(item.WiadomoscId.toString()),
|
||||
"korespondenci": item.Nadawca + " - P - (Fake123456)",
|
||||
"temat": item.Tytul,
|
||||
"data": timestampToIsoTzFormat(item.DataWyslaniaUnixEpoch),
|
||||
"skrzynka": "Jan Kowalski - U - (Fake123456)",
|
||||
"hasZalaczniki": true,
|
||||
"przeczytana": !!item.GodzinaPrzeczytania,
|
||||
"nieprzeczytanePrzeczytanePrzez": null,
|
||||
"wazna": false,
|
||||
"uzytkownikRola": 2,
|
||||
"id": item.WiadomoscId
|
||||
};
|
||||
}));
|
||||
});
|
||||
router.get(['/api/Wyslane', '/api/WyslaneSkrzynka'], (req, res) => {
|
||||
res.json(
|
||||
require('../../data/api/messages/WiadomosciWyslane').map((item) => {
|
||||
return {
|
||||
apiGlobalKey: fromString(item.WiadomoscId.toString()),
|
||||
korespondenci: item.Nadawca + ' - P - (Fake123456)',
|
||||
temat: item.Tytul,
|
||||
data: timestampToIsoTzFormat(item.DataWyslaniaUnixEpoch),
|
||||
skrzynka: 'Jan Kowalski - U - (Fake123456)',
|
||||
hasZalaczniki: true,
|
||||
przeczytana: !!item.GodzinaPrzeczytania,
|
||||
nieprzeczytanePrzeczytanePrzez: null,
|
||||
wazna: false,
|
||||
uzytkownikRola: 2,
|
||||
id: item.WiadomoscId,
|
||||
}
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
router.get([
|
||||
"/api/Usuniete",
|
||||
"/api/UsunieteSkrzynka",
|
||||
], (req, res) => {
|
||||
res.json(require("../../data/api/messages/WiadomosciUsuniete").map(item => {
|
||||
return {
|
||||
"apiGlobalKey": fromString(item.WiadomoscId.toString()),
|
||||
"korespondenci": item.Nadawca + " - P - (Fake123456)",
|
||||
"temat": item.Tytul,
|
||||
"data": timestampToIsoTzFormat(item.DataWyslaniaUnixEpoch),
|
||||
"skrzynka": "Jan Kowalski - U - (Fake123456)",
|
||||
"hasZalaczniki": true,
|
||||
"przeczytana": !!item.GodzinaPrzeczytania,
|
||||
"nieprzeczytanePrzeczytanePrzez": null,
|
||||
"wazna": false,
|
||||
"uzytkownikRola": 2,
|
||||
"id": item.WiadomoscId
|
||||
};
|
||||
}));
|
||||
});
|
||||
router.get(['/api/Usuniete', '/api/UsunieteSkrzynka'], (req, res) => {
|
||||
res.json(
|
||||
require('../../data/api/messages/WiadomosciUsuniete').map((item) => {
|
||||
return {
|
||||
apiGlobalKey: fromString(item.WiadomoscId.toString()),
|
||||
korespondenci: item.Nadawca + ' - P - (Fake123456)',
|
||||
temat: item.Tytul,
|
||||
data: timestampToIsoTzFormat(item.DataWyslaniaUnixEpoch),
|
||||
skrzynka: 'Jan Kowalski - U - (Fake123456)',
|
||||
hasZalaczniki: true,
|
||||
przeczytana: !!item.GodzinaPrzeczytania,
|
||||
nieprzeczytanePrzeczytanePrzez: null,
|
||||
wazna: false,
|
||||
uzytkownikRola: 2,
|
||||
id: item.WiadomoscId,
|
||||
}
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
router.get("/api/Skrzynki", (req, res) => {
|
||||
const users = require("../../data/api/ListaUczniow");
|
||||
res.json(users.map(user => {
|
||||
return {
|
||||
"globalKey": fromString(user.UzytkownikLoginId.toString()),
|
||||
"nazwa": `${user.Imie} ${user.Nazwisko} - U - (${user.JednostkaSprawozdawczaSkrot})`,
|
||||
"typUzytkownika": 3
|
||||
};
|
||||
}));
|
||||
});
|
||||
router.get('/api/Skrzynki', (req, res) => {
|
||||
const users = require('../../data/api/ListaUczniow')
|
||||
res.json(
|
||||
users.map((user) => {
|
||||
return {
|
||||
globalKey: fromString(user.UzytkownikLoginId.toString()),
|
||||
nazwa: `${user.Imie} ${user.Nazwisko} - U - (${user.JednostkaSprawozdawczaSkrot})`,
|
||||
typUzytkownika: 3,
|
||||
}
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
router.all("/api/WiadomoscSzczegoly", (req, res) => {
|
||||
const message = require("../../data/api/messages/WiadomosciOdebrane")[0];
|
||||
res.json({
|
||||
"data": timestampToIsoTzFormat(message.DataWyslaniaUnixEpoch),
|
||||
"apiGlobalKey": fromString(message.WiadomoscId.toString()),
|
||||
"nadawca": "Natalia Wrzesień - P - (Fake123456)",
|
||||
"odbiorcy": ["Jan kowalski - U - (Fake123456)"],
|
||||
"temat": message.Tytul,
|
||||
"tresc": message.Tresc.replaceAll("\n", "<br>"),
|
||||
"odczytana": true,
|
||||
"zalaczniki": [
|
||||
{
|
||||
"url": "https://1drv.ms/u/s!AmvjLDq5anT2psJ4nujoBUyclWOUhw",
|
||||
"nazwaPliku": "nazwa_pliku.pptx",
|
||||
},
|
||||
{
|
||||
"url": "https://wulkanowy.github.io/",
|
||||
"nazwaPliku": "wulkanowy.txt",
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/wulkanowy/wulkanowy",
|
||||
"nazwaPliku": "wulkanowy(2).txt",
|
||||
}
|
||||
],
|
||||
"id": message.WiadomoscId
|
||||
});
|
||||
});
|
||||
router.all('/api/WiadomoscSzczegoly', (req, res) => {
|
||||
const message = require('../../data/api/messages/WiadomosciOdebrane')[0]
|
||||
res.json({
|
||||
data: timestampToIsoTzFormat(message.DataWyslaniaUnixEpoch),
|
||||
apiGlobalKey: fromString(message.WiadomoscId.toString()),
|
||||
nadawca: 'Natalia Wrzesień - P - (Fake123456)',
|
||||
odbiorcy: ['Jan kowalski - U - (Fake123456)'],
|
||||
temat: message.Tytul,
|
||||
tresc: message.Tresc.replaceAll('\n', '<br>'),
|
||||
odczytana: true,
|
||||
zalaczniki: [
|
||||
{
|
||||
url: 'https://1drv.ms/u/s!AmvjLDq5anT2psJ4nujoBUyclWOUhw',
|
||||
nazwaPliku: 'nazwa_pliku.pptx',
|
||||
},
|
||||
{
|
||||
url: 'https://wulkanowy.github.io/',
|
||||
nazwaPliku: 'wulkanowy.txt',
|
||||
},
|
||||
{
|
||||
url: 'https://github.com/wulkanowy/wulkanowy',
|
||||
nazwaPliku: 'wulkanowy(2).txt',
|
||||
},
|
||||
],
|
||||
id: message.WiadomoscId,
|
||||
})
|
||||
})
|
||||
|
||||
router.all("/api/WiadomoscOdpowiedzPrzekaz", (req, res) => {
|
||||
const user = require("../../data/api/ListaUczniow")[1];
|
||||
const message = require("../../data/api/messages/WiadomosciOdebrane")[0];
|
||||
res.json({
|
||||
"data": timestampToIsoTzFormat(message.DataWyslaniaUnixEpoch),
|
||||
"apiGlobalKey": fromString(message.WiadomoscId.toString()),
|
||||
"uzytkownikSkrzynkaGlobalKey": fromString(user.Id.toString()),
|
||||
"nadawcaSkrzynkaGlobalKey": fromString(message.NadawcaId.toString()),
|
||||
"nadawcaSkrzynkaNazwa": "Natalia Wrzesień - P - (Fake123456)",
|
||||
"adresaci": [
|
||||
{
|
||||
"skrzynkaGlobalKey": fromString(user.Id.toString()),
|
||||
"nazwa": "Jan Kowalski - U - (Fake123456)"
|
||||
}
|
||||
],
|
||||
"temat": message.Tytul,
|
||||
"tresc": message.Tresc.replaceAll("\n", "<br>"),
|
||||
"zalaczniki": [
|
||||
{
|
||||
"url": "https://1drv.ms/u/s!AmvjLDq5anT2psJ4nujoBUyclWOUhw",
|
||||
"nazwaPliku": "nazwa_pliku.pptx"
|
||||
}
|
||||
],
|
||||
"id": message.WiadomoscId
|
||||
});
|
||||
});
|
||||
router.all('/api/WiadomoscOdpowiedzPrzekaz', (req, res) => {
|
||||
const user = require('../../data/api/ListaUczniow')[1]
|
||||
const message = require('../../data/api/messages/WiadomosciOdebrane')[0]
|
||||
res.json({
|
||||
data: timestampToIsoTzFormat(message.DataWyslaniaUnixEpoch),
|
||||
apiGlobalKey: fromString(message.WiadomoscId.toString()),
|
||||
uzytkownikSkrzynkaGlobalKey: fromString(user.Id.toString()),
|
||||
nadawcaSkrzynkaGlobalKey: fromString(message.NadawcaId.toString()),
|
||||
nadawcaSkrzynkaNazwa: 'Natalia Wrzesień - P - (Fake123456)',
|
||||
adresaci: [
|
||||
{
|
||||
skrzynkaGlobalKey: fromString(user.Id.toString()),
|
||||
nazwa: 'Jan Kowalski - U - (Fake123456)',
|
||||
},
|
||||
],
|
||||
temat: message.Tytul,
|
||||
tresc: message.Tresc.replaceAll('\n', '<br>'),
|
||||
zalaczniki: [
|
||||
{
|
||||
url: 'https://1drv.ms/u/s!AmvjLDq5anT2psJ4nujoBUyclWOUhw',
|
||||
nazwaPliku: 'nazwa_pliku.pptx',
|
||||
},
|
||||
],
|
||||
id: message.WiadomoscId,
|
||||
})
|
||||
})
|
||||
|
||||
router.all("/api/Pracownicy", (req, res) => {
|
||||
const user = require("../../data/api/ListaUczniow")[1];
|
||||
const recipients = require("../../data/api/dictionaries/Pracownicy");
|
||||
res.json(recipients.map(item => {
|
||||
return {
|
||||
"skrzynkaGlobalKey": fromString(item.Id.toString()),
|
||||
"nazwa": `${item.Nazwisko} ${item.Imie} - P - (${user.JednostkaSprawozdawczaSkrot})`
|
||||
};
|
||||
}));
|
||||
});
|
||||
router.all('/api/Pracownicy', (req, res) => {
|
||||
const user = require('../../data/api/ListaUczniow')[1]
|
||||
const recipients = require('../../data/api/dictionaries/Pracownicy')
|
||||
res.json(
|
||||
recipients.map((item) => {
|
||||
return {
|
||||
skrzynkaGlobalKey: fromString(item.Id.toString()),
|
||||
nazwa: `${item.Nazwisko} ${item.Imie} - P - (${user.JednostkaSprawozdawczaSkrot})`,
|
||||
}
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
router.all([
|
||||
"/api/MoveTrash",
|
||||
"/api/Delete",
|
||||
], (req, res) => {
|
||||
res.status(204).send();
|
||||
});
|
||||
router.all(['/api/MoveTrash', '/api/Delete'], (req, res) => {
|
||||
res.status(204).send()
|
||||
})
|
||||
|
||||
router.all("/api/WiadomoscNowa", (req, res) => {
|
||||
res.status(204).send();
|
||||
});
|
||||
router.all('/api/WiadomoscNowa', (req, res) => {
|
||||
res.status(204).send()
|
||||
})
|
||||
|
||||
module.exports = router;
|
||||
module.exports = router
|
||||
|
|
|
@ -1,163 +1,163 @@
|
|||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const protocol = require('../utils/connection');
|
||||
const express = require('express')
|
||||
const router = express.Router()
|
||||
const protocol = require('../utils/connection')
|
||||
|
||||
router.get("/powiatwulkanowy/Start.mvc/Endpoints", (req, res) => {
|
||||
const base = protocol(req) + "://" + req.get('host') + "/powiatwulkanowy/Start.mvc";
|
||||
res.json({
|
||||
status: "success",
|
||||
data: {
|
||||
endpoints: [
|
||||
"/GetSelfGovernments",
|
||||
"/GetStudentTrips",
|
||||
"/GetStudentConferences",
|
||||
"/GetLastNotes",
|
||||
"/GetNumberOfUnreadMessages",
|
||||
"/GetFreeDays",
|
||||
"/GetKidsLuckyNumbers",
|
||||
"/GetKidsLessonPlan",
|
||||
"/GetLastHomeworks",
|
||||
"/GetLastTests",
|
||||
"/GetLastStudentLessons",
|
||||
"/GetLastAnnouncements",
|
||||
"/GetStudentDirectorInformations",
|
||||
].map(item => {
|
||||
return base + item;
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
router.get('/powiatwulkanowy/Start.mvc/Endpoints', (req, res) => {
|
||||
const base = protocol(req) + '://' + req.get('host') + '/powiatwulkanowy/Start.mvc'
|
||||
res.json({
|
||||
status: 'success',
|
||||
data: {
|
||||
endpoints: [
|
||||
'/GetSelfGovernments',
|
||||
'/GetStudentTrips',
|
||||
'/GetStudentConferences',
|
||||
'/GetLastNotes',
|
||||
'/GetNumberOfUnreadMessages',
|
||||
'/GetFreeDays',
|
||||
'/GetKidsLuckyNumbers',
|
||||
'/GetKidsLessonPlan',
|
||||
'/GetLastHomeworks',
|
||||
'/GetLastTests',
|
||||
'/GetLastStudentLessons',
|
||||
'/GetLastAnnouncements',
|
||||
'/GetStudentDirectorInformations',
|
||||
].map((item) => {
|
||||
return base + item
|
||||
}),
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
router.all("/powiatwulkanowy/Start.mvc/GetSelfGovernments", (req, res) => {
|
||||
res.json({
|
||||
"data": require("../../data/uonetplus/GetSelfGovernments"),
|
||||
"success": true,
|
||||
"errorMessage": null,
|
||||
"feedback": null
|
||||
});
|
||||
});
|
||||
router.all('/powiatwulkanowy/Start.mvc/GetSelfGovernments', (req, res) => {
|
||||
res.json({
|
||||
data: require('../../data/uonetplus/GetSelfGovernments'),
|
||||
success: true,
|
||||
errorMessage: null,
|
||||
feedback: null,
|
||||
})
|
||||
})
|
||||
|
||||
router.all("/powiatwulkanowy/Start.mvc/GetStudentTrips", (req, res) => {
|
||||
res.json({
|
||||
"data": require("../../data/uonetplus/GetStudentTrips"),
|
||||
"success": true,
|
||||
"errorMessage": null,
|
||||
"feedback": null
|
||||
});
|
||||
});
|
||||
router.all('/powiatwulkanowy/Start.mvc/GetStudentTrips', (req, res) => {
|
||||
res.json({
|
||||
data: require('../../data/uonetplus/GetStudentTrips'),
|
||||
success: true,
|
||||
errorMessage: null,
|
||||
feedback: null,
|
||||
})
|
||||
})
|
||||
|
||||
router.all("/powiatwulkanowy/Start.mvc/GetLastNotes", (req, res) => {
|
||||
res.json(require("../../data/uonetplus/GetLastNotes"));
|
||||
});
|
||||
router.all('/powiatwulkanowy/Start.mvc/GetLastNotes', (req, res) => {
|
||||
res.json(require('../../data/uonetplus/GetLastNotes'))
|
||||
})
|
||||
|
||||
router.all("/powiatwulkanowy/Start.mvc/GetFreeDays", (req, res) => {
|
||||
res.json(require("../../data/uonetplus/GetFreeDays"));
|
||||
});
|
||||
router.all('/powiatwulkanowy/Start.mvc/GetFreeDays', (req, res) => {
|
||||
res.json(require('../../data/uonetplus/GetFreeDays'))
|
||||
})
|
||||
|
||||
router.all("/powiatwulkanowy/Start.mvc/GetKidsLuckyNumbers", (req, res) => {
|
||||
res.json(require("../../data/uonetplus/GetKidsLuckyNumbers"));
|
||||
});
|
||||
router.all('/powiatwulkanowy/Start.mvc/GetKidsLuckyNumbers', (req, res) => {
|
||||
res.json(require('../../data/uonetplus/GetKidsLuckyNumbers'))
|
||||
})
|
||||
|
||||
router.all("/powiatwulkanowy/Start.mvc/GetKidsLessonPlan", (req, res) => {
|
||||
res.json({
|
||||
"data": require("../../data/uonetplus/GetKidsLessonPlan"),
|
||||
"success": true,
|
||||
"errorMessage": null,
|
||||
"feedback": null
|
||||
});
|
||||
});
|
||||
router.all('/powiatwulkanowy/Start.mvc/GetKidsLessonPlan', (req, res) => {
|
||||
res.json({
|
||||
data: require('../../data/uonetplus/GetKidsLessonPlan'),
|
||||
success: true,
|
||||
errorMessage: null,
|
||||
feedback: null,
|
||||
})
|
||||
})
|
||||
|
||||
router.all("/powiatwulkanowy/Start.mvc/GetNumberOfUnreadMessages", (req, res) => {
|
||||
res.json({
|
||||
"data": [],
|
||||
"success": false,
|
||||
"errorMessage": "Not implemented yet",
|
||||
"feedback": null
|
||||
});
|
||||
});
|
||||
router.all('/powiatwulkanowy/Start.mvc/GetNumberOfUnreadMessages', (req, res) => {
|
||||
res.json({
|
||||
data: [],
|
||||
success: false,
|
||||
errorMessage: 'Not implemented yet',
|
||||
feedback: null,
|
||||
})
|
||||
})
|
||||
|
||||
router.all("/powiatwulkanowy/Start.mvc/GetLastHomeworks", (req, res) => {
|
||||
res.json({
|
||||
"data": require("../../data/uonetplus/GetLastHomeworks"),
|
||||
"success": true,
|
||||
"errorMessage": null,
|
||||
"feedback": null
|
||||
});
|
||||
});
|
||||
router.all('/powiatwulkanowy/Start.mvc/GetLastHomeworks', (req, res) => {
|
||||
res.json({
|
||||
data: require('../../data/uonetplus/GetLastHomeworks'),
|
||||
success: true,
|
||||
errorMessage: null,
|
||||
feedback: null,
|
||||
})
|
||||
})
|
||||
|
||||
router.all("/powiatwulkanowy/Start.mvc/GetLastTests", (req, res) => {
|
||||
res.json({
|
||||
"data": require("../../data/uonetplus/GetLastTests"),
|
||||
"success": true,
|
||||
"errorMessage": null,
|
||||
"feedback": null
|
||||
});
|
||||
});
|
||||
router.all('/powiatwulkanowy/Start.mvc/GetLastTests', (req, res) => {
|
||||
res.json({
|
||||
data: require('../../data/uonetplus/GetLastTests'),
|
||||
success: true,
|
||||
errorMessage: null,
|
||||
feedback: null,
|
||||
})
|
||||
})
|
||||
|
||||
router.all("/powiatwulkanowy/Start.mvc/GetStudentConferences", (req, res) => {
|
||||
res.json({
|
||||
"data": [],
|
||||
"success": false,
|
||||
"errorMessage": "Not implemented yet",
|
||||
"feedback": null
|
||||
});
|
||||
});
|
||||
router.all('/powiatwulkanowy/Start.mvc/GetStudentConferences', (req, res) => {
|
||||
res.json({
|
||||
data: [],
|
||||
success: false,
|
||||
errorMessage: 'Not implemented yet',
|
||||
feedback: null,
|
||||
})
|
||||
})
|
||||
|
||||
router.all("/powiatwulkanowy/Start.mvc/GetLastStudentLessons", (req, res) => {
|
||||
res.json({
|
||||
"data": require("../../data/uonetplus/GetLastStudentLessons"),
|
||||
"success": true,
|
||||
"errorMessage": null,
|
||||
"feedback": null
|
||||
});
|
||||
});
|
||||
router.all('/powiatwulkanowy/Start.mvc/GetLastStudentLessons', (req, res) => {
|
||||
res.json({
|
||||
data: require('../../data/uonetplus/GetLastStudentLessons'),
|
||||
success: true,
|
||||
errorMessage: null,
|
||||
feedback: null,
|
||||
})
|
||||
})
|
||||
|
||||
router.all("/powiatwulkanowy/Start.mvc/GetStudentDirectorInformations", (req, res) => {
|
||||
res.json({
|
||||
"data": require("../../data/uonetplus/GetStudentDirectorInformations"),
|
||||
"errorMessage": null,
|
||||
"feedback": null,
|
||||
"success": true
|
||||
});
|
||||
});
|
||||
router.all('/powiatwulkanowy/Start.mvc/GetStudentDirectorInformations', (req, res) => {
|
||||
res.json({
|
||||
data: require('../../data/uonetplus/GetStudentDirectorInformations'),
|
||||
errorMessage: null,
|
||||
feedback: null,
|
||||
success: true,
|
||||
})
|
||||
})
|
||||
|
||||
router.all("/powiatwulkanowy/Start.mvc/GetLastAnnouncements", (req, res) => {
|
||||
res.json({
|
||||
"data": require("../../data/uonetplus/GetLastAnnouncements"),
|
||||
"errorMessage": null,
|
||||
"feedback": null,
|
||||
"success": true
|
||||
});
|
||||
});
|
||||
router.all('/powiatwulkanowy/Start.mvc/GetLastAnnouncements', (req, res) => {
|
||||
res.json({
|
||||
data: require('../../data/uonetplus/GetLastAnnouncements'),
|
||||
errorMessage: null,
|
||||
feedback: null,
|
||||
success: true,
|
||||
})
|
||||
})
|
||||
|
||||
router.get("/", (req, res) => {
|
||||
res.render("log-exception", {
|
||||
title: "Dziennik FakeUONET+",
|
||||
message: "Podany identyfikator klienta jest niepoprawny.",
|
||||
});
|
||||
});
|
||||
router.get('/', (req, res) => {
|
||||
res.render('log-exception', {
|
||||
title: 'Dziennik FakeUONET+',
|
||||
message: 'Podany identyfikator klienta jest niepoprawny.',
|
||||
})
|
||||
})
|
||||
|
||||
router.all(/^\/([a-z0-9]+)(?:\/LoginEndpoint\.aspx|\/)?$/i, (req, res) => {
|
||||
let hasCert = req.body.wa && req.body.wresult;
|
||||
let hasCert = req.body.wa && req.body.wresult
|
||||
|
||||
if (req.params[0] != "powiatwulkanowy") {
|
||||
if (hasCert)
|
||||
res.render("permission-error", {
|
||||
title: "Logowanie",
|
||||
});
|
||||
else
|
||||
res.render("log-exception", {
|
||||
title: "Dziennik FakeUONET+",
|
||||
message: "Podany identyfikator klienta jest niepoprawny.",
|
||||
});
|
||||
if (req.params[0] != 'powiatwulkanowy') {
|
||||
if (hasCert)
|
||||
res.render('permission-error', {
|
||||
title: 'Logowanie',
|
||||
})
|
||||
else
|
||||
res.render('log-exception', {
|
||||
title: 'Dziennik FakeUONET+',
|
||||
message: 'Podany identyfikator klienta jest niepoprawny.',
|
||||
})
|
||||
|
||||
return;
|
||||
} else if (hasCert) {
|
||||
return res.redirect("/powiatwulkanowy/Start.mvc/Index");
|
||||
}
|
||||
return
|
||||
} else if (hasCert) {
|
||||
return res.redirect('/powiatwulkanowy/Start.mvc/Index')
|
||||
}
|
||||
|
||||
res.redirect(protocol(req) + "://" + req.get('host').replace("uonetplus", "cufs") + "/powiatwulkanowy/Account/LogOn");
|
||||
});
|
||||
res.redirect(protocol(req) + '://' + req.get('host').replace('uonetplus', 'cufs') + '/powiatwulkanowy/Account/LogOn')
|
||||
})
|
||||
|
||||
router.get(["/powiatwulkanowy/Start.mvc", "/powiatwulkanowy/Start.mvc/Index"], (req, res) => {
|
||||
res.render("homepage", {
|
||||
|
@ -178,7 +178,7 @@ router.get(["/powiatwulkanowy/Start.mvc", "/powiatwulkanowy/Start.mvc/Index"], (
|
|||
protocol(req) +
|
||||
"://" +
|
||||
req.get("host").replace("uonetplus", "uonetplus-wiadomosciplus"),
|
||||
});
|
||||
});
|
||||
})
|
||||
})
|
||||
|
||||
module.exports = router;
|
||||
module.exports = router
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
const {uuid} = require('uuidv4');
|
||||
const { uuid } = require('uuidv4')
|
||||
|
||||
function createResponse(data) {
|
||||
return {
|
||||
"Status": "Ok",
|
||||
"TimeKey": Math.round(new Date().getTime() / 1000),
|
||||
"TimeValue": new Date().toUTCString(), //"2018.04.25 14:44:54"
|
||||
"RequestId": uuid(),
|
||||
"DayOfWeek": new Date().getDay(),
|
||||
"AppVersion": "17.09.0009.26859",
|
||||
"Data": data
|
||||
};
|
||||
return {
|
||||
Status: 'Ok',
|
||||
TimeKey: Math.round(new Date().getTime() / 1000),
|
||||
TimeValue: new Date().toUTCString(), //"2018.04.25 14:44:54"
|
||||
RequestId: uuid(),
|
||||
DayOfWeek: new Date().getDay(),
|
||||
AppVersion: '17.09.0009.26859',
|
||||
Data: data,
|
||||
}
|
||||
}
|
||||
|
||||
function getRandomInt(min, max) {
|
||||
min = Math.ceil(min);
|
||||
max = Math.floor(max);
|
||||
return Math.floor(Math.random() * (max - min)) + min;
|
||||
min = Math.ceil(min)
|
||||
max = Math.floor(max)
|
||||
return Math.floor(Math.random() * (max - min)) + min
|
||||
}
|
||||
|
||||
exports.createResponse = createResponse;
|
||||
exports.getRandomInt = getRandomInt;
|
||||
exports.createResponse = createResponse
|
||||
exports.getRandomInt = getRandomInt
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
module.exports = function(req) {
|
||||
const isConnectionEncrypted = req.connection.encrypted;
|
||||
const isSslEnvSet = process.env.SSL === 'true';
|
||||
const isHeaderSsl = req.header('x-forwarded-proto') === 'https';
|
||||
module.exports = function (req) {
|
||||
const isConnectionEncrypted = req.connection.encrypted
|
||||
const isSslEnvSet = process.env.SSL === 'true'
|
||||
const isHeaderSsl = req.header('x-forwarded-proto') === 'https'
|
||||
|
||||
const proto = isConnectionEncrypted || isSslEnvSet || isHeaderSsl ? 'https' : 'http';
|
||||
const proto = isConnectionEncrypted || isSslEnvSet || isHeaderSsl ? 'https' : 'http'
|
||||
|
||||
return proto.split(/\s*,\s*/)[0];
|
||||
};
|
||||
return proto.split(/\s*,\s*/)[0]
|
||||
}
|
||||
|
|
|
@ -1,103 +1,99 @@
|
|||
const {addDays, toDate, format, getTime} = require('date-fns');
|
||||
const WEEK_TICK = 6048000000000;
|
||||
const DAY_TICK = 864000000000;
|
||||
const { addDays, toDate, format, getTime } = require('date-fns')
|
||||
const WEEK_TICK = 6048000000000
|
||||
const DAY_TICK = 864000000000
|
||||
|
||||
function getDateFromTick(tick) {
|
||||
if (tick === '' || tick === undefined) {
|
||||
return getMonday(new Date());
|
||||
}
|
||||
if (tick === '' || tick === undefined) {
|
||||
return getMonday(new Date())
|
||||
}
|
||||
|
||||
return new Date((tick - 621355968000000000) / 10000);
|
||||
return new Date((tick - 621355968000000000) / 10000)
|
||||
}
|
||||
|
||||
function getTickFromDate(date) {
|
||||
return (date.getTime() * 10000) + 621355968000000000;
|
||||
return date.getTime() * 10000 + 621355968000000000
|
||||
}
|
||||
|
||||
function formatDate(today, iso = false) {
|
||||
let dd = today.getDate();
|
||||
let mm = today.getMonth() + 1; //January is 0!
|
||||
let dd = today.getDate()
|
||||
let mm = today.getMonth() + 1 //January is 0!
|
||||
|
||||
let yyyy = today.getFullYear();
|
||||
let yyyy = today.getFullYear()
|
||||
|
||||
if (dd < 10) {
|
||||
dd = '0' + dd;
|
||||
}
|
||||
if (mm < 10) {
|
||||
mm = '0' + mm;
|
||||
}
|
||||
if (dd < 10) {
|
||||
dd = '0' + dd
|
||||
}
|
||||
if (mm < 10) {
|
||||
mm = '0' + mm
|
||||
}
|
||||
|
||||
if (iso) return `${yyyy}-${mm}-${dd}`;
|
||||
if (iso) return `${yyyy}-${mm}-${dd}`
|
||||
|
||||
return `${dd}.${mm}.${yyyy}`;
|
||||
return `${dd}.${mm}.${yyyy}`
|
||||
}
|
||||
|
||||
function timestampToIsoTzFormat(timestamp) {
|
||||
return format(new Date(timestamp * 1000), 'yyyy-MM-dd\'T\'HH:mm:ss.SSXXX');
|
||||
return format(new Date(timestamp * 1000), "yyyy-MM-dd'T'HH:mm:ss.SSXXX")
|
||||
}
|
||||
|
||||
function dateToTimestamp(date) {
|
||||
return getTime(date) / 1000;
|
||||
return getTime(date) / 1000
|
||||
}
|
||||
|
||||
function getMonday(date) {
|
||||
let day = date.getDate() - date.getDay() + 1;
|
||||
return new Date(date.getFullYear(), date.getMonth(), day);
|
||||
let day = date.getDate() - date.getDay() + 1
|
||||
return new Date(date.getFullYear(), date.getMonth(), day)
|
||||
}
|
||||
|
||||
function getDayName(dateStr) {
|
||||
return new Date(dateStr).toLocaleDateString("pl", {weekday: "long"});
|
||||
return new Date(dateStr).toLocaleDateString('pl', { weekday: 'long' })
|
||||
}
|
||||
|
||||
function getWeekDaysFrom(startDate, number = 5) {
|
||||
if (!(startDate instanceof Date)) startDate = getDateFromTick(startDate);
|
||||
if (!(startDate instanceof Date)) startDate = getDateFromTick(startDate)
|
||||
|
||||
const days = [];
|
||||
for (let i = 0; i < number; i++) {
|
||||
let date = addDays(startDate, i);
|
||||
days.push([
|
||||
getDayName(date),
|
||||
formatDate(toDate(date)),
|
||||
date
|
||||
]);
|
||||
}
|
||||
const days = []
|
||||
for (let i = 0; i < number; i++) {
|
||||
let date = addDays(startDate, i)
|
||||
days.push([getDayName(date), formatDate(toDate(date)), date])
|
||||
}
|
||||
|
||||
return days;
|
||||
return days
|
||||
}
|
||||
|
||||
function getPrevWeekTick(tick) {
|
||||
return getPrevTick(tick, WEEK_TICK);
|
||||
return getPrevTick(tick, WEEK_TICK)
|
||||
}
|
||||
|
||||
function getPrevDayTick(tick) {
|
||||
return getPrevTick(tick, DAY_TICK);
|
||||
return getPrevTick(tick, DAY_TICK)
|
||||
}
|
||||
|
||||
function getNextWeekTick(tick) {
|
||||
return getNextTick(tick, WEEK_TICK);
|
||||
return getNextTick(tick, WEEK_TICK)
|
||||
}
|
||||
|
||||
function getNextDayTick(tick) {
|
||||
return getNextTick(tick, DAY_TICK);
|
||||
return getNextTick(tick, DAY_TICK)
|
||||
}
|
||||
|
||||
function getNextTick(tick, plus) {
|
||||
tick = tick ? tick : getTickFromDate(new Date());
|
||||
return parseInt(tick) + plus;
|
||||
tick = tick ? tick : getTickFromDate(new Date())
|
||||
return parseInt(tick) + plus
|
||||
}
|
||||
|
||||
function getPrevTick(tick, minus) {
|
||||
tick = tick ? tick : getTickFromDate(new Date());
|
||||
return parseInt(tick) - minus;
|
||||
tick = tick ? tick : getTickFromDate(new Date())
|
||||
return parseInt(tick) - minus
|
||||
}
|
||||
|
||||
exports.getDateString = getDateFromTick;
|
||||
exports.getWeekDaysFrom = getWeekDaysFrom;
|
||||
exports.getDayName = getDayName;
|
||||
exports.getPrevDayTick = getPrevDayTick;
|
||||
exports.getNextDayTick = getNextDayTick;
|
||||
exports.getPrevWeekTick = getPrevWeekTick;
|
||||
exports.getNextWeekTick = getNextWeekTick;
|
||||
exports.formatDate = formatDate;
|
||||
exports.timestampToIsoTzFormat = timestampToIsoTzFormat;
|
||||
exports.dateToTimestamp = dateToTimestamp;
|
||||
exports.getDateString = getDateFromTick
|
||||
exports.getWeekDaysFrom = getWeekDaysFrom
|
||||
exports.getDayName = getDayName
|
||||
exports.getPrevDayTick = getPrevDayTick
|
||||
exports.getNextDayTick = getNextDayTick
|
||||
exports.getPrevWeekTick = getPrevWeekTick
|
||||
exports.getNextWeekTick = getNextWeekTick
|
||||
exports.formatDate = formatDate
|
||||
exports.timestampToIsoTzFormat = timestampToIsoTzFormat
|
||||
exports.dateToTimestamp = dateToTimestamp
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
function getByValue(dictionary, index, value, def = {}) {
|
||||
const val = dictionary.filter(obj => {
|
||||
return obj[index] === value;
|
||||
})[0];
|
||||
const val = dictionary.filter((obj) => {
|
||||
return obj[index] === value
|
||||
})[0]
|
||||
|
||||
if (!val) return def;
|
||||
return val;
|
||||
if (!val) return def
|
||||
return val
|
||||
}
|
||||
|
||||
exports.getByValue = getByValue;
|
||||
exports.getByValue = getByValue
|
||||
|
|
|
@ -1,9 +1,14 @@
|
|||
exports.getGradeColorByCategoryName = name => {
|
||||
switch (true) {
|
||||
case name.includes("czarny"): return "000000";
|
||||
case name.includes("czerw"): return "F04C4C";
|
||||
case name.includes("fiol"): return "B16CF1";
|
||||
case name.includes("nieb"): return "20A4F7";
|
||||
case name.includes("zielony"): return "6ECD07";
|
||||
}
|
||||
};
|
||||
exports.getGradeColorByCategoryName = (name) => {
|
||||
switch (true) {
|
||||
case name.includes('czarny'):
|
||||
return '000000'
|
||||
case name.includes('czerw'):
|
||||
return 'F04C4C'
|
||||
case name.includes('fiol'):
|
||||
return 'B16CF1'
|
||||
case name.includes('nieb'):
|
||||
return '20A4F7'
|
||||
case name.includes('zielony'):
|
||||
return '6ECD07'
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue