Commit 58a77ca9 authored by 神楽坂玲奈's avatar 神楽坂玲奈

fix

parent 63577dd2
...@@ -39,5 +39,15 @@ progress { ...@@ -39,5 +39,15 @@ progress {
#network { #network {
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
width: 240px; width: 300px;
}
#network .input-group-btn>.btn:not(:last-child):not(.dropdown-toggle){
border-bottom-right-radius: 0;
border-top-right-radius: 0;
}
#network .input-group-btn>.dropdown-toggle{
border-bottom-left-radius: 0;
border-top-left-radius: 0;
} }
\ No newline at end of file
...@@ -24,10 +24,13 @@ ...@@ -24,10 +24,13 @@
<div id="network" *ngIf="appsService.currentApp.network && appsService.currentApp.network.protocol == 'maotama'"> <div id="network" *ngIf="appsService.currentApp.network && appsService.currentApp.network.protocol == 'maotama'">
<div class="input-group"> <div class="input-group">
<input *ngIf="appsService.connections.get(appsService.currentApp)" [value]="appsService.connections.get(appsService.currentApp)" readonly type="text" class="form-control" aria-label="Text input with dropdown button"> <input *ngIf="appsService.connections.get(appsService.currentApp)" [value]="appsService.connections.get(appsService.currentApp)" readonly type="text" class="form-control" aria-label="Text input with dropdown button">
<div class="input-group-btn btn-group"> <div class="input-group-btn">
<button *ngIf="!appsService.connections.get(appsService.currentApp)" (click)="appsService.network(appsService.currentApp, appsService.currentApp.network.servers[0])" type="button" class="btn btn-secondary" aria-haspopup="true" aria-expanded="false"> <button *ngIf="!appsService.connections.get(appsService.currentApp)" (click)="appsService.network(appsService.currentApp, appsService.currentApp.network.servers[0])" type="button" class="btn btn-secondary">
联机 联机
</button> </button>
<button *ngIf="appsService.connections.get(appsService.currentApp)" (click)="copy(appsService.connections.get(appsService.currentApp))" type="button" class="btn btn-secondary">
复制
</button>
<button type="button" class="btn btn-secondary dropdown-toggle dropdown-toggle-split" <button type="button" class="btn btn-secondary dropdown-toggle dropdown-toggle-split"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style="height: 38px;"> data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style="height: 38px;">
<span class="sr-only">Toggle Dropdown</span> <span class="sr-only">Toggle Dropdown</span>
......
...@@ -10,11 +10,11 @@ declare var $; ...@@ -10,11 +10,11 @@ declare var $;
const readline = System._nodeRequire('readline'); const readline = System._nodeRequire('readline');
const os = System._nodeRequire('os'); const os = System._nodeRequire('os');
const electron = System._nodeRequire('electron'); const {clipboard, remote} = System._nodeRequire('electron');
const sudo = new (System._nodeRequire('electron-sudo').default)({name: 'MyCard'}); const sudo = new (System._nodeRequire('electron-sudo').default)({name: 'MyCard'});
sudo.fork = function (modulePath, args, options) { sudo.fork = function (modulePath, args, options) {
return sudo.spawn(electron.remote.app.getPath('exe'), ['-e', modulePath]).then((child)=> { return sudo.spawn(remote.app.getPath('exe'), ['-e', modulePath]).then((child)=> {
readline.createInterface({input: child.stdout}).on('line', (line) => { readline.createInterface({input: child.stdout}).on('line', (line) => {
child.emit('message', JSON.parse(line)); child.emit('message', JSON.parse(line));
}); });
...@@ -136,7 +136,7 @@ export class AppDetailComponent implements OnInit { ...@@ -136,7 +136,7 @@ export class AppDetailComponent implements OnInit {
} }
selectDir() { selectDir() {
let dir = this.electron.remote.dialog.showOpenDialog({properties: ['openFile', 'openDirectory']}); let dir = remote.dialog.showOpenDialog({properties: ['openFile', 'openDirectory']});
console.log(dir); console.log(dir);
this.appsService.installConfig.installDir = dir[0]; this.appsService.installConfig.installDir = dir[0];
return dir[0]; return dir[0];
...@@ -177,11 +177,15 @@ export class AppDetailComponent implements OnInit { ...@@ -177,11 +177,15 @@ export class AppDetailComponent implements OnInit {
handle.on('close', (code) => { handle.on('close', (code) => {
console.log(`child process exited with code ${code}`); console.log(`child process exited with code ${code}`);
this.electron.remote.getCurrentWindow().restore(); remote.getCurrentWindow().restore();
}); });
this.electron.remote.getCurrentWindow().minimize(); remote.getCurrentWindow().minimize();
} }
copy(text){
clipboard.writeText(text);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment