This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="dropdown"> | |
<div> | |
<app-button | |
[text]='"Dropdownmenu"' | |
[isActive]="isOpen" | |
(click)='changeOpenedState()'></app-button> | |
</div> | |
<div class="menu-wrapper" *ngIf='isOpen'> | |
<app-menu></app-menu> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { PersistentUnorderedMap } from "near-sdk-as"; | |
// Создадим объект для хранения | |
export const products = new PersistentUnorderedMap<string, string>("PRODUCTS"); | |
// Реализуем функцию создания новых товаров | |
export function setProduct(id: string, productName: string): void { products.set(id, productName); } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { PlaywrightTestConfig, devices } from '@playwright/test'; | |
/* | |
* See https://playwright.dev/docs/test-configuration. | |
*/ | |
const config: PlaywrightTestConfig = { | |
globalSetup: require.resolve('./e2e/global-setup'), | |
testDir: './e2e', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// global-setup.ts | |
import { chromium, FullConfig } from '@playwright/test'; | |
async function globalSetup(config: FullConfig) { | |
// const { baseURL } = config.projects[0].use; | |
// const browser = await chromium.launch(); | |
// await browser.close(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Konva from "konva"; | |
import { BackLayerRender } from "./backLayerRender"; | |
export class WhiteBoard { | |
stage!: Konva.Stage; | |
mainLayer!: Konva.Layer; | |
backLayer!: Konva.Layer; | |
private backLayerRender!: BackLayerRender; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare const Konva: any; | |
/* | |
* BackLayer render of infinitely whiteboard | |
*/ | |
export class BackLayerRender { | |
currentX = -120; | |
currentY = -120; | |
width = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export abstract class WhiteBoardState { | |
protected whiteBoard: WhiteBoard; | |
setWhiteBoard(whiteBoard: WhiteBoard) { | |
this.whiteBoard = whiteBoard; | |
} | |
public abstract getTool(): SelectedTool; | |
public abstract handleClick(e): void; | |
public abstract handleDragend(e): void; | |
public abstract handleMousedown(e): void; | |
public abstract handleMouseup(e): void; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class WhiteBoard { | |
public whiteBoardState: WhiteBoardState; | |
toReadOnlyState() { | |
this.setState(new WhiteBoardReadOnlyState()); | |
} | |
toShapeState(shapeType: ShapeTypes) { | |
this.setState(new WhiteBoardShapedState()); | |
} | |
... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class WhiteBoardMovedState extends WhiteBoardState { | |
public handleTouchstart(e: any): void { | |
this.whiteBoard.touchStartStage(e.evt); | |
} | |
public handleTouchend(e: any): void { | |
const position = e.currentTarget.position(); | |
this.whiteBoard.offsetX = -position.x; | |
this.whiteBoard.offsetY = -position.y; | |
this.whiteBoard.backLayerRender.updateGrid(this.whiteBoard.width, this.whiteBoard.height, position.x, position.y, this.whiteBoard.scaleOffset); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run -d \ | |
--name=wg-easy \ | |
-e WG_HOST=YOUR_SERVER_IP \ | |
-e PASSWORD=YOUR_ADMIN_PASSWORD \ | |
-v ~/.wg-easy:/etc/wireguard \ | |
-p 51820:51820/udp \ | |
-p 51821:51821/tcp \ | |
--cap-add=NET_ADMIN \ | |
--cap-add=SYS_MODULE \ | |
--sysctl="net.ipv4.conf.all.src_valid_mark=1" \ |