Code reformat

This commit is contained in:
death-claw
2021-01-12 19:37:12 +01:00
parent 798f39d54f
commit 26fde22af2
92 changed files with 600 additions and 531 deletions
+71 -71
View File
@@ -1,77 +1,77 @@
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>tn.mnlr</groupId>
<artifactId>vripper</artifactId>
<version>3.2.0</version>
</parent>
<artifactId>vripper-electron</artifactId>
<name>vripper-electron</name>
<build>
<plugins>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<classifier>${buildClassifier}</classifier>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>electron</id>
<properties>
<buildClassifier>electron</buildClassifier>
</properties>
<dependencies>
<dependency>
<groupId>tn.mnlr</groupId>
<artifactId>vripper-server</artifactId>
<version>${project.version}</version>
<scope>runtime</scope>
<classifier>${buildClassifier}</classifier>
</dependency>
</dependencies>
<build>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>tn.mnlr</groupId>
<artifactId>vripper</artifactId>
<version>3.2.0</version>
</parent>
<artifactId>vripper-electron</artifactId>
<name>vripper-electron</name>
<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.3</version>
<configuration>
<nodeVersion>v12.2.0</nodeVersion>
<npmVersion>6.9.0</npmVersion>
<workingDirectory>build-dir</workingDirectory>
</configuration>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
</execution>
<execution>
<id>npm run build</id>
<goals>
<goal>npm</goal>
</goals>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<arguments>run dist</arguments>
<classifier>${buildClassifier}</classifier>
</configuration>
<phase>generate-resources</phase>
</execution>
</executions>
</plugin>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</build>
<profiles>
<profile>
<id>electron</id>
<properties>
<buildClassifier>electron</buildClassifier>
</properties>
<dependencies>
<dependency>
<groupId>tn.mnlr</groupId>
<artifactId>vripper-server</artifactId>
<version>${project.version}</version>
<scope>runtime</scope>
<classifier>${buildClassifier}</classifier>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.3</version>
<configuration>
<nodeVersion>v12.2.0</nodeVersion>
<npmVersion>6.9.0</npmVersion>
<workingDirectory>build-dir</workingDirectory>
</configuration>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
</execution>
<execution>
<id>npm run build</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run dist</arguments>
</configuration>
<phase>generate-resources</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
+3 -3
View File
@@ -2,7 +2,7 @@ const cheerio = require('cheerio');
const fs = require('fs');
const rimraf = require("rimraf");
const copydir = require("copy-dir");
const { execSync } = require("child_process");
const {execSync} = require("child_process");
rimraf.sync('./build/vripper-ui');
copydir.sync('../vripper-ui/dist/vripper-ui', './build/vripper-ui', {});
@@ -19,7 +19,7 @@ fs.writeFileSync('./build/vripper-ui/index.html', $.html());
console.log('Building runtime environment');
rimraf.sync('java-runtime');
execSync('jlink --no-header-files --no-man-pages --compress=2 --strip-debug --add-modules java.base,java.desktop,java.instrument,java.management,java.naming,java.prefs,java.rmi,java.scripting,java.security.jgss,java.sql,jdk.httpserver,jdk.unsupported,jdk.crypto.ec --output java-runtime');
if(process.platform === 'linux') {
if (process.platform === 'linux') {
console.log('Stripping libjvm.so');
execSync('strip -p --strip-unneeded java-runtime/lib/server/libjvm.so');
}
}
@@ -1,12 +1,9 @@
package tn.mnlr.vripper;
import lombok.extern.slf4j.Slf4j;
import net.jodah.failsafe.RetryPolicy;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import java.time.temporal.ChronoUnit;
@SpringBootApplication
@Slf4j
public class VripperApplication {
@@ -32,41 +32,20 @@ import java.util.*;
@Slf4j
public class DownloadJob implements CheckedRunnable {
public enum ContextAttributes {
OPEN_CONNECTION("OPEN_CONNECTION");
private final String value;
ContextAttributes(String value) {
this.value = value;
}
@Override
public String toString() {
return value;
}
}
private static final Object LOCK = new Object();
private static final int READ_BUFFER_SIZE = 8192;
private final DataService dataService;
private final PathService pathService;
private final ConnectionService cm;
private final VGAuthService authService;
private final DownloadSpeedService downloadSpeedService;
private final SettingsService settingsService;
private final HttpClientContext context;
@Getter
private final Image image;
@Getter
private final Post post;
private boolean stopped = false;
@Getter
private boolean finished = false;
@@ -280,4 +259,19 @@ public class DownloadJob implements CheckedRunnable {
}
this.stopped = true;
}
public enum ContextAttributes {
OPEN_CONNECTION("OPEN_CONNECTION");
private final String value;
ContextAttributes(String value) {
this.value = value;
}
@Override
public String toString() {
return value;
}
}
}
@@ -8,12 +8,11 @@ import tn.mnlr.vripper.host.Host;
import tn.mnlr.vripper.jpa.domain.Image;
import tn.mnlr.vripper.jpa.domain.Post;
import tn.mnlr.vripper.jpa.domain.enums.Status;
import tn.mnlr.vripper.services.SettingsService;
import tn.mnlr.vripper.services.DataService;
import tn.mnlr.vripper.services.PostService;
import tn.mnlr.vripper.services.SettingsService;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicInteger;
@@ -6,8 +6,8 @@ import org.springframework.stereotype.Service;
import tn.mnlr.vripper.host.Host;
import tn.mnlr.vripper.jpa.domain.Image;
import tn.mnlr.vripper.jpa.domain.Post;
import tn.mnlr.vripper.services.SettingsService;
import tn.mnlr.vripper.services.DataService;
import tn.mnlr.vripper.services.SettingsService;
import javax.annotation.PostConstruct;
import java.util.*;
@@ -10,6 +10,6 @@ public class HostException extends Exception {
}
public HostException(String message, Throwable e) {
super(message,e);
super(message, e);
}
}
@@ -2,5 +2,5 @@ package tn.mnlr.vripper.jpa.repositories;
public interface IRepository {
public void init();
void init();
}
@@ -13,7 +13,7 @@ import javax.annotation.PreDestroy;
@Slf4j
public class QueuedRemoveEventListener implements ApplicationListener<QueuedRemoveEvent>, DataEventListener<QueuedRemoveEvent> {
private Sinks.Many<QueuedRemoveEvent> sink = Sinks.many().multicast().onBackpressureBuffer();
private final Sinks.Many<QueuedRemoveEvent> sink = Sinks.many().multicast().onBackpressureBuffer();
@Override
public void onApplicationEvent(QueuedRemoveEvent event) {
@@ -13,7 +13,7 @@ import javax.annotation.PreDestroy;
@Slf4j
public class QueuedUpdateEventListener implements ApplicationListener<QueuedUpdateEvent>, DataEventListener<QueuedUpdateEvent> {
private Sinks.Many<QueuedUpdateEvent> sink = Sinks.many().multicast().onBackpressureBuffer();
private final Sinks.Many<QueuedUpdateEvent> sink = Sinks.many().multicast().onBackpressureBuffer();
@Override
public void onApplicationEvent(QueuedUpdateEvent event) {
@@ -46,11 +46,11 @@ public class ConnectionService {
maxAttempts = settingsService.getSettings().getMaxAttempts();
Flux<SettingsService.Settings> settingsFlux = settingsService.getSettingsFlux();
disposable = settingsFlux.subscribe(settings -> {
if(connectionTimeout != settings.getConnectionTimeout()) {
if (connectionTimeout != settings.getConnectionTimeout()) {
connectionTimeout = settings.getConnectionTimeout();
buildRequestConfig();
}
if(maxAttempts != settings.getMaxAttempts()) {
if (maxAttempts != settings.getMaxAttempts()) {
maxAttempts = settings.getMaxAttempts();
buildRetryPolicy();
}
@@ -16,18 +16,15 @@ import java.util.concurrent.atomic.AtomicLong;
public class DownloadSpeedService {
private final AtomicLong read = new AtomicLong(0);
private final Sinks.Many<Long> sink = Sinks.many().multicast().onBackpressureBuffer();
@Getter
private long currentValue;
private final Sinks.Many<Long> sink = Sinks.many().multicast().onBackpressureBuffer();
private boolean allowWrite = false;
public Flux<Long> getReadBytesPerSecond() {
return sink.asFlux();
}
private boolean allowWrite = false;
public void increase(long read) {
if (allowWrite) {
this.read.addAndGet(read);
@@ -21,16 +21,10 @@ public class GlobalStateService {
private final PendingQueue pendingQueue;
private final DownloadService downloadService;
private final DataService dataService;
private final Sinks.Many<GlobalState> sink = Sinks.many().multicast().onBackpressureBuffer();
@Getter
private GlobalState currentState;
private final Sinks.Many<GlobalState> sink = Sinks.many().multicast().onBackpressureBuffer();
public Flux<GlobalState> getGlobalState() {
return sink.asFlux();
}
@Autowired
public GlobalStateService(PendingQueue pendingQueue, DownloadService downloadService, DataService dataService) {
this.pendingQueue = pendingQueue;
@@ -38,6 +32,10 @@ public class GlobalStateService {
this.dataService = dataService;
}
public Flux<GlobalState> getGlobalState() {
return sink.asFlux();
}
@Scheduled(fixedDelay = 3000)
private void interval() {
GlobalState newGlobalState = new GlobalState(
@@ -31,31 +31,6 @@ public class HostService {
this.htmlProcessorService = htmlProcessorService;
}
@Getter
public static class Response {
private final Document document;
private final Header[] headers;
protected Response(Document document, Header[] headers) {
this.document = document;
this.headers = headers;
}
}
@Getter
public static class NameUrl {
private String name;
private String url;
public NameUrl(String name, String url) {
this.name = name;
this.url = url;
}
}
public Response getResponse(final String url, final HttpClientContext context) throws HostException {
String basePage;
@@ -102,4 +77,28 @@ public class HostService {
log.debug(String.format("Extracting name from url %s: %s", imgUrl, imageTitle));
return imgUrl;
}
@Getter
public static class Response {
private final Document document;
private final Header[] headers;
protected Response(Document document, Header[] headers) {
this.document = document;
this.headers = headers;
}
}
@Getter
public static class NameUrl {
private final String name;
private final String url;
public NameUrl(String name, String url) {
this.name = name;
this.url = url;
}
}
}
@@ -15,7 +15,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import tn.mnlr.vripper.VripperApplication;
import tn.mnlr.vripper.exception.DownloadException;
import tn.mnlr.vripper.exception.PostParseException;
import tn.mnlr.vripper.jpa.domain.Metadata;
@@ -34,40 +33,12 @@ import java.util.stream.Collectors;
@Service
public class MetadataService {
@Getter
static class Key {
private final String postId;
private final String threadId;
private final String url;
Key(String postId, String threadId, String url) {
this.postId = postId;
this.threadId = threadId;
this.url = url;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Key key = (Key) o;
return Objects.equals(postId, key.postId);
}
@Override
public int hashCode() {
return Objects.hash(postId);
}
}
private static final List<String> dictionary = Arrays.asList("download", "link", "rapidgator", "filefactory", "filefox");
private final LoadingCache<Key, Metadata> cache;
private final ConnectionService cm;
private final VGAuthService VGAuthService;
private final HtmlProcessorService htmlProcessorService;
private final XpathService xpathService;
@Autowired
public MetadataService(ConnectionService cm, VGAuthService VGAuthService, HtmlProcessorService htmlProcessorService, XpathService xpathService) {
this.cm = cm;
@@ -162,4 +133,30 @@ public class MetadataService {
}
}
}
@Getter
static class Key {
private final String postId;
private final String threadId;
private final String url;
Key(String postId, String threadId, String url) {
this.postId = postId;
this.threadId = threadId;
this.url = url;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Key key = (Key) o;
return Objects.equals(postId, key.postId);
}
@Override
public int hashCode() {
return Objects.hash(postId);
}
}
}
@@ -141,7 +141,7 @@ public class PostService {
}
log.debug(String.format("threadId %s, postId %s is added automatically for download", queued.getThreadId(), queued.getPostId()));
} else {
if(dataService.findQueuedByThreadId(queued.getThreadId()).isEmpty()) {
if (dataService.findQueuedByThreadId(queued.getThreadId()).isEmpty()) {
dataService.newQueueLink(queued);
} else {
log.info(String.format("Thread with id = %s is already loaded", queued.getThreadId()));
@@ -199,11 +199,11 @@ public class SettingsService {
throw new ValidationException(String.format("Invalid max concurrent download settings, values must be in [%d,%d]", 1, 4));
}
if(settings.getConnectionTimeout() < 1 || settings.getConnectionTimeout() > 300) {
if (settings.getConnectionTimeout() < 1 || settings.getConnectionTimeout() > 300) {
throw new ValidationException(String.format("Invalid connection timeout settings, values must be in [%d,%d]", 1, 300));
}
if(settings.getMaxAttempts() < 1 || settings.getMaxAttempts() > 10) {
if (settings.getMaxAttempts() < 1 || settings.getMaxAttempts() > 10) {
throw new ValidationException(String.format("Invalid maximum attempts settings, values must be in [%d,%d]", 1, 10));
}
}
@@ -39,15 +39,12 @@ public class VGAuthService {
@Getter
private final HttpClientContext context = HttpClientContext.create();
private final Sinks.Many<String> sink = Sinks.many().multicast().onBackpressureBuffer();
@Getter
private boolean authenticated = false;
@Getter
private String loggedUser = "";
private final Sinks.Many<String> sink = Sinks.many().multicast().onBackpressureBuffer();
@Autowired
public VGAuthService(ConnectionService cm, SettingsService settingsService, ThreadPoolService threadPoolService, DataService dataService) {
this.cm = cm;
@@ -12,7 +12,7 @@ import javax.xml.xpath.XPathFactory;
@Service
public class XpathService {
private XPath xpath = XPathFactory.newInstance().newXPath();
private final XPath xpath = XPathFactory.newInstance().newXPath();
public Node getAsNode(Node source, String xpathExpression) throws XpathException {
try {
@@ -7,7 +7,6 @@ import tn.mnlr.vripper.SpringContext;
import tn.mnlr.vripper.host.Host;
import tn.mnlr.vripper.jpa.domain.Image;
import tn.mnlr.vripper.jpa.domain.Post;
import tn.mnlr.vripper.services.domain.ApiPost;
import java.util.Collection;
import java.util.HashSet;
@@ -96,7 +95,7 @@ class ApiPostHandler extends DefaultHandler {
@Override
public void endElement(String uri, String localName, String qName) {
if ("post".equals(qName.toLowerCase())) {
if ("post".equalsIgnoreCase(qName)) {
parsedPost.setTotal(images.size());
if (!previews.isEmpty()) {
parsedPost.setPreviews(previews);
@@ -16,6 +16,8 @@ public class ApiThreadHandler extends DefaultHandler {
private final Queued queued;
private final Collection<Host> supportedHosts;
private final Map<Host, AtomicInteger> hostMap = new HashMap<>();
@Getter
private final List<MultiPostItem> posts = new ArrayList<>();
private List<String> previews = new ArrayList<>();
private String threadTitle;
private String postId;
@@ -24,9 +26,6 @@ public class ApiThreadHandler extends DefaultHandler {
private int postCounter;
private int previewCounter = 0;
@Getter
private final List<MultiPostItem> posts = new ArrayList<>();
public ApiThreadHandler(Queued queued) {
this.queued = queued;
this.supportedHosts = SpringContext.getBeansOfType(Host.class).values();
@@ -63,7 +62,7 @@ public class ApiThreadHandler extends DefaultHandler {
@Override
public void endElement(String uri, String localName, String qName) {
if ("post".equals(qName.toLowerCase())) {
if ("post".equalsIgnoreCase(qName)) {
if (imageCount != 0) {
posts.add(new MultiPostItem(
queued.getThreadId(),
@@ -29,7 +29,7 @@ public class MetadataRunnable implements Runnable {
@Override
public void run() {
try {
if(Thread.interrupted()) {
if (Thread.interrupted()) {
log.debug(String.format("Metadata fetching for postId=%s, threadId=%s interrupted", post.getPostId(), post.getThreadId()));
return;
}
@@ -10,13 +10,12 @@ import tn.mnlr.vripper.exception.PostParseException;
import tn.mnlr.vripper.jpa.domain.Metadata;
import tn.mnlr.vripper.jpa.domain.Post;
import tn.mnlr.vripper.jpa.domain.Queued;
import tn.mnlr.vripper.services.ThreadPoolService;
import tn.mnlr.vripper.services.DataService;
import tn.mnlr.vripper.services.PathService;
import tn.mnlr.vripper.services.domain.MultiPostItem;
import tn.mnlr.vripper.services.PostService;
import tn.mnlr.vripper.services.ThreadPoolService;
import tn.mnlr.vripper.services.domain.MultiPostItem;
import tn.mnlr.vripper.web.restendpoints.domain.*;
import tn.mnlr.vripper.web.restendpoints.domain.PostId;
import tn.mnlr.vripper.web.restendpoints.exceptions.BadRequestException;
import tn.mnlr.vripper.web.restendpoints.exceptions.NotFoundException;
import tn.mnlr.vripper.web.restendpoints.exceptions.ServerErrorException;
@@ -36,15 +35,13 @@ import java.util.stream.Collectors;
public class PostRestEndpoint {
private static final Pattern VG_URL_PATTERN = Pattern.compile("https://vipergirls\\.to/threads/(\\d+)((.*p=)(\\d+))?");
private static final Object LOCK = new Object();
private final DataService dataService;
private final PathService pathService;
private final DownloadService downloadService;
private final PostService postService;
private final ThreadPoolService threadPoolService;
private static final Object LOCK = new Object();
@Autowired
public PostRestEndpoint(DataService dataService, PathService pathService, DownloadService downloadService, PostService postService, ThreadPoolService threadPoolService) {
this.dataService = dataService;
@@ -6,7 +6,6 @@ import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;
import tn.mnlr.vripper.exception.ValidationException;
import tn.mnlr.vripper.services.SettingsService;
import tn.mnlr.vripper.services.VGAuthService;
import tn.mnlr.vripper.web.restendpoints.exceptions.BadRequestException;
@RestController
@@ -1,6 +1,9 @@
package tn.mnlr.vripper.web.restendpoints.domain;
import lombok.*;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Getter
@Setter
@@ -1,6 +1,9 @@
package tn.mnlr.vripper.web.restendpoints.domain;
import lombok.*;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Getter
@Setter
@@ -1,6 +1,9 @@
package tn.mnlr.vripper.web.restendpoints.domain;
import lombok.*;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Getter
@Setter
@@ -1,6 +1,9 @@
package tn.mnlr.vripper.web.restendpoints.domain;
import lombok.*;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import java.util.List;
@@ -1,6 +1,9 @@
package tn.mnlr.vripper.web.restendpoints.domain;
import lombok.*;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Getter
@Setter
@@ -1,6 +1,9 @@
package tn.mnlr.vripper.web.restendpoints.domain;
import lombok.*;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Getter
@Setter
@@ -1,6 +1,9 @@
package tn.mnlr.vripper.web.restendpoints.domain;
import lombok.*;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Getter
@Setter
@@ -8,7 +8,10 @@ import org.springframework.stereotype.Controller;
import tn.mnlr.vripper.jpa.domain.Image;
import tn.mnlr.vripper.jpa.domain.Post;
import tn.mnlr.vripper.jpa.domain.Queued;
import tn.mnlr.vripper.services.*;
import tn.mnlr.vripper.services.DataService;
import tn.mnlr.vripper.services.DownloadSpeedService;
import tn.mnlr.vripper.services.GlobalStateService;
import tn.mnlr.vripper.services.VGAuthService;
import tn.mnlr.vripper.services.domain.DownloadSpeed;
import tn.mnlr.vripper.services.domain.GlobalState;
@@ -33,16 +36,6 @@ public class DataController {
this.dataService = dataService;
}
@Getter
public static class LoggedUser {
private final String user;
LoggedUser(String user) {
this.user = user;
}
}
@SubscribeMapping("/user")
public LoggedUser user() {
return new LoggedUser(VGAuthService.getLoggedUser());
@@ -72,4 +65,14 @@ public class DataController {
public Collection<Queued> queued() {
return StreamSupport.stream(dataService.findAllQueued().spliterator(), false).collect(Collectors.toList());
}
@Getter
public static class LoggedUser {
private final String user;
LoggedUser(String user) {
this.user = user;
}
}
}
+6 -5
View File
@@ -1,6 +1,6 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule} from '@angular/router';
import { HomeComponent } from './home/home.component';
import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {HomeComponent} from './home/home.component';
const routes: Routes = [
@@ -10,10 +10,11 @@ const routes: Routes = [
@NgModule({
imports: [
RouterModule.forRoot(routes, { relativeLinkResolution: 'legacy' })
RouterModule.forRoot(routes, {relativeLinkResolution: 'legacy'})
],
exports: [
RouterModule
]
})
export class AppRoutingModule { }
export class AppRoutingModule {
}
+55 -15
View File
@@ -46,31 +46,71 @@
animation: sk-chase-dot-before 2.0s infinite ease-in-out both;
}
.sk-chase-dot:nth-child(1) { animation-delay: -1.1s; }
.sk-chase-dot:nth-child(2) { animation-delay: -1.0s; }
.sk-chase-dot:nth-child(3) { animation-delay: -0.9s; }
.sk-chase-dot:nth-child(4) { animation-delay: -0.8s; }
.sk-chase-dot:nth-child(5) { animation-delay: -0.7s; }
.sk-chase-dot:nth-child(6) { animation-delay: -0.6s; }
.sk-chase-dot:nth-child(1):before { animation-delay: -1.1s; }
.sk-chase-dot:nth-child(2):before { animation-delay: -1.0s; }
.sk-chase-dot:nth-child(3):before { animation-delay: -0.9s; }
.sk-chase-dot:nth-child(4):before { animation-delay: -0.8s; }
.sk-chase-dot:nth-child(5):before { animation-delay: -0.7s; }
.sk-chase-dot:nth-child(6):before { animation-delay: -0.6s; }
.sk-chase-dot:nth-child(1) {
animation-delay: -1.1s;
}
.sk-chase-dot:nth-child(2) {
animation-delay: -1.0s;
}
.sk-chase-dot:nth-child(3) {
animation-delay: -0.9s;
}
.sk-chase-dot:nth-child(4) {
animation-delay: -0.8s;
}
.sk-chase-dot:nth-child(5) {
animation-delay: -0.7s;
}
.sk-chase-dot:nth-child(6) {
animation-delay: -0.6s;
}
.sk-chase-dot:nth-child(1):before {
animation-delay: -1.1s;
}
.sk-chase-dot:nth-child(2):before {
animation-delay: -1.0s;
}
.sk-chase-dot:nth-child(3):before {
animation-delay: -0.9s;
}
.sk-chase-dot:nth-child(4):before {
animation-delay: -0.8s;
}
.sk-chase-dot:nth-child(5):before {
animation-delay: -0.7s;
}
.sk-chase-dot:nth-child(6):before {
animation-delay: -0.6s;
}
@keyframes sk-chase {
100% { transform: rotate(360deg); }
100% {
transform: rotate(360deg);
}
}
@keyframes sk-chase-dot {
80%, 100% { transform: rotate(360deg); }
80%, 100% {
transform: rotate(360deg);
}
}
@keyframes sk-chase-dot-before {
50% {
transform: scale(0.4);
} 100%, 0% {
}
100%, 0% {
transform: scale(1.0);
}
}
+4 -5
View File
@@ -14,6 +14,10 @@ import {RxStompState} from '@stomp/rx-stomp';
changeDetection: ChangeDetectionStrategy.OnPush
})
export class AppComponent implements OnDestroy, AfterViewInit {
electron: Subject<boolean>;
loaded: Subject<boolean> = new BehaviorSubject(false);
private subscriptions: Subscription[] = [];
constructor(
private dialog: MatDialog,
public ws: WsConnectionService,
@@ -26,11 +30,6 @@ export class AppComponent implements OnDestroy, AfterViewInit {
this.electron = new BehaviorSubject(electronService.isElectronApp);
}
private subscriptions: Subscription[] = [];
electron: Subject<boolean>;
loaded: Subject<boolean> = new BehaviorSubject(false);
ngAfterViewInit() {
this.appService.renderer = this.renderer;
this.subscriptions.push(
@@ -11,5 +11,6 @@ export interface DialogConfirmation {
templateUrl: 'confirmation-dialog.html'
})
export class ConfirmDialogComponent {
constructor(public dialogRef: MatDialogRef<ConfirmDialogComponent>, @Inject(MAT_DIALOG_DATA) public data: DialogConfirmation) {}
constructor(public dialogRef: MatDialogRef<ConfirmDialogComponent>, @Inject(MAT_DIALOG_DATA) public data: DialogConfirmation) {
}
}
@@ -1,4 +1,4 @@
export interface Credentials {
username: string;
password: string;
}
username: string;
password: string;
}
@@ -1,3 +1,3 @@
export interface DownloadPath {
path: string;
path: string;
}
@@ -1,3 +1,4 @@
export class DownloadSpeed {
constructor(public speed: string) {}
constructor(public speed: string) {
}
}
@@ -1,4 +1,4 @@
export class GlobalState {
constructor(public running: number, public remaining: number, public error: number) {
}
constructor(public running: number, public remaining: number, public error: number) {
}
}
@@ -7,5 +7,6 @@ export class MultiPostModel {
public removed: boolean,
public total: number,
public loading: boolean
) {}
) {
}
}
+2 -1
View File
@@ -5,5 +5,6 @@ export class Photo {
public progress: number,
public status: string,
public index: number
) {}
) {
}
}
@@ -1,4 +1,4 @@
export interface RemoveAllResponse {
removed: number;
postIds: string[];
}
removed: number;
postIds: string[];
}
@@ -1,3 +1,3 @@
export interface RemoveResponse {
postId: string;
}
postId: string;
}
@@ -8,5 +8,6 @@ export class MultiPostItem {
public url: string,
public previews: string[],
public hosts: string
) {}
) {
}
}
@@ -1,6 +1,6 @@
export class WSMessage {
constructor(public destination: string, public payload?: string) {
}
constructor(public destination: string, public payload?: string) {
}
}
@@ -10,7 +10,7 @@ export class PostAltRendererNative implements ICellRendererComp {
private contextMenuService: PostContextMenuService;
destroy(): void {
if(this.gui) {
if (this.gui) {
this.gui.removeEventListener('contextmenu', this.context.bind(this));
}
}
@@ -13,7 +13,7 @@ export class PostFilesRendererNative implements ICellRendererComp {
private contextMenuService: PostContextMenuService;
destroy(): void {
if(this.gui) {
if (this.gui) {
this.gui.removeEventListener('contextmenu', this.context.bind(this));
}
}
@@ -9,7 +9,7 @@ export class PostProgressRendererNative extends ProgressRendererNative {
private contextMenuService: PostContextMenuService;
destroy(): void {
if(this.gui) {
if (this.gui) {
this.gui.removeEventListener('contextmenu', this.context.bind(this));
}
}
@@ -9,7 +9,7 @@ export class PostStatusRendererNative extends StatusRendererNative {
private contextMenuService: PostContextMenuService;
destroy(): void {
if(this.gui) {
if (this.gui) {
this.gui.removeEventListener('contextmenu', this.context.bind(this));
}
}
@@ -6,30 +6,28 @@ import {AppPreviewComponent} from '../preview-tooltip/preview-tooltip.component'
import {ComponentRef, NgZone} from '@angular/core';
export class TitleRendererNative implements ICellRendererComp {
tooltipPortal = new ComponentPortal(AppPreviewComponent);
appPreview: string[];
private gui: HTMLElement;
private text: HTMLSpanElement;
private gridApi: GridApi;
private node: RowNode;
private contextMenuService: PostContextMenuService;
private icon: HTMLSpanElement;
private overlayPositionBuilder: OverlayPositionBuilder;
private overlay: Overlay;
private zone: NgZone;
private overlayRef: OverlayRef;
tooltipPortal = new ComponentPortal(AppPreviewComponent);
appPreview: string[];
destroy(): void {
if(this.gui) {
if (this.gui) {
this.gui.removeEventListener('contextmenu', this.context.bind(this));
}
if(this.overlayRef) {
if (this.overlayRef) {
this.overlayRef.dispose();
}
if(this.icon) {
if (this.icon) {
this.icon.removeEventListener('mouseenter', this.mouseenter.bind(this));
this.icon.removeEventListener('mouseleave', this.mouseout.bind(this));
}
@@ -86,7 +84,7 @@ export class TitleRendererNative implements ICellRendererComp {
overlayY: 'bottom'
}
]);
this.overlayRef = this.overlay.create({ positionStrategy, scrollStrategy: this.overlay.scrollStrategies.close() });
this.overlayRef = this.overlay.create({positionStrategy, scrollStrategy: this.overlay.scrollStrategies.close()});
this.icon.addEventListener('mouseenter', this.mouseenter.bind(this));
this.icon.addEventListener('mouseleave', this.mouseout.bind(this));
@@ -10,7 +10,7 @@ export class UrlRendererNative implements ICellRendererComp {
private url: string;
destroy(): void {
if(this.link) {
if (this.link) {
this.link.removeEventListener('click', this.goTo.bind(this));
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
<mat-tab-group animationDuration="0" dynamicHeight style="height: 100%; margin-bottom: 20px;">
<mat-tab label="Downloads">
<app-posts></app-posts>
<app-posts></app-posts>
</mat-tab>
<mat-tab>
<ng-template mat-tab-label>
+5 -4
View File
@@ -14,6 +14,8 @@ import {HttpClient} from '@angular/common/http';
changeDetection: ChangeDetectionStrategy.OnPush
})
export class HomeComponent implements OnInit, OnDestroy {
clipboardSub: Subscription;
constructor(
private clipboardService: ClipboardService,
public dialog: MatDialog,
@@ -22,15 +24,14 @@ export class HomeComponent implements OnInit, OnDestroy {
private _snackBar: MatSnackBar,
private ngZone: NgZone,
public linkCollectorService: LinkCollectorService
) {}
clipboardSub: Subscription;
) {
}
ngOnInit() {
this.clipboardSub = this.clipboardService.links.subscribe(e => {
this.ngZone.run(() => {
this.httpClient
.post<{ threadId: string; postId: string }>(this.serverService.baseUrl + '/post', { url: e })
.post<{ threadId: string; postId: string }>(this.serverService.baseUrl + '/post', {url: e})
.subscribe(
response => {
this._snackBar.open('Clipboard scan complete', null, {
+1 -1
View File
@@ -17,7 +17,7 @@ import {MatSlideToggleModule} from '@angular/material/slide-toggle';
import {MatSnackBar, MatSnackBarModule} from '@angular/material/snack-bar';
import {MatTabsModule} from '@angular/material/tabs';
import {MatToolbarModule} from '@angular/material/toolbar';
import {MatSelectModule} from "@angular/material/select";
import {MatSelectModule} from '@angular/material/select';
import {MatTooltipModule} from '@angular/material/tooltip';
@NgModule({
@@ -5,6 +5,8 @@ import {GridOptions, RowNode} from 'ag-grid-community';
import {NgZone} from '@angular/core';
export class MultiPostGridDataSource {
subscriptions: Subscription[] = [];
constructor(
private ws: WsConnectionService,
private gridOptions: GridOptions,
@@ -12,8 +14,6 @@ export class MultiPostGridDataSource {
) {
}
subscriptions: Subscription[] = [];
connect() {
this.subscriptions.push(this.ws.multiPosts$.subscribe((e: MultiPostModel[]) => {
this.zone.run(() => {
@@ -1,6 +1,6 @@
import {LinkCollectorService} from '../services/link-collector.service';
import {MultiPostGridDataSource} from './multi-post-grid-data.source';
import {ChangeDetectionStrategy, Component, NgZone, OnDestroy, OnInit} from '@angular/core';
import {ChangeDetectionStrategy, Component, NgZone, OnDestroy} from '@angular/core';
import {GridOptions} from 'ag-grid-community';
import {WsConnectionService} from '../services/ws-connection.service';
import {CollectorActionsRendererNative} from '../grid-custom-cells/collector-actions-renderer.native';
@@ -32,7 +32,7 @@ export class MultiPostGridComponent implements OnDestroy {
sort: 'asc',
cellRenderer: 'urlCellRenderer',
cellRendererParams: {
electronService: this.electronService
electronService: this.electronService
},
flex: 1
}, {
@@ -1,9 +1,9 @@
$cell-space: 8px;
.title-cell {
margin-right: $cell-space;
margin-right: $cell-space;
}
.progress-cell {
margin-left: $cell-space;
}
margin-left: $cell-space;
}
@@ -124,7 +124,8 @@ export class MultiPostItemsComponent {
})
)
.subscribe(
() => {},
() => {
},
error => {
this._snackBar.open(error?.error?.message || 'Unexpected error, check log file', null, {
duration: 5000
@@ -1,12 +1,12 @@
<div fxLayout="column" class="dialog-container" style="height: 100%;">
<div class="dialog-container" fxLayout="column" style="height: 100%;">
<div fxFlex="nogrow">
<h2 class="no-wrap" mat-dialog-title>{{ dialogData.title }}</h2>
<h2 class="no-wrap" mat-dialog-title>{{ dialogData.title }}</h2>
</div>
<mat-dialog-content fxFlex="grow">
<ag-grid-angular style="width: 100%; height: 100%;" class="ag-theme-alpine" [gridOptions]="gridOptions">
<ag-grid-angular [gridOptions]="gridOptions" class="ag-theme-alpine" style="width: 100%; height: 100%;">
</ag-grid-angular>
</mat-dialog-content>
<mat-dialog-actions fxFlex="nogrow" align="end">
<button mat-raised-button color="primary" (click)="onNoClick()">Close</button>
<mat-dialog-actions align="end" fxFlex="nogrow">
<button (click)="onNoClick()" color="primary" mat-raised-button>Close</button>
</mat-dialog-actions>
</div>
@@ -1,9 +1,9 @@
$cell-space: 8px;
.title-cell {
margin-right: $cell-space;
margin-right: $cell-space;
}
.progress-cell {
margin-left: $cell-space;
}
margin-left: $cell-space;
}
@@ -17,6 +17,9 @@ import {ElectronService} from 'ngx-electron';
})
export class PhotosComponent implements OnInit, OnDestroy {
gridOptions: GridOptions;
dataSource: PhotosDatasource;
constructor(
public dialogRef: MatDialogRef<PhotosComponent>,
@Inject(MAT_DIALOG_DATA) public dialogData: Post,
@@ -79,9 +82,6 @@ export class PhotosComponent implements OnInit, OnDestroy {
}
gridOptions: GridOptions;
dataSource: PhotosDatasource;
ngOnInit() {
}
@@ -4,6 +4,9 @@ import {WsConnectionService} from '../services/ws-connection.service';
import {NgZone} from '@angular/core';
export class PhotosDatasource {
subscriptions: Subscription[] = [];
postDetailsSub: Subscription;
constructor(
private ws: WsConnectionService,
private gridOptions: GridOptions,
@@ -12,9 +15,6 @@ export class PhotosDatasource {
) {
}
subscriptions: Subscription[] = [];
postDetailsSub: Subscription;
connect() {
this.postDetailsSub = this.ws.postDetails$(this.postId).subscribe(e => {
this.zone.run(() => {
@@ -1,8 +1,8 @@
<div fxLayout="column" class="dialog-container" style="height: 100%;">
<h2 mat-dialog-title fxFlex="nogrow">Alternative title</h2>
<div class="dialog-container" fxLayout="column" style="height: 100%;">
<h2 fxFlex="nogrow" mat-dialog-title>Alternative title</h2>
<mat-dialog-content fxFlex="grow">
<form fxLayout="column" fxLayoutAlign="space-around center" [formGroup]="form" autocomplete="off">
<form [formGroup]="form" autocomplete="off" fxLayout="column" fxLayoutAlign="space-around center">
<mat-form-field *ngIf="data.post?.metadata?.resolvedNames.length > 0">
<mat-label>Choose a title</mat-label>
<mat-select formControlName="altNameSelect">
@@ -16,9 +16,9 @@
</mat-form-field>
</form>
</mat-dialog-content>
<mat-dialog-actions fxFlex="nogrow" align="end">
<button mat-raised-button mat-dialog-close>Close</button>
<button [disabled]="form.invalid" color="primary" mat-dialog-close="yes" mat-raised-button (click)="rename()">
<mat-dialog-actions align="end" fxFlex="nogrow">
<button mat-dialog-close mat-raised-button>Close</button>
<button (click)="rename()" [disabled]="form.invalid" color="primary" mat-dialog-close="yes" mat-raised-button>
Rename
</button>
</mat-dialog-actions>
@@ -19,6 +19,11 @@ export interface AlternativeTitleDialog {
})
export class AlternativeTitleComponent implements OnInit {
form = new FormGroup({
altNameSelect: new FormControl(''),
altNameInput: new FormControl('', Validators.required)
});
constructor(
public dialogRef: MatDialogRef<AlternativeTitleComponent>,
@Inject(MAT_DIALOG_DATA) public data: AlternativeTitleDialog,
@@ -34,11 +39,6 @@ export class AlternativeTitleComponent implements OnInit {
}
}
form = new FormGroup({
altNameSelect: new FormControl(''),
altNameInput: new FormControl('', Validators.required)
});
rename() {
this.httpClient.post<RenamePostModel>(this.serverService.baseUrl + '/post/rename', [{
postId: this.data.post.postId,
@@ -58,7 +58,8 @@ export class PostContextMenuComponent {
restart() {
this.contextMenuService.closePostContextMenu();
this.httpClient.post(this.serverService.baseUrl + '/post/restart', [this.post.postId]).subscribe(
() => {},
() => {
},
error => {
this._snackBar.open(error?.error?.message || 'Unexpected error, check log file', null, {
duration: 5000
@@ -140,7 +141,8 @@ export class PostContextMenuComponent {
stop() {
this.contextMenuService.closePostContextMenu();
this.httpClient.post(this.serverService.baseUrl + '/post/stop', [this.post.postId]).subscribe(
() => {},
() => {
},
error => {
this._snackBar.open(error?.error?.message || 'Unexpected error, check log file', null, {
duration: 5000
@@ -1,4 +1,4 @@
<div style="width: 100%; height: 100%">
<ag-grid-angular style="width: 100%; height: 100%" class="ag-theme-alpine" [gridOptions]="gridOptions">
<ag-grid-angular [gridOptions]="gridOptions" class="ag-theme-alpine" style="width: 100%; height: 100%">
</ag-grid-angular>
</div>
+4 -4
View File
@@ -19,6 +19,10 @@ import {PostsService} from '../services/posts.service';
changeDetection: ChangeDetectionStrategy.OnPush
})
export class PostsComponent implements OnDestroy {
dialogOpen: Subject<boolean> = new Subject();
gridOptions: GridOptions;
dataSource: PostsDataSource;
constructor(
private wsConnection: WsConnectionService,
private zone: NgZone,
@@ -110,10 +114,6 @@ export class PostsComponent implements OnDestroy {
};
}
dialogOpen: Subject<boolean> = new Subject();
gridOptions: GridOptions;
dataSource: PostsDataSource;
ngOnDestroy(): void {
this.dataSource.disconnect();
}
+2 -2
View File
@@ -5,11 +5,11 @@ import {GridOptions, RowNode} from 'ag-grid-community';
import {NgZone} from '@angular/core';
export class PostsDataSource {
subscriptions: Subscription[] = [];
constructor(private ws: WsConnectionService, private gridOptions: GridOptions, private zone: NgZone) {
}
subscriptions: Subscription[] = [];
connect() {
this.subscriptions.push(this.ws.posts$.subscribe((e: Post[]) => {
this.zone.run(() => {
@@ -5,17 +5,17 @@ import {ComponentPortal} from '@angular/cdk/portal';
@Directive({selector: '[appPreview]'})
export class AppPreviewDirective implements OnInit, OnDestroy {
private overlayRef: OverlayRef;
tooltipPortal = new ComponentPortal(AppPreviewComponent);
@Input() appPreview: string[];
private overlayRef: OverlayRef;
constructor(
private overlayPositionBuilder: OverlayPositionBuilder,
private elementRef: ElementRef,
private overlay: Overlay,
private ngZone: NgZone
) {}
) {
}
ngOnInit() {
const positionStrategy = this.overlayPositionBuilder
@@ -36,7 +36,7 @@ export class AppPreviewDirective implements OnInit, OnDestroy {
overlayY: 'bottom'
}
]);
this.overlayRef = this.overlay.create({ positionStrategy, scrollStrategy: this.overlay.scrollStrategies.close() });
this.overlayRef = this.overlay.create({positionStrategy, scrollStrategy: this.overlay.scrollStrategies.close()});
}
ngOnDestroy() {
+1 -1
View File
@@ -1,3 +1,3 @@
:host ::ng-deep .ag-cell {
background-color: snow !important;
background-color: snow !important;
}
+14 -11
View File
@@ -13,6 +13,9 @@ import {BehaviorSubject, Subject} from 'rxjs';
changeDetection: ChangeDetectionStrategy.OnPush
})
export class ScanComponent implements OnInit, AfterViewInit {
input: string;
loading: Subject<boolean> = new BehaviorSubject(false);
constructor(
private ngZone: NgZone,
private httpClient: HttpClient,
@@ -20,10 +23,8 @@ export class ScanComponent implements OnInit, AfterViewInit {
private _snackBar: MatSnackBar,
public dialogRef: MatDialogRef<ScanComponent>,
@Inject(MAT_DIALOG_DATA) public data: DialogData
) {}
input: string;
loading: Subject<boolean> = new BehaviorSubject(false);
) {
}
submit() {
this.ngZone.run(() => {
@@ -42,22 +43,24 @@ export class ScanComponent implements OnInit, AfterViewInit {
processUrl(url: string) {
this.loading.next(true);
this.httpClient
.post<{ threadId: string; postId: string }>(this.serverService.baseUrl + '/post', { url: url })
.post<{ threadId: string; postId: string }>(this.serverService.baseUrl + '/post', {url: url})
.pipe(
finalize(() => {
this.close();
this.loading.next(false);
})
)
.subscribe(response => {},
error => {
this._snackBar.open(error?.error?.message || 'Unexpected error, check log file', null, {
duration: 5000
.subscribe(response => {
},
error => {
this._snackBar.open(error?.error?.message || 'Unexpected error, check log file', null, {
duration: 5000
});
});
});
}
ngOnInit() {}
ngOnInit() {
}
ngAfterViewInit(): void {
this.ngZone.run(() => {
+10 -8
View File
@@ -14,6 +14,8 @@ import {Title} from '@angular/platform-browser';
providedIn: 'root'
})
export class AppService {
isExtraSmall: Observable<BreakpointState> = this.breakpointObserver.observe(Breakpoints.XSmall);
constructor(
private httpClient: HttpClient,
private serverService: ServerService,
@@ -25,23 +27,23 @@ export class AppService {
}
private _darkTheme = false;
private _settings: Settings;
private _renderer: Renderer2;
get settings(): Settings {
return { ...this._settings };
}
get darkTheme(): boolean {
return this._darkTheme;
}
private _settings: Settings;
get settings(): Settings {
return {...this._settings};
}
private _renderer: Renderer2;
set renderer(renderer: Renderer2) {
this._renderer = renderer;
}
isExtraSmall: Observable<BreakpointState> = this.breakpointObserver.observe(Breakpoints.XSmall);
updateTheme(darkTheme: boolean) {
this._darkTheme = darkTheme;
if (this._darkTheme) {
@@ -18,7 +18,12 @@ export class ClipboardService {
private electronService: ElectronService,
private serverService: ServerService,
private httpClient: HttpClient
) {}
) {
}
get links(): Observable<string> {
return this.links$.asObservable();
}
init(settings?: Settings) {
if (!settings) {
@@ -64,8 +69,4 @@ export class ClipboardService {
private textHasDiff(a, b) {
return a && b !== a;
}
get links(): Observable<string> {
return this.links$.asObservable();
}
}
@@ -10,9 +10,9 @@ export class LinkCollectorService {
get count(): Observable<number> {
return this._count$.asObservable();
}
}
setCount(count: number) {
this._count$.next(count);
}
setCount(count: number) {
this._count$.next(count);
}
}
@@ -4,7 +4,7 @@ import {MultiPostModel} from '../domain/multi-post.model';
import {MatDialog} from '@angular/material/dialog';
import {HttpClient} from '@angular/common/http';
import {ServerService} from './server-service';
import { GridApi } from 'ag-grid-community';
import {GridApi} from 'ag-grid-community';
interface ThreadId {
threadId: string;
@@ -20,6 +20,15 @@ export class MultiPostService {
private serverService: ServerService) {
}
private static removeFromGrid(api: GridApi, data: ThreadId) {
const removeTx = [];
const nodeToDelete = api.getRowNode(data.threadId);
if (nodeToDelete != null) {
removeTx.push(nodeToDelete.data);
}
api.applyTransaction({remove: removeTx});
}
selectItems(multiPostModel: MultiPostModel) {
this.dialog.open(MultiPostItemsComponent, {
width: '90%',
@@ -38,13 +47,4 @@ export class MultiPostService {
);
}
private static removeFromGrid(api: GridApi, data: ThreadId) {
const removeTx = [];
const nodeToDelete = api.getRowNode(data.threadId);
if (nodeToDelete != null) {
removeTx.push(nodeToDelete.data);
}
api.applyTransaction({remove: removeTx});
}
}
@@ -1,23 +1,23 @@
import {ComponentRef, Injectable} from '@angular/core';
import {ComponentPortal} from "@angular/cdk/portal";
import {PostContextMenuComponent} from "../posts/context-menu/post-context-menu.component";
import {Overlay, OverlayPositionBuilder, OverlayRef} from "@angular/cdk/overlay";
import {fromEvent, Subscription} from "rxjs";
import {Post} from "../domain/post-state.model";
import {filter, take} from "rxjs/operators";
import {ComponentPortal} from '@angular/cdk/portal';
import {PostContextMenuComponent} from '../posts/context-menu/post-context-menu.component';
import {Overlay, OverlayPositionBuilder, OverlayRef} from '@angular/cdk/overlay';
import {fromEvent, Subscription} from 'rxjs';
import {Post} from '../domain/post-state.model';
import {filter, take} from 'rxjs/operators';
@Injectable({
providedIn: 'root'
})
export class PostContextMenuService {
postContextMenuPortal = new ComponentPortal(PostContextMenuComponent);
postContext: Subscription;
private postContextMenuOverlayRef: OverlayRef;
constructor(private overlayPositionBuilder: OverlayPositionBuilder, private overlay: Overlay) {
}
postContextMenuPortal = new ComponentPortal(PostContextMenuComponent);
private postContextMenuOverlayRef: OverlayRef;
postContext: Subscription;
openPostContextMenu(mouseEvent: MouseEvent, post: Post) {
mouseEvent.preventDefault();
this.closePostContextMenu();
@@ -11,9 +11,9 @@ export class SelectionService {
get selected$(): Observable<RowNode[]> {
return this._selected$.asObservable();
}
}
public onSelectionChanged(selected: RowNode[]) {
this._selected$.next(selected);
}
public onSelectionChanged(selected: RowNode[]) {
this._selected$.next(selected);
}
}
+11 -9
View File
@@ -5,24 +5,26 @@ import {Injectable} from '@angular/core';
})
export class ServerService {
private _baseUrl: string;
private _wsBaseUrl: string;
constructor() {}
set baseUrl(baseUrl: string) {
this._baseUrl = baseUrl;
constructor() {
}
private _baseUrl: string;
get baseUrl(): string {
return this._baseUrl;
}
set wsBaseUrl(wsBaseUrl: string) {
this._wsBaseUrl = wsBaseUrl;
set baseUrl(baseUrl: string) {
this._baseUrl = baseUrl;
}
private _wsBaseUrl: string;
get wsBaseUrl(): string {
return this._wsBaseUrl;
}
set wsBaseUrl(wsBaseUrl: string) {
this._wsBaseUrl = wsBaseUrl;
}
}
@@ -9,7 +9,7 @@ import {Post} from '../domain/post-state.model';
import {LoggedUser} from '../domain/logged-user.model';
import {DownloadSpeed} from '../domain/download-speed.model';
import {GlobalState} from '../domain/global-state.model';
import {map, share, throttleTime} from 'rxjs/operators';
import {map, share} from 'rxjs/operators';
import {RxStomp, RxStompConfig, RxStompState} from '@stomp/rx-stomp';
import {ElectronService} from 'ngx-electron';
@@ -35,6 +35,38 @@ export class WsConnectionService {
this.init();
}
public get state(): Observable<RxStompState> {
return this.connectionState$.asObservable();
}
get globalState$(): Observable<GlobalState> {
return this.globalState;
}
get speed$(): Observable<DownloadSpeed> {
return this.speed;
}
get user$(): Observable<LoggedUser> {
return this.user;
}
get posts$(): Observable<Post[]> {
return this.posts;
}
get postsRemove$(): Observable<string[]> {
return this.postsRemove;
}
get queuedRemove$(): Observable<string[]> {
return this.queuedRemove;
}
get multiPosts$(): Observable<MultiPostModel[]> {
return this.multiPostModels;
}
init() {
if (this.electronService.isElectronApp) {
const portRequest = setInterval(() => {
@@ -74,10 +106,6 @@ export class WsConnectionService {
this.rxStomp.activate();
}
public get state(): Observable<RxStompState> {
return this.connectionState$.asObservable();
}
disconnect() {
this.rxStomp.deactivate();
}
@@ -162,30 +190,6 @@ export class WsConnectionService {
);
}
get globalState$(): Observable<GlobalState> {
return this.globalState;
}
get speed$(): Observable<DownloadSpeed> {
return this.speed;
}
get user$(): Observable<LoggedUser> {
return this.user;
}
get posts$(): Observable<Post[]> {
return this.posts;
}
get postsRemove$(): Observable<string[]> {
return this.postsRemove;
}
get queuedRemove$(): Observable<string[]> {
return this.queuedRemove;
}
postDetails$(postId: string): Observable<Photo[]> {
if (this.postDetails != null && this.postIdDetails === postId) {
return this.postDetails;
@@ -212,10 +216,6 @@ export class WsConnectionService {
return this.postDetails;
}
get multiPosts$(): Observable<MultiPostModel[]> {
return this.multiPostModels;
}
send(wsMessage: WSMessage) {
this.rxStomp.publish({destination: wsMessage.destination, body: wsMessage.payload});
}
@@ -1,4 +1,4 @@
<div fxLayout="column" class="dialog-container" style="height: 100%;">
<div class="dialog-container" fxLayout="column" style="height: 100%;">
<div fxFlex="nogrow" fxLayout="row" fxLayoutAlign="space-between center">
<h2 class="no-wrap" mat-dialog-title>Preferences</h2>
<mat-slide-toggle (change)="updateTheme()" [(ngModel)]="darkTheme"
@@ -7,20 +7,20 @@
</div>
<mat-dialog-content fxFlex="grow">
<div class="container">
<mat-tab-group dynamicHeight="true" animationDuration="0ms">
<mat-tab-group animationDuration="0ms" dynamicHeight="true">
<mat-tab label="Download">
<form fxLayout="column" [formGroup]="downloadSettingsForm" autocomplete="off">
<div fxLayout="row" fxLayoutGap="20px" fxLayoutAlign="center center">
<form [formGroup]="downloadSettingsForm" autocomplete="off" fxLayout="column">
<div fxLayout="row" fxLayoutAlign="center center" fxLayoutGap="20px">
<mat-form-field fxFlex="grow">
<input
formControlName="downloadPath"
matInput
placeholder="Download Path"
name="downloadPath"
placeholder="Download Path"
required
/>
</mat-form-field>
<button fxFlex="100px" (click)="browse()" mat-raised-button *ngIf="electronService.isElectronApp">
<button (click)="browse()" *ngIf="electronService.isElectronApp" fxFlex="100px" mat-raised-button>
Browse
</button>
</div>
@@ -29,14 +29,17 @@
<mat-checkbox color="primary" formControlName="autoStart" name="autoStart"
>Auto start downloads
</mat-checkbox>
<mat-icon matTooltip="Gallery download will start as soon as it is added to the download queue, download will not automatically start otherwise" svgIcon="help-circle-outline"></mat-icon>
<mat-icon
matTooltip="Gallery download will start as soon as it is added to the download queue, download will not automatically start otherwise"
svgIcon="help-circle-outline"></mat-icon>
</section>
<section class="input">
<mat-checkbox color="primary" formControlName="subLocation" name="subLocation"
>Save posts in sub folders
</mat-checkbox>
<mat-icon matTooltip="Gallery will be downloaded in sub folders based on the forum section they belong to" svgIcon="help-circle-outline"></mat-icon>
<mat-icon matTooltip="Gallery will be downloaded in sub folders based on the forum section they belong to"
svgIcon="help-circle-outline"></mat-icon>
</section>
<section class="input">
@@ -46,39 +49,45 @@
name="threadSubLocation"
>Create a subfolder per thread
</mat-checkbox>
<mat-icon matTooltip="Gallery will be downloaded inside a sub folder based on the thread they belong to" svgIcon="help-circle-outline"></mat-icon>
<mat-icon matTooltip="Gallery will be downloaded inside a sub folder based on the thread they belong to"
svgIcon="help-circle-outline"></mat-icon>
</section>
<section class="input">
<mat-checkbox color="primary" formControlName="forceOrder" name="forceOrder"
>Order images
</mat-checkbox>
<mat-icon matTooltip="Downloaded images will be ordered by adding a number at the start of the filename e.g 001_,002_..." svgIcon="help-circle-outline"></mat-icon>
<mat-icon
matTooltip="Downloaded images will be ordered by adding a number at the start of the filename e.g 001_,002_..."
svgIcon="help-circle-outline"></mat-icon>
</section>
<section class="input">
<mat-checkbox color="primary" formControlName="appendPostId" name="appendPostId"
>Append post id to download folder
</mat-checkbox>
<mat-icon matTooltip="Downloaded gallery name will include the post id at the end" svgIcon="help-circle-outline"></mat-icon>
<mat-icon matTooltip="Downloaded gallery name will include the post id at the end"
svgIcon="help-circle-outline"></mat-icon>
</section>
<section class="input">
<mat-checkbox color="primary" formControlName="clearCompleted" name="clearCompleted"
>Clear Finished
</mat-checkbox>
<mat-icon matTooltip="Galleries will be automatically removed from the download queue once successfully completed" svgIcon="help-circle-outline"></mat-icon>
<mat-icon
matTooltip="Galleries will be automatically removed from the download queue once successfully completed"
svgIcon="help-circle-outline"></mat-icon>
</section>
</form>
</mat-tab>
<mat-tab label="Connection">
<form fxLayout="column" [formGroup]="connectionSettingsForm" autocomplete="off">
<form [formGroup]="connectionSettingsForm" autocomplete="off" fxLayout="column">
<mat-form-field fxFlex="grow">
<input
formControlName="maxTotalThreads"
matInput
min="0"
max="12"
min="0"
name="maxTotalThreads"
placeholder="Global concurrent downloads"
required
@@ -101,8 +110,8 @@
<input
formControlName="connectionTimeout"
matInput
min="1"
max="300"
min="1"
name="connectionTimeout"
placeholder="Connection timeout"
required
@@ -113,8 +122,8 @@
<input
formControlName="maxAttempts"
matInput
min="1"
max="10"
min="1"
name="maxAttempts"
placeholder="Maximum attempts"
required
@@ -124,12 +133,12 @@
</form>
</mat-tab>
<mat-tab label="ViperGirls">
<form fxLayout="column" [formGroup]="viperGirlsSettingsForm" autocomplete="off">
<form [formGroup]="viperGirlsSettingsForm" autocomplete="off" fxLayout="column">
<mat-slide-toggle color="primary" formControlName="vLogin" name="vLogin">
Enable ViperGirls Authentication
</mat-slide-toggle>
<section class="vg-inputs" fxLayout="column" *ngIf="viperGirlsSettingsForm.get('vLogin').value">
<section *ngIf="viperGirlsSettingsForm.get('vLogin').value" class="vg-inputs" fxLayout="column">
<mat-form-field>
<input formControlName="vUsername" matInput name="vUsername" placeholder="ViperGirls Username"/>
</mat-form-field>
@@ -137,26 +146,30 @@
<mat-form-field>
<input
formControlName="vPassword"
type="password"
matInput
placeholder="ViperGirls Password"
name="vPassword"
placeholder="ViperGirls Password"
type="password"
/>
</mat-form-field>
<section class="input">
<mat-checkbox color="primary" formControlName="vThanks" name="vThanks">Leave thanks</mat-checkbox>
<mat-icon matTooltip="Automatically leave a thanks to the poster" svgIcon="help-circle-outline"></mat-icon>
<mat-icon matTooltip="Automatically leave a thanks to the poster"
svgIcon="help-circle-outline"></mat-icon>
</section>
<section class="input">
<mat-checkbox color="primary" formControlName="leaveThanksOnStart" name="leaveThanksOnStart">Leave thanks when download starts
<mat-checkbox color="primary" formControlName="leaveThanksOnStart" name="leaveThanksOnStart">Leave
thanks when download starts
</mat-checkbox>
<mat-icon matTooltip="Leave a thanks only when the download starts, if unchecked, leave a thanks once a gallery is added to the download queue" svgIcon="help-circle-outline"></mat-icon>
<mat-icon
matTooltip="Leave a thanks only when the download starts, if unchecked, leave a thanks once a gallery is added to the download queue"
svgIcon="help-circle-outline"></mat-icon>
</section>
</section>
</form>
</mat-tab>
<mat-tab label="Desktop Integration" *ngIf="electronService.isElectronApp">
<mat-tab *ngIf="electronService.isElectronApp" label="Desktop Integration">
<form [formGroup]="desktopSettingsForm" autocomplete="off">
<section class="input">
<mat-checkbox *ngIf="electronService.isElectronApp" color="primary" formControlName="desktopClipboard"
@@ -170,13 +183,10 @@
</mat-tab-group>
</div>
</mat-dialog-content>
<mat-dialog-actions fxFlex="nogrow" align="end">
<button mat-raised-button mat-dialog-close>Close</button>
<mat-dialog-actions align="end" fxFlex="nogrow">
<button mat-dialog-close mat-raised-button>Close</button>
<button
mat-raised-button
(click)="onSubmit()"
color="primary"
type="submit"
[disabled]="
(desktopSettingsForm.pristine && connectionSettingsForm.pristine && downloadSettingsForm.pristine && viperGirlsSettingsForm.pristine) ||
viperGirlsSettingsForm.invalid ||
@@ -185,6 +195,9 @@
desktopSettingsForm.invalid ||
loading
"
color="primary"
mat-raised-button
type="submit"
>
Apply
</button>
@@ -8,6 +8,7 @@ form {
.input {
display: flex;
> :first-child {
margin-right: 5px;
}
@@ -1,15 +1,15 @@
.status-bar {
position: fixed;
width: 100%;
bottom: 0;
left: 0;
white-space: nowrap;
padding: 2px 0;
z-index: 9999;
position: fixed;
width: 100%;
bottom: 0;
left: 0;
white-space: nowrap;
padding: 2px 0;
z-index: 9999;
}
span {
margin: 0 8px;
user-select: none;
font-size: small;
margin: 0 8px;
user-select: none;
font-size: small;
}
@@ -12,14 +12,14 @@ import {GlobalState} from '../domain/global-state.model';
changeDetection: ChangeDetectionStrategy.OnPush
})
export class StatusBarComponent implements OnInit, OnDestroy {
constructor(private ws: WsConnectionService, private ngZone: NgZone, private selectionService: SelectionService) {
}
downloadSpeed$: Subject<DownloadSpeed> = new BehaviorSubject(new DownloadSpeed('0 B'));
globalState$: Subject<GlobalState> = new BehaviorSubject(new GlobalState(0, 0, 0));
selected$: Subject<number> = new BehaviorSubject(0);
subscriptions: Subscription[] = [];
constructor(private ws: WsConnectionService, private ngZone: NgZone, private selectionService: SelectionService) {
}
ngOnInit() {
this.subscriptions.push(this.ws.speed$.subscribe(e => this.ngZone.run(() => this.downloadSpeed$.next(e))));
this.subscriptions.push(this.ws.globalState$.subscribe(e => this.ngZone.run(() => this.globalState$.next(e))));
@@ -1,7 +1,7 @@
<mat-toolbar class="mat-elevation-z8">
<mat-toolbar-row fxLayout="row" fxLayoutAlign="space-between center" fxLayoutGap="10px">
<div fxLayout="row" fxLayoutAlign="center center" fxLayoutGap="5px" id="left-controls">
<button matTooltip="Add links" (click)="scan()" class="add-button" color="primary" mat-icon-button>
<button (click)="scan()" class="add-button" color="primary" mat-icon-button matTooltip="Add links">
<mat-icon>add</mat-icon>
</button>
<button (click)="remove()" [disabled]="disableSelection$ | async" mat-icon-button
@@ -31,7 +31,7 @@
<mat-icon>stop</mat-icon>
</button>
</div>
<div fxFlex="grow" id="global-search" fxHide.lt-md>
<div fxFlex="grow" fxHide.lt-md id="global-search">
<form autocomplete="off">
<mat-form-field class="search-field">
<input (ngModelChange)="search($event)" matInput name="search" ngModel placeholder="Search"/>
@@ -40,10 +40,10 @@
</form>
</div>
<div fxLayout="row" fxLayoutAlign="center center" fxLayoutGap="5px" id="right-controls">
<p class="logged-user" fxHide.lt-sm *ngIf="user$ | async as user">
<p *ngIf="user$ | async as user" class="logged-user" fxHide.lt-sm>
<span *ngIf="user.user.length > 0">Logged in as: {{ user.user }}</span>
</p>
<button (click)="openSettings()" matTooltip="Preferences" mat-icon-button>
<button (click)="openSettings()" mat-icon-button matTooltip="Preferences">
<mat-icon>settings</mat-icon>
</button>
</div>
+16 -11
View File
@@ -25,6 +25,12 @@ import {PostsService} from '../services/posts.service';
changeDetection: ChangeDetectionStrategy.OnPush
})
export class ToolbarComponent implements OnInit, OnDestroy {
user$: Subject<LoggedUser> = new BehaviorSubject({user: ''});
disableSelection$: Subject<boolean> = new BehaviorSubject(true);
isExtraSmall: Observable<BreakpointState> = this.breakpointObserver.observe(Breakpoints.XSmall);
selected: RowNode[] = [];
subscriptions: Subscription[] = [];
constructor(
private serverService: ServerService,
private appService: AppService,
@@ -39,12 +45,6 @@ export class ToolbarComponent implements OnInit, OnDestroy {
) {
}
user$: Subject<LoggedUser> = new BehaviorSubject({user: ''});
disableSelection$: Subject<boolean> = new BehaviorSubject(true);
isExtraSmall: Observable<BreakpointState> = this.breakpointObserver.observe(Breakpoints.XSmall);
selected: RowNode[] = [];
subscriptions: Subscription[] = [];
openSettings(): void {
const dialogRef = this.dialog.open(SettingsComponent, {
width: '70%',
@@ -106,7 +106,8 @@ export class ToolbarComponent implements OnInit, OnDestroy {
const toStart = [];
this.selected.forEach(e => toStart.push(e.data.postId));
this.httpClient.post(this.serverService.baseUrl + '/post/restart', toStart).subscribe(
() => {},
() => {
},
error => {
this._snackBar.open(error?.error?.message || 'Unexpected error, check log file', null, {
duration: 5000
@@ -119,7 +120,8 @@ export class ToolbarComponent implements OnInit, OnDestroy {
const toStop = [];
this.selected.forEach(e => toStop.push(e.data.postId));
this.httpClient.post(this.serverService.baseUrl + '/post/stop', toStop).subscribe(
() => {},
() => {
},
error => {
this._snackBar.open(error?.error?.message || 'Unexpected error, check log file', null, {
duration: 5000
@@ -132,7 +134,8 @@ export class ToolbarComponent implements OnInit, OnDestroy {
const toRename = [];
this.selected.forEach(e => toRename.push(e.data.postId));
this.httpClient.post<PostId[]>(this.serverService.baseUrl + '/post/rename/first', toRename).subscribe(
() => {},
() => {
},
error => {
this._snackBar.open(error?.error?.message || 'Unexpected error, check log file', null, {
duration: 5000
@@ -144,7 +147,8 @@ export class ToolbarComponent implements OnInit, OnDestroy {
clear() {
this.ngZone.run(() => {
this.httpClient.post<RemoveAllResponse>(this.serverService.baseUrl + '/post/clear/all', {}).subscribe(
data => {},
data => {
},
error => {
this._snackBar.open(error?.error?.message || 'Unexpected error, check log file', null, {
duration: 5000
@@ -157,7 +161,8 @@ export class ToolbarComponent implements OnInit, OnDestroy {
stopAll() {
this.ngZone.run(() => {
this.httpClient.post(this.serverService.baseUrl + '/post/stop/all', {}).subscribe(
() => {},
() => {
},
error => {
this._snackBar.open(error?.error?.message || 'Unexpected error, check log file', null, {
duration: 5000
+31 -31
View File
@@ -2,43 +2,43 @@
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns="http://www.w3.org/2000/svg"
width="1024"
height="1024"
viewBox="0 0 270.93333 270.93334"
version="1.1"
id="svg8"
inkscape:export-filename="C:\Users\Marwen\IdeaProjects\vripper-project\vripper-electron\build\icons\1024x1024.png"
inkscape:export-xdpi="96.00956"
inkscape:export-ydpi="96.00956"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
sodipodi:docname="v.svg">
sodipodi:docname="v.svg"
version="1.1"
viewBox="0 0 270.93333 270.93334"
width="1024"
xmlns="http://www.w3.org/2000/svg"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd">
<defs
id="defs2"/>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.35"
id="base"
inkscape:current-layer="layer1"
inkscape:cx="-200.49762"
inkscape:cy="299.73785"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
units="px"
inkscape:window-width="1920"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:window-height="1017"
inkscape:window-maximized="1"
inkscape:window-width="1920"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"/>
inkscape:zoom="0.35"
pagecolor="#ffffff"
showgrid="false"
units="px"/>
<metadata
id="metadata5">
<rdf:RDF>
@@ -52,29 +52,29 @@
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
inkscape:groupmode="layer"
inkscape:label="Layer 1"
transform="translate(0,-26.06665)">
<circle
id="path3715"
cx="135.46666"
cy="161.53331"
style="fill:#aa0000;fill-opacity:1;stroke-width:0.35248032"
r="135.45317"/>
id="path3715"
r="135.45317"
style="fill:#aa0000;fill-opacity:1;stroke-width:0.35248032"/>
<flowRoot
xml:space="preserve"
id="flowRoot4522"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:40.00005341px;line-height:1.25;font-family:'Fira Code';-inkscape-font-specification:'Fira Code, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none"
transform="matrix(5.7825687,0,0,5.7825687,-859.25089,-2020.8769)"><flowRegion
transform="matrix(5.7825687,0,0,5.7825687,-859.25089,-2020.8769)"
xml:space="preserve"><flowRegion
id="flowRegion4524"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:40.00005341px;font-family:'Fira Code';-inkscape-font-specification:'Fira Code, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1"><rect
id="rect4526"
width="514.28571"
height="380"
id="rect4526"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:40.00005341px;font-family:'Fira Code';-inkscape-font-specification:'Fira Code, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1"
width="514.28571"
x="160"
y="356.80539"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:40.00005341px;font-family:'Fira Code';-inkscape-font-specification:'Fira Code, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1" /></flowRegion>
y="356.80539" /></flowRegion>
<flowPara
id="flowPara4534">V</flowPara></flowRoot>
</g>

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

+1 -1
View File
@@ -32,7 +32,7 @@
margin-right: 5px;
}
.ag-header-row,.ag-sort-order {
.ag-header-row, .ag-sort-order {
color: mat-color($foreground, text);
}
+1 -1
View File
@@ -77,7 +77,7 @@
/***************************************************************************************************
* Zone JS is required by default for Angular itself.
*/
import 'zone.js/dist/zone'; // Included with Angular CLI.
import 'zone.js/dist/zone'; // Included with Angular CLI.
/***************************************************************************************************
+7 -5
View File
@@ -5,11 +5,11 @@
}
@font-face {
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: url(assets/material-icons.woff2) format('woff2');
}
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: url(assets/material-icons.woff2) format('woff2');
}
.material-icons {
font-family: 'Material Icons', sans-serif;
@@ -94,6 +94,7 @@ body a {
&:hover {
text-decoration: underline;
}
color: rgba(0, 0, 0, 0.87);
text-decoration: none;
}
@@ -105,6 +106,7 @@ body .ag-cell {
body .mat-list-base .mat-list-item {
height: 35px;
font-size: 14px;
.mat-icon {
font-size: 20px;
}
+2 -5
View File
@@ -1,11 +1,8 @@
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
import 'zone.js/dist/zone-testing';
import { getTestBed } from '@angular/core/testing';
import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';
import {getTestBed} from '@angular/core/testing';
import {BrowserDynamicTestingModule, platformBrowserDynamicTesting} from '@angular/platform-browser-dynamic/testing';
declare const require: any;
+15 -15
View File
@@ -1,17 +1,17 @@
{
"extends": "../tslint.json",
"rules": {
"directive-selector": [
true,
"attribute",
"app",
"camelCase"
],
"component-selector": [
true,
"element",
"app",
"kebab-case"
]
}
"extends": "../tslint.json",
"rules": {
"directive-selector": [
true,
"attribute",
"app",
"camelCase"
],
"component-selector": [
true,
"element",
"app",
"kebab-case"
]
}
}