conflict_resolution
stringlengths
27
16k
<<<<<<< ======= hotPort: { type: 'string', }, host: { type: 'string', alias: 'h' }, open: { type: 'boolean', alias: 'o', default: true }, outDir: { type: 'string', alias: 'd' }, outFile: { type: 'string', }, html: { type: 'boolean', default: true }, webpack: { type: 'string', } >>>>>>>
<<<<<<< ======= if (bashProfileExists) { >>>>>>> <<<<<<< if (!bashProfileIncludesText) { console.log("Bash profile did not include text, adding it to profile"); await fsp.appendFile(process.env['HOME'] + '/.bash_profile', textToInsert) ======= if (!bashIncludesText) { console.log("did not include text, adding it to profile"); await fsp.appendFile(process.env['HOME'] + '/.bash_profile', textToInsert) process.env['PATH'] = process.env['HOME'] + '/bin:' + process.env['PATH']; >>>>>>> if (!bashIncludesText) { console.log("did not include text, adding it to profile"); await fsp.appendFile(process.env['HOME'] + '/.bash_profile', textToInsert) process.env['PATH'] = process.env['HOME'] + '/bin:' + process.env['PATH'];
<<<<<<< <ActionButton clickHandler={setAWSCredentials} buttonText={`Submit`} /> <HelpInfoButton clickHandler={displayInfoHandler} /> ======= <ActionButton id={'home_form_buttom'} clickHandler={props.setAWSCredentials} buttonText={`Submit`} /> <HelpInfoButton clickHandler={props.displayInfoHandler} /> >>>>>>> <ActionButton id={'home_form_buttom'} clickHandler={setAWSCredentials} buttonText={`Submit`} /> <HelpInfoButton clickHandler={displayInfoHandler} />
<<<<<<< creatingCluster={creatingCluster} ======= getAndDisplayClusterData={this.getAndDisplayClusterData} >>>>>>> creatingCluster={creatingCluster} getAndDisplayClusterData={this.getAndDisplayClusterData}
<<<<<<< test('x-forwarded-for with unknown first ip', function(t) { t.plan(1); var options = { url: '', headers: { 'x-forwarded-for': 'unknown, 93.186.30.120' } }; // create new server for each test so we can easily close it after the test is done // prevents tests from hanging and competing against closing a global server var server = new serverFactory(); server.listen(0, serverInfo.host); server.on('listening', function() { options.url = 'http://' + serverInfo.host + ':' + server.address().port; request(options, callback); }); function callback(error, response, body) { if (!error && response.statusCode === 200) { // make sure response ip is the same as the one we passed in var secondIp = options.headers['x-forwarded-for'].split(',')[1].trim(); t.equal(secondIp, body); server.close(); } } }); ======= test('cf-connecting-ip', function(t) { t.plan(1); var options = { url: '', headers: { 'cf-connecting-ip': '8.8.8.8' } }; var server = new serverFactory(); server.listen(0, serverInfo.host); server.on('listening', function() { options.url = 'http://' + serverInfo.host + ':' + server.address().port; request(options, callback); }); function callback(error, response, body) { if (!error && response.statusCode === 200) { t.equal(options.headers['cf-connecting-ip'], body); server.close(); } } }); test('true-client-ip', function(t) { t.plan(1); var options = { url: '', headers: { 'true-client-ip': '8.8.8.8' } }; var server = new serverFactory(); server.listen(0, serverInfo.host); server.on('listening', function() { options.url = 'http://' + serverInfo.host + ':' + server.address().port; request(options, callback); }); function callback(error, response, body) { if (!error && response.statusCode === 200) { t.equal(options.headers['true-client-ip'], body); server.close(); } } }); >>>>>>> test('x-forwarded-for with unknown first ip', function(t) { t.plan(1); var options = { url: '', headers: { 'x-forwarded-for': 'unknown, 93.186.30.120' } }; // create new server for each test so we can easily close it after the test is done // prevents tests from hanging and competing against closing a global server var server = new serverFactory(); server.listen(0, serverInfo.host); server.on('listening', function() { options.url = 'http://' + serverInfo.host + ':' + server.address().port; request(options, callback); }); function callback(error, response, body) { if (!error && response.statusCode === 200) { // make sure response ip is the same as the one we passed in var secondIp = options.headers['x-forwarded-for'].split(',')[1].trim(); t.equal(secondIp, body); server.close(); } } }); test('cf-connecting-ip', function(t) { t.plan(1); var options = { url: '', headers: { 'cf-connecting-ip': '8.8.8.8' } }; var server = new serverFactory(); server.listen(0, serverInfo.host); server.on('listening', function() { options.url = 'http://' + serverInfo.host + ':' + server.address().port; request(options, callback); }); function callback(error, response, body) { if (!error && response.statusCode === 200) { t.equal(options.headers['cf-connecting-ip'], body); server.close(); } } }); test('true-client-ip', function(t) { t.plan(1); var options = { url: '', headers: { 'true-client-ip': '8.8.8.8' } }; var server = new serverFactory(); server.listen(0, serverInfo.host); server.on('listening', function() { options.url = 'http://' + serverInfo.host + ':' + server.address().port; request(options, callback); }); function callback(error, response, body) { if (!error && response.statusCode === 200) { t.equal(options.headers['true-client-ip'], body); server.close(); } } });
<<<<<<< js = falafel(js, parseOptions, function(node) { ======= var patternReplacement = unwrapNodes(pattern, replacement); pattern = patternReplacement[0]; replacement = patternReplacement[1]; return falafel(js, parseOptions, function(node) { >>>>>>> var patternReplacement = unwrapNodes(pattern, replacement); pattern = patternReplacement[0]; replacement = patternReplacement[1]; js = falafel(js, parseOptions, function(node) { <<<<<<< // esformatter doesn't like shebangs // remove if one exists as the first line if (js.indexOf('#!') === 0) { js = js.substring(js.indexOf('\n')); } var pattern = esprima.parse(searchRule, { ======= var pattern = unwrapNode(esprima.parse(searchRule, { >>>>>>> // esformatter doesn't like shebangs // remove if one exists as the first line if (js.indexOf('#!') === 0) { js = js.substring(js.indexOf('\n')); } var pattern = unwrapNode(esprima.parse(searchRule, {
<<<<<<< function isRestWildcard(node) { return node.type == "SpreadElement" && isWildcard(node.argument); } function matchPartial(wildcards, patterns, nodes) { ======= // Exposes the "meat" of the node function unwrapNode(node) { // If the program is only one expression/statement // assume we want to match the contents. if (node.type == 'Program' && node.body.length == 1) { node = unwrapNode(node.body[0]); // We want to match the expression, not the statement. } else if (node.type == 'ExpressionStatement') { node = unwrapNode(node.expression); } return node; } // Same as `unwrapNode` except that this ensures both nodes are in sync function unwrapNodes(a, b) { if (a.type == 'Program' && a.body.length == 1 && b.type == 'Program' && b.body.length == 1) { return unwrapNodes(a.body[0], b.body[0]); } else if (a.type == 'ExpressionStatement' && b.type == 'ExpressionStatement') { return unwrapNodes(a.expression, b.expression); } return [a, b]; } function partial(wildcards, patterns, nodes) { >>>>>>> function isRestWildcard(node) { return node.type == "SpreadElement" && isWildcard(node.argument); } // Exposes the "meat" of the node function unwrapNode(node) { // If the program is only one expression/statement // assume we want to match the contents. if (node.type == 'Program' && node.body.length == 1) { node = unwrapNode(node.body[0]); // We want to match the expression, not the statement. } else if (node.type == 'ExpressionStatement') { node = unwrapNode(node.expression); } return node; } // Same as `unwrapNode` except that this ensures both nodes are in sync function unwrapNodes(a, b) { if (a.type == 'Program' && a.body.length == 1 && b.type == 'Program' && b.body.length == 1) { return unwrapNodes(a.body[0], b.body[0]); } else if (a.type == 'ExpressionStatement' && b.type == 'ExpressionStatement') { return unwrapNodes(a.expression, b.expression); } return [a, b]; } function matchPartial(wildcards, patterns, nodes) {
<<<<<<< import React, { useEffect, useState } from "react"; import { useSelector, useDispatch } from "react-redux"; import * as actions from "../actions/actions"; import { BrowserRouter as Router, Switch, Route, Link } from "react-router-dom"; import Metrics from "./tabs/Metrics"; import Images from "./tabs/Images"; import Yml from "./tabs/Yml"; import Running from "./tabs/Running"; import Stopped from "./tabs/Stopped"; import LTMetrics from "./tabs/LTMetrics"; import * as helper from "./helper/commands"; import Docketeer from "../../assets/docketeer-title.png"; import Settings from "./tabs/Settings"; import startNotificationRequester from "./helper/notificationsRequester"; ======= import React, { useEffect, useState } from 'react'; import { useSelector, useDispatch } from 'react-redux'; import * as actions from '../actions/actions'; import { BrowserRouter as Router, Switch, Route, Link } from 'react-router-dom'; import Metrics from './tabs/Metrics'; import Images from './tabs/Images'; import Yml from './tabs/Yml'; import Running from './tabs/Running'; import Stopped from './tabs/Stopped'; import LTMetrics from './tabs/LTMetrics'; import * as helper from './helper/commands'; import Docketeer from '../../assets/docketeer-title.png'; import Settings from './tabs/Settings'; import startNotificationRequester from './helper/notificationsRequester'; import { HelpOutlineSharp } from '@material-ui/icons'; >>>>>>> import React, { useEffect, useState } from "react"; import { useSelector, useDispatch } from "react-redux"; import * as actions from "../actions/actions"; import { BrowserRouter as Router, Switch, Route, Link } from "react-router-dom"; import Metrics from "./tabs/Metrics"; import Images from "./tabs/Images"; import Yml from "./tabs/Yml"; import Running from "./tabs/Running"; import Stopped from "./tabs/Stopped"; import LTMetrics from "./tabs/LTMetrics"; import * as helper from "./helper/commands"; import Docketeer from "../../assets/docketeer-title.png"; import Settings from "./tabs/Settings"; import startNotificationRequester from "./helper/notificationsRequester"; import { HelpOutlineSharp } from "@material-ui/icons"; <<<<<<< useEffect(() => { helper.writeToDb(); helper.displayNetwork(getComposeYmlFiles); }, []); ======= >>>>>>> <<<<<<< <i className="fas fa-settings"></i>Settings ======= <i className='fas fa-settings'></i> Settings >>>>>>> <i className="fas fa-settings"></i> Settings <<<<<<< <Route path="/LTMetrics"> ======= {/* <Route path='/LTMetrics'> >>>>>>> {/* <Route path='/LTMetrics'> <<<<<<< </Route> <Route path="/yml"> ======= </Route> */} <Route path='/yml'> >>>>>>> </Route> */} <Route path="/yml">
<<<<<<< console.log("I am here6") console.log(stdout); ======= >>>>>>> <<<<<<< console.log(convertedValue) ======= console.log(convertedValue); >>>>>>> console.log(convertedValue); <<<<<<< console.log("I am here 7") console.log("newList.length", newList.length); ======= console.log(newList.length) >>>>>>> console.log(newList.length) <<<<<<< export const runIm = (id, runningList) => { ======= export const runIm = (id, runningList, callback_1, callback_2) => { >>>>>>> export const runIm = (id, runningList, callback_1, callback_2) => {
<<<<<<< console.log('*** Rendered Settings ***'); const [tempPhoneNumber, setTempPhoneNumber] = useState(''); // styling ======= const [tempPhoneNumber, setTempPhoneNumber] = useState(""); >>>>>>> const [tempPhoneNumber, setTempPhoneNumber] = useState('');
<<<<<<< ======= useEffect(() => { helper.writeToDb(); helper.displayNetwork(getComposeYmlFiles); helper.setDbSessionTimeZone(); }, []); >>>>>>>
<<<<<<< ======= case types.ADD_RUNNING_CONTAINERS: const newRunningList = state.runningList.slice(); for (let container of action.payload) { newRunningList.push(container); } return { ...state, runningList: newRunningList }; case types.ADD_PHONE_NUMBER: return { ...state, phoneNumber: action.payload, }; case types.REMOVE_CONTAINER: const removeContainerList = []; for (let container of state.stoppedList) { if (container.cid !== action.payload) { removeContainerList.push(container); } } return { ...state, stoppedList: removeContainerList }; case types.STOP_RUNNING_CONTAINER: const newStoppedList = state.stoppedList.slice(); const newestRunningList = []; for (let container of state.runningList) { if (container.cid !== action.payload) { newestRunningList.push(container); } else { newStoppedList.push(container); } } return { ...state, runningList: newestRunningList, stoppedList: newStoppedList, }; case types.ADD_STOPPED_CONTAINERS: const newerStoppedList = state.stoppedList.slice(); for (let container of action.payload) { newerStoppedList.push(container); } return { ...state, stoppedList: newerStoppedList }; case types.RUN_STOPPED_CONTAINER: console.log('HITTING RUN_STOPPED IN REDUCERS'); const runningListCopy = state.runningList.slice(); const newerStoppedContainer = []; for (let container of state.stoppedList) { if (container.cid === action.payload) { runningListCopy.push(container) } else { newerStoppedContainer.push(container); } } return { ...state, runningList: runningListCopy, stoppedList: newerStoppedContainer, }; case types.GET_IMAGES: const newImagesList = state.imagesList.slice(); for (let image of action.payload) { newImagesList.push(image); } return { ...state, imagesList: newImagesList, }; case types.REMOVE_IMAGE: const newRemoveImage = []; for (let image of state.imagesList) { if (image.id !== action.payload) { newRunningList.push(image); } } return { ...state, imageList: newRemoveImage }; case types.REFRESH_RUNNING_CONTAINERS: const newRunningList2 = []; for (let container of action.payload) { newRunningList2.push(container); } return { ...state, runningList: newRunningList2 }; case types.REFRESH_STOPPED_CONTAINERS: const newStoppedList4 = []; for (let container of action.payload) { newStoppedList4.push(container); } return { ...state, stoppedList: newStoppedList4 }; case types.REFRESH_IMAGES: const newImagesList2 = []; for (let image of action.payload) { newImagesList2.push(image); } ; return { ...state, imagesList: newImagesList2 } case types.COMPOSE_YML_FILES: console.log('action.payload compose YML FILESs: ', action.payload); const newnetworkList = state.networkList.slice(); newnetworkList.push(action.payload[0]); return { ...state, networkList: newnetworkList }; case types.GET_COMPOSED_YML_FILES: const newNetworkList2 = state.networkList.slice(); console.log('action.payload get compose:', action.payload); let keys = Object.keys(action.payload); for (let i = 0; i < keys.length; i++) { console.log('action.payload[keys[i]]: ', action.payload[keys[i]]) let newKey = keys[i] let obj = {}; obj[newKey] = action.payload[keys[i]]; newNetworkList2.push(obj); } // console.log('GET_COMPOSED_YML_FILES action.payload: ', action.payload); // console.log('GET_COMPOSED_YML_FILES networkList state: ', newNetworkList2); return { ...state, networkList: newNetworkList2 }; case types.COMPOSE_DOWN: console.log('Compose down action.payload: ', action.payload); const newNetworkList = state.networkList.slice(); const targetNetwork = action.payload; // parse this because " " for (let i = 0; i < newNetworkList.length; i++) { const network = newNetworkList[i]; if (network[targetNetwork]) { newNetworkList.splice(i, 1); break; } } return { ...state, networkList: newNetworkList }; >>>>>>> <<<<<<< if (action.payload === "clear") return { ...state, graphAxis: [] }; let payloadDate = new Date(action.payload).toISOString(); if ( payloadDate > state.graphAxis[state.graphAxis.length - 1] || !state.graphAxis.length ) { ======= console.log('action.payload build axis:', action.payload); if (action.payload === 'clear') return { ...state, graphAxis: [] }; // cuts the timezone off. let formatedDate = action.payload.toString().slice(0, 24) // compare two string dates if (formatedDate > state.graphAxis[state.graphAxis.length - 1] || !state.graphAxis.length) { >>>>>>>
<<<<<<< import React, { Component, Fragment } from "react"; ======= import React, { Component, Fragment } from 'react'; import PropTypes from 'prop-types'; >>>>>>> import React, { Component, Fragment } from 'react';
<<<<<<< const parser = new DOMParser(); // eslint-disable-line let xml = $scope.xmlCodeBox.getValue(); xml = xml.replace(/..xml.+\?>/,''); ======= const text = $scope.xmlCodeBox.getValue(); const xml = replaceIllegalXML(text); >>>>>>> const text = $scope.xmlCodeBox.getValue(); let xml = replaceIllegalXML(text); xml = xml.replace(/..xml.+\?>/,'');
<<<<<<< import prepError from 'plugins/wazuh/services/prep-error'; import chrome from 'ui/chrome'; import * as modules from 'ui/modules' ======= /* * Wazuh app - Generic request service * Copyright (C) 2018 Wazuh, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Find more information about this on the LICENSE file. */ const prepError = require('plugins/wazuh/services/prep-error'); import chrome from 'ui/chrome'; >>>>>>> /* * Wazuh app - Generic request service * Copyright (C) 2018 Wazuh, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Find more information about this on the LICENSE file. */ import prepError from 'plugins/wazuh/services/prep-error'; import chrome from 'ui/chrome'; import * as modules from 'ui/modules'
<<<<<<< }; this.visualizeProps = { selectedTab: this.tab, updateRootScope: (prop, value) => { this.$rootScope[prop] = value; this.$rootScope.$applyAsync(); }, cardReqs: {} }; ======= }; >>>>>>> }; <<<<<<< if ( newTab !== 'pci' && newTab !== 'gdpr' && newTab !== 'hipaa' && newTab !== 'nist' ) { this.visualizeProps.cardReqs = {}; } if (newTab === 'pci') { this.visualizeProps.cardReqs = { items: await this.commonData.getPCI(), reqTitle: 'PCI DSS Requirement' }; } if (newTab === 'gdpr') { this.visualizeProps.cardReqs = { items: await this.commonData.getGDPR(), reqTitle: 'GDPR Requirement' }; } if (newTab === 'hipaa') { this.visualizeProps.cardReqs = { items: await this.commonData.getHIPAA(), reqTitle: 'HIPAA Requirement' }; } if (newTab === 'nist') { this.visualizeProps.cardReqs = { items: await this.commonData.getNIST(), reqTitle: 'NIST 800-53 Requirement' }; } this.visualizeProps.selectedTab = newTab; ======= >>>>>>>
<<<<<<< export default err => { ======= /* * Wazuh app - Module for error messages * Copyright (C) 2018 Wazuh, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Find more information about this on the LICENSE file. */ module.exports = err => { >>>>>>> /* * Wazuh app - Module for error messages * Copyright (C) 2018 Wazuh, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Find more information about this on the LICENSE file. */ export default err => {
<<<<<<< import './wz-config-item/wz-config-item.less'; import './wz-tag-filter/wz-tag-filter'; import './wz-tag-filter/wz-tag-filter.less'; ======= import './wz-config-item/wz-config-item.less'; import './wz-config-viewer/wz-config-viewer'; >>>>>>> import './wz-config-item/wz-config-item.less'; import './wz-tag-filter/wz-tag-filter'; import './wz-tag-filter/wz-tag-filter.less'; import './wz-config-viewer/wz-config-viewer';
<<<<<<< this.$scope.lookingAssessment = false; ======= this.$scope.expandArray = [ false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false ]; >>>>>>> this.$scope.lookingAssessment = false; this.$scope.expandArray = [ false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false ]; <<<<<<< async launchRootcheckScan() { try { const isActive = ((this.$scope.agent || {}).status || '') === 'Active'; if (!isActive) { throw new Error('Agent is not active') } await this.apiReq.request( 'PUT', `/rootcheck/${this.$scope.agent.id}`, {} ); this.errorHandler.info( `Policy monitoring scan launched successfully on agent ${ this.$scope.agent.id }`, '' ); } catch (error) { this.errorHandler.handle(error, ''); } return; } async launchSyscheckScan() { try { const isActive = ((this.$scope.agent || {}).status || '') === 'Active'; if (!isActive) { throw new Error('Agent is not active') } await this.apiReq.request('PUT', `/syscheck/${this.$scope.agent.id}`, {}); this.errorHandler.info( `FIM scan launched successfully on agent ${this.$scope.agent.id}`, '' ); } catch (error) { this.errorHandler.handle(error, ''); } return; } ======= falseAllExpand() { this.$scope.expandArray = [ false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false ]; } expand(i) { const oldValue = this.$scope.expandArray[i]; this.falseAllExpand(); this.$scope.expandArray[i] = !oldValue; } >>>>>>> async launchRootcheckScan() { try { const isActive = ((this.$scope.agent || {}).status || '') === 'Active'; if (!isActive) { throw new Error('Agent is not active') } await this.apiReq.request( 'PUT', `/rootcheck/${this.$scope.agent.id}`, {} ); this.errorHandler.info( `Policy monitoring scan launched successfully on agent ${ this.$scope.agent.id }`, '' ); } catch (error) { this.errorHandler.handle(error, ''); } return; } async launchSyscheckScan() { try { const isActive = ((this.$scope.agent || {}).status || '') === 'Active'; if (!isActive) { throw new Error('Agent is not active') } await this.apiReq.request('PUT', `/syscheck/${this.$scope.agent.id}`, {}); this.errorHandler.info( `FIM scan launched successfully on agent ${this.$scope.agent.id}`, '' ); } catch (error) { this.errorHandler.handle(error, ''); } return; } falseAllExpand() { this.$scope.expandArray = [ false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false ]; } expand(i) { const oldValue = this.$scope.expandArray[i]; this.falseAllExpand(); this.$scope.expandArray[i] = !oldValue; }
<<<<<<< ======= if($scope.tab !== 'configuration' && $scope.tab !== 'welcome') tabHistory.push($scope.tab) >>>>>>> <<<<<<< if(tab !== 'welcome' && tab !== 'configuration') tabHistory.push(tab); if (tabHistory.length > 2) tabHistory = tabHistory.slice(-2); ======= if(tab !== 'configuration' && tab !== 'welcome') tabHistory.push(tab) if (tabHistory.length > 2) tabHistory = tabHistory.slice(-2); >>>>>>> if(tab !== 'configuration' && tab !== 'welcome') tabHistory.push(tab); if (tabHistory.length > 2) tabHistory = tabHistory.slice(-2); <<<<<<< const preserveDiscover = tabHistory.length === 2 && tabHistory[0] === tabHistory[1]; ======= const preserveDiscover = tabHistory.length === 2 && tabHistory[0] === tabHistory[1] && !force; >>>>>>> const preserveDiscover = tabHistory.length === 2 && tabHistory[0] === tabHistory[1] && !force;
<<<<<<< const targetSubTab = (this.targetLocation && typeof this.targetLocation === 'object' ? this.targetLocation.subTab: 'panels'); if (this.$scope.tab === 'configuration') { this.firstLoad(); } else { ======= if (this.$scope.tab !== 'configuration') { >>>>>>> const targetSubTab = (this.targetLocation && typeof this.targetLocation === 'object' ? this.targetLocation.subTab: 'panels'); if (this.$scope.tab !== 'configuration') {
<<<<<<< import cron from 'node-cron' import needle from 'needle' import getPath from'../util/get-path' import colors from 'ansicolors' import log from './logger' import ElasticWrapper from './lib/elastic-wrapper' import monitoringTemplate from './integration-files/monitoring-template' import packageJSON from '../package.json' export default (server, options) => { const blueWazuh = colors.blue('wazuh'); const index_pattern = "wazuh-monitoring-3.x-*"; const index_prefix = "wazuh-monitoring-3.x-"; ======= /* * Wazuh app - Module for agent info fetching functions * Copyright (C) 2018 Wazuh, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Find more information about this on the LICENSE file. */ const cron = require('node-cron'); const needle = require('needle'); const getPath = require('../util/get-path'); const colors = require('ansicolors'); const blueWazuh = colors.blue('wazuh'); const { log } = require('./logger'); const ElasticWrapper = require('./lib/elastic-wrapper'); const index_pattern = "wazuh-monitoring-3.x-*"; const index_prefix = "wazuh-monitoring-3.x-"; module.exports = (server, options) => { >>>>>>> /* * Wazuh app - Module for agent info fetching functions * Copyright (C) 2018 Wazuh, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Find more information about this on the LICENSE file. */ import cron from 'node-cron' import needle from 'needle' import getPath from'../util/get-path' import colors from 'ansicolors' import log from './logger' import ElasticWrapper from './lib/elastic-wrapper' import monitoringTemplate from './integration-files/monitoring-template' import packageJSON from '../package.json' export default (server, options) => { const blueWazuh = colors.blue('wazuh'); const index_pattern = "wazuh-monitoring-3.x-*"; const index_prefix = "wazuh-monitoring-3.x-"; <<<<<<< ======= let packageJSON = {}; // Read Wazuh App package file try { packageJSON = require('../package.json'); } catch (error) { log('[monitoring]', error.message || error); server.log([blueWazuh, 'monitoring', 'error'], 'Could not read the Wazuh package file due to ' + error.message || error); } >>>>>>>
<<<<<<< import ErrorResponse from './error-response' ======= import { Parser } from 'json2csv'; >>>>>>> import ErrorResponse from './error-response' import { Parser } from 'json2csv';
<<<<<<< const loadSyscollector = async id => { try { const data = await Promise.all([ apiReq.request('GET', `/syscollector/${id}/hardware`, {}), apiReq.request('GET', `/syscollector/${id}/os`, {}), apiReq.request('GET', `/syscollector/${id}/netiface`, {}), apiReq.request('GET', `/syscollector/${id}/ports`, {}), apiReq.request('GET', `/syscollector/${id}/packages`, { limit: 1, select: 'scan_time' }), apiReq.request('GET', `/syscollector/${id}/processes`, { limit: 1, select: 'scan_time' }) ]); if ( !data[0] || !data[0].data || !data[0].data.data || typeof data[0].data.data !== 'object' || !Object.keys(data[0].data.data).length || !data[1] || !data[1].data || !data[1].data.data || typeof data[1].data.data !== 'object' || !Object.keys(data[1].data.data).length ) { $scope.syscollector = null; } else { const netiface = {}; const ports = {}; const packagesDate = {}; const processesDate = {}; if (data[2] && data[2].data && data[2].data.data) Object.assign(netiface, data[2].data.data); if (data[3] && data[3].data && data[3].data.data) Object.assign(ports, data[3].data.data); if (data[4] && data[4].data && data[4].data.data) Object.assign(packagesDate, data[4].data.data); if (data[5] && data[5].data && data[5].data.data) Object.assign(processesDate, data[5].data.data); $scope.syscollector = { hardware: data[0].data.data, os: data[1].data.data, netiface: netiface, ports: ports, packagesDate: packagesDate && packagesDate.items && packagesDate.items.length ? packagesDate.items[0].scan_time : 'Unknown', processesDate: processesDate && processesDate.items && processesDate.items.length ? processesDate.items[0].scan_time : 'Unknown' }; } ======= //Destroy this.$scope.$on('$destroy', () => { this.visFactoryService.clearAll(); }); >>>>>>> const loadSyscollector = async id => { try { const data = await Promise.all([ apiReq.request('GET', `/syscollector/${id}/hardware`, {}), apiReq.request('GET', `/syscollector/${id}/os`, {}), apiReq.request('GET', `/syscollector/${id}/netiface`, {}), apiReq.request('GET', `/syscollector/${id}/ports`, {}), apiReq.request('GET', `/syscollector/${id}/packages`, { limit: 1, select: 'scan_time' }), apiReq.request('GET', `/syscollector/${id}/processes`, { limit: 1, select: 'scan_time' }) ]); if ( !data[0] || !data[0].data || !data[0].data.data || typeof data[0].data.data !== 'object' || !Object.keys(data[0].data.data).length || !data[1] || !data[1].data || !data[1].data.data || typeof data[1].data.data !== 'object' || !Object.keys(data[1].data.data).length ) { $scope.syscollector = null; } else { const netiface = {}; const ports = {}; const packagesDate = {}; const processesDate = {}; if (data[2] && data[2].data && data[2].data.data) Object.assign(netiface, data[2].data.data); if (data[3] && data[3].data && data[3].data.data) Object.assign(ports, data[3].data.data); if (data[4] && data[4].data && data[4].data.data) Object.assign(packagesDate, data[4].data.data); if (data[5] && data[5].data && data[5].data.data) Object.assign(processesDate, data[5].data.data); $scope.syscollector = { hardware: data[0].data.data, os: data[1].data.data, netiface: netiface, ports: ports, packagesDate: packagesDate && packagesDate.items && packagesDate.items.length ? packagesDate.items[0].scan_time : 'Unknown', processesDate: processesDate && processesDate.items && processesDate.items.length ? processesDate.items[0].scan_time : 'Unknown' }; } } } this.$scope.$on('$destroy', () => { this.visFactoryService.clearAll(); });
<<<<<<< app.controller('agentsPreviewController', function ($scope, DataFactory, Notifier, errlog, genericReq, Agents, apiReq) { ======= app.controller('agentsPreviewController', function ($scope, $mdDialog, DataFactory, Notifier, errlog, genericReq, Agents, apiReq) { >>>>>>> app.controller('agentsPreviewController', function ($scope, $mdDialog, DataFactory, Notifier, errlog, genericReq, Agents, apiReq) { <<<<<<< $scope.agentsStatus = false; ======= $scope.newAgent = { 'name': '', 'ip': '' }; $scope.newAgentKey = ''; >>>>>>> $scope.agentsStatus = false; $scope.newAgent = { 'name': '', 'ip': '' }; $scope.newAgentKey = '';
<<<<<<< import * as modules from 'ui/modules' const app = modules.get('app/wazuh', []); ======= /* * Wazuh app - Dynamic directive * Copyright (C) 2018 Wazuh, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Find more information about this on the LICENSE file. */ const app = require('ui/modules').get('app/wazuh', []); >>>>>>> /* * Wazuh app - Dynamic directive * Copyright (C) 2018 Wazuh, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Find more information about this on the LICENSE file. */ import * as modules from 'ui/modules' const app = modules.get('app/wazuh', []);
<<<<<<< import ElasticWrapper from '../lib/elastic-wrapper'; import fs from 'fs'; import yml from 'js-yaml'; import path from 'path'; ======= /* * Wazuh app - Class for Wazuh-Elastic functions * Copyright (C) 2018 Wazuh, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Find more information about this on the LICENSE file. */ const ElasticWrapper = require('../lib/elastic-wrapper'); >>>>>>> /* * Wazuh app - Class for Wazuh-Elastic functions * Copyright (C) 2018 Wazuh, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Find more information about this on the LICENSE file. */ import ElasticWrapper from '../lib/elastic-wrapper'; import fs from 'fs'; import yml from 'js-yaml'; import path from 'path'; <<<<<<< const raw = await this.buildVisualizationsRaw(file,req.params.pattern,req.params.timestamp); return res({acknowledge: true, raw: raw }); ======= const bulkBody = this.buildVisualizationsBulk(file,req.params.pattern,req.params.timestamp,clusterName); const output = await this.wzWrapper.pushBulkToKibanaIndex(bulkBody); return res({acknowledge: true, output: output }); >>>>>>> const raw = await this.buildVisualizationsRaw(file,req.params.pattern,req.params.timestamp); return res({acknowledge: true, raw: raw }); <<<<<<< } ======= } module.exports = WazuhElastic; >>>>>>> }
<<<<<<< import * as modules from 'ui/modules' const app = modules.get('app/wazuh', []); ======= /* * Wazuh app - Manager controllers * Copyright (C) 2018 Wazuh, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Find more information about this on the LICENSE file. */ // Require config let app = require('ui/modules').get('app/wazuh', []); >>>>>>> /* * Wazuh app - Manager controllers * Copyright (C) 2018 Wazuh, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Find more information about this on the LICENSE file. */ import * as modules from 'ui/modules' const app = modules.get('app/wazuh', []);
<<<<<<< import {Text} from './text/text'; ======= import {Sprites} from './sprites/sprites'; >>>>>>> import {Sprites} from './sprites/sprites'; import {Text} from './text/text'; <<<<<<< StyleManager.register(Points); StyleManager.register(Text); ======= StyleManager.register(Points); StyleManager.register(Sprites); >>>>>>> StyleManager.register(Points); StyleManager.register(Sprites); StyleManager.register(Text);
<<<<<<< import { WzFilterBar } from '../../../components/wz-filter-bar/wz-filter-bar'; import { CheckUpgrade } from './checkUpgrade'; import { toastNotifications } from 'ui/notify'; import { WzRequest } from '../../../react-services/wz-request'; import { ActionAgents } from '../../../react-services/action-agents'; ======= import { WzFilterBar } from '../../../components/wz-filter-bar/wz-filter-bar'; >>>>>>> import { WzFilterBar } from '../../../components/wz-filter-bar/wz-filter-bar'; import { CheckUpgrade } from './checkUpgrade'; import { toastNotifications } from 'ui/notify'; import { WzRequest } from '../../../react-services/wz-request'; import { ActionAgents } from '../../../react-services/action-agents'; <<<<<<< ======= _isMount = false; >>>>>>> _isMount = false; <<<<<<< totalItems: 0, selectedItems: [], allSelected: false, purgeModal: false }; ======= totalItems: 0 }; >>>>>>> totalItems: 0, selectedItems: [], allSelected: false, purgeModal: false }; <<<<<<< async componentWillMount() { const managerVersion = await WzRequest.apiReq('GET', '/version', {}); const totalAgent = await WzRequest.apiReq('GET', '/agents', {}); const agentActive = await WzRequest.apiReq('GET', '/agents', { q: 'status=active' }); this.setState({ managerVersion: managerVersion.data.data, agentActive: agentActive.data.data.totalItems, avaibleAgents: totalAgent.data.data.items }); } ======= async componentDidMount() { this._isMount = true; await this.getItems(); const filterStatus = this.filterBarModelStatus(); const filterGroups = await this.filterBarModelGroups(); const filterOs = await this.filterBarModelOs(); const filterVersion = await this.filterBarModelWazuhVersion(); const filterOsPlatform = await this.filterBarModelOsPlatform(); const filterNodes = await this.filterBarModelNodes(); this._isMount && this.setState({ filterStatus, filterGroups, filterOs, filterVersion, filterOsPlatform, filterNodes }); } async componentDidUpdate(prevProps, prevState) { if (this.state.isProcessing) { const { q, search } = this.state; const { q: prevQ, search: prevSearch } = prevState; if (prevQ !== q || prevSearch !== search) { this._isMount && this.setState({ pageIndex: 0 }); } await this.getItems(); } } componentWillUnmount() { this._isMount = false; } >>>>>>> async componentWillMount() { const managerVersion = await WzRequest.apiReq('GET', '/version', {}); const totalAgent = await WzRequest.apiReq('GET', '/agents', {}); const agentActive = await WzRequest.apiReq('GET', '/agents', { q: 'status=active' }); this.setState({ managerVersion: managerVersion.data.data, agentActive: agentActive.data.data.totalItems, avaibleAgents: totalAgent.data.data.items }); } <<<<<<< async componentDidMount() { await this.getItems(); const filterStatus = this.filterBarModelStatus(); const filterGroups = await this.filterBarModelGroups(); const filterOs = await this.filterBarModelOs(); const filterVersion = await this.filterBarModelWazuhVersion(); const filterOsPlatform = await this.filterBarModelOsPlatform(); const filterNodes = await this.filterBarModelNodes(); this.setState({ filterStatus, filterGroups, filterOs, filterVersion, filterOsPlatform, filterNodes }); } ======= >>>>>>> async componentDidMount() { await this.getItems(); const filterStatus = this.filterBarModelStatus(); const filterGroups = await this.filterBarModelGroups(); const filterOs = await this.filterBarModelOs(); const filterVersion = await this.filterBarModelWazuhVersion(); const filterOsPlatform = await this.filterBarModelOsPlatform(); const filterNodes = await this.filterBarModelNodes(); this.setState({ filterStatus, filterGroups, filterOs, filterVersion, filterOsPlatform, filterNodes }); } <<<<<<< const totalAgent = await WzRequest.apiReq('GET', '/agents', {}); this.setState({ isProcessing: true, isLoading: true, avaibleAgents: totalAgent.data.data.items }); ======= this._isMount && this.setState({ isProcessing: true, isLoading: true }); >>>>>>> const totalAgent = await WzRequest.apiReq('GET', '/agents', {}); this.setState({ isProcessing: true, isLoading: true, avaibleAgents: totalAgent.data.data.items }); <<<<<<< async componentDidUpdate(prevProps, prevState) { if (this.state.isProcessing) { const { q, search } = this.state; const { q: prevQ, search: prevSearch } = prevState; if (prevQ !== q || prevSearch !== search) { this.setState({ pageIndex: 0 }); } await this.getItems(); } if (prevState.allSelected === false && this.state.allSelected === true) { this.setState({ loadingAllItem: true }); this.getAllItems(); } } ======= >>>>>>> async componentDidUpdate(prevProps, prevState) { if (this.state.isProcessing) { const { q, search } = this.state; const { q: prevQ, search: prevSearch } = prevState; if (prevQ !== q || prevSearch !== search) { this.setState({ pageIndex: 0 }); } await this.getItems(); } if (prevState.allSelected === false && this.state.allSelected === true) { this.setState({ loadingAllItem: true }); this.getAllItems(); } } <<<<<<< const formatedAgents = ( ((rawAgents || {}).data || {}).data || {} ).items.map(this.formatAgent.bind(this)); this.setState({ agents: formatedAgents, totalItems: (((rawAgents || {}).data || {}).data || {}).totalItems, isProcessing: false, isLoading: false }); } async getAllItems() { const { pageIndex, pageSize } = this.state; const filterTable = { offset: pageIndex * pageSize, limit: pageSize, q: this.buildQFilter(), sort: this.buildSortFilter() }; const filterAll = { q: this.buildQFilter(), sort: this.buildSortFilter() }; const rawAgents = await this.props.wzReq('GET', '/agents', filterTable); const agentsFiltered = await this.props .wzReq('GET', '/agents', filterAll) .then(() => { this.setState({ loadingAllItem: false }); }); const formatedAgents = ( ((rawAgents || {}).data || {}).data || {} ).items.map(this.formatAgent.bind(this)); this.setState({ agents: formatedAgents, avaibleAgents: agentsFiltered.data.data.items, totalItems: (((rawAgents || {}).data || {}).data || {}).totalItems, isProcessing: false, isLoading: false }); ======= const formatedAgents = ( ((rawAgents || {}).data || {}).data || {} ).items.map(this.formatAgent.bind(this)); this._isMount && this.setState({ agents: formatedAgents, totalItems: (((rawAgents || {}).data || {}).data || {}).totalItems, isProcessing: false, isLoading: false }); >>>>>>> const formatedAgents = ( ((rawAgents || {}).data || {}).data || {} ).items.map(this.formatAgent.bind(this)); this._isMount && this.setState({ agents: formatedAgents, totalItems: (((rawAgents || {}).data || {}).data || {}).totalItems, isProcessing: false, isLoading: false }); } async getAllItems() { const { pageIndex, pageSize } = this.state; const filterTable = { offset: pageIndex * pageSize, limit: pageSize, q: this.buildQFilter(), sort: this.buildSortFilter() }; const filterAll = { q: this.buildQFilter(), sort: this.buildSortFilter() }; const rawAgents = await this.props.wzReq('GET', '/agents', filterTable); const agentsFiltered = await this.props .wzReq('GET', '/agents', filterAll) .then(() => { this.setState({ loadingAllItem: false }); }); const formatedAgents = ( ((rawAgents || {}).data || {}).data || {} ).items.map(this.formatAgent.bind(this)); this._isMount && this.setState({ agents: formatedAgents, avaibleAgents: agentsFiltered.data.data.items, totalItems: (((rawAgents || {}).data || {}).data || {}).totalItems, isProcessing: false, isLoading: false }); <<<<<<< id: agent.id, name: agent.name, ip: agent.ip, status: agent.status, group: checkField(agent.group), os_name: agent, version: agentVersion, dateAdd: timeService(agent.dateAdd), lastKeepAlive: lastKeepAlive(agent.lastKeepAlive, timeService), actions: agent, upgrading: false }; ======= id: agent.id, name: agent.name, ip: agent.ip, status: agent.status, group: checkField(agent.group), os_name: agent, version: agentVersion, dateAdd: timeService(agent.dateAdd), lastKeepAlive: lastKeepAlive(agent.lastKeepAlive, timeService), actions: agent }; >>>>>>> id: agent.id, name: agent.name, ip: agent.ip, status: agent.status, group: checkField(agent.group), os_name: agent, version: agentVersion, dateAdd: timeService(agent.dateAdd), lastKeepAlive: lastKeepAlive(agent.lastKeepAlive, timeService), actions: agent, upgrading: false }; <<<<<<< return <EuiHealth color={color(status)}>{status}</EuiHealth>; } reloadAgent = () => { this.setState({ isProcessing: true, isLoading: true }); this.props.reload(); }; addUpgradeStatus(version, agent) { const { managerVersion } = this.state; return ( <CheckUpgrade {...agent} managerVersion={managerVersion} changeStatusUpdate={this.changeUpgradingState} reloadAgent={this.reloadAgent} /> ); ======= return <EuiHealth color={color(status)}>{status}</EuiHealth>; >>>>>>> return <EuiHealth color={color(status)}>{status}</EuiHealth>; } reloadAgent = () => { this.setState({ isProcessing: true, isLoading: true }); this.props.reload(); }; addUpgradeStatus(version, agent) { const { managerVersion } = this.state; return ( <CheckUpgrade {...agent} managerVersion={managerVersion} changeStatusUpdate={this.changeUpgradingState} reloadAgent={this.reloadAgent} /> ); <<<<<<< const filterSearch = { name: 'search', value: search }; this.props.downloadCsv([filterQ, filterSearch]); }; ======= const filterSearch = { name: 'search', value: search }; this.props.downloadCsv([filterQ, filterSearch]); }; >>>>>>> const filterSearch = { name: 'search', value: search }; this.props.downloadCsv([filterQ, filterSearch]); }; <<<<<<< sortable: true /* render: (version, agent) => this.addUpgradeStatus(version, agent), */ ======= sortable: true >>>>>>> sortable: true /* render: (version, agent) => this.addUpgradeStatus(version, agent), */
<<<<<<< app.controller('rulesController', function ($scope, $rootScope, Rules, RulesAutoComplete, errorHandler, genericReq, csvReq, appState) { ======= app.controller('rulesController', function ($scope, $rootScope, Rules, RulesRelated, RulesAutoComplete, errorHandler, genericReq, appState) { >>>>>>> app.controller('rulesController', function ($scope, $rootScope, Rules, RulesRelated, RulesAutoComplete, errorHandler, genericReq, appState, csvReq) { <<<<<<< $scope.downloadCsv = async () => { try { const currentApi = JSON.parse(appState.getCurrentAPI()).id; const output = await csvReq.fetch('/rules',currentApi); const csvGenerator = new CsvGenerator(output.csv, 'rules.csv'); csvGenerator.download(true); } catch (error) { errorHandler.handle(error,'Download CSV'); if(!$rootScope.$$phase) $rootScope.$digest(); } } ======= /** * This function takes back to the list but adding a group filter */ $scope.addGroupFilter = (name) => { // Clear the autocomplete component $scope.searchTerm = ''; angular.element(document.querySelector('#autocomplete')).blur(); // Add the filter and go back to the list $scope.rules.addFilter('group', name); $scope.closeDetailView(); } /** * This function takes back to the list but adding a PCI filter */ $scope.addPciFilter = (name) => { // Clear the autocomplete component $scope.searchTerm = ''; angular.element(document.querySelector('#autocomplete')).blur(); // Add the filter and go back to the list $scope.rules.addFilter('pci', name); $scope.closeDetailView(); } /** * This function changes to the rule detail view */ $scope.openDetailView = (rule) => { $scope.currentRule = rule; $scope.rulesRelated.reset(); $scope.rulesRelated.ruleID = $scope.currentRule.id; $scope.rulesRelated.addFilter('file', $scope.currentRule.file); $scope.viewingDetail = true; if(!$scope.$$phase) $scope.$digest(); } /** * This function changes to the rules list view */ $scope.closeDetailView = () => { $scope.viewingDetail = false; $scope.currentRule = false; $scope.rulesRelated.reset(); if(!$scope.$$phase) $scope.$digest(); } >>>>>>> $scope.downloadCsv = async () => { try { const currentApi = JSON.parse(appState.getCurrentAPI()).id; const output = await csvReq.fetch('/rules',currentApi); const csvGenerator = new CsvGenerator(output.csv, 'rules.csv'); csvGenerator.download(true); } catch (error) { errorHandler.handle(error,'Download CSV'); if(!$rootScope.$$phase) $rootScope.$digest(); } } /** * This function takes back to the list but adding a group filter */ $scope.addGroupFilter = (name) => { // Clear the autocomplete component $scope.searchTerm = ''; angular.element(document.querySelector('#autocomplete')).blur(); // Add the filter and go back to the list $scope.rules.addFilter('group', name); $scope.closeDetailView(); } /** * This function takes back to the list but adding a PCI filter */ $scope.addPciFilter = (name) => { // Clear the autocomplete component $scope.searchTerm = ''; angular.element(document.querySelector('#autocomplete')).blur(); // Add the filter and go back to the list $scope.rules.addFilter('pci', name); $scope.closeDetailView(); } /** * This function changes to the rule detail view */ $scope.openDetailView = (rule) => { $scope.currentRule = rule; $scope.rulesRelated.reset(); $scope.rulesRelated.ruleID = $scope.currentRule.id; $scope.rulesRelated.addFilter('file', $scope.currentRule.file); $scope.viewingDetail = true; if(!$scope.$$phase) $scope.$digest(); } /** * This function changes to the rules list view */ $scope.closeDetailView = () => { $scope.viewingDetail = false; $scope.currentRule = false; $scope.rulesRelated.reset(); if(!$scope.$$phase) $scope.$digest(); } <<<<<<< app.controller('decodersController', function ($scope, $rootScope, Decoders, DecodersAutoComplete, errorHandler, genericReq, appState, csvReq) { ======= app.controller('decodersController', function ($scope, $rootScope, $sce, Decoders, DecodersRelated, DecodersAutoComplete, errorHandler, genericReq, appState) { >>>>>>> app.controller('decodersController', function ($scope, $rootScope, $sce, Decoders, DecodersRelated, DecodersAutoComplete, errorHandler, genericReq, appState, csvReq) { <<<<<<< $scope.downloadCsv = async () => { try { const currentApi = JSON.parse(appState.getCurrentAPI()).id; const output = await csvReq.fetch('/decoders',currentApi); const csvGenerator = new CsvGenerator(output.csv, 'decoders.csv'); csvGenerator.download(true); } catch (error) { errorHandler.handle(error,'Download CSV'); if(!$rootScope.$$phase) $rootScope.$digest(); } } ======= /** * This function changes to the decoder detail view */ $scope.openDetailView = (decoder) => { $scope.currentDecoder = decoder; $scope.decodersRelated.reset(); $scope.decodersRelated.path = `/decoders/${$scope.currentDecoder.name}`; $scope.decodersRelated.decoderPosition = $scope.currentDecoder.position; $scope.decodersRelated.nextPage(''); $scope.viewingDetail = true; if(!$scope.$$phase) $scope.$digest(); } /** * This function changes to the decoders list view */ $scope.closeDetailView = () => { $scope.viewingDetail = false; $scope.currentDecoder = false; $scope.decodersRelated.reset(); if(!$scope.$$phase) $scope.$digest(); } >>>>>>> $scope.downloadCsv = async () => { try { const currentApi = JSON.parse(appState.getCurrentAPI()).id; const output = await csvReq.fetch('/decoders',currentApi); const csvGenerator = new CsvGenerator(output.csv, 'decoders.csv'); csvGenerator.download(true); } catch (error) { errorHandler.handle(error,'Download CSV'); if(!$rootScope.$$phase) $rootScope.$digest(); } } /** * This function changes to the decoder detail view */ $scope.openDetailView = (decoder) => { $scope.currentDecoder = decoder; $scope.decodersRelated.reset(); $scope.decodersRelated.path = `/decoders/${$scope.currentDecoder.name}`; $scope.decodersRelated.decoderPosition = $scope.currentDecoder.position; $scope.decodersRelated.nextPage(''); $scope.viewingDetail = true; if(!$scope.$$phase) $scope.$digest(); } /** * This function changes to the decoders list view */ $scope.closeDetailView = () => { $scope.viewingDetail = false; $scope.currentDecoder = false; $scope.decodersRelated.reset(); if(!$scope.$$phase) $scope.$digest(); }
<<<<<<< import Utils from '../utils/utils'; import hashString from '../utils/hash'; // TODO: support high-density `@2x`-style filenames for raster tiles and geo-referenced images ======= import log from '../utils/log'; >>>>>>> import Utils from '../utils/utils'; import hashString from '../utils/hash'; import log from '../utils/log'; // TODO: support high-density `@2x`-style filenames for raster tiles and geo-referenced images <<<<<<< async tileTexture (tile) { let coords = Tile.coordinateWithMaxZoom(tile.coords, this.max_zoom); let key = coords.key; ======= tileTexture (tile) { let coords = this.adjustRasterTileZoom(tile); let key = coords.key; >>>>>>> async tileTexture (tile) { let coords = this.adjustRasterTileZoom(tile); let key = coords.key; <<<<<<< let url = this.formatURL(this.url, { coords }); this.textures[key] = { name: url, url, filtering: this.filtering, coords }; ======= let url = this.formatUrl(this.url, { coords }); this.textures[key] = { url, filtering: this.filtering, coords }; >>>>>>> let url = this.formatURL(this.url, { coords }); this.textures[key] = { name: url, url, filtering: this.filtering, coords };
<<<<<<< $scope.agentOSVersionFilter = function (osVersion) { if (osVersion == 'all') { DataFactory.filters.unset(objectsArray['/agents'], 'os.version'); } else { DataFactory.filters.set(objectsArray['/agents'], 'os.version', osVersion); } DataFactory.setOffset(objectsArray['/agents'],0); DataFactory.get(objectsArray['/agents']).then(function (data) { $scope.agents.items = data.data.items; }); }; ======= function bulkOperation(operation){ var selectedAgents = []; angular.forEach($scope.agents.items, function(agent){ if(agent.selected){ selectedAgents.push(agent.id); } }); var requestData = { 'ids': selectedAgents } if(selectedAgents.length > 0){ switch (operation){ case "delete": apiReq.request('DELETE', '/agents', requestData) .then(function (data) { if(data.data.ids.length!=0){ data.data.ids.forEach(function(id) { notify.error('The agent ' + id + ' was not deleted.'); }); } else{ notify.info(data.data.msg); } load(); }, printError); break; case "restart": apiReq.request('POST', '/agents/restart', requestData) .then(function (data) { if(data.data.ids.length!=0){ data.data.ids.forEach(function(id) { notify.error('The agent ' + id + ' was not restarted.'); }); } else{ notify.info(data.data.msg); } load(); }, printError); break; } } $scope.$parent._bulkOperation="nothing"; } $scope.changeAgentsStatus = function (){ angular.forEach($scope.agents.items, function(agent){ agent.selected = $scope.agentsStatus; }); } $scope.saveNewAgent = function (){ if($scope.newAgent.name != '') { var requestData = { 'name': $scope.newAgent.name, 'ip': $scope.newAgent.ip == '' ? 'any' : $scope.newAgent.ip } apiReq.request('POST', '/agents', requestData) .then(function (data) { if(data.error=='0'){ notify.info('The agent was added successfully.'); apiReq.request('GET', '/agents/' + data.data + '/key', {}) .then(function(data) { $scope.newAgentKey = data.data; load(); }); } else{ $scope.hidePrerenderedDialog(); notify.error('There was an error adding the new agent.'); } }, function(error){ printError(error); $scope.hidePrerenderedDialog(); }); } else{ $scope.hidePrerenderedDialog(); notify.error('The agent name is mandatory.'); } } $scope.showNewAgentDialog = function(ev) { $mdDialog.show({ contentElement: '#newAgentDialog', parent: angular.element(document.body), targetEvent: ev, clickOutsideToClose: true }); }; $scope.showDeletePrompt = function(ev) { // Appending dialog to document.body to cover sidenav in docs app var confirm = $mdDialog.prompt() .title('Remove selected agents') .textContent('Write REMOVE to remove all the selected agents. CAUTION! This action can not be undone.') .targetEvent(ev) .ok('Remove') .cancel('Close'); >>>>>>> $scope.agentOSVersionFilter = function (osVersion) { if (osVersion == 'all') { DataFactory.filters.unset(objectsArray['/agents'], 'os.version'); } else { DataFactory.filters.set(objectsArray['/agents'], 'os.version', osVersion); } DataFactory.setOffset(objectsArray['/agents'],0); DataFactory.get(objectsArray['/agents']).then(function (data) { $scope.agents.items = data.data.items; }); }; function bulkOperation(operation){ var selectedAgents = []; angular.forEach($scope.agents.items, function(agent){ if(agent.selected){ selectedAgents.push(agent.id); } }); var requestData = { 'ids': selectedAgents } if(selectedAgents.length > 0){ switch (operation){ case "delete": apiReq.request('DELETE', '/agents', requestData) .then(function (data) { if(data.data.ids.length!=0){ data.data.ids.forEach(function(id) { notify.error('The agent ' + id + ' was not deleted.'); }); } else{ notify.info(data.data.msg); } load(); }, printError); break; case "restart": apiReq.request('POST', '/agents/restart', requestData) .then(function (data) { if(data.data.ids.length!=0){ data.data.ids.forEach(function(id) { notify.error('The agent ' + id + ' was not restarted.'); }); } else{ notify.info(data.data.msg); } load(); }, printError); break; } } $scope.$parent._bulkOperation="nothing"; } $scope.changeAgentsStatus = function (){ angular.forEach($scope.agents.items, function(agent){ agent.selected = $scope.agentsStatus; }); } $scope.saveNewAgent = function (){ if($scope.newAgent.name != '') { var requestData = { 'name': $scope.newAgent.name, 'ip': $scope.newAgent.ip == '' ? 'any' : $scope.newAgent.ip } apiReq.request('POST', '/agents', requestData) .then(function (data) { if(data.error=='0'){ notify.info('The agent was added successfully.'); apiReq.request('GET', '/agents/' + data.data + '/key', {}) .then(function(data) { $scope.newAgentKey = data.data; load(); }); } else{ $scope.hidePrerenderedDialog(); notify.error('There was an error adding the new agent.'); } }, function(error){ printError(error); $scope.hidePrerenderedDialog(); }); } else{ $scope.hidePrerenderedDialog(); notify.error('The agent name is mandatory.'); } } $scope.showNewAgentDialog = function(ev) { $mdDialog.show({ contentElement: '#newAgentDialog', parent: angular.element(document.body), targetEvent: ev, clickOutsideToClose: true }); }; $scope.showDeletePrompt = function(ev) { // Appending dialog to document.body to cover sidenav in docs app var confirm = $mdDialog.prompt() .title('Remove selected agents') .textContent('Write REMOVE to remove all the selected agents. CAUTION! This action can not be undone.') .targetEvent(ev) .ok('Remove') .cancel('Close');
<<<<<<< console.log(result.data) return (((result || {}).data || {}).data || {}).affected_items; ======= return (((result || {}).data || {}).data || {}).items; >>>>>>> return (((result || {}).data || {}).data || {}).affected_items; <<<<<<< console.log(result.data) return (((result || {}).data || {}).data || {}).affected_items; ======= return (((result || {}).data || {}).data || {}).items; >>>>>>> return (((result || {}).data || {}).data || {}).affected_items; <<<<<<< console.log(result.data) return (((result || {}).data || {}).data || {}).affected_items; ======= return (((result || {}).data || {}).data || {}).items; >>>>>>> return (((result || {}).data || {}).data || {}).affected_items; <<<<<<< console.log(result.data) return (((result || {}).data || {}).data || {}).affected_items; ======= return (((result || {}).data || {}).data || {}).items; >>>>>>> return (((result || {}).data || {}).data || {}).affected_items; <<<<<<< console.log(result.data) return (((result || {}).data || {}).data || {}).affected_items; ======= return (((result || {}).data || {}).data || {}).items; >>>>>>> return (((result || {}).data || {}).data || {}).affected_items;
<<<<<<< this.setState({isLoading: true}); const rawData = await WzRequest.apiReq('GET', '/agents', { params: this.buildFilter() } ); const data = (((rawData || {}).data || {}).data || {}).affected_items; const totalItems = (((rawData || {}).data || {}).data || {}).total_affected_items; ======= this._isMounted && this.setState({isLoading: true}); const rawData = await WzRequest.apiReq('GET', '/agents', this.buildFilter()); const data = (((rawData || {}).data || {}).data || {}).items; const totalItems = (((rawData || {}).data || {}).data || {}).totalItems; >>>>>>> this._isMounted && this.setState({isLoading: true}); const rawData = await WzRequest.apiReq('GET', '/agents', { params: this.buildFilter() }); const data = (((rawData || {}).data || {}).data || {}).affected_items; const totalItems = (((rawData || {}).data || {}).data || {}).total_affected_items; <<<<<<< filterBarModelStatus() { return { label: 'Status', options: [ { label: 'Active', group: 'status' }, { label: 'Disconnected', group: 'status' }, { label: 'Never connected', group: 'status' } ] }; } async filterBarModelGroups() { const rawGroups = await WzRequest.apiReq('GET', '/groups', {}); const itemsGroups = (((rawGroups || {}).data || {}).data || {}).affected_items; const groups = itemsGroups .filter(item => { return item.count > 0; }) .map(item => { return { label: item.name, group: 'group' }; }); return { label: 'Groups', options: groups }; } async filterBarModelOs() { const rawOs = await WzRequest.apiReq( 'GET', '/agents/stats/distinct', { params: { fields: 'os.name,os.version', q: 'id!=000' } } ); const itemsOs = (((rawOs || {}).data || {}).data || {}).affected_items; const os = itemsOs .filter(item => { return Object.keys(item).includes('os'); }) .map(item => { const { name, version } = item.os; return { label: `${name}-${version}`, group: 'osname', query: `os.name=${name};os.version=${version}` }; }); return { label: 'OS Name', options: os }; } async filterBarModelOsPlatform() { const rawOsPlatform = await WzRequest.apiReq( 'GET', '/agents/stats/distinct', { params: { fields: 'os.platform', q: 'id!=000' } } ); const itemsOsPlatform = (((rawOsPlatform || {}).data || {}).data || {}) .affected_items; const osPlatform = itemsOsPlatform .filter(item => { return Object.keys(item).includes('os'); }) .map(item => { const { platform } = item.os; return { label: platform, group: 'osplatform', query: `os.platform=${platform}` }; }); return { label: 'OS Platform', options: osPlatform }; } async filterBarModelNodes() { const rawNodes = await WzRequest.apiReq( 'GET', '/agents/stats/distinct', { params: { fields: 'node_name', q: 'id!=000;node_name!=unknown' } } ); const itemsNodes = (((rawNodes || {}).data || {}).data || {}).affected_items; const nodes = itemsNodes .filter(item => { return Object.keys(item).includes('node_name'); }) .map(item => { const { node_name } = item; return { label: node_name, group: 'nodename', query: `node_name=${node_name}` }; }); return { label: 'Nodes', options: nodes }; } async filterBarModelWazuhVersion() { const rawVersions = await WzRequest.apiReq( 'GET', '/agents/stats/distinct', { params: { fields: 'version', q: 'id!=000' } } ); const itemsVersions = (((rawVersions || {}).data || {}).data || {}).affected_items; const versions = itemsVersions .filter(item => { return Object.keys(item).includes('version'); }) .map(item => { return { label: item.version, group: 'version' }; }); return { label: 'Version', options: versions }; } ======= >>>>>>>
<<<<<<< export default [ ======= /* * Wazuh app - Module for Agents/OSCAP visualizations * Copyright (C) 2018 Wazuh, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Find more information about this on the LICENSE file. */ module.exports = [{ "_id": "Wazuh-App-Agents-OSCAP-Higher-score-metric", "_source": { "title": "Wazuh App Agents OSCAP Higher score metric", "visState": "{\"title\":\"Wazuh App Agents OSCAP Higher score metric\",\"type\":\"metric\",\"params\":{\"addTooltip\":true,\"addLegend\":false,\"type\":\"gauge\",\"gauge\":{\"verticalSplit\":false,\"autoExtend\":false,\"percentageMode\":false,\"gaugeType\":\"Metric\",\"gaugeStyle\":\"Full\",\"backStyle\":\"Full\",\"orientation\":\"vertical\",\"colorSchema\":\"Green to Red\",\"gaugeColorMode\":\"None\",\"useRange\":false,\"colorsRange\":[{\"from\":0,\"to\":100}],\"invertColors\":false,\"labels\":{\"show\":true,\"color\":\"black\"},\"scale\":{\"show\":false,\"labels\":false,\"color\":\"#333\",\"width\":2},\"type\":\"simple\",\"style\":{\"fontSize\":20,\"bgColor\":false,\"labelColor\":false,\"subText\":\"\"}}},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"max\",\"schema\":\"metric\",\"params\":{\"field\":\"data.oscap.scan.score\",\"customLabel\":\"Higher score\"}}]}", "uiStateJSON": "{\"vis\":{\"defaultColors\":{\"0 - 100\":\"rgb(0,104,55)\"}}}", "description": "", "version": 1, "kibanaSavedObjectMeta": { "searchSourceJSON": "{\"index\":\"wazuh-alerts\",\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"}}" } }, "_type": "visualization" }, >>>>>>> /* * Wazuh app - Module for Agents/OSCAP visualizations * Copyright (C) 2018 Wazuh, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Find more information about this on the LICENSE file. */ export default [
<<<<<<< .value('Logtest', Logtest) .value('ToolsWelcomeCards', ToolsWelcomeCards) .value('TestConfiguration', TestConfiguration) .value('EuiSwitch', EuiSwitch); ======= .value('EuiSwitch', EuiSwitch) .value('EuiSpacer',EuiSpacer); >>>>>>> .value('Logtest', Logtest) .value('ToolsWelcomeCards', ToolsWelcomeCards) .value('TestConfiguration', TestConfiguration) .value('EuiSwitch', EuiSwitch) .value('EuiSpacer',EuiSpacer);
<<<<<<< assignFilters($scope.tab, $scope.agent.id, localChange); $rootScope.$emit('changeTabView',{tabView:subtab}); ======= assignFilters($scope.tab, $scope.agent.id, localChange || preserveDiscover); $rootScope.$emit('changeTabView',{tabView:subtab}) >>>>>>> assignFilters($scope.tab, $scope.agent.id, localChange || preserveDiscover); $rootScope.$emit('changeTabView',{tabView:subtab}); <<<<<<< const preserveDiscover = $scope.tab === 'configuration'; ======= const preserveDiscover = tabHistory.length === 3 && tabHistory[0] === tabHistory[2] && tabHistory[1] === 'configuration'; >>>>>>> const preserveDiscover = tabHistory.length === 3 && tabHistory[0] === tabHistory[2] && tabHistory[1] === 'configuration';
<<<<<<< import { RulesetHandler } from './ruleset-handler'; ======= import { SaveConfig } from './save-config'; >>>>>>> import { RulesetHandler } from './ruleset-handler'; import { SaveConfig } from './save-config'; <<<<<<< .service('groupHandler', GroupHandler) .service('rulesetHandler', RulesetHandler); ======= .service('groupHandler', GroupHandler) .service('saveConfig', SaveConfig); >>>>>>> .service('groupHandler', GroupHandler) .service('rulesetHandler', RulesetHandler) .service('saveConfig', SaveConfig);
<<<<<<< export default { ======= /* * Wazuh app - Module for monitoring template * Copyright (C) 2018 Wazuh, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Find more information about this on the LICENSE file. */ module.exports = { >>>>>>> /* * Wazuh app - Module for monitoring template * Copyright (C) 2018 Wazuh, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Find more information about this on the LICENSE file. */ export default {
<<<<<<< import { WAZUH_ALERTS_PATTERN } from '../../../../util/constants'; ======= import { AppState } from '../../../react-services/app-state'; >>>>>>> import { WAZUH_ALERTS_PATTERN } from '../../../../util/constants'; import { AppState } from '../../../react-services/app-state'; <<<<<<< "index": WAZUH_ALERTS_PATTERN ======= "index": AppState.getCurrentPattern() || "wazuh-alerts-3.x-*" >>>>>>> "index": AppState.getCurrentPattern() || WAZUH_ALERTS_PATTERN
<<<<<<< import React, { Component, Fragment } from "react"; ======= import React, { Component, Fragment } from 'react'; import PropTypes from 'prop-types'; import {} from '@elastic/eui'; >>>>>>> import React, { Component, Fragment } from 'react';
<<<<<<< import * as modules from 'ui/modules' const app = modules.get('app/wazuh', []); ======= /* * Wazuh app - Ruleset controllers * Copyright (C) 2018 Wazuh, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Find more information about this on the LICENSE file. */ let app = require('ui/modules').get('app/wazuh', []); >>>>>>> /* * Wazuh app - Ruleset controllers * Copyright (C) 2018 Wazuh, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Find more information about this on the LICENSE file. */ import * as modules from 'ui/modules' const app = modules.get('app/wazuh', []); <<<<<<< $rootScope.rawVisualizations = null; const data = await genericReq.request('GET',`/api/wazuh-elastic/create-vis/manager-ruleset-rules/${$rootScope.visTimestamp}/${appState.getCurrentPattern()}`) $rootScope.rawVisualizations = data.data.raw; ======= await genericReq.request('GET',`/api/wazuh-elastic/create-vis/manager-ruleset-rules/${$rootScope.visTimestamp}/${appState.getCurrentPattern()}`) >>>>>>> $rootScope.rawVisualizations = null; const data = await genericReq.request('GET',`/api/wazuh-elastic/create-vis/manager-ruleset-rules/${$rootScope.visTimestamp}/${appState.getCurrentPattern()}`) $rootScope.rawVisualizations = data.data.raw; <<<<<<< $rootScope.rawVisualizations = null; const data = await genericReq.request('GET',`/api/wazuh-elastic/create-vis/manager-ruleset-decoders/${$rootScope.visTimestamp}/${appState.getCurrentPattern()}`) $rootScope.rawVisualizations = data.data.raw; ======= await genericReq.request('GET',`/api/wazuh-elastic/create-vis/manager-ruleset-decoders/${$rootScope.visTimestamp}/${appState.getCurrentPattern()}`) >>>>>>> $rootScope.rawVisualizations = null; const data = await genericReq.request('GET',`/api/wazuh-elastic/create-vis/manager-ruleset-decoders/${$rootScope.visTimestamp}/${appState.getCurrentPattern()}`) $rootScope.rawVisualizations = data.data.raw;
<<<<<<< Tile.buildGeometry(tile, self.layers, self.rules, self.styles).then(keys => { resolve(WorkerBroker.returnWithTransferables({ tile: Tile.slice(tile, keys) })); ======= Tile.buildGeometry(tile, self.config, self.rules, self.styles).then(keys => { resolve({ tile: Tile.slice(tile, keys) }); >>>>>>> Tile.buildGeometry(tile, self.config, self.rules, self.styles).then(keys => { resolve(WorkerBroker.returnWithTransferables({ tile: Tile.slice(tile, keys) })); <<<<<<< return Tile.buildGeometry(tile, self.layers, self.rules, self.styles).then(keys => { return WorkerBroker.returnWithTransferables({ tile: Tile.slice(tile, keys) }); ======= return Tile.buildGeometry(tile, self.config, self.rules, self.styles).then(keys => { return { tile: Tile.slice(tile, keys) }; >>>>>>> return Tile.buildGeometry(tile, self.config, self.rules, self.styles).then(keys => { return WorkerBroker.returnWithTransferables({ tile: Tile.slice(tile, keys) });
<<<<<<< this.$scope.getAgentStatusClass = agentStatus => agentStatus === 'active' ? 'teal' : 'red'; ======= this.$scope.getAgentStatusClass = agentStatus => agentStatus === 'Active' ? 'teal' : 'red'; >>>>>>> this.$scope.getAgentStatusClass = agentStatus => agentStatus === 'active' ? 'teal' : 'red'; <<<<<<< return ['active', 'disconnected'].includes(agentStatus) ? agentStatus : 'never connected'; ======= return ['Active', 'Disconnected'].includes(agentStatus) ? agentStatus : 'Never connected'; >>>>>>> return ['active', 'disconnected'].includes(agentStatus) ? agentStatus : 'never connected'; <<<<<<< const failed = result && Array.isArray(result.failed_items) && result.failed_items.length; ======= const failed = result && Array.isArray(result.failed_ids) && result.failed_ids.length; >>>>>>> const failed = result && Array.isArray(result.failed_items) && result.failed_items.length; <<<<<<< .then(() => this.apiReq.request('GET', `/agents`, { params: { list_agents: this.$scope.agent.id, } })) ======= .then(() => this.apiReq.request('GET', `/agents/${this.$scope.agent.id}`, {}) ) >>>>>>> .then(() => this.apiReq.request('GET', `/agents`, { params: { list_agents: this.$scope.agent.id, } })) <<<<<<< const agentInfo = await this.apiReq.request( 'GET', `/agents`, { params: { list_agents: this.$scope.agent.id, select: 'status' } } ); ======= const agentInfo = await this.apiReq.request( 'GET', `/agents/${this.$scope.agent.id}`, { select: 'status' } ); >>>>>>> const agentInfo = await this.apiReq.request( 'GET', `/agents`, { params: { list_agents: this.$scope.agent.id, select: 'status' } } ); <<<<<<< (((((agentInfo || {}).data || {}).data || {}).affected_items || [])[0] || {}).status || this.$scope.agent.status; } catch (error) {} // eslint-disable-line ======= (((agentInfo || {}).data || {}).data || {}).status || this.$scope.agent.status; } catch (error) {} // eslint-disable-line >>>>>>> (((((agentInfo || {}).data || {}).data || {}).affected_items || [])[0] || {}).status || this.$scope.agent.status; } catch (error) {} // eslint-disable-line <<<<<<< if (tab === 'pci') { this.$scope.visualizeProps.cardReqs = { items: await this.commonData.getPCI(), reqTitle: 'PCI DSS Requirement' }; } if (tab === 'gdpr') { this.$scope.visualizeProps.cardReqs = { items: await this.commonData.getGDPR(), reqTitle: 'GDPR Requirement' }; } if (tab === 'mitre') { const result = await this.apiReq.request('GET', '/rules/mitre', {}); //TODO: adapt to API 4.0 when Core merges Mitre. this.$scope.mitreIds = ((((result || {}).data) || {}).data || {}).items this.$scope.mitreCardsSliderProps = { items: this.$scope.mitreIds, attacksCount: this.$scope.attacksCount, reqTitle: 'MITRE', wzReq: (method, path, body) => this.apiReq.request(method, path, body), addFilter: id => this.addMitrefilter(id), }; } if (tab === 'hipaa') { this.$scope.visualizeProps.cardReqs = { items: await this.commonData.getHIPAA(), reqTitle: 'HIPAA Requirement' }; } if (tab === 'nist') { this.$scope.visualizeProps.cardReqs = { items: await this.commonData.getNIST(), reqTitle: 'NIST 800-53 Requirement' }; } ======= >>>>>>> <<<<<<< selectedTab: this.$scope.tab || (this.currentPanel && this.currentPanel.length ? this.currentPanel[0] : ''), tabs: cleanTabs, ======= selectedTab: this.$scope.tab || (this.currentPanel && this.currentPanel.length ? this.currentPanel[0] : ''), tabs: cleanTabs >>>>>>> selectedTab: this.$scope.tab || (this.currentPanel && this.currentPanel.length ? this.currentPanel[0] : ''), tabs: cleanTabs <<<<<<< this.$scope.isSynchronized = (((((isSync || {}).data || {}).data || {}).affected_items || [])[0] || {}).synced || false; ======= this.$scope.isSynchronized = (((isSync || {}).data || {}).data || {}).synced || false; >>>>>>> this.$scope.isSynchronized = (((((isSync || {}).data || {}).data || {}).affected_items || [])[0] || {}).synced || false; <<<<<<< const syscollectorData = await this.genericReq.request( 'GET', `/api/syscollector/${id}` ); ======= const syscollectorData = await this.genericReq.request( 'GET', `/api/syscollector/${id}` ); >>>>>>> const syscollectorData = await this.genericReq.request( 'GET', `/api/syscollector/${id}` ); <<<<<<< const breadcrumb = [{ text: '' }, { text: 'Agents', href: '/app/wazuh#/agents-preview' }, { text: `${this.$scope.agent.name} (${this.$scope.agent.id})` }, ======= const breadcrumb = [ { text: '' }, { text: 'Agents', href: '/app/wazuh#/agents-preview' }, { text: `${this.$scope.agent.name} (${this.$scope.agent.id})` } >>>>>>> const breadcrumb = [ { text: '' }, { text: 'Agents', href: '/app/wazuh#/agents-preview' }, { text: `${this.$scope.agent.name} (${this.$scope.agent.id})` } <<<<<<< await this.apiReq.request('PUT', `/syscheck`, { params: { list_agents: this.$scope.agent.id } }); this.errorHandler.info( `FIM scan launched successfully on agent ${this.$scope.agent.id}`, '' ); ======= await this.apiReq.request('PUT', `/syscheck/${this.$scope.agent.id}`, {}); this.errorHandler.info( `FIM scan launched successfully on agent ${this.$scope.agent.id}`, '' ); >>>>>>> await this.apiReq.request('PUT', `/syscheck`, { params: { list_agents: this.$scope.agent.id } }); this.errorHandler.info( `FIM scan launched successfully on agent ${this.$scope.agent.id}`, '' );
<<<<<<< export default [ ======= /* * Wazuh app - Module for Agents/Audit visualizations * Copyright (C) 2018 Wazuh, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Find more information about this on the LICENSE file. */ module.exports = [{ "_id": "Wazuh-App-Agents-Audit-New-files-metric", "_source": { "title": "Wazuh App Agents Audit New files metric", "visState": "{\"title\":\"Wazuh App Agents Audit New files metric\",\"type\":\"metric\",\"params\":{\"addTooltip\":true,\"addLegend\":false,\"type\":\"gauge\",\"gauge\":{\"verticalSplit\":false,\"autoExtend\":false,\"percentageMode\":false,\"gaugeType\":\"Metric\",\"gaugeStyle\":\"Full\",\"backStyle\":\"Full\",\"orientation\":\"vertical\",\"colorSchema\":\"Green to Red\",\"gaugeColorMode\":\"None\",\"useRange\":false,\"colorsRange\":[{\"from\":0,\"to\":100}],\"invertColors\":false,\"labels\":{\"show\":true,\"color\":\"black\"},\"scale\":{\"show\":false,\"labels\":false,\"color\":\"#333\",\"width\":2},\"type\":\"simple\",\"style\":{\"fontSize\":20,\"bgColor\":false,\"labelColor\":false,\"subText\":\"\"}}},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{\"customLabel\":\"New files\"}}]}", "uiStateJSON": "{\"vis\":{\"defaultColors\":{\"0 - 100\":\"rgb(0,104,55)\"}}}", "description": "", "version": 1, "kibanaSavedObjectMeta": { "searchSourceJSON": "{\"index\":\"wazuh-alerts\",\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"}}" } }, "_type": "visualization" }, >>>>>>> /* * Wazuh app - Module for Agents/Audit visualizations * Copyright (C) 2018 Wazuh, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Find more information about this on the LICENSE file. */ export default [
<<<<<<< ======= onTimeChange = (datePicker) => { const {start:from, end:to} = datePicker; this.setState({datePicker: {from, to}}); } getOptions(){ return [ { value: 'pci', text: 'PCI DSS' }, { value: 'gdpr', text: 'GDPR' }, { value: 'nist', text: 'NIST 800-53' }, { value: 'hipaa', text: 'HIPAA' }, { value: 'gpg13', text: 'GPG13' }, { value: 'tsc', text: 'TSC' }, ]; } setSelectValue(e){ this.setState({selectedRequirement: e.target.value}); } getRequirementVis(){ if(this.state.selectedRequirement === 'pci'){ return 'Wazuh-App-Agents-Welcome-Top-PCI'; } if(this.state.selectedRequirement === 'gdpr'){ return 'Wazuh-App-Agents-Welcome-Top-GDPR'; } if(this.state.selectedRequirement === 'hipaa'){ return 'Wazuh-App-Agents-Welcome-Top-HIPAA'; } if(this.state.selectedRequirement === 'nist'){ return 'Wazuh-App-Agents-Welcome-Top-NIST-800-53'; } if(this.state.selectedRequirement === 'gpg13'){ return 'Wazuh-App-Agents-Welcome-Top-GPG-13'; } if(this.state.selectedRequirement === 'tsc'){ return 'Wazuh-App-Agents-Welcome-Top-TSC'; } return 'Wazuh-App-Agents-Welcome-Top-PCI' } >>>>>>> getOptions(){ return [ { value: 'pci', text: 'PCI DSS' }, { value: 'gdpr', text: 'GDPR' }, { value: 'nist', text: 'NIST 800-53' }, { value: 'hipaa', text: 'HIPAA' }, { value: 'gpg13', text: 'GPG13' }, { value: 'tsc', text: 'TSC' }, ]; } setSelectValue(e){ this.setState({selectedRequirement: e.target.value}); } getRequirementVis(){ if(this.state.selectedRequirement === 'pci'){ return 'Wazuh-App-Agents-Welcome-Top-PCI'; } if(this.state.selectedRequirement === 'gdpr'){ return 'Wazuh-App-Agents-Welcome-Top-GDPR'; } if(this.state.selectedRequirement === 'hipaa'){ return 'Wazuh-App-Agents-Welcome-Top-HIPAA'; } if(this.state.selectedRequirement === 'nist'){ return 'Wazuh-App-Agents-Welcome-Top-NIST-800-53'; } if(this.state.selectedRequirement === 'gpg13'){ return 'Wazuh-App-Agents-Welcome-Top-GPG-13'; } if(this.state.selectedRequirement === 'tsc'){ return 'Wazuh-App-Agents-Welcome-Top-TSC'; } return 'Wazuh-App-Agents-Welcome-Top-PCI' }
<<<<<<< this.$scope.agentsCoverity = (active / total) * 100; this.$scope.daemons = daemons; this.$scope.managerInfo = managerInfo; this.$scope.totalRules = totalRules.totalItems; this.$scope.totalDecoders = totalDecoders.totalItems; ======= this.$scope.agentsCoverity = total ? (active / total) * 100 : 0; this.$scope.daemons = data[1].data.data; this.$scope.managerInfo = data[2].data.data; this.$scope.totalRules = data[3].data.data.totalItems; this.$scope.totalDecoders = data[4].data.data.totalItems; >>>>>>> this.$scope.agentsCoverity = total ? (active / total) * 100 : 0; this.$scope.daemons = daemons; this.$scope.managerInfo = managerInfo; this.$scope.totalRules = totalRules.totalItems; this.$scope.totalDecoders = totalDecoders.totalItems;
<<<<<<< /** * This set an API entry as default * @param {Object} req * @param {Object} reply * Request response or ErrorResponse */ async setAPIEntryDefault(req, reply) { try { // Searching for previous default const data = await this.wzWrapper.searchActiveDocumentsWazuhIndex(req); if (data.hits.total === 1) { await this.wzWrapper.updateWazuhIndexDocument(data.hits.hits[0]._id, { doc: { active: 'false' } }); } await this.wzWrapper.updateWazuhIndexDocument(req.params.id, { doc: { active: 'true' } }); return reply({ statusCode: 200, message: 'ok' }); } catch (error) { log('PUT /elastic/apis/{id}', error.message || error); return ErrorResponse( `Could not save data in elasticsearch due to ${error.message || error}`, 2003, 500, reply ); } } /** * This check if connection and auth on an API is correct * @param {Object} payload */ ======= >>>>>>> /** * This check if connection and auth on an API is correct * @param {Object} payload */
<<<<<<< import React, { Component, Fragment } from "react"; ======= import React, { Component, Fragment } from 'react'; import PropTypes from 'prop-types'; >>>>>>> import React, { Component, Fragment } from 'react';
<<<<<<< import React, { Component, Fragment } from "react"; ======= import React, { Component, Fragment } from 'react'; import PropTypes from 'prop-types'; >>>>>>> import React, { Component, Fragment } from 'react';
<<<<<<< app.controller('rulesController', function ($scope, $rootScope, $sce, Rules, RulesRelated, RulesAutoComplete, errorHandler, genericReq, appState, csvReq) { ======= app.controller('rulesController', function ($timeout, $scope, $rootScope, Rules, RulesRelated, RulesAutoComplete, errorHandler, genericReq, appState, csvReq) { >>>>>>> app.controller('rulesController', function ($timeout, $scope, $rootScope, $sce, Rules, RulesRelated, RulesAutoComplete, errorHandler, genericReq, appState, csvReq) {
<<<<<<< import knownFields from '../integration-files/known-fields'; ======= /* * Wazuh app - Class for the Elastic wrapper * Copyright (C) 2018 Wazuh, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Find more information about this on the LICENSE file. */ const knownFields = require('../integration-files/known-fields'); >>>>>>> /* * Wazuh app - Class for the Elastic wrapper * Copyright (C) 2018 Wazuh, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Find more information about this on the LICENSE file. */ import knownFields from '../integration-files/known-fields';
<<<<<<< import * as modules from 'ui/modules' const app = modules.get('app/wazuh', []); ======= /* * Wazuh app - Error handler service * Copyright (C) 2018 Wazuh, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Find more information about this on the LICENSE file. */ const app = require('ui/modules').get('app/wazuh', []); >>>>>>> /* * Wazuh app - Error handler service * Copyright (C) 2018 Wazuh, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Find more information about this on the LICENSE file. */ import * as modules from 'ui/modules' const app = modules.get('app/wazuh', []);
<<<<<<< $scope.isPolicyMonitoring = () => { return instance.path.includes('configuration-assessment') && instance.path.includes('/checks') } $scope.expandPolicyMonitoringCheck = item => { if (item.expanded) item.expanded = false; else { $scope.pagedItems[$scope.currentPage].map(item => item.expanded = false); item.expanded = true; } } ======= $scope.showTooltip = (id1, id2, item) => { var $element = $('#td-' + id1 + '-' + id2 + ' div'); var $c = $element .clone() .css({ display: 'inline', width: 'auto', visibility: 'hidden' }) .appendTo('body'); if ($c.width() > $element.width()) { if (!item.showTooltip) { item.showTooltip = []; } item.showTooltip[id2] = true; } $c.remove(); }; >>>>>>> $scope.isPolicyMonitoring = () => { return instance.path.includes('configuration-assessment') && instance.path.includes('/checks') } $scope.expandPolicyMonitoringCheck = item => { if (item.expanded) item.expanded = false; else { $scope.pagedItems[$scope.currentPage].map(item => item.expanded = false); item.expanded = true; } } $scope.showTooltip = (id1, id2, item) => { var $element = $('#td-' + id1 + '-' + id2 + ' div'); var $c = $element .clone() .css({ display: 'inline', width: 'auto', visibility: 'hidden' }) .appendTo('body'); if ($c.width() > $element.width()) { if (!item.showTooltip) { item.showTooltip = []; } item.showTooltip[id2] = true; } $c.remove(); };
<<<<<<< import { getServices } from 'plugins/kibana/discover/kibana_services'; import { WAZUH_ALERTS_PATTERN } from '../../../util/constants'; ======= import { getServices } from '../../../../../src/plugins/discover/public/kibana_services'; import { AppState } from '../../react-services/app-state'; >>>>>>> import { getServices } from '../../../../../src/plugins/discover/public/kibana_services'; import { WAZUH_ALERTS_PATTERN } from '../../../util/constants'; import { AppState } from '../../react-services/app-state'; <<<<<<< "index": WAZUH_ALERTS_PATTERN ======= "index": AppState.getCurrentPattern() || "wazuh-alerts-3.x-*" >>>>>>> "index": AppState.getCurrentPattern() || WAZUH_ALERTS_PATTERN
<<<<<<< icon_type: (St.IconType.SYMBOLIC), style_class: 'system-status-icon' ======= icon_type: (St.IconType.FULLCOLOR), // TODO: shouldn't be necessary style_class: 'popup-menu-icon', gicon: gicon >>>>>>> icon_type: (St.IconType.SYMBOLIC), style_class: 'system-status-icon' gicon: gicon <<<<<<< icon_type: (St.IconType.SYMBOLIC), icon_name: default_entry.icon, ======= icon_type: (St.IconType.FULLCOLOR), // TODO: use proper symbolic icons gicon: default_entry.icon, >>>>>>> icon_type: (St.IconType.SYMBOLIC), // icon_name: default_entry.icon, gicon: default_entry.icon, <<<<<<< this.icon.set_icon_name(item.icon); ======= this.status_label.set_text(item.label); this.icon.set_gicon(item.icon); >>>>>>> // this.icon.set_icon_name(item.icon); this.icon.set_gicon(item.icon);
<<<<<<< handle('set-layout-tiled-horizontal', function() { self.change_layout(true); }); handle('set-layout-floating', function() { self.change_layout(false); }); // move a window's borders // to resize it handle('increase-main-split', function() { self.current_layout().adjust_main_window_area(+BORDER_RESIZE_INCREMENT); }); handle('decrease-main-split', function() { self.current_layout().adjust_main_window_area(-BORDER_RESIZE_INCREMENT); }); handle('increase-minor-split', function() { self.current_layout().adjust_current_window_size(+BORDER_RESIZE_INCREMENT); }); handle('decrease-minor-split', function() { self.current_layout().adjust_current_window_size(-BORDER_RESIZE_INCREMENT); }); // resize a window without // affecting others handle('decrease-main-size', function() { self.current_layout().scale_current_window(-WINDOW_ONLY_RESIZE_INGREMENT, 'x'); }); handle('increase-main-size', function() { self.current_layout().scale_current_window(+WINDOW_ONLY_RESIZE_INGREMENT, 'x'); }); handle('decrease-minor-size', function() { self.current_layout().scale_current_window(-WINDOW_ONLY_RESIZE_INGREMENT, 'y'); }); handle('increase-minor-size', function() { self.current_layout().scale_current_window(+WINDOW_ONLY_RESIZE_INGREMENT, 'y'); }); handle('decrease-size', function() { self.current_layout().scale_current_window(-WINDOW_ONLY_RESIZE_INGREMENT); }); handle('increase-size', function() { self.current_layout().scale_current_window(+WINDOW_ONLY_RESIZE_INGREMENT); }); handle('switch-workspace-down', function() { self.switch_workspace(+1); }); handle('switch-workspace-up', function() { self.switch_workspace(-1); }); handle('move-window-workspace-down', function() { self.switch_workspace(+1, self.current_window()); }); handle('move-window-workspace-up', function() { self.switch_workspace(-1, self.current_window()); }); handle('toggle-maximize', function() { self.current_layout().toggle_maximize();}); handle('minimize-window', function() { self.current_layout().minimize_window();}); handle('unminimize-last-window', function() { self.current_layout().unminimize_last_window();}); ======= handle('d', function() { self.change_layout(Tiling.HorizontalTiledLayout); }); handle('f', function() { self.change_layout(Tiling.FloatingLayout); }); // move a window's borders to resize it handle('h', function() { self.current_layout().adjust_main_window_area(-BORDER_RESIZE_INCREMENT); }); handle('l', function() { self.current_layout().adjust_main_window_area(+BORDER_RESIZE_INCREMENT); }); handle('u', function() { self.current_layout().adjust_current_window_size(-BORDER_RESIZE_INCREMENT); }); handle('i', function() { self.current_layout().adjust_current_window_size(+BORDER_RESIZE_INCREMENT); }); // resize a window without affecting others handle('shift_h', function() { self.current_layout().scale_current_window(-WINDOW_ONLY_RESIZE_INGREMENT, 'x'); }); handle('shift_l', function() { self.current_layout().scale_current_window(+WINDOW_ONLY_RESIZE_INGREMENT, 'x'); }); handle('shift_u', function() { self.current_layout().scale_current_window(-WINDOW_ONLY_RESIZE_INGREMENT, 'y'); }); handle('shift_i', function() { self.current_layout().scale_current_window(+WINDOW_ONLY_RESIZE_INGREMENT, 'y'); }); handle('minus', function() { self.current_layout().scale_current_window(-WINDOW_ONLY_RESIZE_INGREMENT); }); handle('plus', function() { self.current_layout().scale_current_window(+WINDOW_ONLY_RESIZE_INGREMENT); }); handle('alt_j', function() { self.switch_workspace(+1); }); handle('alt_k', function() { self.switch_workspace(-1); }); handle('alt_shift_j', function() { self.switch_workspace(+1, self.current_window()); }); handle('alt_shift_k', function() { self.switch_workspace(-1, self.current_window()); }); handle('z', function() { self.current_layout().toggle_maximize();}); handle('shift_m', function() { self.current_layout().unminimize_last_window();}); >>>>>>> handle('set-layout-tiled-horizontal', function() { self.change_layout(Tiling.HorizontalTiledLayout); }); handle('set-layout-floating', function() { self.change_layout(Tiling.FloatingLayout); }); // move a window's borders // to resize it handle('increase-main-split', function() { self.current_layout().adjust_main_window_area(+BORDER_RESIZE_INCREMENT); }); handle('decrease-main-split', function() { self.current_layout().adjust_main_window_area(-BORDER_RESIZE_INCREMENT); }); handle('increase-minor-split', function() { self.current_layout().adjust_current_window_size(+BORDER_RESIZE_INCREMENT); }); handle('decrease-minor-split', function() { self.current_layout().adjust_current_window_size(-BORDER_RESIZE_INCREMENT); }); // resize a window without // affecting others handle('decrease-main-size', function() { self.current_layout().scale_current_window(-WINDOW_ONLY_RESIZE_INGREMENT, 'x'); }); handle('increase-main-size', function() { self.current_layout().scale_current_window(+WINDOW_ONLY_RESIZE_INGREMENT, 'x'); }); handle('decrease-minor-size', function() { self.current_layout().scale_current_window(-WINDOW_ONLY_RESIZE_INGREMENT, 'y'); }); handle('increase-minor-size', function() { self.current_layout().scale_current_window(+WINDOW_ONLY_RESIZE_INGREMENT, 'y'); }); handle('decrease-size', function() { self.current_layout().scale_current_window(-WINDOW_ONLY_RESIZE_INGREMENT); }); handle('increase-size', function() { self.current_layout().scale_current_window(+WINDOW_ONLY_RESIZE_INGREMENT); }); handle('switch-workspace-down', function() { self.switch_workspace(+1); }); handle('switch-workspace-up', function() { self.switch_workspace(-1); }); handle('move-window-workspace-down', function() { self.switch_workspace(+1, self.current_window()); }); handle('move-window-workspace-up', function() { self.switch_workspace(-1, self.current_window()); }); handle('toggle-maximize', function() { self.current_layout().toggle_maximize();}); handle('minimize-window', function() { self.current_layout().minimize_window();}); handle('unminimize-last-window', function() { self.current_layout().unminimize_last_window();}); <<<<<<< self.screen_dimensions.width = self.monitor.width; self.screen_dimensions.offset_x = 0; self.screen_dimensions.offset_y = Main.panel.actor.height; self.screen_dimensions.height = self.monitor.height - self.screen_dimensions.offset_y; ======= self.screen_dimensions = {} self.bounds = {}; self.bounds.pos = { x: 0, y: Main.panel.actor.height } self.bounds.size = {x: self.monitor.width, y: self.monitor.height - self.bounds.pos.y } >>>>>>> self.screen_dimensions = {} self.bounds = {}; self.bounds.pos = { x: 0, y: Main.panel.actor.height } self.bounds.size = {x: self.monitor.width, y: self.monitor.height - self.bounds.pos.y }
<<<<<<< _mapped: {}, ======= >>>>>>> _mapped: {}, <<<<<<< if (this.options.autocomplete === 'bootstrap') { this.element.typeahead({ source: function(query, process) { self._mapped = {}; var response = function(results) { var labels = []; for (var i = 0; i < results.length; i++) { self._mapped[results[i].label] = results[i]; labels.push(results[i].label); }; process(labels); } var request = {term: query}; self._geocode(request, response); }, updater: function(item) { var ui = {item: self._mapped[item]} self._focusAddress(null, ui); self._selectAddress(null, ui); return item; } }); } else { this.element.autocomplete({ source: $.proxy(this._geocode, this), focus: $.proxy(this._focusAddress, this), select: $.proxy(this._selectAddress, this) }); } ======= this.element.autocomplete($.extend({ source: $.proxy(this._geocode, this), focus: $.proxy(this._focusAddress, this), select: $.proxy(this._selectAddress, this) }), this.options.autocomplete); >>>>>>> if (this.options.autocomplete === 'bootstrap') { this.element.typeahead({ source: function(query, process) { self._mapped = {}; var response = function(results) { var labels = []; for (var i = 0; i < results.length; i++) { self._mapped[results[i].label] = results[i]; labels.push(results[i].label); }; process(labels); } var request = {term: query}; self._geocode(request, response); }, updater: function(item) { var ui = {item: self._mapped[item]} self._focusAddress(null, ui); self._selectAddress(null, ui); return item; } }); } else { this.element.autocomplete($.extend({ source: $.proxy(this._geocode, this), focus: $.proxy(this._focusAddress, this), select: $.proxy(this._selectAddress, this) }), this.options.autocomplete); }
<<<<<<< ======= var paused = startPaused || false; var readable = false; // convert to an old-style stream. stream.readable = true; stream.pipe = Stream.prototype.pipe; stream.on = stream.addListener = Stream.prototype.on; stream.on('readable', function() { readable = true; var c; while (!paused && (null !== (c = stream.read()))) stream.emit('data', c); if (c === null) { readable = false; stream._readableState.needReadable = true; } }); stream.pause = function() { paused = true; this.emit('pause'); }; stream.resume = function() { paused = false; if (readable) process.nextTick(function() { stream.emit('readable'); }); else this.read(0); this.emit('resume'); }; // Start reading in next tick to allow caller to set event listeners on // the stream object (like 'error') process.nextTick(function() { // now make it start, just in case it hadn't already. stream.emit('readable'); }); // Let others know about our mode state.oldMode = true; >>>>>>>
<<<<<<< nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape), nonAuthChars = ['/', '@', '?', '#'].concat(delims), ======= nonHostChars = ['%', '/', '?', ';', '#'] .concat(unwise).concat(autoEscape), hostEndingChars = ['/', '?', '#'], >>>>>>> nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape), hostEndingChars = ['/', '?', '#'],
<<<<<<< (util.isFunction(list.listener) && list.listener === listener)) { this._events[type] = undefined; ======= (typeof list.listener === 'function' && list.listener === listener)) { delete this._events[type]; >>>>>>> (util.isFunction(list.listener) && list.listener === listener)) { delete this._events[type];
<<<<<<< assert.equal(0, Buffer('hello').slice(0, 0).length); // test hex toString console.log('Create hex string from buffer'); var hexb = new Buffer(256); for (var i = 0; i < 256; i ++) { hexb[i] = i; } var hexStr = hexb.toString('hex'); assert.equal(hexStr, '000102030405060708090a0b0c0d0e0f'+ '101112131415161718191a1b1c1d1e1f'+ '202122232425262728292a2b2c2d2e2f'+ '303132333435363738393a3b3c3d3e3f'+ '404142434445464748494a4b4c4d4e4f'+ '505152535455565758595a5b5c5d5e5f'+ '606162636465666768696a6b6c6d6e6f'+ '707172737475767778797a7b7c7d7e7f'+ '808182838485868788898a8b8c8d8e8f'+ '909192939495969798999a9b9c9d9e9f'+ 'a0a1a2a3a4a5a6a7a8a9aaabacadaeaf'+ 'b0b1b2b3b4b5b6b7b8b9babbbcbdbebf'+ 'c0c1c2c3c4c5c6c7c8c9cacbcccdcecf'+ 'd0d1d2d3d4d5d6d7d8d9dadbdcdddedf'+ 'e0e1e2e3e4e5e6e7e8e9eaebecedeeef'+ 'f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff'); console.log('Create buffer from hex string'); var hexb2 = new Buffer(hexStr, 'hex'); for (var i = 0; i < 256; i ++) { assert.equal(hexb2[i], hexb[i]); } // test an invalid slice end. console.log('Try to slice off the end of the buffer'); var b = new Buffer([1,2,3,4,5]); var b2 = b.toString('hex', 1, 10000); var b3 = b.toString('hex', 1, 5); var b4 = b.toString('hex', 1); assert.equal(b2, b3); assert.equal(b2, b4); ======= assert.equal(0, Buffer('hello').slice(0, 0).length); // Test slice on SlowBuffer GH-843 var SlowBuffer = process.binding('buffer').SlowBuffer; function buildSlowBuffer (data) { if (Array.isArray(data)) { var buffer = new SlowBuffer(data.length); data.forEach(function(v,k) { buffer[k] = v; }); return buffer; }; return null; } var x = buildSlowBuffer([0x81,0xa3,0x66,0x6f,0x6f,0xa3,0x62,0x61,0x72]); console.log(x.inspect()) assert.equal('<SlowBuffer 81 a3 66 6f 6f a3 62 61 72>', x.inspect()); var z = x.slice(4); console.log(z.inspect()) console.log(z.length) assert.equal(5, z.length); assert.equal(0x6f, z[0]); assert.equal(0xa3, z[1]); assert.equal(0x62, z[2]); assert.equal(0x61, z[3]); assert.equal(0x72, z[4]); var z = x.slice(0); console.log(z.inspect()) console.log(z.length) assert.equal(z.length, x.length); var z = x.slice(0, 4); console.log(z.inspect()) console.log(z.length) assert.equal(4, z.length); assert.equal(0x81, z[0]); assert.equal(0xa3, z[1]); var z = x.slice(0, 9); console.log(z.inspect()) console.log(z.length) assert.equal(9, z.length); var z = x.slice(1, 4); console.log(z.inspect()) console.log(z.length) assert.equal(3, z.length); assert.equal(0xa3, z[0]); var z = x.slice(2, 4); console.log(z.inspect()) console.log(z.length) assert.equal(2, z.length); assert.equal(0x66, z[0]); assert.equal(0x6f, z[1]); >>>>>>> assert.equal(0, Buffer('hello').slice(0, 0).length); // test hex toString console.log('Create hex string from buffer'); var hexb = new Buffer(256); for (var i = 0; i < 256; i ++) { hexb[i] = i; } var hexStr = hexb.toString('hex'); assert.equal(hexStr, '000102030405060708090a0b0c0d0e0f'+ '101112131415161718191a1b1c1d1e1f'+ '202122232425262728292a2b2c2d2e2f'+ '303132333435363738393a3b3c3d3e3f'+ '404142434445464748494a4b4c4d4e4f'+ '505152535455565758595a5b5c5d5e5f'+ '606162636465666768696a6b6c6d6e6f'+ '707172737475767778797a7b7c7d7e7f'+ '808182838485868788898a8b8c8d8e8f'+ '909192939495969798999a9b9c9d9e9f'+ 'a0a1a2a3a4a5a6a7a8a9aaabacadaeaf'+ 'b0b1b2b3b4b5b6b7b8b9babbbcbdbebf'+ 'c0c1c2c3c4c5c6c7c8c9cacbcccdcecf'+ 'd0d1d2d3d4d5d6d7d8d9dadbdcdddedf'+ 'e0e1e2e3e4e5e6e7e8e9eaebecedeeef'+ 'f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff'); console.log('Create buffer from hex string'); var hexb2 = new Buffer(hexStr, 'hex'); for (var i = 0; i < 256; i ++) { assert.equal(hexb2[i], hexb[i]); } // test an invalid slice end. console.log('Try to slice off the end of the buffer'); var b = new Buffer([1,2,3,4,5]); var b2 = b.toString('hex', 1, 10000); var b3 = b.toString('hex', 1, 5); var b4 = b.toString('hex', 1); assert.equal(b2, b3); assert.equal(b2, b4); // Test slice on SlowBuffer GH-843 var SlowBuffer = process.binding('buffer').SlowBuffer; function buildSlowBuffer (data) { if (Array.isArray(data)) { var buffer = new SlowBuffer(data.length); data.forEach(function(v,k) { buffer[k] = v; }); return buffer; }; return null; } var x = buildSlowBuffer([0x81,0xa3,0x66,0x6f,0x6f,0xa3,0x62,0x61,0x72]); console.log(x.inspect()) assert.equal('<SlowBuffer 81 a3 66 6f 6f a3 62 61 72>', x.inspect()); var z = x.slice(4); console.log(z.inspect()) console.log(z.length) assert.equal(5, z.length); assert.equal(0x6f, z[0]); assert.equal(0xa3, z[1]); assert.equal(0x62, z[2]); assert.equal(0x61, z[3]); assert.equal(0x72, z[4]); var z = x.slice(0); console.log(z.inspect()) console.log(z.length) assert.equal(z.length, x.length); var z = x.slice(0, 4); console.log(z.inspect()) console.log(z.length) assert.equal(4, z.length); assert.equal(0x81, z[0]); assert.equal(0xa3, z[1]); var z = x.slice(0, 9); console.log(z.inspect()) console.log(z.length) assert.equal(9, z.length); var z = x.slice(1, 4); console.log(z.inspect()) console.log(z.length) assert.equal(3, z.length); assert.equal(0xa3, z[0]); var z = x.slice(2, 4); console.log(z.inspect()) console.log(z.length) assert.equal(2, z.length); assert.equal(0x66, z[0]); assert.equal(0x6f, z[1]);
<<<<<<< EventEmitter.prototype.setMaxListeners = function(n) { if (!util.isNumber(n) || n < 0 || isNaN(n)) ======= var defaultMaxListeners = 10; EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) { if (typeof n !== 'number' || n < 0 || isNaN(n)) >>>>>>> EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) { if (!util.isNumber(n) || n < 0 || isNaN(n)) <<<<<<< EventEmitter.prototype.once = function(type, listener) { if (!util.isFunction(listener)) ======= EventEmitter.prototype.once = function once(type, listener) { if (typeof listener !== 'function') >>>>>>> EventEmitter.prototype.once = function once(type, listener) { if (!util.isFunction(listener))
<<<<<<< // #243 Test write() with maxLength var buf = new Buffer(4); buf.fill(0xFF); var written = buf.write('abcd', 1, 2, 'utf8'); console.log(buf); assert.equal(written, 2); assert.equal(buf[0], 0xFF); assert.equal(buf[1], 0x61); assert.equal(buf[2], 0x62); assert.equal(buf[3], 0xFF); buf.fill(0xFF); written = buf.write('abcd', 1, 4); console.log(buf); assert.equal(written, 3); assert.equal(buf[0], 0xFF); assert.equal(buf[1], 0x61); assert.equal(buf[2], 0x62); assert.equal(buf[3], 0x63); buf.fill(0xFF); written = buf.write('abcd', 'utf8', 1, 2); // legacy style console.log(buf); assert.equal(written, 2); assert.equal(buf[0], 0xFF); assert.equal(buf[1], 0x61); assert.equal(buf[2], 0x62); assert.equal(buf[3], 0xFF); buf.fill(0xFF); written = buf.write('abcdef', 1, 2, 'hex'); console.log(buf); assert.equal(written, 2); assert.equal(buf[0], 0xFF); assert.equal(buf[1], 0xAB); assert.equal(buf[2], 0xCD); assert.equal(buf[3], 0xFF); buf.fill(0xFF); written = buf.write('abcd', 0, 2, 'ucs2'); console.log(buf); assert.equal(written, 2); assert.equal(buf[0], 0x61); assert.equal(buf[1], 0x00); assert.equal(buf[2], 0xFF); assert.equal(buf[3], 0xFF); ======= // test for buffer overrun buf = new Buffer([0, 0, 0, 0, 0]); // length: 5 var sub = buf.slice(0, 4); // length: 4 written = sub.write('12345', 'binary'); assert.equal(written, 4); assert.equal(buf[4], 0); // test for _charsWritten buf = new Buffer(9); buf.write('あいうえ', 'utf8'); // 3bytes * 4 assert.equal(Buffer._charsWritten, 3); buf.write('あいうえお', 'ucs2'); // 2bytes * 5 assert.equal(Buffer._charsWritten, 4); buf.write('0123456789', 'ascii'); assert.equal(Buffer._charsWritten, 9); buf.write('0123456789', 'binary'); assert.equal(Buffer._charsWritten, 9); buf.write('123456', 'base64'); assert.equal(Buffer._charsWritten, 6); >>>>>>> // #243 Test write() with maxLength var buf = new Buffer(4); buf.fill(0xFF); var written = buf.write('abcd', 1, 2, 'utf8'); console.log(buf); assert.equal(written, 2); assert.equal(buf[0], 0xFF); assert.equal(buf[1], 0x61); assert.equal(buf[2], 0x62); assert.equal(buf[3], 0xFF); buf.fill(0xFF); written = buf.write('abcd', 1, 4); console.log(buf); assert.equal(written, 3); assert.equal(buf[0], 0xFF); assert.equal(buf[1], 0x61); assert.equal(buf[2], 0x62); assert.equal(buf[3], 0x63); buf.fill(0xFF); written = buf.write('abcd', 'utf8', 1, 2); // legacy style console.log(buf); assert.equal(written, 2); assert.equal(buf[0], 0xFF); assert.equal(buf[1], 0x61); assert.equal(buf[2], 0x62); assert.equal(buf[3], 0xFF); buf.fill(0xFF); written = buf.write('abcdef', 1, 2, 'hex'); console.log(buf); assert.equal(written, 2); assert.equal(buf[0], 0xFF); assert.equal(buf[1], 0xAB); assert.equal(buf[2], 0xCD); assert.equal(buf[3], 0xFF); buf.fill(0xFF); written = buf.write('abcd', 0, 2, 'ucs2'); console.log(buf); assert.equal(written, 2); assert.equal(buf[0], 0x61); assert.equal(buf[1], 0x00); assert.equal(buf[2], 0xFF); assert.equal(buf[3], 0xFF); // test for buffer overrun buf = new Buffer([0, 0, 0, 0, 0]); // length: 5 var sub = buf.slice(0, 4); // length: 4 written = sub.write('12345', 'binary'); assert.equal(written, 4); assert.equal(buf[4], 0); // test for _charsWritten buf = new Buffer(9); buf.write('あいうえ', 'utf8'); // 3bytes * 4 assert.equal(Buffer._charsWritten, 3); buf.write('あいうえお', 'ucs2'); // 2bytes * 5 assert.equal(Buffer._charsWritten, 4); buf.write('0123456789', 'ascii'); assert.equal(Buffer._charsWritten, 9); buf.write('0123456789', 'binary'); assert.equal(Buffer._charsWritten, 9); buf.write('123456', 'base64'); assert.equal(Buffer._charsWritten, 6);
<<<<<<< testPBKDF2('password', 'salt', 2, 20, '\xea\x6c\x01\x4d\xc7\x2d\x6f\x8c\xcd\x1e\xd9\x2a' + '\xce\x1d\x41\xf0\xd8\xde\x89\x57'); testPBKDF2('password', 'salt', 4096, 20, '\x4b\x00\x79\x01\xb7\x65\x48\x9a\xbe\xad\x49\xd9\x26' + '\xf7\x21\xd0\x65\xa4\x29\xc1'); testPBKDF2('passwordPASSWORDpassword', 'saltSALTsaltSALTsaltSALTsaltSALTsalt', 4096, 25, '\x3d\x2e\xec\x4f\xe4\x1c\x84\x9b\x80\xc8\xd8\x36\x62' + '\xc0\xe4\x4a\x8b\x29\x1a\x96\x4c\xf2\xf0\x70\x38'); testPBKDF2('pass\0word', 'sa\0lt', 4096, 16, '\x56\xfa\x6a\xa7\x55\x48\x09\x9d\xcc\x37\xd7\xf0\x34' + '\x25\xe0\xc3'); function assertSorted(list) { for (var i = 0, k = list.length - 1; i < k; ++i) { var a = list[i + 0]; var b = list[i + 1]; assert(a <= b); } } // Assume that we have at least AES256-SHA. assert.notEqual(0, crypto.getCiphers()); assert.notEqual(-1, crypto.getCiphers().indexOf('AES256-SHA')); assertSorted(crypto.getCiphers()); // Assert that we have sha and sha1 but not SHA and SHA1. assert.notEqual(0, crypto.getHashes()); assert.notEqual(-1, crypto.getHashes().indexOf('sha1')); assert.notEqual(-1, crypto.getHashes().indexOf('sha')); assert.equal(-1, crypto.getHashes().indexOf('SHA1')); assert.equal(-1, crypto.getHashes().indexOf('SHA')); assertSorted(crypto.getHashes()); (function() { var c = crypto.createDecipher('aes-128-ecb', ''); assert.throws(function() { c.final('utf8') }, /invalid public key/); })(); // Base64 padding regression test, see #4837. (function() { var c = crypto.createCipher('aes-256-cbc', 'secret'); var s = c.update('test', 'utf8', 'base64') + c.final('base64'); assert.equal(s, '375oxUQCIocvxmC5At+rvA=='); })(); ======= // Error path should not leak memory (check with valgrind). assert.throws(function() { crypto.pbkdf2('password', 'salt', 1, 20, null); }); // Calling Cipher.final() or Decipher.final() twice should error but // not assert. See #4886. (function() { var c = crypto.createCipher('aes-256-cbc', 'secret'); try { c.final('xxx') } catch (e) { /* Ignore. */ } try { c.final('xxx') } catch (e) { /* Ignore. */ } try { c.final('xxx') } catch (e) { /* Ignore. */ } var d = crypto.createDecipher('aes-256-cbc', 'secret'); try { d.final('xxx') } catch (e) { /* Ignore. */ } try { d.final('xxx') } catch (e) { /* Ignore. */ } try { d.final('xxx') } catch (e) { /* Ignore. */ } })(); >>>>>>> testPBKDF2('password', 'salt', 2, 20, '\xea\x6c\x01\x4d\xc7\x2d\x6f\x8c\xcd\x1e\xd9\x2a' + '\xce\x1d\x41\xf0\xd8\xde\x89\x57'); testPBKDF2('password', 'salt', 4096, 20, '\x4b\x00\x79\x01\xb7\x65\x48\x9a\xbe\xad\x49\xd9\x26' + '\xf7\x21\xd0\x65\xa4\x29\xc1'); testPBKDF2('passwordPASSWORDpassword', 'saltSALTsaltSALTsaltSALTsaltSALTsalt', 4096, 25, '\x3d\x2e\xec\x4f\xe4\x1c\x84\x9b\x80\xc8\xd8\x36\x62' + '\xc0\xe4\x4a\x8b\x29\x1a\x96\x4c\xf2\xf0\x70\x38'); testPBKDF2('pass\0word', 'sa\0lt', 4096, 16, '\x56\xfa\x6a\xa7\x55\x48\x09\x9d\xcc\x37\xd7\xf0\x34' + '\x25\xe0\xc3'); function assertSorted(list) { for (var i = 0, k = list.length - 1; i < k; ++i) { var a = list[i + 0]; var b = list[i + 1]; assert(a <= b); } } // Assume that we have at least AES256-SHA. assert.notEqual(0, crypto.getCiphers()); assert.notEqual(-1, crypto.getCiphers().indexOf('AES256-SHA')); assertSorted(crypto.getCiphers()); // Assert that we have sha and sha1 but not SHA and SHA1. assert.notEqual(0, crypto.getHashes()); assert.notEqual(-1, crypto.getHashes().indexOf('sha1')); assert.notEqual(-1, crypto.getHashes().indexOf('sha')); assert.equal(-1, crypto.getHashes().indexOf('SHA1')); assert.equal(-1, crypto.getHashes().indexOf('SHA')); assertSorted(crypto.getHashes()); (function() { var c = crypto.createDecipher('aes-128-ecb', ''); assert.throws(function() { c.final('utf8') }, /invalid public key/); })(); // Base64 padding regression test, see #4837. (function() { var c = crypto.createCipher('aes-256-cbc', 'secret'); var s = c.update('test', 'utf8', 'base64') + c.final('base64'); assert.equal(s, '375oxUQCIocvxmC5At+rvA=='); })(); // Error path should not leak memory (check with valgrind). assert.throws(function() { crypto.pbkdf2('password', 'salt', 1, 20, null); }); // Calling Cipher.final() or Decipher.final() twice should error but // not assert. See #4886. (function() { var c = crypto.createCipher('aes-256-cbc', 'secret'); try { c.final('xxx') } catch (e) { /* Ignore. */ } try { c.final('xxx') } catch (e) { /* Ignore. */ } try { c.final('xxx') } catch (e) { /* Ignore. */ } var d = crypto.createDecipher('aes-256-cbc', 'secret'); try { d.final('xxx') } catch (e) { /* Ignore. */ } try { d.final('xxx') } catch (e) { /* Ignore. */ } try { d.final('xxx') } catch (e) { /* Ignore. */ } })();
<<<<<<< 'lua', ======= 'ocaml', 'perl', >>>>>>> 'lua', 'ocaml', 'perl',
<<<<<<< //var tmpRecord, i; //var timeNow = Date.now(); var beforeCounts = [ Object.size(this._raw.ship), Object.size(this._raw.slotitem) ]; ======= var tmpRecord, i; var timeNow = Date.now(); var beforeCounts = [ Object.size(this._ship), Object.size(this._slotitem) ]; var newCounts = [0/*ships*/, 0/*items*/]; // Organize master ship into indexes for(i in raw.api_mst_ship){ tmpRecord = raw.api_mst_ship[i]; if(typeof tmpRecord.api_name != "undefined"){ if(typeof this._ship[tmpRecord.api_id] == "undefined" && beforeCounts[0]>0){ this._newShips[tmpRecord.api_id] = timeNow; newCounts[0]++; } this._ship[tmpRecord.api_id] = tmpRecord; } } >>>>>>> var newCounts = [0/*ships*/, 0/*items*/]; <<<<<<< return [0,0]; ======= return newCounts; >>>>>>> return [0,0];
<<<<<<< // Ship-only, non abyssal $(".tab_mstship .shipInfo .stats").html(""); $(".tab_mstship .shipInfo .intro").html( shipData.api_getmes ); ======= // Ship-only, non abyssal $(".tab_mstship .shipInfo .stats").html(""); $(".tab_mstship .shipInfo .intro").html( shipData.api_getmes ); // Check saltiness if(ConfigManager.salt_list.indexOf(shipData.kc3_bship)>=0) { $(".tab_mstship .shipInfo").addClass('salted'); } >>>>>>> // Ship-only, non abyssal $(".tab_mstship .shipInfo .stats").html(""); $(".tab_mstship .shipInfo .intro").html( shipData.api_getmes ); <<<<<<< // Play voice $(".tab_mstship .shipInfo .voice").on("click", function(){ if(self.audio){ self.audio.pause(); } self.audio = new Audio("http://"+self.server_ip+"/kcs/sound/kc"+self.currentGraph+"/"+$(this).data("vnum")+".mp3"); self.audio.play(); }); // On-click remodels $(".tab_mstship .shipInfo").on("click", ".remodel_name a", function(e){ console.log( "Move to ship", $(this).data("sid") ); e.preventDefault(); self.showShip( $(this).data("sid") ); return false; }); // Salt-toggle $(".tab_mstship .shipInfo").on("click", ".salty-zone", function(e){ var saltList = ConfigManager.salt_list, saltPos = saltList.indexOf(shipData.kc3_bship), shipBox = $(".shipRecord").filter(function(i,x){ return shipData.kc3_bship == $(x).data('bs'); }); if(saltPos >= 0) { saltList.splice(saltPos,1); shipBox.removeClass('salted'); } else { saltList.push(shipData.kc3_bship); shipBox.addClass('salted'); } $(".tab_mstship .shipInfo .salty-zone").text(KC3Meta.term(denyTerm())); saltClassUpdate(); ConfigManager.save(); return false; }); ======= >>>>>>>
<<<<<<< // each alignment needs to be rendered separately for (let align in info.align) { this.drawText(lines, info.align[align].texture_position, info.size, { stroke: text_settings.stroke, transform: text_settings.transform, align: align }); info.align[align].texcoords = Texture.getTexcoordsForSprite( info.align[align].texture_position, info.size.texture_size, texture_size ); } ======= this.drawText(lines, info.position, info.size, { stroke: text_settings.stroke, transform: text_settings.transform, align: text_settings.align }); info.texcoords = Texture.getTexcoordsForSprite( info.position, info.size.texture_size, texture_size ); info.multi_texcoords = []; var text_position = info.position.slice(); var text_texture_size = info.size.texture_size.slice(); var x = text_position[0]; var y = text_position[1]; for (var i = 0; i < info.size.segment_texture_size.length; i++){ var w = info.size.segment_texture_size[i]; text_texture_size[0] = w; text_position[0] = x; var texcoord = Texture.getTexcoordsForSprite( text_position, text_texture_size, texture_size ); info.multi_texcoords.push(texcoord); x += w; } >>>>>>> this.drawText(lines, info.position, info.size, { stroke: text_settings.stroke, transform: text_settings.transform, align: text_settings.align }); info.texcoords = Texture.getTexcoordsForSprite( info.position, info.size.texture_size, texture_size ); info.multi_texcoords = []; var text_position = info.position.slice(); var text_texture_size = info.size.texture_size.slice(); var x = text_position[0]; var y = text_position[1]; for (var i = 0; i < info.size.segment_texture_size.length; i++){ var w = info.size.segment_texture_size[i]; text_texture_size[0] = w; text_position[0] = x; var texcoord = Texture.getTexcoordsForSprite( text_position, text_texture_size, texture_size ); info.multi_texcoords.push(texcoord); x += w; } <<<<<<< CanvasText.cache_stats = { hits: 0, misses: 0 }; // Font detection CanvasText.fonts_loaded = Promise.resolve(); // resolves when all requested fonts have been detected ======= CanvasText.cache_stats = { hits: 0, misses: 0 }; function isRTL(s){ var weakChars = '\u0000-\u0040\u005B-\u0060\u007B-\u00BF\u00D7\u00F7\u02B9-\u02FF\u2000-\u2BFF\u2010-\u2029\u202C\u202F-\u2BFF', rtlChars = '\u0591-\u07FF\u200F\u202B\u202E\uFB1D-\uFDFD\uFE70-\uFEFC', rtlDirCheck = new RegExp('^['+weakChars+']*['+rtlChars+']'); return rtlDirCheck.test(s); }; function reorderWordsLTR(words) { var words_LTR = []; var words_RTL = []; // loop through words and re-order RTL groups in reverse order (but in LTR visual order) for (var i = 0; i < words.length; i++){ var str = words[i]; var rtl = isRTL(str); if (rtl){ words_RTL.push(str); } else { while (words_RTL.length > 0){ words_LTR.push(words_RTL.pop()); } words_LTR.push(str); } } while (words_RTL.length > 0){ words_LTR.push(words_RTL.pop()); } return words_LTR; } >>>>>>> CanvasText.cache_stats = { hits: 0, misses: 0 }; // Font detection CanvasText.fonts_loaded = Promise.resolve(); // resolves when all requested fonts have been detected function isRTL(s){ var weakChars = '\u0000-\u0040\u005B-\u0060\u007B-\u00BF\u00D7\u00F7\u02B9-\u02FF\u2000-\u2BFF\u2010-\u2029\u202C\u202F-\u2BFF', rtlChars = '\u0591-\u07FF\u200F\u202B\u202E\uFB1D-\uFDFD\uFE70-\uFEFC', rtlDirCheck = new RegExp('^['+weakChars+']*['+rtlChars+']'); return rtlDirCheck.test(s); }; function reorderWordsLTR(words) { var words_LTR = []; var words_RTL = []; // loop through words and re-order RTL groups in reverse order (but in LTR visual order) for (var i = 0; i < words.length; i++){ var str = words[i]; var rtl = isRTL(str); if (rtl){ words_RTL.push(str); } else { while (words_RTL.length > 0){ words_LTR.push(words_RTL.pop()); } words_LTR.push(str); } } while (words_RTL.length > 0){ words_LTR.push(words_RTL.pop()); } return words_LTR; }
<<<<<<< var self = this, shipData = KC3Master.ship(ship_id), saltState = function(){ return ConfigManager.info_salt && shipData.kc3_bship && ConfigManager.salt_list.indexOf(shipData.kc3_bship)>=0; }, denyTerm = function(){ return ["MasterShipSalt","Un","Check"].filter(function(str,i){ return ((i==1) && !saltState()) ? "" : str; }).join(''); }, saltClassUpdate = function(){ if(saltState()) $(".tab_mstship .shipInfo").addClass('salted'); else $(".tab_mstship .shipInfo").removeClass('salted'); }; ======= var self = this; var shipData = KC3Master.ship(ship_id); this.currentShipId = ship_id; >>>>>>> var self = this, shipData = KC3Master.ship(ship_id), saltState = function(){ return ConfigManager.info_salt && shipData.kc3_bship && ConfigManager.salt_list.indexOf(shipData.kc3_bship)>=0; }, denyTerm = function(){ return ["MasterShipSalt","Un","Check"].filter(function(str,i){ return ((i==1) && !saltState()) ? "" : str; }).join(''); }, saltClassUpdate = function(){ if(saltState()) $(".tab_mstship .shipInfo").addClass('salted'); else $(".tab_mstship .shipInfo").removeClass('salted'); }; this.currentShipId = ship_id; <<<<<<< ======= $(".tab_mstship .shipInfo .hourlies").show(); $(".tab_mstship .shipInfo .hourlies").html(""); >>>>>>> $(".tab_mstship .shipInfo .hourlies").show(); $(".tab_mstship .shipInfo .hourlies").html("");
<<<<<<< KC3Network.trigger("HQ"); ======= KC3Network.trigger("Quests"); >>>>>>> KC3Network.trigger("HQ"); KC3Network.trigger("Quests"); <<<<<<< KC3Network.trigger("HQ"); ======= KC3Network.trigger("Quests"); >>>>>>> KC3Network.trigger("HQ"); KC3Network.trigger("Quests");
<<<<<<< KC3Network.nextBlockCheck(); ======= if(response.api_data.api_m2 > 0) { KC3Network.trigger("DebuffNotify", response.api_data); } >>>>>>> if(response.api_data.api_m2 > 0) { KC3Network.trigger("DebuffNotify", response.api_data); } KC3Network.nextBlockCheck();
<<<<<<< saltClassUpdate(); ======= var statBox; >>>>>>> saltClassUpdate(); var statBox;
<<<<<<< info: { type: 'resource', label: 'Info', title: 'Article Info', icon: 'icon-info-sign', references: ['contributor_reference'], renderer: ResourceRenderer }, ======= >>>>>>> info: { type: 'resource', label: 'Info', title: 'Article Info', icon: 'icon-info-sign', references: ['contributor_reference'], renderer: ResourceRenderer },
<<<<<<< it('Method "clearSelection" should clear selection.', function () { $('#multiselect-container input[value="value-1"]').click(); $('#multiselect-container input[value="value-2"]').click(); ======= it('Method "clearSelection" should clear selection.', function() { $('#multiselect-container input[value="value-1"]').trigger('click'); $('#multiselect-container input[value="value-2"]').trigger('click'); >>>>>>> it('Method "clearSelection" should clear selection.', function () { $('#multiselect-container input[value="value-1"]').trigger('click'); $('#multiselect-container input[value="value-2"]').trigger('click'); <<<<<<< it('Method "clearSelection" should clear selection.', function () { $('#multiselect-container input[value="multiselect-all"]').click(); ======= it('Method "clearSelection" should clear selection.', function() { $('#multiselect-container input[value="multiselect-all"]').trigger('click'); >>>>>>> it('Method "clearSelection" should clear selection.', function () { $('#multiselect-container input[value="multiselect-all"]').trigger('click'); <<<<<<< it('Method "clearSelection" is NOT able to clear selection.', function () { $('#multiselect-container input[value="value-2"]').click(); ======= it('Method "clearSelection" is NOT able to clear selection.', function() { $('#multiselect-container input[value="value-2"]').trigger('click'); >>>>>>> it('Method "clearSelection" is NOT able to clear selection.', function () { $('#multiselect-container input[value="value-2"]').trigger('click'); <<<<<<< $('#multiselect-container .multiselect-group').each(function () { $('.form-check-label', $(this)).click(); ======= $('#multiselect-container .multiselect-group').each(function() { $('.form-check-label', $(this)).trigger('click'); >>>>>>> $('#multiselect-container .multiselect-group').each(function () { $('.form-check-label', $(this)).trigger('click'); <<<<<<< $('#multiselect-container .multiselect-group').each(function () { $('.form-check-label', $(this)).click(); ======= $('#multiselect-container .multiselect-group').each(function() { $('.form-check-label', $(this)).trigger('click'); >>>>>>> $('#multiselect-container .multiselect-group').each(function () { $('.form-check-label', $(this)).trigger('click'); <<<<<<< $('#multiselect-container .multiselect-group').each(function () { $('.form-check-label', $(this)).click(); ======= $('#multiselect-container .multiselect-group').each(function() { $('.form-check-label', $(this)).trigger('click'); >>>>>>> $('#multiselect-container .multiselect-group').each(function () { $('.form-check-label', $(this)).trigger('click'); <<<<<<< $('#multiselect-container .multiselect-group').each(function () { $('.form-check-label', $(this)).click(); ======= $('#multiselect-container .multiselect-group').each(function() { $('.form-check-label', $(this)).trigger('click'); >>>>>>> $('#multiselect-container .multiselect-group').each(function () { $('.form-check-label', $(this)).trigger('click'); <<<<<<< it('Should select all options (including option groups).', function () { //$('#multiselect-container li.multiselect-group .caret-container').click(); $('#multiselect-container input[value="multiselect-all"]').click(); ======= it('Should select all options (including option groups).', function() { //$('#multiselect-container li.multiselect-group .caret-container').trigger('click'); $('#multiselect-container input[value="multiselect-all"]').trigger('click'); >>>>>>> it('Should select all options (including option groups).', function () { //$('#multiselect-container li.multiselect-group .caret-container').trigger('click'); $('#multiselect-container input[value="multiselect-all"]').trigger('click'); <<<<<<< $('#multiselect-container .multiselect-group').each(function () { $('.form-check-label', $(this)).click(); ======= $('#multiselect-container .multiselect-group').each(function() { $('.form-check-label', $(this)).trigger('click'); >>>>>>> $('#multiselect-container .multiselect-group').each(function () { $('.form-check-label', $(this)).trigger('click'); <<<<<<< it('Should select one option.', function () { $('#multiselect-container .multiselect-all input[value="multiselect-all"]').click(); ======= it('Should select one option.', function() { $('#multiselect-container .multiselect-all input[value="multiselect-all"]').trigger('click'); >>>>>>> it('Should select one option.', function () { $('#multiselect-container .multiselect-all input[value="multiselect-all"]').trigger('click'); <<<<<<< it('Should deselect one option.', function () { $('#multiselect-container .multiselect-all input').click(); ======= it('Should deselect one option.', function() { $('#multiselect-container .multiselect-all input').trigger('click'); >>>>>>> it('Should deselect one option.', function () { $('#multiselect-container .multiselect-all input').trigger('click'); <<<<<<< it('Should select all options.', function () { $('#multiselect-container .multiselect-all input[value="multiselect-all"]').click(); ======= it('Should select all options.', function() { $('#multiselect-container .multiselect-all input[value="multiselect-all"]').trigger('click'); >>>>>>> it('Should select all options.', function () { $('#multiselect-container .multiselect-all input[value="multiselect-all"]').trigger('click'); <<<<<<< it('Should select all options.', function () { $('#multiselect-container .multiselect-all input[value="multiselect-all"]').click(); ======= it('Should select all options.', function() { $('#multiselect-container .multiselect-all input[value="multiselect-all"]').trigger('click'); >>>>>>> it('Should select all options.', function () { $('#multiselect-container .multiselect-all input[value="multiselect-all"]').trigger('click'); <<<<<<< $('#multiselect-container .multiselect-group').each(function () { $('.form-check-label', $(this)).click(); ======= $('#multiselect-container .multiselect-group').each(function() { $('.form-check-label', $(this)).trigger('click'); >>>>>>> $('#multiselect-container .multiselect-group').each(function () { $('.form-check-label', $(this)).trigger('click');
<<<<<<< `find did not return ${this.selector}, cannot call attributes() on empty Wrapper` ======= `find did not return ${buildSelectorString( this.selector )}, cannot call attributes() on empty Wrapper` >>>>>>> `find did not return ${buildSelectorString( this.selector )}, cannot call attributes() on empty Wrapper` <<<<<<< `find did not return ${this.selector}, cannot call classes() on empty Wrapper` ======= `find did not return ${buildSelectorString( this.selector )}, cannot call classes() on empty Wrapper` >>>>>>> `find did not return ${buildSelectorString( this.selector )}, cannot call classes() on empty Wrapper` <<<<<<< `find did not return ${this.selector}, cannot call contains() on empty Wrapper` ======= `find did not return ${buildSelectorString( this.selector )}, cannot call contains() on empty Wrapper` >>>>>>> `find did not return ${buildSelectorString( this.selector )}, cannot call contains() on empty Wrapper` <<<<<<< `find did not return ${this.selector}, cannot call emittedByOrder() on empty Wrapper` ======= `find did not return ${buildSelectorString( this.selector )}, cannot call emittedByOrder() on empty Wrapper` >>>>>>> `find did not return ${buildSelectorString( this.selector )}, cannot call emittedByOrder() on empty Wrapper` <<<<<<< `find did not return ${this.selector}, cannot call visible() on empty Wrapper` ======= `find did not return ${buildSelectorString( this.selector )}, cannot call visible() on empty Wrapper` >>>>>>> `find did not return ${buildSelectorString( this.selector )}, cannot call visible() on empty Wrapper` <<<<<<< `find did not return ${this.selector}, cannot call hasProp() on empty Wrapper` ======= `find did not return ${buildSelectorString( this.selector )}, cannot call hasProp() on empty Wrapper` >>>>>>> `find did not return ${this.selector}, cannot call hasProp() on empty Wrapper` `find did not return ${buildSelectorString( this.selector )}, cannot call hasProp() on empty Wrapper` <<<<<<< `find did not return ${this.selector}, cannot call hasStyle() on empty Wrapper` ======= `find did not return ${buildSelectorString( this.selector )}, cannot call hasStyle() on empty Wrapper` >>>>>>> `find did not return ${this.selector}, cannot call hasStyle() on empty Wrapper` `find did not return ${buildSelectorString( this.selector )}, cannot call hasStyle() on empty Wrapper` <<<<<<< `find did not return ${this.selector}, cannot call findAll() on empty Wrapper` ======= `find did not return ${buildSelectorString( this.selector )}, cannot call findAll() on empty Wrapper` >>>>>>> `find did not return ${this.selector}, cannot call findAll() on empty Wrapper` `find did not return ${buildSelectorString( this.selector )}, cannot call findAll() on empty Wrapper` <<<<<<< `find did not return ${this.selector}, cannot call find() on empty Wrapper` ======= `find did not return ${buildSelectorString( this.selector )}, cannot call find() on empty Wrapper` >>>>>>> `find did not return ${this.selector}, cannot call find() on empty Wrapper` `find did not return ${buildSelectorString( this.selector )}, cannot call find() on empty Wrapper` <<<<<<< `find did not return ${this.selector}, cannot call html() on empty Wrapper` ======= `find did not return ${buildSelectorString( this.selector )}, cannot call html() on empty Wrapper` >>>>>>> `find did not return ${this.selector}, cannot call html() on empty Wrapper` `find did not return ${buildSelectorString( this.selector )}, cannot call html() on empty Wrapper` <<<<<<< `find did not return ${this.selector}, cannot call isEmpty() on empty Wrapper` ======= `find did not return ${buildSelectorString( this.selector )}, cannot call isEmpty() on empty Wrapper` >>>>>>> `find did not return ${this.selector}, cannot call isEmpty() on empty Wrapper` `find did not return ${buildSelectorString( this.selector )}, cannot call isEmpty() on empty Wrapper` <<<<<<< `find did not return ${this.selector}, cannot call isVisible() on empty Wrapper` ======= `find did not return ${buildSelectorString( this.selector )}, cannot call isVisible() on empty Wrapper` >>>>>>> `find did not return ${this.selector}, cannot call isVisible() on empty Wrapper` `find did not return ${buildSelectorString( this.selector )}, cannot call isVisible() on empty Wrapper` <<<<<<< `find did not return ${this.selector}, cannot call isVueInstance() on empty Wrapper` ======= `find did not return ${buildSelectorString( this.selector )}, cannot call isVueInstance() on empty Wrapper` >>>>>>> `find did not return ${this.selector}, cannot call isVueInstance() on empty Wrapper` `find did not return ${buildSelectorString( this.selector )}, cannot call isVueInstance() on empty Wrapper` <<<<<<< `find did not return ${this.selector}, cannot call name() on empty Wrapper` ======= `find did not return ${buildSelectorString( this.selector )}, cannot call name() on empty Wrapper` >>>>>>> `find did not return ${this.selector}, cannot call name() on empty Wrapper` `find did not return ${buildSelectorString( this.selector )}, cannot call name() on empty Wrapper` <<<<<<< `find did not return ${this.selector}, cannot call props() on empty Wrapper` ======= `find did not return ${buildSelectorString( this.selector )}, cannot call props() on empty Wrapper` >>>>>>> `find did not return ${this.selector}, cannot call props() on empty Wrapper` `find did not return ${buildSelectorString( this.selector )}, cannot call props() on empty Wrapper` <<<<<<< `find did not return ${this.selector}, cannot call text() on empty Wrapper` ======= `find did not return ${buildSelectorString( this.selector )}, cannot call text() on empty Wrapper` >>>>>>> `find did not return ${this.selector}, cannot call text() on empty Wrapper` `find did not return ${buildSelectorString( this.selector )}, cannot call text() on empty Wrapper` <<<<<<< `find did not return ${this.selector}, cannot call setComputed() on empty Wrapper` ======= `find did not return ${buildSelectorString( this.selector )}, cannot call setComputed() on empty Wrapper` >>>>>>> `find did not return ${this.selector}, cannot call setComputed() on empty Wrapper` `find did not return ${buildSelectorString( this.selector )}, cannot call setComputed() on empty Wrapper` <<<<<<< `find did not return ${this.selector}, cannot call setData() on empty Wrapper` ======= `find did not return ${buildSelectorString( this.selector )}, cannot call setData() on empty Wrapper` >>>>>>> `find did not return ${this.selector}, cannot call setData() on empty Wrapper` `find did not return ${buildSelectorString( this.selector )}, cannot call setData() on empty Wrapper` <<<<<<< `find did not return ${this.selector}, cannot call setMethods() on empty Wrapper` ======= `find did not return ${buildSelectorString( this.selector )}, cannot call setMethods() on empty Wrapper` >>>>>>> `find did not return ${this.selector}, cannot call setMethods() on empty Wrapper` `find did not return ${buildSelectorString( this.selector )}, cannot call setMethods() on empty Wrapper` <<<<<<< `find did not return ${this.selector}, cannot call setProps() on empty Wrapper` ======= `find did not return ${buildSelectorString( this.selector )}, cannot call setProps() on empty Wrapper` >>>>>>> `find did not return ${this.selector}, cannot call setProps() on empty Wrapper` `find did not return ${buildSelectorString( this.selector )}, cannot call setProps() on empty Wrapper` <<<<<<< `find did not return ${this.selector}, cannot call setValue() on empty Wrapper` ======= `find did not return ${buildSelectorString( this.selector )}, cannot call setValue() on empty Wrapper` >>>>>>> `find did not return ${this.selector}, cannot call setValue() on empty Wrapper` `find did not return ${buildSelectorString( this.selector )}, cannot call setValue() on empty Wrapper` <<<<<<< `find did not return ${this.selector}, cannot call setChecked() on empty Wrapper` ======= `find did not return ${buildSelectorString( this.selector )}, cannot call setChecked() on empty Wrapper` >>>>>>> `find did not return ${this.selector}, cannot call setChecked() on empty Wrapper` `find did not return ${buildSelectorString( this.selector )}, cannot call setChecked() on empty Wrapper` <<<<<<< `find did not return ${this.selector}, cannot call setSelected() on empty Wrapper` ======= `find did not return ${buildSelectorString( this.selector )}, cannot call setSelected() on empty Wrapper` >>>>>>> `find did not return ${this.selector}, cannot call setSelected() on empty Wrapper` `find did not return ${buildSelectorString( this.selector )}, cannot call setSelected() on empty Wrapper` <<<<<<< `find did not return ${this.selector}, cannot call trigger() on empty Wrapper` ======= `find did not return ${buildSelectorString( this.selector )}, cannot call trigger() on empty Wrapper` >>>>>>> `find did not return ${this.selector}, cannot call trigger() on empty Wrapper` `find did not return ${buildSelectorString( this.selector )}, cannot call trigger() on empty Wrapper` <<<<<<< `find did not return ${this.selector}, cannot call destroy() on empty Wrapper` ======= `find did not return ${buildSelectorString( this.selector )}, cannot call destroy() on empty Wrapper` >>>>>>> `find did not return ${this.selector}, cannot call destroy() on empty Wrapper` `find did not return ${buildSelectorString( this.selector )}, cannot call destroy() on empty Wrapper`
<<<<<<< import { DA_Translaticiarum_list_get } from '../../data/da/ToDo'; import CompendiumsConnection from "./CompendiumsConnection"; ======= import NodeInterface from "../interface/NodeInterface"; >>>>>>> import { DA_Translaticiarum_list_get } from '../../data/da/ToDo'; import NodeInterface from "../interface/NodeInterface"; <<<<<<< import TranslaticiarumsConnection from "./ToDosConnection"; ======= import User from '../../data/model/User'; import { Uuid } from '../../data/da_cassandra/_client.js'; const Uuid_0 = Uuid.fromString( '00000000-0000-0000-0000-000000000000' ); >>>>>>> import TranslaticiarumsConnection from "./TranslaticiarumsConnection"; import User from '../../data/model/User'; import { Uuid } from '../../data/da_cassandra/_client.js'; const Uuid_0 = Uuid.fromString( '00000000-0000-0000-0000-000000000000' );
<<<<<<< import classNames from 'classnames'; ======= import moment from 'moment'; import _get from 'lodash/get'; >>>>>>> import moment from 'moment'; import classNames from 'classnames'; <<<<<<< import PostListItemActions from './post-list-item-actions'; ======= import PostListItemAuthor from './post-list-item-author'; >>>>>>> import PostListItemAuthor from './post-list-item-author'; import PostListItemActions from './post-list-item-actions'; <<<<<<< return ( <li className={ classNames( 'post-list-item', { 'post-list-item--selected': isSelected } ) } onClick={ () => onSelectItem() } > <h2 dangerouslySetInnerHTML={ { __html: post.title.rendered }} /> <div className="post-select-result-meta">Type, Date, author</div> <PostListItemActions actions={ actions }/> </li> ); ======= if ( post.author ) { meta.push( <PostListItemAuthor id={ post.author }/> ); } return <Button id={ `post-list-item-button-${post.id}` } className={ className } onClick={ onClick }> <h2 className="post-list-item--title" dangerouslySetInnerHTML={ { __html: post.title.rendered } } /> <div className="post-list-item--meta"> { meta.map( ( metaItem, i ) => <Fragment key={ i }>{ metaItem } </Fragment> ) } </div> </Button> >>>>>>> if ( post.author ) { meta.push( <PostListItemAuthor id={ post.author }/> ); } return ( <li className={ classNames( 'post-list-item', { 'post-list-item--selected': isSelected } ) } onClick={ () => onSelectItem() } > <h2 dangerouslySetInnerHTML={ { __html: post.title.rendered }} /> <div className="post-list-item--meta"> { meta.map( ( metaItem, i ) => <Fragment key={ i }>{ metaItem } </Fragment> ) } </div> <PostListItemActions actions={ actions }/> </li> );
<<<<<<< return gulp.src(SOURCES) .pipe(uniffe()) ======= var sources = [ // Component handler 'src/mdlComponentHandler.js', // Polyfills/dependencies 'src/third_party/**/*.js', // Base components 'src/button/button.js', 'src/checkbox/checkbox.js', 'src/icon-toggle/icon-toggle.js', 'src/menu/menu.js', 'src/progress/progress.js', 'src/radio/radio.js', 'src/slider/slider.js', 'src/spinner/spinner.js', 'src/switch/switch.js', 'src/tabs/tabs.js', 'src/textfield/textfield.js', 'src/tooltip/tooltip.js', // Complex components (which reuse base components) 'src/layout/layout.js', 'src/data-table/data-table.js', // And finally, the ripples 'src/ripple/ripple.js' ]; return gulp.src(sources) .pipe($.if(/mdlComponentHandler\.js/, $.util.noop(), uniffe())) >>>>>>> return gulp.src(SOURCES) .pipe($.if(/mdlComponentHandler\.js/, $.util.noop(), uniffe()))
<<<<<<< ======= return ( <Box flexDirection="row" width="100%" height="100%" alignItems="center" justifyContent="center"> <Box> {state.depthbox.map((props, index) => ( <DepthLayerCard key={index} {...props} boxWidth={boxWidth} boxHeight={boxHeight} map={textures[index]} /> ))} </Box> </Box> ) } function Content({ onReflow }) { const group = useRef() const { viewport, size } = useThree() >>>>>>> <<<<<<< state.mouse = [(e.clientX / window.innerWidth) * 2 - 1, (e.clientY / window.innerHeight) * 2 - 1] console.log(state.mouse) ======= state.mouse = [(e.clientX / window.innerWidth) * 2 - 1, (e.clientY / window.innerHeight) * 2 - 1] >>>>>>> state.mouse = [(e.clientX / window.innerWidth) * 2 - 1, (e.clientY / window.innerHeight) * 2 - 1]
<<<<<<< this.get('Content-Type') || this.set('Content-Type', 'application/json'); ======= if (!this.get('Content-Type')) { this.charset = 'utf-8'; this.set('X-Content-Type-Options', 'nosniff'); this.set('Content-Type', 'application/json'); } >>>>>>> if (!this.get('Content-Type')) { this.set('X-Content-Type-Options', 'nosniff'); this.set('Content-Type', 'application/json'); }
<<<<<<< ======= /*! * express * Copyright(c) 2009-2013 TJ Holowaychuk * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ >>>>>>> /*! * express * Copyright(c) 2009-2013 TJ Holowaychuk * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ <<<<<<< var contentDisposition = require('content-disposition'); var deprecate = require('depd')('express'); var mime = require('send').mime; var basename = require('path').basename; ======= var contentType = require('content-type'); >>>>>>> var contentDisposition = require('content-disposition'); var contentType = require('content-type'); var deprecate = require('depd')('express'); var mime = require('send').mime; var basename = require('path').basename; <<<<<<< var qs = require('qs'); var querystring = require('querystring'); var typer = require('media-typer'); ======= >>>>>>> var qs = require('qs'); var querystring = require('querystring'); <<<<<<< return typer.format(parsed); }; /** * Return new empty object. * * @return {Object} * @api private */ function newObject() { return {}; } ======= return contentType.format(parsed); }; >>>>>>> return contentType.format(parsed); }; /** * Return new empty object. * * @return {Object} * @api private */ function newObject() { return {}; }
<<<<<<< var mime = require('send').mime; var crc32 = require('buffer-crc32'); var basename = require('path').basename; var deprecate = require('util').deprecate; ======= var mime = require('connect').mime , deprecate = require('util').deprecate , proxyaddr = require('proxy-addr') , crc32 = require('buffer-crc32'); /** * toString ref. */ var toString = {}.toString; >>>>>>> var mime = require('send').mime; var crc32 = require('buffer-crc32'); var basename = require('path').basename; var deprecate = require('util').deprecate; var proxyaddr = require('proxy-addr'); <<<<<<< ======= } /** * Escape special characters in the given string of html. * * @param {String} html * @return {String} * @api private */ exports.escape = function(html) { return String(html) .replace(/&/g, '&amp;') .replace(/"/g, '&quot;') .replace(/</g, '&lt;') .replace(/>/g, '&gt;'); }; /** * Normalize the given path string, * returning a regular expression. * * An empty array should be passed, * which will contain the placeholder * key names. For example "/user/:id" will * then contain ["id"]. * * @param {String|RegExp|Array} path * @param {Array} keys * @param {Boolean} sensitive * @param {Boolean} strict * @return {RegExp} * @api private */ exports.pathRegexp = function(path, keys, sensitive, strict) { if (toString.call(path) == '[object RegExp]') return path; if (Array.isArray(path)) path = '(' + path.join('|') + ')'; path = path .concat(strict ? '' : '/?') .replace(/\/\(/g, '(?:/') .replace(/(\/)?(\.)?:(\w+)(?:(\(.*?\)))?(\?)?(\*)?/g, function(_, slash, format, key, capture, optional, star){ keys.push({ name: key, optional: !! optional }); slash = slash || ''; return '' + (optional ? '' : slash) + '(?:' + (optional ? slash : '') + (format || '') + (capture || (format && '([^/.]+?)' || '([^/]+?)')) + ')' + (optional || '') + (star ? '(/*)?' : ''); }) .replace(/([\/.])/g, '\\$1') .replace(/\*/g, '(.*)'); return new RegExp('^' + path + '$', sensitive ? '' : 'i'); } /** * Compile "proxy trust" value to function. * * @param {Boolean|String|Number|Array|Function} val * @return {Function} * @api private */ exports.compileTrust = function(val) { if (typeof val === 'function') return val; if (val === true) { // Support plain true/false return function(){ return true }; } if (typeof val === 'number') { // Support trusting hop count return function(a, i){ return i < val }; } if (typeof val === 'string') { // Support comma-separated values val = val.split(/ *, */); } return proxyaddr.compile(val || []); >>>>>>> } /** * Compile "proxy trust" value to function. * * @param {Boolean|String|Number|Array|Function} val * @return {Function} * @api private */ exports.compileTrust = function(val) { if (typeof val === 'function') return val; if (val === true) { // Support plain true/false return function(){ return true }; } if (typeof val === 'number') { // Support trusting hop count return function(a, i){ return i < val }; } if (typeof val === 'string') { // Support comma-separated values val = val.split(/ *, */); } return proxyaddr.compile(val || []);
<<<<<<< res.send = function send(body) { var chunk = body; ======= res.send = function(body){ var req = this.req; var type; >>>>>>> res.send = function send(body) { var chunk = body; <<<<<<< // method check var isHead = req.method === 'HEAD'; // ETag support if (len !== undefined && (isHead || req.method === 'GET')) { var etag = app.get('etag fn'); if (etag && !this.get('ETag')) { etag = etag(chunk, encoding); etag && this.set('ETag', etag); ======= // populate ETag var etag; var generateETag = len !== undefined && app.get('etag fn'); if (typeof generateETag === 'function' && !this.get('ETag')) { if ((etag = generateETag(body, encoding))) { this.set('ETag', etag); >>>>>>> // populate ETag var etag; var generateETag = len !== undefined && app.get('etag fn'); if (typeof generateETag === 'function' && !this.get('ETag')) { if ((etag = generateETag(chunk, encoding))) { this.set('ETag', etag); <<<<<<< if (isHead) { // skip body for HEAD this.end(); } else { // respond this.end(chunk, encoding); } ======= if (req.method === 'HEAD') { // skip body for HEAD this.end(); } else { // respond this.end(body, encoding); } >>>>>>> if (req.method === 'HEAD') { // skip body for HEAD this.end(); } else { // respond this.end(chunk, encoding); }
<<<<<<< var mixin = require('utils-merge'); var escapeHtml = require('escape-html'); var Router = require('./router'); var methods = require('methods'); var middleware = require('./middleware/init'); var query = require('./middleware/query'); var debug = require('debug')('express:application'); var View = require('./view'); var http = require('http'); var compileETag = require('./utils').compileETag; var compileTrust = require('./utils').compileTrust; var deprecate = require('./utils').deprecate; var resolve = require('path').resolve; ======= var connect = require('connect') , Router = require('./router') , methods = require('methods') , middleware = require('./middleware') , debug = require('debug')('express:application') , locals = require('./utils').locals , compileETag = require('./utils').compileETag , compileTrust = require('./utils').compileTrust , View = require('./view') , utils = connect.utils , http = require('http'); var deprecate = require('depd')('express'); >>>>>>> var mixin = require('utils-merge'); var escapeHtml = require('escape-html'); var Router = require('./router'); var methods = require('methods'); var middleware = require('./middleware/init'); var query = require('./middleware/query'); var debug = require('debug')('express:application'); var View = require('./view'); var http = require('http'); var compileETag = require('./utils').compileETag; var compileTrust = require('./utils').compileTrust; var deprecate = require('depd')('express'); var resolve = require('path').resolve;
<<<<<<< it('should only call once per request', function(done) { var app = express(); var called = 0; var count = 0; app.param('user', function(req, res, next, user) { called++; req.user = user; next(); }); app.get('/foo/:user', function(req, res, next) { count++; next(); }); app.get('/foo/:user', function(req, res, next) { count++; next(); }); app.use(function(req, res) { res.end([count, called, req.user].join(' ')); }); request(app) .get('/foo/bob') .expect('2 1 bob', done); }) it('should call when values differ', function(done) { var app = express(); var called = 0; var count = 0; app.param('user', function(req, res, next, user) { called++; req.users = (req.users || []).concat(user); next(); }); app.get('/:user/bob', function(req, res, next) { count++; next(); }); app.get('/foo/:user', function(req, res, next) { count++; next(); }); app.use(function(req, res) { res.end([count, called, req.users.join(',')].join(' ')); }); request(app) .get('/foo/bob') .expect('2 2 foo,bob', done); }) ======= it('should work with encoded values', function(done){ var app = express(); app.param('name', function(req, res, next, name){ req.params.name = name; next(); }); app.get('/user/:name', function(req, res){ var name = req.params.name; res.send('' + name); }); request(app) .get('/user/foo%25bar') .expect('foo%bar', done); }) >>>>>>> it('should only call once per request', function(done) { var app = express(); var called = 0; var count = 0; app.param('user', function(req, res, next, user) { called++; req.user = user; next(); }); app.get('/foo/:user', function(req, res, next) { count++; next(); }); app.get('/foo/:user', function(req, res, next) { count++; next(); }); app.use(function(req, res) { res.end([count, called, req.user].join(' ')); }); request(app) .get('/foo/bob') .expect('2 1 bob', done); }) it('should call when values differ', function(done) { var app = express(); var called = 0; var count = 0; app.param('user', function(req, res, next, user) { called++; req.users = (req.users || []).concat(user); next(); }); app.get('/:user/bob', function(req, res, next) { count++; next(); }); app.get('/foo/:user', function(req, res, next) { count++; next(); }); app.use(function(req, res) { res.end([count, called, req.users.join(',')].join(' ')); }); request(app) .get('/foo/bob') .expect('2 2 foo,bob', done); }) it('should work with encoded values', function(done){ var app = express(); app.param('name', function(req, res, next, name){ req.params.name = name; next(); }); app.get('/user/:name', function(req, res){ var name = req.params.name; res.send('' + name); }); request(app) .get('/user/foo%25bar') .expect('foo%bar', done); })
<<<<<<< var mime = require('send').mime; var crc32 = require('buffer-crc32'); var basename = require('path').basename; var deprecate = require('util').deprecate; var proxyaddr = require('proxy-addr'); ======= var mime = require('connect').mime , deprecate = require('util').deprecate , proxyaddr = require('proxy-addr') , crc32 = require('buffer-crc32') , crypto = require('crypto'); /** * toString ref. */ var toString = {}.toString; >>>>>>> var mime = require('send').mime; var crc32 = require('buffer-crc32'); var crypto = require('crypto'); var basename = require('path').basename; var deprecate = require('util').deprecate; var proxyaddr = require('proxy-addr'); <<<<<<< ======= * Escape special characters in the given string of html. * * @param {String} html * @return {String} * @api private */ exports.escape = function(html) { return String(html) .replace(/&/g, '&amp;') .replace(/"/g, '&quot;') .replace(/</g, '&lt;') .replace(/>/g, '&gt;'); }; /** * Normalize the given path string, * returning a regular expression. * * An empty array should be passed, * which will contain the placeholder * key names. For example "/user/:id" will * then contain ["id"]. * * @param {String|RegExp|Array} path * @param {Array} keys * @param {Boolean} sensitive * @param {Boolean} strict * @return {RegExp} * @api private */ exports.pathRegexp = function(path, keys, sensitive, strict) { if (toString.call(path) == '[object RegExp]') return path; if (Array.isArray(path)) path = '(' + path.join('|') + ')'; path = path .concat(strict ? '' : '/?') .replace(/\/\(/g, '(?:/') .replace(/(\/)?(\.)?:(\w+)(?:(\(.*?\)))?(\?)?(\*)?/g, function(_, slash, format, key, capture, optional, star){ keys.push({ name: key, optional: !! optional }); slash = slash || ''; return '' + (optional ? '' : slash) + '(?:' + (optional ? slash : '') + (format || '') + (capture || (format && '([^/.]+?)' || '([^/]+?)')) + ')' + (optional || '') + (star ? '(/*)?' : ''); }) .replace(/([\/.])/g, '\\$1') .replace(/\*/g, '(.*)'); return new RegExp('^' + path + '$', sensitive ? '' : 'i'); } /** * Compile "etag" value to function. * * @param {Boolean|String|Function} val * @return {Function} * @api private */ exports.compileETag = function(val) { var fn; if (typeof val === 'function') { return val; } switch (val) { case true: fn = exports.wetag; break; case false: break; case 'strong': fn = exports.etag; break; case 'weak': fn = exports.wetag; break; default: throw new TypeError('unknown value for etag function: ' + val); } return fn; } /** >>>>>>> * Compile "etag" value to function. * * @param {Boolean|String|Function} val * @return {Function} * @api private */ exports.compileETag = function(val) { var fn; if (typeof val === 'function') { return val; } switch (val) { case true: fn = exports.wetag; break; case false: break; case 'strong': fn = exports.etag; break; case 'weak': fn = exports.wetag; break; default: throw new TypeError('unknown value for etag function: ' + val); } return fn; } /**
<<<<<<< app.use(function(req, res){ var str = Array(1000).join('-'); ======= app.use(function (req, res) { var str = Array(1024 * 2).join('-'); >>>>>>> app.use(function (req, res) { var str = Array(1000).join('-'); <<<<<<< .expect('ETag', 'W/"3e7-8084ccd1"') .end(done); }) it('should not set ETag for non-GET/HEAD', function(done){ var app = express(); app.use(function(req, res){ var str = Array(1000).join('-'); res.send(str); }); request(app) .post('/') .end(function(err, res){ if (err) return done(err); assert(!res.header.etag, 'has an ETag'); done(); }); ======= .expect('ETag', 'W/"fz/jGo0ONwzb+aKy/rWipg=="') .expect(200, done); >>>>>>> .expect('ETag', 'W/"3e7-8084ccd1"') .expect(200, done); <<<<<<< app.use(function(req, res){ var str = Array(1000).join('-'); ======= app.use(function (req, res) { var str = Array(1024 * 2).join('-'); >>>>>>> app.use(function (req, res) { var str = Array(1000).join('-'); <<<<<<< .expect('ETag', 'W/"3e7-8084ccd1"') .end(done); ======= .expect('ETag', 'W/"fz/jGo0ONwzb+aKy/rWipg=="') .expect(200, done); >>>>>>> .expect('ETag', 'W/"3e7-8084ccd1"') .expect(200, done); <<<<<<< app.use(function(req, res){ var str = Array(1000).join('-'); ======= app.use(function (req, res) { var str = Array(1024 * 2).join('-'); >>>>>>> app.use(function (req, res) { var str = Array(1000).join('-'); <<<<<<< .expect('etag', 'W/"3e7-8084ccd1"', done) ======= .expect('ETag', 'W/"fz/jGo0ONwzb+aKy/rWipg=="') .expect(200, done); >>>>>>> .expect('ETag', 'W/"3e7-8084ccd1"') .expect(200, done); <<<<<<< app.use(function(req, res){ var str = Array(1000).join('-'); ======= app.use(function (req, res) { var str = Array(1024 * 2).join('-'); >>>>>>> app.use(function (req, res) { var str = Array(1000).join('-'); <<<<<<< app.set('etag', function(body, encoding){ var chunk = !Buffer.isBuffer(body) ? new Buffer(body, encoding) : body; chunk.toString().should.equal('hello, world!') return '"custom"' ======= app.set('etag', function (body, encoding) { body.should.equal('hello, world!'); encoding.should.equal('utf8'); return '"custom"'; >>>>>>> app.set('etag', function (body, encoding) { var chunk = !Buffer.isBuffer(body) ? new Buffer(body, encoding) : body; chunk.toString().should.equal('hello, world!'); return '"custom"';
<<<<<<< var http = require('http'); var path = require('path'); var mixin = require('utils-merge'); var escapeHtml = require('escape-html'); var sign = require('cookie-signature').sign; var normalizeType = require('./utils').normalizeType; var normalizeTypes = require('./utils').normalizeTypes; var setCharset = require('./utils').setCharset; var contentDisposition = require('./utils').contentDisposition; var deprecate = require('./utils').deprecate; var etag = require('./utils').etag; var statusCodes = http.STATUS_CODES; var cookie = require('cookie'); var send = require('send'); var basename = path.basename; var extname = path.extname; var mime = send.mime; ======= var http = require('http') , path = require('path') , connect = require('connect') , utils = connect.utils , sign = require('cookie-signature').sign , normalizeType = require('./utils').normalizeType , normalizeTypes = require('./utils').normalizeTypes , setCharset = require('./utils').setCharset , deprecate = require('./utils').deprecate , statusCodes = http.STATUS_CODES , cookie = require('cookie') , send = require('send') , mime = connect.mime , resolve = require('url').resolve , basename = path.basename , extname = path.extname; >>>>>>> var http = require('http'); var path = require('path'); var mixin = require('utils-merge'); var escapeHtml = require('escape-html'); var sign = require('cookie-signature').sign; var normalizeType = require('./utils').normalizeType; var normalizeTypes = require('./utils').normalizeTypes; var setCharset = require('./utils').setCharset; var contentDisposition = require('./utils').contentDisposition; var deprecate = require('./utils').deprecate; var statusCodes = http.STATUS_CODES; var cookie = require('cookie'); var send = require('send'); var basename = path.basename; var extname = path.extname; var mime = send.mime; <<<<<<< // populate Content-Length if (undefined !== body && !this.get('Content-Length')) { this.set('Content-Length', len = Buffer.isBuffer(body) ? body.length : Buffer.byteLength(body)); } // ETag support // TODO: W/ support if (app.settings.etag && len && ('GET' == req.method || 'HEAD' == req.method)) { if (!this.get('ETag')) { this.set('ETag', etag(body)); } } ======= >>>>>>>
<<<<<<< it('should accept headers option', function(done){ var app = express(); var headers = { 'x-success': 'sent', 'x-other': 'done' }; app.use(function(req, res){ res.sendfile('test/fixtures/user.html', { headers: headers }); }); request(app) .get('/') .expect('x-success', 'sent') .expect('x-other', 'done') .expect(200, done); }) it('should ignore headers option on 404', function(done){ var app = express(); var headers = { 'x-success': 'sent' }; app.use(function(req, res){ res.sendfile('test/fixtures/user.nothing', { headers: headers }); }); request(app) .get('/') .expect(404, function (err, res) { if (err) return done(err); res.headers.should.not.have.property('x-success'); done(); }); }) ======= it('should transfer a file', function (done) { var app = express(); app.use(function (req, res) { res.sendfile('test/fixtures/name.txt'); }); request(app) .get('/') .expect(200, 'tobi', done); }); it('should transfer a directory index file', function (done) { var app = express(); app.use(function (req, res) { res.sendfile('test/fixtures/blog/'); }); request(app) .get('/') .expect(200, '<b>index</b>', done); }); >>>>>>> it('should accept headers option', function(done){ var app = express(); var headers = { 'x-success': 'sent', 'x-other': 'done' }; app.use(function(req, res){ res.sendfile('test/fixtures/user.html', { headers: headers }); }); request(app) .get('/') .expect('x-success', 'sent') .expect('x-other', 'done') .expect(200, done); }) it('should ignore headers option on 404', function(done){ var app = express(); var headers = { 'x-success': 'sent' }; app.use(function(req, res){ res.sendfile('test/fixtures/user.nothing', { headers: headers }); }); request(app) .get('/') .expect(404, function (err, res) { if (err) return done(err); res.headers.should.not.have.property('x-success'); done(); }); }) it('should transfer a file', function (done) { var app = express(); app.use(function (req, res) { res.sendfile('test/fixtures/name.txt'); }); request(app) .get('/') .expect(200, 'tobi', done); }); it('should transfer a directory index file', function (done) { var app = express(); app.use(function (req, res) { res.sendfile('test/fixtures/blog/'); }); request(app) .get('/') .expect(200, '<b>index</b>', done); });
<<<<<<< 'auditLogResource', 'invoiceResource', 'settingsResource', 'paymentResource', 'shipmentResource', 'paymentGatewayProviderResource', 'orderResource', 'invoiceHelper', 'dialogDataFactory', 'merchelloTabsFactory', 'addressDisplayBuilder', 'salesHistoryDisplayBuilder', ======= 'auditLogResource', 'invoiceResource', 'settingsResource', 'paymentResource', 'shipmentResource', 'orderResource', 'dialogDataFactory', 'merchelloTabsFactory', 'addressDisplayBuilder', 'countryDisplayBuilder', 'salesHistoryDisplayBuilder', >>>>>>> 'auditLogResource', 'invoiceResource', 'settingsResource', 'paymentResource', 'shipmentResource', 'paymentGatewayProviderResource', 'orderResource', 'dialogDataFactory', 'merchelloTabsFactory', 'addressDisplayBuilder', 'countryDisplayBuilder', 'salesHistoryDisplayBuilder', <<<<<<< auditLogResource, invoiceResource, settingsResource, paymentResource, shipmentResource, paymentGatewayProviderResource, orderResource, invoiceHelper, dialogDataFactory, merchelloTabsFactory, addressDisplayBuilder, salesHistoryDisplayBuilder, invoiceDisplayBuilder, paymentDisplayBuilder, paymentMethodDisplayBuilder, shipMethodsQueryDisplayBuilder) { ======= auditLogResource, invoiceResource, settingsResource, paymentResource, shipmentResource, orderResource, dialogDataFactory, merchelloTabsFactory, addressDisplayBuilder, countryDisplayBuilder, salesHistoryDisplayBuilder, invoiceDisplayBuilder, paymentDisplayBuilder, paymentMethodDisplayBuilder, shipMethodsQueryDisplayBuilder) { >>>>>>> auditLogResource, invoiceResource, settingsResource, paymentResource, shipmentResource, paymentGatewayProviderResource, orderResource, dialogDataFactory, merchelloTabsFactory, addressDisplayBuilder, countryDisplayBuilder, salesHistoryDisplayBuilder, invoiceDisplayBuilder, paymentDisplayBuilder, paymentMethodDisplayBuilder, shipMethodsQueryDisplayBuilder) { <<<<<<< $scope.toggleNewPaymentOpen = toggleNewPaymentOpen; $scope.reload = init; ======= $scope.openAddressAddEditDialog = openAddressAddEditDialog; >>>>>>> $scope.toggleNewPaymentOpen = toggleNewPaymentOpen; $scope.reload = init; $scope.openAddressAddEditDialog = openAddressAddEditDialog;
<<<<<<< it('correctly sets the value of the tile source', () => { assert.equal(subject.tile_source, sampleScene.tileSource); }); it('correctly sets the value of the layers object', () => { assert.equal(subject.layer_source, sampleScene.layers); }); it('correctly sets the value of the styles object', () => { assert.equal(subject.style_source, sampleScene.styles); }); ======= >>>>>>> it('correctly sets the value of the tile source', () => { assert.equal(subject.tile_source, sampleScene.tileSource); }); it('correctly sets the value of the layers object', () => { assert.equal(subject.layer_source, sampleScene.layers); }); it('correctly sets the value of the styles object', () => { assert.equal(subject.style_source, sampleScene.styles); }); <<<<<<< it('calls back', (done) => { subject.init(() => { assert.ok(true); done(); }); ======= beforeEach((done) => { subject = makeOne({}); subject.init(done); >>>>>>> beforeEach((done) => { subject = makeOne({}); subject.init(done);
<<<<<<< // FIXME: We should check for errors here? // Perform backward tick on rounds // WARNING: DB_WRITE modules.rounds.backwardTick(oldLastBlock, previousBlock, function () { // Delete last block from blockchain // WARNING: Db_WRITE ======= if (err) { // Fatal error, memory tables will be inconsistent library.logger.error('Failed to undo transactions', err); return process.exit(0); } modules.rounds.backwardTick(oldLastBlock, previousBlock, function (err) { if (err) { // Fatal error, memory tables will be inconsistent library.logger.error('Failed to perform backwards tick', err); return process.exit(0); } >>>>>>> if (err) { // Fatal error, memory tables will be inconsistent library.logger.error('Failed to undo transactions', err); return process.exit(0); } // Perform backward tick on rounds // WARNING: DB_WRITE modules.rounds.backwardTick(oldLastBlock, previousBlock, function (err) { if (err) { // Fatal error, memory tables will be inconsistent library.logger.error('Failed to perform backwards tick', err); return process.exit(0); } // Delete last block from blockchain // WARNING: Db_WRITE <<<<<<< // When client is not loaded, is syncing or round is ticking // Do not receive new blocks as client is not ready if (!__private.loaded || modules.loader.syncing() || modules.rounds.ticking()) { library.logger.debug('Client not ready to receive block', block.id); return; } // Execute in sequence via sequence ======= >>>>>>> // Execute in sequence via sequence <<<<<<< // Initial check if new block looks fine ======= // When client is not loaded, is syncing or round is ticking // Do not receive new blocks as client is not ready if (!__private.loaded || modules.loader.syncing() || modules.rounds.ticking()) { library.logger.debug('Client not ready to receive block', block.id); return setImmediate(cb); } >>>>>>> // When client is not loaded, is syncing or round is ticking // Do not receive new blocks as client is not ready if (!__private.loaded || modules.loader.syncing() || modules.rounds.ticking()) { library.logger.debug('Client not ready to receive block', block.id); return setImmediate(cb); }
<<<<<<< // ----------- Make the server listening ----------- server.listen(port, function () { // Activate the pool requests Request.activate() logger.info('Seeded all the videos') logger.info('Server listening on port %d', port) app.emit('ready') ======= // Run the migration scripts if needed migrator.migrate(function (err) { if (err) throw err // Create/activate the webtorrent module webtorrent.create(function () { function cleanForExit () { utils.cleanForExit(webtorrent.app) } function exitGracefullyOnSignal () { process.exit(-1) } process.on('exit', cleanForExit) process.on('SIGINT', exitGracefullyOnSignal) process.on('SIGTERM', exitGracefullyOnSignal) // ----------- Make the server listening ----------- server.listen(port, function () { // Activate the pool requests Request.activate() Video.seedAllExisting(function (err) { if (err) throw err logger.info('Seeded all the videos') logger.info('Server listening on port %d', port) app.emit('ready') }) }) }) >>>>>>> // Run the migration scripts if needed migrator.migrate(function (err) { if (err) throw err // ----------- Make the server listening ----------- server.listen(port, function () { // Activate the pool requests Request.activate() logger.info('Seeded all the videos') logger.info('Server listening on port %d', port) app.emit('ready') })
<<<<<<< const config = require('config') const createTorrent = require('create-torrent') ======= const eachLimit = require('async/eachLimit') >>>>>>> const config = require('config') const createTorrent = require('create-torrent') <<<<<<< const http = config.get('webserver.https') === true ? 'https' : 'http' const host = config.get('webserver.host') const port = config.get('webserver.port') const uploadsDir = pathUtils.join(__dirname, '..', '..', config.get('storage.uploads')) const thumbnailsDir = pathUtils.join(__dirname, '..', '..', config.get('storage.thumbnails')) const torrentsDir = pathUtils.join(__dirname, '..', '..', config.get('storage.torrents')) const webseedBaseUrl = http + '://' + host + ':' + port + constants.STATIC_PATHS.WEBSEED ======= >>>>>>> const http = config.get('webserver.https') === true ? 'https' : 'http' const host = config.get('webserver.host') const port = config.get('webserver.port') const uploadsDir = pathUtils.join(__dirname, '..', '..', config.get('storage.uploads')) const thumbnailsDir = pathUtils.join(__dirname, '..', '..', config.get('storage.thumbnails')) const torrentsDir = pathUtils.join(__dirname, '..', '..', config.get('storage.torrents')) const webseedBaseUrl = http + '://' + host + ':' + port + constants.STATIC_PATHS.WEBSEED <<<<<<< getDurationFromFile: getDurationFromFile, list: list, listByUrlAndMagnet: listByUrlAndMagnet, listByUrls: listByUrls, listOwned: listOwned, listRemotes: listRemotes, load: load, search: search ======= getDurationFromFile, listForApi, listByUrlAndMagnet, listByUrls, listOwned, listOwnedByAuthor, listRemotes, load, search, seedAllExisting >>>>>>> getDurationFromFile, listForApi, listByUrlAndMagnet, listByUrls, listOwned, listOwnedByAuthor, listRemotes, load, search <<<<<<< ======= function seedAllExisting (callback) { listOwned.call(this, function (err, videos) { if (err) return callback(err) eachLimit(videos, constants.SEEDS_IN_PARALLEL, function (video, callbackEach) { const videoPath = pathUtils.join(constants.CONFIG.STORAGE.UPLOAD_DIR, video.filename) seed(videoPath, callbackEach) }, callback) }) } >>>>>>>
<<<<<<< var prevFile, parts, file, lineno, result = ""; ======= var lastFile = null, parts, file, lineno; >>>>>>> var prevFile = null, parts, file, lineno, result = ""; <<<<<<< ++count; file = encodeURI(options.uri + Util.rtrim(parts.shift().replace(basePath, "")), "/"); ======= file = parts.shift(); >>>>>>> file = encodeURI(options.uri + Util.rtrim(parts.shift().replace(basePath, "")), "/"); <<<<<<< if (file !== prevFile) { ======= ++count; if (file !== lastFile) { >>>>>>> ++count; if (file !== prevFile) {
<<<<<<< import DS from 'ember-data'; moment.locale("zh-cn"); ======= >>>>>>>
<<<<<<< var css$1 = "#wildcard-container table.htCore {\r\n font-size: 18px;\r\n}\r\n\r\n#wildcard-container {\r\n border-top: solid thin #ddd;\r\n position: fixed;\r\n overflow: hidden;\r\n background-color: white;\r\n font-size: 14px;\r\n height: 250px;\r\n width: 100%;\r\n z-index: 3000;\r\n bottom: 0;\r\n}\r\n\r\n#wildcard-container.single-row {\r\n height: 100px;\r\n}\r\n\r\n.wildcard-table-toggle {\r\n font-size: 14px;\r\n border-radius: 10px;\r\n z-index: 100000;\r\n padding: 10px;\r\n position: fixed;\r\n bottom: 20px;\r\n right: 20px;\r\n background-color: white;\r\n box-shadow: 0px 0px 10px -1px #d5d5d5;\r\n border: none;\r\n cursor: pointer;\r\n}\r\n\r\n.wildcard-table-toggle.table-open {\r\n bottom: 270px;\r\n}\r\n\r\n.wildcard-table-toggle:active {\r\n background-color: #ddd;\r\n}\r\n\r\n.wildcard-table-toggle:focus {\r\n outline: 0;\r\n}\r\n"; ======= class FormulaEditor extends Handsontable.editors.TextEditor { constructor(hotInstance) { super(hotInstance); } prepare(row, col, prop, td, originalValue, cellProperties) { super.prepare(row, col, prop, td, originalValue, cellProperties); if(cellProperties.formula) { this.formula = cellProperties.formula; } else { this.formula = null; } } // If cell contains a formula, edit the formula, not the value beginEditing(newValue, event) { let valueToEdit = newValue; if (this.formula) { valueToEdit = this.formula; } super.beginEditing(valueToEdit, event); } } var css$1 = "#wildcard-container table.htCore {\n font-size: 18px;\n}\n\n#wildcard-container {\n border-top: solid thin #ddd;\n position: fixed;\n overflow: hidden;\n background-color: white;\n font-size: 14px;\n height: 250px;\n width: 100%;\n z-index: 1000;\n bottom: 0;\n}\n\n#wildcard-container.single-row {\n height: 100px;\n}\n\n.wildcard-table-toggle {\n font-size: 14px;\n border-radius: 10px;\n z-index: 100000;\n padding: 10px;\n position: fixed;\n bottom: 20px;\n right: 20px;\n background-color: white;\n box-shadow: 0px 0px 10px -1px #d5d5d5;\n border: none;\n cursor: pointer;\n}\n\n.wildcard-table-toggle.table-open {\n bottom: 270px;\n}\n\n.wildcard-table-toggle:active {\n background-color: #ddd;\n}\n\n.wildcard-table-toggle:focus {\n outline: 0;\n}\n"; >>>>>>> class FormulaEditor extends Handsontable.editors.TextEditor { constructor(hotInstance) { super(hotInstance); } prepare(row, col, prop, td, originalValue, cellProperties) { super.prepare(row, col, prop, td, originalValue, cellProperties); if(cellProperties.formula) { this.formula = cellProperties.formula; } else { this.formula = null; } } // If cell contains a formula, edit the formula, not the value beginEditing(newValue, event) { let valueToEdit = newValue; if (this.formula) { valueToEdit = this.formula; } super.beginEditing(valueToEdit, event); } } var css$1 = "#wildcard-container table.htCore {\r\n font-size: 18px;\r\n}\r\n\r\n#wildcard-container {\r\n border-top: solid thin #ddd;\r\n position: fixed;\r\n overflow: hidden;\r\n background-color: white;\r\n font-size: 14px;\r\n height: 250px;\r\n width: 100%;\r\n z-index: 3000;\r\n bottom: 0;\r\n}\r\n\r\n#wildcard-container.single-row {\r\n height: 100px;\r\n}\r\n\r\n.wildcard-table-toggle {\r\n font-size: 14px;\r\n border-radius: 10px;\r\n z-index: 100000;\r\n padding: 10px;\r\n position: fixed;\r\n bottom: 20px;\r\n right: 20px;\r\n background-color: white;\r\n box-shadow: 0px 0px 10px -1px #d5d5d5;\r\n border: none;\r\n cursor: pointer;\r\n}\r\n\r\n.wildcard-table-toggle.table-open {\r\n bottom: 270px;\r\n}\r\n\r\n.wildcard-table-toggle:active {\r\n background-color: #ddd;\r\n}\r\n\r\n.wildcard-table-toggle:focus {\r\n outline: 0;\r\n}\r\n"; <<<<<<< return el instanceof HTMLElement || (el.__proto__.toString().includes("HTML") && el.__proto__.toString().includes("Element")); ======= return el instanceof HTMLElement || (el.__proto__.toString().includes("HTML") && el.__proto__.toString().includes("Element")); }; var colSpecFromProp = function (prop) { return options.colSpecs.find(function (spec) { return spec.name == prop; }); }; // Touch all the cells in a column, triggering afterChange callbacks // todo: I think this can be optimized a lot for formula columns, seems slow var resetColumn = function (prop) { var currentData = hot.getDataAtProp(prop); hot.setDataAtRowProp(currentData.map(function (val, idx) { return [idx, prop, val]; })); >>>>>>> return el instanceof HTMLElement || (el.__proto__.toString().includes("HTML") && el.__proto__.toString().includes("Element")); }; var colSpecFromProp = function (prop) { return options.colSpecs.find(function (spec) { return spec.name == prop; }); }; // Touch all the cells in a column, triggering afterChange callbacks // todo: I think this can be optimized a lot for formula columns, seems slow var resetColumn = function (prop) { var currentData = hot.getDataAtProp(prop); hot.setDataAtRowProp(currentData.map(function (val, idx) { return [idx, prop, val]; })); <<<<<<< { name: "id", type: "text", hidden: true }, { name: "Time", type: "time", timeFormat: 'h:mm:ss a', correctFormat: true }, ======= { name: "Time", type: "text" }, >>>>>>> { name: "id", type: "text", hidden: true }, { name: "Time", type: "time", timeFormat: 'h:mm:ss a', correctFormat: true },
<<<<<<< const app = electron.app; const Menu = electron.Menu; const createMenuTemplate = require('./menutemplate'); const BrowserWindow = electron.BrowserWindow; ======= const { app, Menu, BrowserWindow, dialog } = electron; const menuTemplate = require('./menutemplate'); >>>>>>> const { app, Menu, BrowserWindow, dialog } = electron; const Menu = electron.Menu; const createMenuTemplate = require('./menutemplate');