mirror of
https://github.com/apache/superset.git
synced 2024-09-12 08:39:45 -04:00
Change userId, dbId to username and dbname (#1274)
This commit is contained in:
parent
f837733d85
commit
5c5b393f2f
@ -126,7 +126,7 @@ class QuerySearch extends React.Component {
|
|||||||
</div>
|
</div>
|
||||||
<QueryTable
|
<QueryTable
|
||||||
columns={[
|
columns={[
|
||||||
'state', 'dbId', 'userId',
|
'state', 'db', 'user',
|
||||||
'progress', 'rows', 'sql', 'querylink',
|
'progress', 'rows', 'sql', 'querylink',
|
||||||
]}
|
]}
|
||||||
onUserClicked={this.onUserClicked.bind(this)}
|
onUserClicked={this.onUserClicked.bind(this)}
|
||||||
|
@ -28,7 +28,8 @@ class QueryTable extends React.Component {
|
|||||||
}
|
}
|
||||||
getQueryLink(dbId, sql) {
|
getQueryLink(dbId, sql) {
|
||||||
const params = ['dbid=' + dbId, 'sql=' + sql, 'title=Untitled Query'];
|
const params = ['dbid=' + dbId, 'sql=' + sql, 'title=Untitled Query'];
|
||||||
return getLink(this.state.cleanUri, params);
|
const link = getLink(this.state.cleanUri, params);
|
||||||
|
return encodeURI(link);
|
||||||
}
|
}
|
||||||
hideVisualizeModal() {
|
hideVisualizeModal() {
|
||||||
this.setState({ showVisualizeModal: false });
|
this.setState({ showVisualizeModal: false });
|
||||||
@ -50,20 +51,20 @@ class QueryTable extends React.Component {
|
|||||||
if (q.endDttm) {
|
if (q.endDttm) {
|
||||||
q.duration = fDuration(q.startDttm, q.endDttm);
|
q.duration = fDuration(q.startDttm, q.endDttm);
|
||||||
}
|
}
|
||||||
q.userId = (
|
q.user = (
|
||||||
<button
|
<button
|
||||||
className="btn btn-link btn-xs"
|
className="btn btn-link btn-xs"
|
||||||
onClick={this.props.onUserClicked.bind(this, q.userId)}
|
onClick={this.props.onUserClicked.bind(this, q.userId)}
|
||||||
>
|
>
|
||||||
{q.userId}
|
{q.user}
|
||||||
</button>
|
</button>
|
||||||
);
|
);
|
||||||
q.dbId = (
|
q.db = (
|
||||||
<button
|
<button
|
||||||
className="btn btn-link btn-xs"
|
className="btn btn-link btn-xs"
|
||||||
onClick={this.props.onDbClicked.bind(this, q.dbId)}
|
onClick={this.props.onDbClicked.bind(this, q.dbId)}
|
||||||
>
|
>
|
||||||
{q.dbId}
|
{q.db}
|
||||||
</button>
|
</button>
|
||||||
);
|
);
|
||||||
q.started = moment(q.startDttm).format('HH:mm:ss');
|
q.started = moment(q.startDttm).format('HH:mm:ss');
|
||||||
|
@ -2006,6 +2006,7 @@ class Query(Model):
|
|||||||
|
|
||||||
database = relationship(
|
database = relationship(
|
||||||
'Database', foreign_keys=[database_id], backref='queries')
|
'Database', foreign_keys=[database_id], backref='queries')
|
||||||
|
user = relationship('User', backref='queries', foreign_keys=[user_id])
|
||||||
|
|
||||||
__table_args__ = (
|
__table_args__ = (
|
||||||
sqla.Index('ti_user_id_changed_on', user_id, changed_on),
|
sqla.Index('ti_user_id_changed_on', user_id, changed_on),
|
||||||
@ -2020,6 +2021,7 @@ class Query(Model):
|
|||||||
'changedOn': self.changed_on,
|
'changedOn': self.changed_on,
|
||||||
'changed_on': self.changed_on.isoformat(),
|
'changed_on': self.changed_on.isoformat(),
|
||||||
'dbId': self.database_id,
|
'dbId': self.database_id,
|
||||||
|
'db': self.database.database_name,
|
||||||
'endDttm': self.end_time,
|
'endDttm': self.end_time,
|
||||||
'errorMessage': self.error_message,
|
'errorMessage': self.error_message,
|
||||||
'executedSql': self.executed_sql,
|
'executedSql': self.executed_sql,
|
||||||
@ -2037,6 +2039,7 @@ class Query(Model):
|
|||||||
'tab': self.tab_name,
|
'tab': self.tab_name,
|
||||||
'tempTable': self.tmp_table_name,
|
'tempTable': self.tmp_table_name,
|
||||||
'userId': self.user_id,
|
'userId': self.user_id,
|
||||||
|
'user': self.user.username,
|
||||||
'limit_reached': self.limit_reached,
|
'limit_reached': self.limit_reached,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user