mirror of
https://github.com/plankanban/planka.git
synced 2025-08-04 21:15:25 +02:00
Docker, update readme, update dependencies
This commit is contained in:
parent
2398199740
commit
adbcb67f03
30 changed files with 1202 additions and 1744 deletions
|
@ -13,7 +13,7 @@ const http = {};
|
|||
return result;
|
||||
}, new FormData());
|
||||
|
||||
return fetch(`${Config.API_URL}${Config.API_PATH}${url}`, {
|
||||
return fetch(`${Config.SERVER_BASE_URL}/api${url}`, {
|
||||
method,
|
||||
headers,
|
||||
body: formData,
|
||||
|
|
|
@ -5,7 +5,7 @@ import Config from '../constants/Config';
|
|||
|
||||
const io = sailsIOClient(socketIOClient);
|
||||
|
||||
io.sails.url = Config.API_URL;
|
||||
io.sails.url = Config.SERVER_BASE_URL;
|
||||
io.sails.autoConnect = false;
|
||||
io.sails.reconnection = true;
|
||||
io.sails.useCORSRouteToGetCookie = false;
|
||||
|
@ -22,7 +22,7 @@ socket.connect = socket._connect; // eslint-disable-line no-underscore-dangle
|
|||
method,
|
||||
data,
|
||||
headers,
|
||||
url: `${Config.API_PATH}${url}`,
|
||||
url: `/api${url}`,
|
||||
},
|
||||
(_, { body, error }) => {
|
||||
if (error) {
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
const API_URL = 'http://localhost:1337';
|
||||
const API_PATH = '';
|
||||
const SERVER_BASE_URL = process.env.REACT_APP_SERVER_BASE_URL
|
||||
|| (process.env.NODE_ENV === 'production' ? '' : 'http://localhost:1337');
|
||||
|
||||
const POSITION_GAP = 65535;
|
||||
|
||||
const ACTIONS_LIMIT = 10;
|
||||
|
||||
export default {
|
||||
API_URL,
|
||||
API_PATH,
|
||||
SERVER_BASE_URL,
|
||||
POSITION_GAP,
|
||||
ACTIONS_LIMIT,
|
||||
};
|
||||
|
|
|
@ -3,14 +3,8 @@ import ReactDOM from 'react-dom';
|
|||
|
||||
import store from './store';
|
||||
import history from './history';
|
||||
import * as serviceWorker from './service-worker';
|
||||
import Root from './components/Root';
|
||||
|
||||
import './i18n';
|
||||
|
||||
ReactDOM.render(React.createElement(Root, { store, history }), document.getElementById('root'));
|
||||
|
||||
// If you want your app to work offline and load faster, you can change
|
||||
// unregister() to register() below. Note this comes with some pitfalls.
|
||||
// Learn more about service workers: http://bit.ly/CRA-PWA
|
||||
serviceWorker.register();
|
||||
|
|
|
@ -15,8 +15,7 @@ export default {
|
|||
addUser_title: 'Add User',
|
||||
administrator: 'Administrator',
|
||||
all: 'All',
|
||||
allChangesWillBeAutomaticallySavedAfterConnectionRestored:
|
||||
'All changes will be automatically saved<br />after connection restored',
|
||||
allChangesWillBeAutomaticallySavedAfterConnectionRestored: 'All changes will be automatically saved<br />after connection restored',
|
||||
areYouSureYouWantToDeleteThisBoard: 'Are you sure you want to delete this board?',
|
||||
areYouSureYouWantToDeleteThisCard: 'Are you sure you want to delete this card?',
|
||||
areYouSureYouWantToDeleteThisComment: 'Are you sure you want to delete this comment?',
|
||||
|
@ -25,8 +24,7 @@ export default {
|
|||
areYouSureYouWantToDeleteThisProject: 'Are you sure you want to delete this project?',
|
||||
areYouSureYouWantToDeleteThisTask: 'Are you sure you want to delete this task?',
|
||||
areYouSureYouWantToDeleteThisUser: 'Are you sure you want to delete this user?',
|
||||
areYouSureYouWantToRemoveThisMemberFromProject:
|
||||
'Are you sure you want to remove this member from project?',
|
||||
areYouSureYouWantToRemoveThisMemberFromProject: 'Are you sure you want to remove this member from project?',
|
||||
boardNotFound_title: 'Board Not Found',
|
||||
cardActions_title: 'Card Actions',
|
||||
cardNotFound_title: 'Card Not Found',
|
||||
|
@ -72,10 +70,8 @@ export default {
|
|||
notifications: 'Notifications',
|
||||
noUnreadNotifications: 'No unread notifications',
|
||||
openBoard_title: 'Open Board',
|
||||
pageNotFound_title: 'Page Not Found',
|
||||
projectNotFound_title: 'Project Not Found',
|
||||
refreshPageToLoadLastDataAndReceiveUpdates:
|
||||
'<0>Refresh the page</0> to load last data<br />and receive updates',
|
||||
refreshPageToLoadLastDataAndReceiveUpdates: '<0>Refresh the page</0> to load last data<br />and receive updates',
|
||||
removeMember_title: 'Remove Member',
|
||||
seconds: 'Seconds',
|
||||
taskActions_title: 'Task Actions',
|
||||
|
@ -87,8 +83,7 @@ export default {
|
|||
userIsAlreadyExist: 'User is already exist',
|
||||
userLeftNewCommentToCard: '{{user}} left a new comment «{{comment}}» to <2>{{card}}</2>',
|
||||
userMovedCardFromListToList: '{{user}} moved <2>{{card}}</2> from {{fromList}} to {{toList}}',
|
||||
userMovedThisCardFromListToList:
|
||||
'<0>{{user}}</0><1> moved this card from {{fromList}} to {{toList}}</1>',
|
||||
userMovedThisCardFromListToList: '<0>{{user}}</0><1> moved this card from {{fromList}} to {{toList}}</1> 12342134123412412412412412412',
|
||||
users: 'Users',
|
||||
writeComment: 'Write a comment...',
|
||||
},
|
||||
|
|
|
@ -6,6 +6,7 @@ export default {
|
|||
invalidPassword: 'Invalid password',
|
||||
logInToPlanka: 'Log in to Planka',
|
||||
noInternetConnection: 'No internet connection',
|
||||
pageNotFound_title: 'Page Not Found',
|
||||
password: 'Password',
|
||||
projectManagment: 'Project managment',
|
||||
serverConnectionFailed: 'Server connection failed',
|
||||
|
|
|
@ -19,8 +19,7 @@ export default {
|
|||
addUser: 'Добавление пользователя',
|
||||
administrator: 'Администратор',
|
||||
all: 'Все',
|
||||
allChangesWillBeAutomaticallySavedAfterConnectionRestored:
|
||||
'Все изменения сохранятся автоматически,<br />как только подключение восстановится',
|
||||
allChangesWillBeAutomaticallySavedAfterConnectionRestored: 'Все изменения сохранятся автоматически,<br />как только подключение восстановится',
|
||||
areYouSureYouWantToDeleteThisBoard: 'Вы уверены, что хотите удалить эту доску?',
|
||||
areYouSureYouWantToDeleteThisCard: 'Вы уверены, что хотите удалить эту карточку?',
|
||||
areYouSureYouWantToDeleteThisComment: 'Вы уверены, что хотите удалить этот комментарий?',
|
||||
|
@ -29,8 +28,7 @@ export default {
|
|||
areYouSureYouWantToDeleteThisProject: 'Вы уверены, что хотите удалить этот проект?',
|
||||
areYouSureYouWantToDeleteThisTask: 'Вы уверены, что хотите удалить эту задачу?',
|
||||
areYouSureYouWantToDeleteThisUser: 'Вы уверены, что хотите удалить этого пользователя?',
|
||||
areYouSureYouWantToRemoveThisMemberFromProject:
|
||||
'Вы уверены, что хотите удалить этого участника из проекта?',
|
||||
areYouSureYouWantToRemoveThisMemberFromProject: 'Вы уверены, что хотите удалить этого участника из проекта?',
|
||||
boardNotFound: 'Доска не найдена',
|
||||
cardActions: 'Действия с карточкой',
|
||||
cardNotFound: 'Карточка не найдена',
|
||||
|
@ -76,10 +74,8 @@ export default {
|
|||
notifications: 'Уведомления',
|
||||
noUnreadNotifications: 'Уведомлений нет',
|
||||
openBoard: 'Откройте доску',
|
||||
pageNotFound: 'Страница не найдена',
|
||||
projectNotFound: 'Доска не найдена',
|
||||
refreshPageToLoadLastDataAndReceiveUpdates:
|
||||
'<0>Обновите страницу</0>, чтобы загрузить<br />актуальные данные и получать обновления',
|
||||
refreshPageToLoadLastDataAndReceiveUpdates: '<0>Обновите страницу</0>, чтобы загрузить<br />актуальные данные и получать обновления',
|
||||
removeMember: 'Удаление участника',
|
||||
seconds: 'Секунды',
|
||||
taskActions: 'Действия с задачей',
|
||||
|
@ -90,10 +86,8 @@ export default {
|
|||
userAddedThisCardToList: '<0>{{user}}</0><1> добавил(а) эту карточку в {{list}}</1>',
|
||||
userIsAlreadyExist: 'Пользователь уже существует',
|
||||
userLeftNewCommentToCard: '{{user}} оставил(а) комментарий «{{comment}}» к <2>{{card}}</2>',
|
||||
userMovedCardFromListToList:
|
||||
'{{user}} переместил(а) <2>{{card}}</2> из {{fromList}} в {{toList}}',
|
||||
userMovedThisCardFromListToList:
|
||||
'<0>{{user}}</0><1> переместил(а) эту карточку из {{fromList}} в {{toList}}</1>',
|
||||
userMovedCardFromListToList: '{{user}} переместил(а) <2>{{card}}</2> из {{fromList}} в {{toList}}',
|
||||
userMovedThisCardFromListToList: '<0>{{user}}</0><1> переместил(а) эту карточку из {{fromList}} в {{toList}}</1>',
|
||||
users: 'Пользователи',
|
||||
writeComment: 'Напишите комментарий...',
|
||||
},
|
||||
|
|
|
@ -6,6 +6,7 @@ export default {
|
|||
invalidPassword: 'Неверный пароль',
|
||||
logInToPlanka: 'Вход в Planka',
|
||||
noInternetConnection: 'Нет соединения',
|
||||
pageNotFound: 'Страница не найдена',
|
||||
password: 'Пароль',
|
||||
projectManagment: 'Управление проектами',
|
||||
serverConnectionFailed: 'Не могу подключиться к серверу',
|
||||
|
|
|
@ -1,135 +0,0 @@
|
|||
// This optional code is used to register a service worker.
|
||||
// register() is not called by default.
|
||||
|
||||
// This lets the app load faster on subsequent visits in production, and gives
|
||||
// it offline capabilities. However, it also means that developers (and users)
|
||||
// will only see deployed updates on subsequent visits to a page, after all the
|
||||
// existing tabs open on the page have been closed, since previously cached
|
||||
// resources are updated in the background.
|
||||
|
||||
// To learn more about the benefits of this model and instructions on how to
|
||||
// opt-in, read http://bit.ly/CRA-PWA
|
||||
|
||||
const isLocalhost = Boolean(
|
||||
window.location.hostname === 'localhost' ||
|
||||
// [::1] is the IPv6 localhost address.
|
||||
window.location.hostname === '[::1]' ||
|
||||
// 127.0.0.1/8 is considered localhost for IPv4.
|
||||
window.location.hostname.match(
|
||||
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
|
||||
)
|
||||
);
|
||||
|
||||
export function register(config) {
|
||||
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
|
||||
// The URL constructor is available in all browsers that support SW.
|
||||
const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);
|
||||
if (publicUrl.origin !== window.location.origin) {
|
||||
// Our service worker won't work if PUBLIC_URL is on a different origin
|
||||
// from what our page is served on. This might happen if a CDN is used to
|
||||
// serve assets; see https://github.com/facebook/create-react-app/issues/2374
|
||||
return;
|
||||
}
|
||||
|
||||
window.addEventListener('load', () => {
|
||||
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
|
||||
|
||||
if (isLocalhost) {
|
||||
// This is running on localhost. Let's check if a service worker still exists or not.
|
||||
checkValidServiceWorker(swUrl, config);
|
||||
|
||||
// Add some additional logging to localhost, pointing developers to the
|
||||
// service worker/PWA documentation.
|
||||
navigator.serviceWorker.ready.then(() => {
|
||||
console.log(
|
||||
'This web app is being served cache-first by a service ' +
|
||||
'worker. To learn more, visit http://bit.ly/CRA-PWA'
|
||||
);
|
||||
});
|
||||
} else {
|
||||
// Is not localhost. Just register service worker
|
||||
registerValidSW(swUrl, config);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function registerValidSW(swUrl, config) {
|
||||
navigator.serviceWorker
|
||||
.register(swUrl)
|
||||
.then(registration => {
|
||||
registration.onupdatefound = () => {
|
||||
const installingWorker = registration.installing;
|
||||
if (installingWorker == null) {
|
||||
return;
|
||||
}
|
||||
installingWorker.onstatechange = () => {
|
||||
if (installingWorker.state === 'installed') {
|
||||
if (navigator.serviceWorker.controller) {
|
||||
// At this point, the updated precached content has been fetched,
|
||||
// but the previous service worker will still serve the older
|
||||
// content until all client tabs are closed.
|
||||
console.log(
|
||||
'New content is available and will be used when all ' +
|
||||
'tabs for this page are closed. See http://bit.ly/CRA-PWA.'
|
||||
);
|
||||
|
||||
// Execute callback
|
||||
if (config && config.onUpdate) {
|
||||
config.onUpdate(registration);
|
||||
}
|
||||
} else {
|
||||
// At this point, everything has been precached.
|
||||
// It's the perfect time to display a
|
||||
// "Content is cached for offline use." message.
|
||||
console.log('Content is cached for offline use.');
|
||||
|
||||
// Execute callback
|
||||
if (config && config.onSuccess) {
|
||||
config.onSuccess(registration);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error during service worker registration:', error);
|
||||
});
|
||||
}
|
||||
|
||||
function checkValidServiceWorker(swUrl, config) {
|
||||
// Check if the service worker can be found. If it can't reload the page.
|
||||
fetch(swUrl)
|
||||
.then(response => {
|
||||
// Ensure service worker exists, and that we really are getting a JS file.
|
||||
const contentType = response.headers.get('content-type');
|
||||
if (
|
||||
response.status === 404 ||
|
||||
(contentType != null && contentType.indexOf('javascript') === -1)
|
||||
) {
|
||||
// No service worker found. Probably a different app. Reload the page.
|
||||
navigator.serviceWorker.ready.then(registration => {
|
||||
registration.unregister().then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
});
|
||||
} else {
|
||||
// Service worker found. Proceed as normal.
|
||||
registerValidSW(swUrl, config);
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
console.log(
|
||||
'No internet connection found. App is running in offline mode.'
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
export function unregister() {
|
||||
if ('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.ready.then(registration => {
|
||||
registration.unregister();
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue